2006-07-28 Bruno Haible <bruno@clisp.org>
[pspp] / lib / ChangeLog
1 2006-07-28  Bruno Haible <bruno@clisp.org>
2
3         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
4
5 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
6
7         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
8         arpa/inet.h.
9
10 2006-07-28  Bruno Haible  <bruno@clisp.org>
11
12         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
13         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
14         fallbacks.
15         Avoids link error on FreeBSD 4.x.
16         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
17
18         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
19         encoding.
20         * mbswidth.c (iswcntrl): Likewise.
21
22 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
23
24         * modechange.c (mode_compile): Numeric modes now affect setuid and
25         setgid on directories only if they set these bits.
26         * modechange.h: Remove obsolete comment about masks.
27
28 2006-07-27  Bruno Haible  <bruno@clisp.org>
29
30         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
31         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
32         defined.
33
34 2006-07-26  Eric Blake  <ebb9@byu.net>
35
36         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
37         like mingw that lack mkstemp.
38         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
39         avoid compilation warning on mingw.
40
41 2006-07-25  Bruno Haible  <bruno@clisp.org>
42
43         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
44         <stdarg.h> or config.h.
45
46 2006-07-24  Bruno Haible  <bruno@clisp.org>
47
48         * clean-temp.h: New file, from GNU gettext.
49         * clean-temp.c: New file, from GNU gettext.
50
51 2006-07-24  Bruno Haible  <bruno@clisp.org>
52
53         * tmpdir.h: New file, from GNU gettext.
54         * tmpdir.c: New file, from GNU gettext.
55
56 2006-07-23  Bruno Haible  <bruno@clisp.org>
57
58         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
59         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
60         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
61         gl_linked_remove_at): Use it.
62
63 2006-07-23  Eric Blake  <ebb9@byu.net>
64
65         * tmpfile-safer.c: New file.
66         * stdio-safer.h (fopen_safer): Add prototype.
67         * stdio--.h (tmpfile): Make safer.
68
69 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
70
71         * close-stream.c, close-stream.h: New files.
72
73 2006-07-22  Bruno Haible  <bruno@clisp.org>
74
75         Merge from GNU gettext 0.15.
76
77         2005-07-05  Bruno Haible  <bruno@clisp.org>
78
79                 * printf-args.c (printf_fetchargs): Work around broken
80                 definition of wint_t on mingw.
81
82         2005-02-12  Bruno Haible  <bruno@clisp.org>
83
84                 * xallocsa.h: Add extern "C" for C++.
85
86         2006-05-17  Bruno Haible  <bruno@clisp.org>
87
88                 Cygwin portability.
89                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
90
91         2006-04-30  Bruno Haible  <bruno@clisp.org>
92
93                 * progreloc.c: Include <mach-o/dyld.h> if available.
94                 (find_executable): Use _NSGetExecutablePath when possible.
95
96         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
97
98                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
99                 function.
100
101         2005-12-29  Bruno Haible  <bruno@clisp.org>
102
103                 * progreloc.c (set_program_name_and_installdir): Fix
104                 compilation error.
105
106         2005-12-04  Bruno Haible  <bruno@clisp.org>
107
108                 Cygwin portability.
109                 * progreloc.c: Include <windows.h> also on Cygwin.
110                 (find_executable): Add support for Cygwin.
111                 (set_program_name_and_installdir): Handle also platforms with
112                 nonempty EXEEXT.
113
114         2006-07-11  Bruno Haible  <bruno@clisp.org>
115
116                 * javacomp.c: Fix a comment.
117                 Reported by Jim Meyering.
118
119         2006-04-30  Bruno Haible  <bruno@clisp.org>
120
121                 * javacomp.h (compile_java_class): Add source_version,
122                 target_version arguments.
123                 * javacomp.c: Rewritten to choose only a compiler that
124                 respects the specified source_version and target_version.
125
126         2006-06-27  Bruno Haible  <bruno@clisp.org>
127
128                 Assume correct S_ISDIR macro.
129                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
130
131         2006-07-22  Bruno Haible  <bruno@clisp.org>
132
133                 * javaversion.h: New file, from GNU gettext.
134                 * javaversion.c: New file, from GNU gettext.
135                 * javaversion.java: New file, from GNU gettext.
136                 * javaversion.class: New file, from GNU gettext.
137
138         2006-05-17  Bruno Haible  <bruno@clisp.org>
139
140                 Cygwin portability.
141                 * javaexec.c (execute_java_class): Test for jview program
142                 also on Cygwin.
143
144         2006-04-09  Bruno Haible  <bruno@clisp.org>
145
146                 * fatal-signal.c: Don't include string.h.
147                 (at_fatal_signal): Use a copying loop instead of memcpy.
148
149         2005-12-04  Bruno Haible  <bruno@clisp.org>
150
151                 * csharpexec.c: Add support for 'clix' launcher (untested).
152                 (execute_csharp_using_sscli): New function.
153                 (execute_csharp_program): Call it.
154
155         2006-06-21  Bruno Haible  <bruno@clisp.org>
156
157                 Avoid warnings from recent versions of mcs.
158                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
159                 -o, -L, -r any more. Use options documented since mcs-1.0
160                 instead. Similarly for -g.
161
162         2005-07-09  Bruno Haible  <bruno@clisp.org>
163
164                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
165                 add a .dll suffix.
166                 Reported by Mark Junker <mjscod@gmx.de>.
167
168         2006-06-17  Bruno Haible  <bruno@clisp.org>
169
170                 * config.charset: Update for NetBSD 3.0.
171
172         2006-05-17  Bruno Haible  <bruno@clisp.org>
173
174                 Cygwin portability.
175                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
176
177         2006-05-16  Bruno Haible  <bruno@clisp.org>
178
179                 * localcharset.c [CYGWIN]: Include <windows.h>.
180                 (get_charset_aliases): For Cygwin, return the same CPxxx
181                 aliases list as under WIN32.
182                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
183                 the environment variables. Fall back to GetACP().
184
185         2006-04-05  Bruno Haible  <bruno@clisp.org>
186
187                 * config.charset: Update Juan Manuel Guerrero's address.
188
189         2005-02-12  Bruno Haible  <bruno@clisp.org>
190
191                 * allocsa.h: Add extern "C" for C++.
192
193         2005-02-10  Bruno Haible  <bruno@clisp.org>
194
195                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
196                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
197
198         2006-07-22  Bruno Haible  <bruno@clisp.org>
199
200                 * gettext.h: Update to GNU gettext-0.15.
201
202 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
203         and Simon Josefsson <jas@extundo.com>
204
205         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
206
207         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
208
209 2006-07-21  Eric Blake  <ebb9@byu.net>
210
211         * stdlib-safer.h: New file from coreutils, required by
212         stdlib--.h.
213
214 2006-07-19  Derek R. Price  <derek@ximbiot.com>
215
216         * getaddrinfo.h: Don't define unimplemented AI_* flags.
217         Reindent and repaginate.
218
219 2006-07-17  Bruno Haible  <bruno@clisp.org>
220
221         * gl_list.h: New file.
222         * gl_list.c: New file.
223         * gl_array_list.h: New file.
224         * gl_array_list.c: New file.
225         * gl_carray_list.h: New file.
226         * gl_carray_list.c: New file.
227         * gl_linked_list.h: New file.
228         * gl_linked_list.c: New file.
229         * gl_anylinked_list1.h: New file.
230         * gl_anylinked_list2.h: New file.
231         * gl_avltree_list.h: New file.
232         * gl_avltree_list.c: New file.
233         * gl_anyavltree_list1.h: New file.
234         * gl_anyavltree_list2.h: New file.
235         * gl_rbtree_list.h: New file.
236         * gl_rbtree_list.c: New file.
237         * gl_anyrbtree_list1.h: New file.
238         * gl_anyrbtree_list2.h: New file.
239         * gl_anytree_list1.h: New file.
240         * gl_anytree_list2.h: New file.
241         * gl_linkedhash_list.h: New file.
242         * gl_linkedhash_list.c: New file.
243         * gl_anyhash_list1.h: New file.
244         * gl_anyhash_list2.h: New file.
245         * gl_avltreehash_list.h: New file.
246         * gl_avltreehash_list.c: New file.
247         * gl_rbtreehash_list.h: New file.
248         * gl_rbtreehash_list.c: New file.
249         * gl_anytreehash_list1.h: New file.
250         * gl_anytreehash_list2.h: New file.
251
252         * gl_oset.h: New file.
253         * gl_oset.c: New file.
254         * gl_array_oset.h: New file.
255         * gl_array_oset.c: New file.
256         * gl_avltree_oset.h: New file.
257         * gl_avltree_oset.c: New file.
258         * gl_rbtree_oset.h: New file.
259         * gl_rbtree_oset.c: New file.
260         * gl_anytree_oset.h: New file.
261
262 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
263
264         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
265         New files.
266         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
267         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
268         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
269         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
270         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
271         callers changed.  Revamp internals significantly, by not
272         attempting to create directories that are temporarily more
273         permissive than the final results.  Do not attempt to use
274         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
275         This removes some race conditions, fixes some bugs, and simplifies
276         things.  Use new dirchownmod function to do owner and mode changes.
277         * mkdir-p.h: Likewise.
278         * modechange.c (octal_to_mode): New function.
279         (struct mode_change): New member mentioned.
280         (make_node_op_equals): New arg mentioned.  All callers changed.
281         (mode_compile): Keep track of which mode bits the user has explicitly
282         mentioned.
283         (mode_adjust): New arg DIR, so that we implement the X op correctly.
284         New arg PMODE_BITS, to keep track of which mode bits the user
285         mentioned; it treats S_ISUID and S_ISGID speciall.
286         All callers changed.
287         * modechange.h: Likewise.
288
289 2006-07-11  Derek R. Price  <derek@ximbiot.com>
290
291         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
292
293 2006-07-10  Derek R. Price  <derek@ximbiot.com>
294
295         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
296         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
297         macros into the GNU _D_EXACT_NAMLEN.
298         * savedir.c:  Likewise.
299         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
300
301 2006-07-09  Jim Meyering  <jim@meyering.net>
302
303         * argp-pv.c: Remove a doubled word in a comment.
304         * check-version.c (check_version): Likewise.
305         * javacomp.c (compile_java_class): Likewise.
306
307 2006-07-08  Jim Meyering  <jim@meyering.net>
308
309         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
310
311 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
312
313         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
314         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
315         brackets.  Other minor changes to suppress some compiler
316         warnings.
317
318 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
319
320         * getloadavg.c: Use __VMS, not VMS.
321         * getopt.c: Likewise.
322         * getpagesize.h: Likewise.
323         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
324         probably does not work.
325
326 2006-07-06  Derek R. Price  <derek@ximbiot.com>
327         and Paul Eggert  <eggert@cs.ucla.edu>
328
329         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
330         Don't worry about this obsolete case any more.
331         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
332         directories.
333         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
334         worry about this obsolete case any more.
335         * fts.c: Likewise.
336         * getcwd.c: Likewise.
337         * glob.h: Likewise.
338         * savedir.c: Likewise.
339
340 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
341
342         * .cppi-disable: Add wcwidth.
343         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
344         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
345         (ISGRAPH): Remove.  All uses changed to isgraph.
346         (FOLD) [!defined _LIBC]: Remove special case.
347         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
348         * regext_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
349         HAVE_ISBLANK.
350         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
351
352 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
353
354         * strtod.c (strtod): cast the argument of tolower to unsigned char.
355
356 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
357
358         * memcasecmp.c: Include <limits.h>.
359         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
360         * strtod.c (strtod): Don't assume isspace works on negative chars.
361         Don't assume isdigit succeeds only on '0' through '9'.
362
363 2006-07-05  Derek R. Price  <derek@ximbiot.com>
364
365         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
366         All uses of is_space replaced by isspace.
367         * exit.h: Don't talk about STDC_HEADERS.
368         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
369         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
370         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
371         replaced by isprint etc.
372         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
373         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
374         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
375         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
376         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
377         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
378
379 2006-07-05  Eric Blake  <ebb9@byu.net>
380
381         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
382         missing from netdb.h.
383         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
384
385 2006-06-27  Bruno Haible  <bruno@clisp.org>
386
387         Assume ANSI C header files and <ctype.h> functions.
388         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
389         (mbsnwidth): Use isprint, iscntrl instead.
390
391 2006-07-03  Jim Meyering  <jim@meyering.net>
392
393         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
394         macro is used before the first cycle_check call.
395
396 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
397
398         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
399         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
400         reported by Mark D. Baushke, one in
401         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
402
403         Merge from coreutils.
404
405         * .cppi-disable: Add stdint_.h.
406         * .cvsignore: Add stdint.h.
407
408         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
409
410         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
411         both double and long double versions.
412         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
413         * xstrtold.c: New file.
414         * xstrtod.h (xstrtold): New decl.
415
416         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
417
418         * filemode.c (setst): Remove.
419         (strmode): Rewrite to avoid setst.  This makes the code shorter,
420         (arguably) clearer, and the generated code is a bit smaller on my
421         Debian GNU/Linux stable x86 host.
422
423         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
424
425         * filemode.c: Include "filemode.h" first, to test the interface.
426         Assume that filemode.h includes sys/types.h and sys/stat.h.
427         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
428         (ftypelet): Reorder to put common cases first, for efficiency.
429         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
430         to do 'M'.
431         (strmode): Renamed from mode_string, and now stores 12 bytes instead
432         of 10, for compatibility with FreeBSD.  All callers changed.
433         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
434         that can't be deduced solely from st_mode.  First arg is now a const
435         pointer.
436         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
437         (strmode): Renamed from mode_string.
438         (filemodestring): New decl.
439         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
440         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
441         (S_ISPORT, S_ISWHT): New macros, if not already defined.
442
443         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
444
445         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
446         fsusage.h now does that.  Include fsusage.h first, to test interface.
447         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
448         at most one method (the old code could have generated decls that
449         didn't conform to C89, not that this was ever exercised).
450         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
451
452         2006-03-19  Jim Meyering  <jim@meyering.net>
453
454         Work even in a chroot where d_ino values for entries in "/"
455         don't match the stat.st_ino values for the same names.
456         * getcwd.c (__getcwd): When no d_ino value matches the target inode
457         number, iterate through all entries again, using lstat instead.
458         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
459         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
460
461         * getcwd.c (__getcwd): Clarify a comment.
462         Use memcpy in place of a call to strcpy.
463
464         2006-03-12  Jim Meyering  <jim@meyering.net>
465
466         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
467         that of the current directory (which we're about to chdir ".." out of),
468         then save the dev-ino of the parent, instead.
469
470         * same-inode.h (SAME_INODE): New file/macro.
471         * chdir-safer.c (SAME_INODE): Remove definition.
472         Include "same-inode.h", instead.
473         * same.c: Likewise.
474         * cycle-check.h: Include "same-inode.h".
475         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
476         * cycle-check.c (SAME_INODE): Remove definition.
477         * root-dev-ino.h: Include "same-inode.h".
478
479         2006-03-11  Eric Blake  <ebb9@byu.net>
480
481         * same.c (same_name): s/base_name/last_component/
482         * backupfile.c (check_extension, numbered_backup): Likewise.
483         * filenamecat.c (file_name_concat): Likewise.
484
485         2006-03-11  Eric Blake  <ebb9@byu.net>,
486                     Paul Eggert  <eggert@cs.ucla.edu>
487
488         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
489         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
490         drive prefix.
491         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
492         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
493         (last_component): New method.
494         * dirname.c (dir_len): Determine when drive letters need a
495         subsequent slash.  Preserve // when it is special.
496         (dir_name): Don't append dot when drive letter is absolute.
497         [TEST_DIRNAME]: Move into a full-blown gnulib test.
498         * basename.c (base_name): New semantics - malloc the result.
499         Preserve // when it is special.  Preserve relative files that look
500         like drive letters.
501         (base_len): Preserve // when it is special.
502         (last_component): New method, similar to old base_name semantics.
503         * stripslash.c (strip_trailing_slashes): Use last_component, not
504         base_name.  Strip redundant slashes from ///.
505
506 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
507
508         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
509         both are 64 bits, since this seems to be the tradition, and this
510         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
511         we ever run into a host that prefers long long to long in this
512         case, we'll need another configure-time test.  Problem reported by
513         Jim Meyering.
514
515 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
516
517         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
518         possible collision with system files.
519         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
520         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
521         WCHAR_MIN and WCHAR_MAX in this case.
522         (<stddef.h>): Do not include; no longer needed.
523         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
524         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
525         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
526         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
527         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
528         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
529         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
530         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
531         !defined(__c99))]: Include in this case too, since it's harmless
532         now.
533         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
534         dangerous to do so.
535         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
536         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
537         (_STDINT_MIN, _STDINT_MAX): New macros.
538         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
539         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
540         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
541         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
542         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
543         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
544         macros, not typedefs; this simplifies things quite a bit.
545         Use long int for all types narrower than int64_t.
546         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
547         Define in terms of long long int or int64_t or long int,
548         not int64_t or int32_t.  This saves some compile-time testing.
549         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
550         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
551         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
552         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
553         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
554         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
555         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
556         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
557         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
558         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
559         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
560         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
561         undef any previous version and define our own version, for
562         simplicity and consistency with the new macros for types.
563         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
564         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
565         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
566         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
567         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
568         @WINT_T_SUFFIX@ to keep things simple here.
569         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
570         Simplify by assuming typical 8/16/32/64 host, since we're
571         already doing that elsewhere anyway.
572         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
573         and assume long long int is 64 bits if available.  This
574         speeds up 'configure'.
575
576 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
577
578         * getaddrinfo.c: fixed typo
579
580 2006-06-29  Eric Blake  <ebb9@byu.net>
581
582         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
583         unused static function.
584
585 2006-06-29  Eric Blake  <ebb9@byu.net>
586
587         * stat_.h: New file.
588
589 2006-06-29  Derek R. Price  <derek@ximbiot.com>
590
591         * strftime.c: Assume strftime() exists.
592
593 2006-06-28  Bruno Haible  <bruno@clisp.org>
594
595         * getaddrinfo.h: Fix POSIX URL.
596         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
597         (use_win32_p): Make static.
598         (getaddrinfo): Reject service name if it is empty or does not consist
599         solely of decimal digits, or if its value is > 65535.
600         (getnameinfo): Remove useless casts.
601
602 2006-06-28  Derek R. Price  <derek@ximbiot.com>
603
604         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
605         Autoconf 2.60 says this stuff was obsolete.
606
607 2006-05-12  Bruno Haible  <bruno@clisp.org>
608
609         * mkdtemp.c [MINGW]: Include <io.h>.
610         (mkdir): Define using _mkdir.
611
612 2006-06-28  Bruno Haible  <bruno@clisp.org>
613
614         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
615         declaration for wcwidth.
616         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
617
618 2006-06-28  Eric Blake  <ebb9@byu.net>
619
620         * xvasprintf.h: Fix comments.
621
622 2006-06-28  Eric Blake  <ebb9@byu.net>
623
624         * mbchar.h (wcwidth): Include wcwidth.h.
625         * mbswidth.c (wcwidth): Move from here...
626         * wcwidth.h: ...to this new file.
627
628 2006-06-28  Simon Josefsson  <jas@extundo.com>
629
630         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
631         functions there.  It will succeed on Windows XP, but on Windows
632         2000 and (presumably) earlier, it will fail, and use the internal
633         re-implementation.
634         (use_win32_p): New function.
635         (getaddrinfo): Use strtoul on servname, to support numeric ports.
636         Support AI_NUMERICSERV to disable getservbyname.
637         (getnameinfo): New function, only supports
638         NI_NUMERICHOST|NI_NUMERICSERV for now.
639
640         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
641         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
642         getnameinfo.
643
644 2006-06-27  Bruno Haible  <bruno@clisp.org>
645
646         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
647
648 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
649
650         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
651         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
652         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
653
654 2006-06-26  Bruno Haible  <bruno@clisp.org>
655
656         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
657         WCHAR_MAX.
658         Reported by Mark D. Baushke and Larry Jones.
659
660 2006-06-26  Bruno Haible  <bruno@clisp.org>
661
662         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
663         in pre-C99 mode.
664         Suggested by Mark D. Baushke and Larry Jones.
665
666 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
667
668         * stdint_.h: Treat BSD/OS like OpenBSD.
669
670 2006-06-23  Bruno Haible  <bruno@clisp.org>
671
672         * stdint_.h: Treat IRIX like OpenBSD.
673
674 2006-06-23  Bruno Haible  <bruno@clisp.org>
675
676         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
677         ISO C 99 Technical Corrigendum 1.
678
679 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
680
681         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
682         Some compiler complained about some of them.  Problem reported by
683         Larry Jones in
684         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
685
686 2006-06-21  Simon Josefsson  <jas@extundo.com>
687
688         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
689         variable.
690
691         * socket_.h: Don't define WINVER.
692
693         * inet_pton.h, inet_pton.c: New file, taken from glibc but
694         slightly modified to work in gnulib.
695
696 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
697
698         * read-file.c (fread_file): Start with buffer allocation of
699         0 bytes rather than 1 byte; this simplifies the code.
700         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
701         code to free buffer and save/restore errno.
702         (internal_read_file): Remove unused local.
703
704 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
705
706         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
707         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
708         Problem reported by Denis Excoffier in
709         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
710
711 2006-06-19  Simon Josefsson  <jas@extundo.com>
712
713         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
714
715 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
716
717         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
718
719 2006-06-17  Bruno Haible  <bruno@clisp.org>
720
721         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
722
723 2006-06-17  Bruno Haible  <bruno@clisp.org>
724
725         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
726         problem on Solaris 2.5.1.
727
728 2006-06-16  Eric Blake  <ebb9@byu.net>
729
730         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
731         * unicodeio.c [!defined errno]: Likewise.
732         * strtol.c [!defined errno]: Likewise.
733         * strtod.c [!defined errno]: Likewise.
734
735 2006-06-15  Bruno Haible  <bruno@clisp.org>
736
737         * stdint_.h: Rewritten to be fully auto-configured.
738         Fixes bug on HP-UX/IA64.
739
740 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
741
742         * getdate.y (__attribute__): Don't define if already defined.
743         Problem reported by Larry Jones.
744         * utimens.c (__attribute__): Likewise.
745
746 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
747
748         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
749         reported by Andreas Schwab.
750
751 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
752             Bruno Haible  <bruno@clisp.org>
753
754         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
755
756 2006-05-26  Martin Lambers  <marlam@marlam.de>
757
758         * getpass.c: Updates the test for the native W32 API, and adds
759         missing includes, thus fixing compilation warnings.
760
761 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
762
763         * tempname.c (small_open, large_open): New macros.
764         (__open, __open64) [!_LIBC]: Remove.
765         (__gen_tempname): Use small_open and large_open instead of __open
766         and __open64.  This fixes a portability bug on HP-UX 11.11i
767         reported by Simon Wing-Tang in
768         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
769
770 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
771
772         * exclude.c (exclude_fnmatch): New function.
773         (excluded_file_name): Call exclude_fnmatch.
774         * exclude.h (excluded_file_name): New prototype
775
776 2006-05-24  Bruno Haible  <bruno@clisp.org>
777
778         * printf-args.c (printf_fetchargs): Turn NULL pointers for
779         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
780         Reported by Thorsten Maerz <torte@netztorte.de> via
781         Aaron Stone <aaron@serendipity.cx>.
782
783 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
784
785         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
786         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
787         (my_usleep): Don't mishandle maximum value.
788
789 2006-05-19  Jim Meyering  <jim@meyering.net>
790
791         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
792
793 2006-05-17  Bruno Haible  <bruno@clisp.org>
794
795         Cygwin portability.
796         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
797
798 2006-05-17  Bruno Haible  <bruno@clisp.org>
799
800         * stdint_.h: Fix recognition of Cygwin.
801
802 2006-05-11  Jim Meyering  <jim@meyering.net>
803
804         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
805
806 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
807
808         * crc.c (crc32_update): Remove unnecessary L suffix.
809         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
810         unwanted sign propagation, e.g., on hosts with 64-bit int.
811         There still are some problems with reeelly weird theoretical hosts
812         (e.g., 33-bit int) but it's not worth worrying about now.
813         * sha1.c (rol): Likewise.
814         (K1, K2, K3, K4): Remove unnecessary L suffix.
815
816 2006-05-10  Bruno Haible  <bruno@clisp.org>
817
818         * des.c: Cast to avoid warnings.
819
820 2006-05-10  Simon Josefsson  <jas@extundo.com>
821
822         * md4.c: Typo fix, update copyright years.
823         (K1, K2): Don't use L because it turn computations into 64-bit on
824         64-bit platforms.
825
826 2006-05-09  Bruno Haible  <bruno@clisp.org>
827
828         * xvasprintf.c: Include limits.h, string.h, xsize.h.
829         (EOVERFLOW): Define fallback value.
830         (xstrcat): New function.
831         (xvasprintf): Recognize the special case of a string concatenation.
832
833 2006-05-01  Bruno Haible  <bruno@clisp.org>
834
835         * stdint_.h: Shorter URL.
836         * inttypes.h: Likewise.
837
838 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
839
840         * verify.h: Document the internals better.  Most of this change
841         was written by Bruno Haible.
842
843 2006-04-29  Bruno Haible  <bruno@clisp.org>
844
845         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
846         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
847
848 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
849
850         * getdate.y (get_date): When adding relative date, start with the
851         initial time, not with the result of the first mktime call.
852
853 2006-04-23  Bruno Haible  <bruno@clisp.org>
854
855         * copy-file.c: Include <unistd.h> unconditionally.
856         * execute.c: Likewise.
857         * fatal-signal.c: Likewise.
858         * findprog.c: Likewise.
859         * mkdtemp.c: Likewise.
860         * pipe.h: Likewise.
861         * pipe.c: Likewise.
862         * wait-process.h: Likewise.
863
864 2006-04-23  Bruno Haible  <bruno@clisp.org>
865
866         * fwriteerror.c (fwriteerror): Call fclose also when an error
867         condition was already detected.
868         Reported by Ben Pfaff <blp@cs.stanford.edu>.
869
870 2006-04-19  Derek Price  <derek@ximbiot.com>
871             Eric Blake  <ebb9@byu.net>
872
873         * inttypes.h: Correct grammar in comment.
874
875 2006-04-18  Derek Price  <derek@ximbiot.com>
876             Paul Eggert  <eggert@cs.ucla.edu>
877
878         * inttypes.h: New file.
879         * strtoimax.c: Assume <inttypes.h>.
880
881 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
882
883         * utimens.c (futimens): glibc futimesat messes up if /proc
884         isn't mounted.  Problem reported by Kir Kolyshkin.
885
886 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
887
888         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
889         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
890         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
891
892 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
893
894         Merge regex changes from libc, removing some of our
895         POSIX-conformance changes that were rejected and redoing them in a
896         less-intrusive way.
897
898         * regcomp.c (re_compile_internal, init_dfa):
899         Length arg is now size_t, not Idx.  All uses changed.
900         (peek_token): Forward decl now says internal_function.
901         (__re_error_msgid, __re_error_msgid_idx):
902         Now static rather than extern with attribute_hidden.
903         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
904         For some reason libc prefers K&R style defns for external functions.
905         (regerror) [!defined _LIBC]: Likewise.
906         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
907         (seek_collating_symbol_entry, lookup_collation_sequence_value):
908         (build_range_exp, build_collating_symbol):
909         Use K&R-style defn.
910         (re_compile_fastmap): Use '\0' to memset, not 0.
911         (utf8_sb_map): Make the calculations more obvious.
912         (init_dfa, parse_bracket_exp, build_charclass_op):
913         Call calloc and cast result, as glibc does.
914         (init_word_char, fetch_token, peek_token, peek_token_bracket):
915         (build_range_exp, build_collating_symbol):
916         Now internal functions.
917
918         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
919
920         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
921         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
922         Don't depend on VMS; depend on __VMS instead, for POSIX
923         namespace cleanness.
924         (regoff_t): Define to ssize_t, not long int.
925
926         Remove the REG_ macros named below.  Instead, make the old names
927         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
928         __USE_GNU_REGEX.
929         (REG_BACKSLASH_ESCAPE_IN_LISTS):
930         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
931         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
932         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
933         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
934         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
935         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
936         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
937         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
938         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
939         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
940         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
941         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
942         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
943         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
944         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
945         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
946         (REG_NREGS):
947         Remove.  All uses replaced by the old RE_* names.
948         (RE_BACKSLASH_ESCAPE_IN_LISTS):
949         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
950         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
951         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
952         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
953         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
954         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
955         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
956         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
957         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
958         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
959         Don't bother having these macros be independent of each others'
960         values, since they no longer exist in the POSIX name space.
961
962         Rename the following member names back to their old names,
963         unless !__USE_GNU_REGEX.  All uses changed back.
964         (buffer): Renamed from re_buffer.
965         (allocated): Renamed from re_allocated.
966         (used): Renamed from re_used.
967         (syntax): Renamed from re_syntax.
968         (fastmap): Renamed from re_fastmap.
969         (translate): Renamed from re_translate.
970         (can_be_null): Renamed from re_can_be_null.
971         (regs_allocated): Renamed from re_regs_allocated.
972         (fastmap_accurate): Renamed from re_fastmap_accurate.
973         (no_sub): Renamed from re_no_sub.
974         (not_bol): Renamed from re_not_bol.
975         (not_eol): Renamed from re_not_eol.
976         (newline_anchor): Renamed from re_newline_anchor.
977         (num_regs): Renamed from rm_num_regs.
978         (start): Renamed from rm_start.
979         (end): Renamed from rm_end.
980
981         (free_state): Move up a bit.
982
983         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
984         #define to be empty.
985         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
986         when that is what is intended.
987         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
988         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
989         (MAX): New macro.
990         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
991         All uses changed back to re_malloc, etc.  It's now the caller's
992         responsibility to check for overflow; all callers changed.
993         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
994         (re_x2nrealloc): Remove.
995         (free_state): Remove decl.
996
997         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
998         (re_set_registers, re_exec):
999         Use K&R-style defn.
1000
1001         2006-01-31  Roland McGrath  <roland@redhat.com>
1002
1003         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1004         Reported by Mike Frysinger <vapier@gentoo.org>.
1005
1006         2006-01-15  Andreas Jaeger  <aj@suse.de>
1007
1008         [BZ #1950]
1009         * regex_internal.c (re_string_reconstruct): Adjust for
1010         build_wcs_upper_buffer change.
1011         (build_wcs_upper_buffer): Change return type.
1012
1013         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1014
1015         * regex_internal.h: Include <stdint.h> if available.
1016
1017         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1018
1019         * regex_internal.h (SIZE_MAX): Provide a default definition.
1020
1021         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1022
1023         * regcomp.c: Adjust for changed secondary hash function.
1024
1025         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1026
1027         * regex.h: Pretty printing.
1028         Clean up namespace a bit.
1029
1030         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1031
1032         * regexec.c (update_cur_sifted_state, check_arrival,
1033         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1034
1035         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1036                     Ulrich Drepper  <drepper@redhat.com>
1037
1038         [BZ #1302]
1039         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1040         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1041
1042         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1043
1044         [BZ #281]
1045         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1046         * regcomp.c: Remove unnecessary uses of
1047         unsigned RE_TRANSLATE_TYPE.
1048         * regex_internal.h: Likewise.
1049         * regex_internal.c: Likewise.
1050         * regexec.c: Likewise.
1051         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1052
1053         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1054
1055         * regexec.c (find_recover_state): Remove unnecessary
1056         initialization.
1057         (transit_state_bkref): Make DFA a const pointer.
1058         (get_subexp): Likewise.
1059         (check_arrival): Likewise.
1060         (update_cur_sifted_state): Likewise.
1061         (re_search_internal): Likewise.
1062         (prune_impossible_nodes): Likewise.
1063         (acquire_init_state_context): Likewise.
1064         (proceed_next_node): Likewise.
1065         (set_regs): Likewise.
1066         (free_fail_stack_return): Likewise.
1067         (check_arrival_expand_ecl): Mark DFA parameter as const.
1068         (check_arrival_expand_ecl_sub): Likewise.
1069         (check_subexp_limits): Likewise.
1070         (sub_epsilon_src_nodes):  Likewise.
1071         (add_epsilon_src_nodes):  Likewise.
1072         (merge_state_array): Likewise.
1073         (update_regs): Likewise.
1074         (build_trtable): Likewise.
1075         (sift_states_backward): Mark MCTX parameter as const.
1076         (build_sifted_states): Likewise.
1077         (update_cur_sifted_state): Likewise.
1078         (sift_states_mkref): Likewise.
1079         (check_arrival_expand_ecl): Mark eclosure as const.
1080         (check_dst_limits_calc_pos_1): Likewise.
1081         * regex_internal.h (re_match_context_t): Make dfa a const
1082         pointer.
1083
1084         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1085
1086         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1087         (transit_state_sb): Likewise.
1088         (transit_state_mb): Likewise.
1089         (sift_states_iter_mb): Likewise.
1090         (check_arrival_add_next_nodes): Likewise.
1091         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1092         [_LIBC] (re_search_2_stub): Use mempcpy.
1093
1094         * regex_internal.c (re_string_reconstruct): Avoid calling
1095         mbrtowc for very simple UTF-8 case.
1096
1097         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1098         a pointer-to-const.
1099         (re_acquire_state_context): Likewise.
1100         * regex_internal.h: Adjust prototypes.
1101
1102         * regex.c: Prevent using C++ compilers.
1103
1104         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1105         (re_acquire_state_context): Likewise.
1106
1107 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1108             Bruno Haible  <bruno@clisp.org>
1109
1110         * stdint_.h: On OpenBSD, don't redefine types already included in
1111         <sys/types.h> and <inttypes.h>.
1112
1113 2006-03-24  Eric Blake  <ebb9@byu.net>
1114
1115         * time_r.c (copy_string_result): Remove, as it is no longer used.
1116
1117 2006-03-24  Simon Josefsson  <jas@extundo.com>
1118
1119         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1120         including some doc fixes.
1121         (base64_encode_alloc): Fix +1 bug on allocation failures.
1122
1123 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1124
1125         * base64.c (base64_encode): Do not read past end of array with
1126         unsanitized input on systems with CHAR_BIT > 8.
1127
1128 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1129
1130         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1131         Typedef to long int, not to off_, as POSIX will likely change
1132         in that direction.
1133
1134 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1135
1136         * argp-help.c (validate_uparams): Fix typo
1137         * argp-parse.c (argp_default_options): Consistently begin help
1138         messages with a lowercase letter.
1139
1140 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1141
1142         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1143         overrun buffers and shouldn't be used (much as gets shouldn't be
1144         used).
1145         * time_r.c (asctime_r, ctime_r): Likewise.
1146
1147 2006-03-08  Simon Josefsson  <jas@extundo.com>
1148
1149         * gc-gnulib.c (randomize): Don't open files called 'no', they
1150         signal that configure disabled the device.
1151
1152 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1153
1154         * c-stack.c: Include unistd.h unconditionally, since we now assume
1155         the unistd module.
1156         * getlogin_r.c: Likewise.
1157         * getlogin_r.h: Likewise.
1158         * glob.c: Likewise.
1159         * pagealign_alloc.c: Likewise.
1160         * unistd_.h: Remove; no longer needed.
1161
1162 2006-03-07  Simon Josefsson  <jas@extundo.com>
1163
1164         * unistd_.h: New file.
1165
1166 2006-03-07  Simon Josefsson  <jas@extundo.com>
1167
1168         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1169
1170 2006-03-01  Simon Josefsson  <jas@extundo.com>
1171
1172         * readline.c: Fix typo, tiny patch from Stepan Kasal
1173         <kasal@ucw.cz>.
1174
1175 2006-02-28  Simon Josefsson  <jas@extundo.com>
1176
1177         * getopt.c: Protect #include of unistd.h, for MSVS.
1178
1179 2006-02-27  Simon Josefsson  <jas@extundo.com>
1180
1181         * base64.h: Indent #define's.  From Jim Meyering
1182         <jim@meyering.net>.
1183
1184 2006-02-27  Jim Meyering  <jim@meyering.net>
1185
1186         Revert the change of 2006-02-24, so these files can continue
1187         to be sync'd from gettext.
1188         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1189         of `config.h'.
1190
1191 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1192
1193         * glob.c: Say "invalid" rather than "illegal" in comments.
1194
1195 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1196
1197         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1198
1199 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1200
1201         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1202         AT_FDCWD exceeds INT_MAX.
1203         * openat.h (AT_FDCWD): Likewise.
1204
1205 2006-02-14  Jim Meyering  <jim@meyering.net>
1206
1207         Sync from coreutils.
1208
1209         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1210         failure on deficient systems, and simplify gnulib lgpl dependencies.
1211         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1212         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1213
1214         * xalloc-die.c: Remove unused definition of N_.
1215
1216 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1217
1218         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1219
1220 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1221
1222         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1223         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1224
1225 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1226
1227         * argp-namefrob.h: Restore changes accidentally lost during the
1228         "autoupdate" on 2005-12-12.
1229
1230 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1231
1232         * fnmatch.c (L_): Renamed from L, to work around a bug in
1233         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1234         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1235         All uses changed.
1236
1237 2006-01-26  Simon Josefsson  <jas@extundo.com>
1238
1239         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1240         prototype is visible on mingw32.
1241
1242         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1243         for mingw32.
1244
1245         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1246         mingw32).
1247
1248 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1249
1250         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1251         attempt to open for write; this always fails, at least on POSIX
1252         hosts.  This reinstates the 2006-01-09 change, which was
1253         inadvertently removed.
1254
1255 2006-01-26  Bruno Haible  <bruno@clisp.org>
1256             Paul Eggert  <eggert@cs.ucla.edu>
1257
1258         * stdbool_.h (_Bool)
1259         [(! (defined __cplusplus || defined __BEOS__)
1260           && !defined __GNUC__
1261           && !(defined __HP_cc || defined __xlc__
1262                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1263                || defined __sgi))]:
1264         #define to signed char in these cases too; this simplifies
1265         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1266         etc., separately) and makes it more conservative.
1267
1268 2006-01-21  Jim Meyering  <jim@meyering.net>
1269
1270         Sync from the stable (b5) branch of coreutils:
1271
1272         * fts.c (fts_children): Don't let close() clobber errno from
1273         failed fchdir().
1274
1275         * fts.c (fts_stat): When following a symlink-to-directory,
1276         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1277         a dangling symlink.  That can also happen at least for ELOOP.
1278         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1279         FYI, this bug predates the inclusion of fts.c in coreutils.
1280
1281         * fts.c (fts_open): Put new maxarglen declaration and uses
1282         in their own block, so pre-c99 compilers don't object.
1283
1284         Avoid the double-free (first in fts_read, second in fts_close) that
1285         would occur when an `active' directory is made inaccessible (e.g.,
1286         via chmod a-x) during a traversal.
1287         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1288         before returning.  Reproduce this failure by
1289         mkdir -p a/b; cd a; chmod a-x . b
1290         Reported by Stavros Passas.
1291
1292 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1293
1294         * argp-namefrob.h: Bugfix. Remove stray #
1295
1296 2006-01-25  Bruno Haible  <bruno@clisp.org>
1297
1298         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1299         warnings.
1300         Reported by Paul Eggert.
1301
1302 2006-01-25  Jim Meyering  <jim@meyering.net>
1303
1304         * fileblocks.c: Remove more useless parentheses.
1305         * readutmp.h: Likewise.
1306
1307 2006-01-24  Bruno Haible  <bruno@clisp.org>
1308
1309         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1310         has it.
1311         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1312         2005-11-26.
1313
1314         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1315         to avoid problems with the built-in _Bool type.
1316         Reported by Paul Eggert on 2005-11-26.
1317
1318 2006-01-24  Jim Meyering  <jim@meyering.net>
1319
1320         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1321
1322 2006-01-24  Simon Josefsson  <jas@extundo.com>
1323
1324         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1325         Bruno.
1326
1327 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1328
1329         Work around porting bugs reported by Dieter in
1330         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1331         * getopt.c (_NOPROTO): Remove; no longer needed.
1332         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1333         Include "getopt.h" first, to check interface.
1334         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1335         !HAVE_DECL_GETENV.
1336         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1337         (__strndup): Revert to K&R-style function dfns, the glibc style.
1338         * strnlen.c: Don't claim it's taken from glibc; it's not.
1339         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1340         Include strnlen.h first, to get prototype properly.
1341         (strnlen): Renamed from __strnlen.
1342         Remove weak alias.
1343
1344 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1345
1346         These changes imported from libc.
1347         * getopt.c: Use __fxprintf instead of inline stream orientation
1348         test and two separate function calls.
1349         * strndup.c (__strndup): Add libc_hidden_def.
1350
1351 2006-01-22  Bruno Haible  <bruno@clisp.org>
1352
1353         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1354         temporary buffer for sprintf, take into account the precision also
1355         for 'd', 'i', 'u', 'o', 'x', 'X'.
1356
1357 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1358
1359         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1360         to pacify gcc -Wswitch-default.
1361
1362 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1363
1364         * argp-help.c (usage_long_opt): Do not print DOC options.
1365         (__argp_base_name): Removed
1366         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1367         typo.
1368         (__argp_base_name): Provide macro definition or extern declaration
1369         depending on the configuration
1370
1371 2006-01-20  Simon Josefsson  <jas@extundo.com>
1372
1373         * inet_ntop.h: Unconditionally include sys/socket.h.
1374
1375 2006-01-19  Simon Josefsson  <jas@extundo.com>
1376
1377         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1378
1379 2006-01-12  Simon Josefsson  <jas@extundo.com>
1380
1381         * base64.c: Fix warning, reported by Bruno Haible
1382         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1383
1384 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1385
1386         Sync from coreutils.
1387         * md5.c: Fix commentary typos.
1388         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1389         * md5.h (__attribute__): Remove; unused.
1390         * sha1.c: Fix commentary to match md5 better.
1391         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1392         so that we don't need to worry about alignment.  All uses changed.
1393         This merges the 2005-10-28 md5 change into sha1.
1394
1395 2006-01-11  Jim Meyering  <jim@meyering.net>
1396
1397         Sync from coreutils.
1398         * md5.c (OP): Fix spacing.
1399
1400 2006-01-11  Simon Josefsson  <jas@extundo.com>
1401
1402         * stdint_.h (SIZE_MAX): Add missing (.
1403
1404 2006-01-10  Bruno Haible  <bruno@clisp.org>
1405
1406         * argp.h (__const): Remove macro. Use const instead.
1407         * argp-fmtstream.h (__const): Likewise.
1408         * glob_.h (__const): Remove macro.
1409         * glob-libc.h: Use const instead of __const.
1410
1411 2006-01-10  Jim Meyering  <jim@meyering.net>
1412
1413         Avoid the double-free (first in fts_read, second in fts_close) that
1414         would occur when an `active' directory is made inaccessible (e.g.,
1415         via chmod a-x) during a traversal.
1416         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1417         before returning.  Reproduce this failure by
1418         mkdir -p a/b; cd a; chmod a-x . b
1419         Reported by Stavros Passas.
1420
1421         Sync from coreutils.
1422         * sha1.c: Tweak grammar in a comment.
1423
1424 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1425
1426         * regex_internal.h (BITSET_WORD_BITS):
1427         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1428         preprocessor mishandles large unsigned values as if they were signed.
1429         Problem reported by Claudio Fontana in
1430         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1431
1432 2006-01-10  Simon Josefsson  <jas@extundo.com>
1433
1434         * socket_.h: New file.
1435
1436 2006-01-10  Bruno Haible  <bruno@clisp.org>
1437
1438         * localcharset.c: Update from GNU gettext.
1439
1440 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1441
1442         Sync from coreutils.
1443         * chdir-long.c (cdb_free): Don't bother trying to open directory
1444         for write access: POSIX says that must fail.
1445         * fts.c (diropen): Likewise.
1446         * save-cwd.c (save_cwd): Likewise.
1447         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1448         well, for minor improvements on hosts that lack O_DIRECTORY.
1449         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1450         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1451         Fall back on chown if open failed with EACCES.
1452
1453         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1454         Report an error at compile-time if only a 1-second nominal clock
1455         resolution is found.
1456
1457         * lchmod.h: New file.
1458         * mkdir-p.c: Include lchmod.h, lchown.h.
1459         (make_dir_parents): Use lchown rather than chown, and
1460         lchmod rather than chmod.
1461
1462         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1463         too.  Problem with "none" reported by Bob Proulx.  Problem with
1464         "proc" reported by n0dalus.
1465
1466         * mountlist.c: Include <limits.h>.
1467         (dev_from_mount_options)
1468         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1469         New function.  It no longer assumes "dev=" has the System V meaning
1470         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1471         (read_file_system_list)
1472         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1473         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1474         dev= in that case.
1475
1476         * posixtm.h (PDS_PRE_2000): New macro.
1477         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1478         All usages changed.  Reject dates outside the range 1969-1999 if
1479         PDS_PRE_2000 is used.
1480
1481 2006-01-09  Jim Meyering  <jim@meyering.net>
1482
1483         Sync from coreutils.
1484
1485         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1486
1487         * chdir-safer.h, chdir-safer.c: New files.
1488
1489         * modechange.c (mode_compile): Reject an invalid mode string
1490         that starts with an octal digit.  From Andreas Gruenbacher.
1491
1492         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1493         and dup to open_safer and dup_safer, respectively.
1494         (openat_permissive): Fix typo in comment.
1495
1496         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1497         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1498         (_): Remove; no longer needed.
1499         (openat): Renamed from rpl_openat; no need for rpl_openat
1500         since openat.h renames openat for us.
1501         Replace most of the body with a call to openat_permissive,
1502         to avoid duplicate code.
1503         Port to (probably hypothetical) environments were mode_t is
1504         wider than int.
1505         (openat_permissive): Require mode arg, so that we can check
1506         types better.  Put it just after flags.  Change cwd failure
1507         indicator from pointer-to-bool to pointer-to-errno-value.
1508         All callers changed.
1509         Invoke openat_save_fail and/or openat_restore_fail if
1510         cwd_errno is null, so that openat can call us.
1511         (openat_permissive, fdopendir, fstatat, unlinkat):
1512         Simplify errno handling to avoid some duplicate code,
1513         as it's OK to set errno on success.
1514         * openat.h: Revamp code so that function macros depend on
1515         __OPENAT_PREFIX only, not also on AT_FDCWD.
1516         (openat_ro): Remove.  Caller changed to use openat_permissive.
1517         (openat_permissive): Now a macro, if not a function.
1518         (openat_restore_fail, openat_save_fail): Now always functions,
1519         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1520
1521         * openat-priv.h: New file, defining macros used by mkdirat.c
1522         and openat.c.
1523         * mkdirat.c: Include openat-priv.h.
1524         Remove definitions of macros defined therein.
1525         * openat.c: Likewise.
1526
1527         * mkdirat.c (mkdirat): New file and function.
1528         * openat.h (mkdirat): Declare.
1529
1530         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1531
1532         * openat.h (openat_permissive): Declare.
1533         (openat_ro): Define.
1534
1535         * openat.c (EXPECTED_ERRNO): New macro.
1536         (openat_permissive): New function -- used in remove.c rewrite.
1537         (all functions): Set errno just before returning, only if there
1538         was an actual failure.
1539         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1540
1541         Emulate openat-family functions using Linux's procfs, if possible.
1542         Idea and some code based on Ulrich Drepper's glibc changes.
1543
1544         * openat.c: (BUILD_PROC_NAME): New macro.
1545         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1546         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1547         before falling back on save_cwd and restore_cwd.
1548         (fdopendir, fstatat, unlinkat): Likewise.
1549
1550         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1551         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1552
1553         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1554         as second argument to va_arg.  Otherwise, some versions of gcc
1555         warn that `if this code is reached, the program will abort'.
1556
1557 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1558
1559         Sync from coreutils.
1560
1561         Add POSIX ACL support
1562         * acl.h (copy_acl, set_acl): Add declarations.
1563         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1564         systems other than Linux.
1565         (chmod_or_fchmod): New function: use fchmod when possible,
1566         and chmod otherwise.
1567         (file_has_acl): Add a POSIX ACL implementation, with a
1568         Linux-specific subcase.
1569         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1570         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1571         acls are unsupported.
1572         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1573         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1574         are unsupported.
1575
1576 2006-01-09  Bruno Haible  <bruno@clisp.org>
1577
1578         * sysexit_.h (EX_OK): New macro.
1579         Suggested by Martin Lambers <marlam@marlam.de>.
1580
1581 2006-01-09  Bruno Haible  <bruno@clisp.org>
1582
1583         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1584         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1585         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1586         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1587
1588 2006-01-09  Bruno Haible  <bruno@clisp.org>
1589
1590         * stdint_.h (SIZE_MAX): Write the value without involving negative
1591         numbers.
1592
1593 2005-10-16  Bruno Haible  <bruno@clisp.org>
1594
1595         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1596         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1597
1598 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1599
1600         * strftime.c (tzname): Don't declare if it is already #defined.
1601         Problem reported for Mingw by Mark Junker.
1602
1603 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1604
1605         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1606         long int, not int, for nanosecond counts, so that people who are
1607         used to POSIX struct timespec won't be surprised.  Reported by Jim
1608         Meyering.
1609
1610 2005-12-16  Jim Meyering  <jim@meyering.net>
1611
1612         * fprintftime.c, fprintftime.h: New files.
1613
1614 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1615
1616         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1617         * argp-help.c (fill_in_uparams): Check if the constructed
1618         struct uparams is valid. Fall back to the default values if it is
1619         not.
1620
1621 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1622
1623         * argp-help.c (__argp_base_name): New function
1624         (__argp_short_program_name): Rewrite using __argp_base_name
1625         * argp-namefrob.h: Define program_invocation_name and
1626         program_invocation_short_name if requested
1627         (__argp_base_name): Add prototype
1628         * argp-parse.c (argp_def): Use gettext wrappers
1629         (argp_default_parser): Use __argp_base_name
1630         * argp-pin.c: New file. Defines program_invocation_name and
1631         program_invocation_short_name on systems that lack them.
1632
1633 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1634
1635         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1636         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1637         porting problem reported by Georg Schwarz in
1638         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1639
1640 2005-07-09  Bruno Haible  <bruno@clisp.org>
1641
1642         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1643         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1644         Reported by Mark Junker <mjscod@gmx.de>.
1645
1646 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1647
1648         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1649         (uintmax_t) [defined uintmax_t]: Do not declare.
1650         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1651         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1652         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
1653         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1654         sake of portability to weird hosts that C allows (though we don't
1655         know of any practical examples).
1656
1657         * savedir.h (fdsavedir): New decl.
1658         * savedir.c (fdsavedir, savedirstream): New functions; the latter
1659         contains most of the former guts of savedir.
1660         (savedir): Use savedirstream.
1661         Include "openat.h".
1662
1663 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1664
1665         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1666         coreutils no longer futzes with rounding modes.
1667
1668 2005-11-14  Jim Meyering  <jim@meyering.net>
1669
1670         * mkstemp-safer.c: Include <config.h>, required for possible
1671         replacement of mkstemp.
1672
1673 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1674
1675         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1676         business.
1677         (gethrxtime) [! (HAVE_NANOUPTIME
1678         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1679         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1680         our own approximation.
1681
1682 2005-11-10  Simon Josefsson  <jas@extundo.com>
1683
1684         * readline.c: Remove EOL.
1685
1686 2005-11-08  Eric Blake  <ebb9@byu.net>
1687
1688         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1689
1690 2005-11-08  Eric Blake  <ebb9@byu.net>
1691
1692         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1693
1694 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
1695
1696         Fix porting problem reported by Theodoros V. Kalamatianos.
1697         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1698         Don't assume that futimes failing means we must fail.
1699
1700 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
1701
1702         * getcwd.c (__getcwd): Don't assume that system calls after readdir
1703         leave errno alone.  Problem reported by Dmitry V. Levin.
1704
1705 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1706
1707         * savedir.c (savedir): Don't assume that xrealloc etc. leave
1708         errno alone.  Problem reported by Frederic Jolliton.
1709
1710 2005-10-28  Simon Josefsson  <jas@extundo.com>
1711
1712         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
1713         "restrict" keywords, as per POSIX.  Protect the function
1714         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
1715         Don't use K&R prototypes.  Check the sprintf return values.
1716         Re-define EAFNOSUPPORT if not present.  Indent.
1717
1718         * md5.h, md5.c: Simplify buffer handling visavi alignment,
1719         suggested by Bruno Haible <bruno@clisp.org>.
1720
1721         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
1722
1723         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
1724
1725         * gc-libgcrypt.c: Add MD2 (which is not available through
1726         libgcrypt).
1727
1728         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
1729
1730         * md2.h, md2.c: New files.
1731
1732 2005-10-24  Simon Josefsson  <jas@extundo.com>
1733
1734         * md4.h: Shrink buffer size, now that we changed the type.
1735
1736 2005-10-22  Simon Josefsson  <jas@extundo.com>
1737
1738         * arcfour.h, arcfour.c: Use fixed size indices in the
1739         arcfour_context struct (simplify test vector testing in GNU
1740         Shishi).
1741
1742 2005-10-22  Simon Josefsson  <jas@extundo.com>
1743
1744         * md4.h, md4.c: Simplify buffer handling visavi alignment,
1745         suggested by Bruno Haible <bruno@clisp.org>.
1746
1747 2005-10-22  Simon Josefsson  <jas@extundo.com>
1748
1749         * crc.h: Include stddef.h, for size_t.
1750
1751 2005-10-21  Simon Josefsson  <jas@extundo.com>
1752
1753         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
1754         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
1755
1756 2005-10-21  Simon Josefsson  <jas@extundo.com>
1757
1758         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
1759         block.
1760
1761 2005-10-21  Simon Josefsson  <jas@extundo.com>
1762
1763         * gc-gnulib.c: Support ARCTWO in CBC mode.
1764
1765 2005-10-21  Simon Josefsson  <jas@extundo.com>
1766
1767         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
1768         <bruno@clisp.org>.
1769
1770         * hmac-sha1.c (hmac_sha1): Likewise.
1771
1772         * crc.c (crc32_update): Actually use crc parameter, suggested by
1773         Bruno Haible <bruno@clisp.org>.
1774
1775         * crc.h: Include stdint.h directly, suggested by Bruno Haible
1776         <bruno@clisp.org>.
1777
1778 2005-10-21  Simon Josefsson  <jas@extundo.com>
1779
1780         * des.h, des.c: New files.
1781
1782         * gc-gnulib.c: Support DES.c
1783
1784 2005-10-21  Simon Josefsson  <jas@extundo.com>
1785
1786         * arctwo.h, arctwo.c: New files.
1787
1788         * gc-gnulib.c: Support ARCTWO.
1789
1790 2005-10-21  Simon Josefsson  <jas@extundo.com>
1791
1792         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
1793
1794 2005-10-19  Simon Josefsson  <jas@extundo.com>
1795
1796         * gc-gnulib.c: Support ARCFOUR.
1797
1798 2005-10-19  Simon Josefsson  <jas@extundo.com>
1799
1800         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
1801         support.
1802
1803         * gc.h: Add ECB enum type.
1804
1805         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
1806
1807 2005-10-19  Simon Josefsson  <jas@extundo.com>
1808
1809         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
1810
1811 2005-10-18  Simon Josefsson  <jas@extundo.com>
1812
1813         * md4.h, md4.c: New files, based on md5.?.
1814
1815 2005-10-17  Simon Josefsson  <jas@extundo.com>
1816
1817         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
1818
1819         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
1820
1821 2005-10-17  Simon Josefsson  <jas@extundo.com>
1822
1823         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
1824
1825 2005-10-17  Simon Josefsson  <jas@extundo.com>
1826
1827         * gc.h, gc-libgcrypt.c: Add ciphers.
1828
1829 2005-10-17  Simon Josefsson  <jas@extundo.com>
1830
1831         * sha1.c: Use uint32_t instead of md5_uint32.t
1832
1833         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
1834         md5.h.
1835
1836         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
1837
1838         * md5.h: Use stdint.h and uint32_t.  Doc fix.
1839
1840 2005-10-15  Simon Josefsson  <jas@extundo.com>
1841
1842         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
1843
1844         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
1845
1846 2005-10-14  Simon Josefsson  <jas@extundo.com>
1847
1848         * arcfour.h, arcfour.c: New files.
1849
1850 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
1851
1852         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
1853         include <wchar.h>; no longer needed.
1854
1855 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
1856         and  Ulrich Drepper  <drepper@redhat.com>
1857
1858         Import from libc.
1859         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
1860         instead of inline stream orientation test and two separate
1861         function calls.  Pay no attention to USE_IN_LIBIO.
1862
1863 2005-10-14  Roland McGrath  <roland@redhat.com>
1864
1865         Import from libc.  [BZ #1331]
1866         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
1867         macro argument.
1868         Reported by Matej Vela <vela@debian.org>.
1869
1870 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
1871
1872         * mkdir-p.c (make_dir_parents): Don't report an error if an
1873         intermediate directory is in a read-only file system.  Problem
1874         reported by Eric Blake.
1875
1876 2005-10-13  Simon Josefsson  <jas@extundo.com>
1877
1878         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
1879         Move memory allocation outside of loop.
1880
1881 2005-10-12  Simon Josefsson  <jas@extundo.com>
1882
1883         * gc-pbkdf2-sha1.c: New file.
1884
1885         * gc.h: Add gc_pbkdf2_sha1 prototype.
1886
1887 2005-10-12  Simon Josefsson  <jas@extundo.com>
1888
1889         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
1890         suggested by Bruno Haible <bruno@clisp.org>.
1891
1892 2005-10-12  Simon Josefsson  <jas@extundo.com>
1893
1894         * gc-libgcrypt.c (gc_hmac_sha1): New function.
1895
1896         * gc-gnulib.c (gc_hmac_sha1): New function.
1897
1898 2005-10-12  Simon Josefsson  <jas@extundo.com>
1899
1900         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
1901
1902 2005-10-12  Simon Josefsson  <jas@extundo.com>
1903
1904         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
1905         GC_USE_HMAC_MD5, respectively.
1906
1907         * gc-libgcrypt.c (gc_md5): Fix assert call.
1908         (gc_md5): Fix typo.
1909
1910         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
1911
1912         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
1913
1914         * gc-gnulib.c (gc_hash_buffer): Ditto.
1915
1916 2005-10-11  Bruno Haible  <bruno@clisp.org>
1917
1918         * c-strcasestr.h: New file, from GNU gettext.
1919         * c-strcasestr.c: New file, from GNU gettext.
1920
1921 2005-10-11  Bruno Haible  <bruno@clisp.org>
1922
1923         * c-strcase.h: New file, from GNU gettext.
1924         * c-strcasecmp.c: New file, from GNU gettext.
1925         * c-strncasecmp.c: New file, from GNU gettext.
1926
1927 2005-10-11  Simon Josefsson  <jas@extundo.com>
1928
1929         * crc.h, crc.c: New files.
1930
1931         * gc.h (gc_hash_buffer): Add doc.
1932
1933 2005-10-08  Simon Josefsson  <jas@extundo.com>
1934
1935         * gc.h: Add gc_hash and gc_hash_buffer.
1936
1937         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
1938
1939         * gc-libgcrypt.c (gc_hash_buffer): Add.
1940
1941 2005-10-11  Bruno Haible  <bruno@clisp.org>
1942
1943         * strcasecmp.c: Include limits.h.
1944         (strcasecmp): Avoid integer overflow on exotic platforms.
1945         * strncasecmp.c: Include limits.h.
1946         (strncasecmp): Avoid integer overflow on exotic platforms.
1947         Reported by Paul Eggert.
1948
1949 2005-10-06  Simon Josefsson  <jas@extundo.com>
1950
1951         * hmac-md5.c: New file.
1952
1953         * hmac.h: New file.
1954
1955 2005-10-06  Simon Josefsson  <jas@extundo.com>
1956
1957         * memxor.c (memxor): Avoid casts and warnings.
1958
1959 2005-10-05  Derek Price  <derek@ximbiot.com>
1960
1961         * getdelim.c (SIZE_MAX): New macro, if not already defined.
1962
1963 2005-10-05  Simon Josefsson  <jas@extundo.com>
1964
1965         * memxor.c (memxor): Fix compiler error.
1966
1967         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
1968         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
1969
1970         * memxor.h, memxor.c: New files.
1971
1972         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
1973         we assume all systems have it, suggested by Jim Meyering
1974         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
1975         any systems lack sys/socket.h; mingw32 is known to lack it, but we
1976         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
1977         same reasons.
1978
1979 2005-10-04  Bruno Haible  <bruno@clisp.org>
1980
1981         * verify.h (verify_true): Provide alternative definition for C++.
1982
1983 2005-10-04  Simon Josefsson  <jas@extundo.com>
1984
1985         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
1986         D. Baushke" <mdb@gnu.org>.
1987
1988 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
1989
1990         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
1991         (SSIZE_MAX): New macro, if not already defined.
1992         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
1993         than 2 GiB.
1994
1995 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
1996
1997         * exclude.c: Include verify.h.
1998         (verify): Remove.  All callers changed to use verify.h's version.
1999         * strtoimax.c: Likewise.
2000         * utimecmp.c: Likewis.e
2001
2002         Sync from coreutils.
2003         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2004         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2005         * .cvsignore: Add fts.h, search.h, t-fpending.
2006         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2007         bother returning ENOSYS if settimeofday or stime fails; just let
2008         them return whatever errno they want to return.
2009         * utimens.c: Include unistd.h, for dup2.
2010         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2011         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2012
2013 2005-10-02  Jim Meyering  <jim@meyering.net>
2014
2015         Sync from coreutils.
2016         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2017         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2018         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2019         Remove AT_FDCWD test.
2020         Do not consume the fd unless successful.
2021         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2022         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2023         block, so that we don't even try to compile it if settimeofday is
2024         available.  This works around a compilation failure on OSF1 V5.1,
2025         due to stime requiring a `long int*' while tv_sec is `int'.
2026
2027 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2028
2029         * getdelim.c (getdelim): Remove unused variables.
2030
2031 2005-10-01  Simon Josefsson  <jas@extundo.com>
2032
2033         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2034         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2035         AI_* and EAI_* definitions.  Protect function declarations.
2036
2037 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2038
2039         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2040         so that the code works even with ancient cpp.  Portability problem
2041         with GCC 2.7.2.1 reported by Thomas M.Ott.
2042
2043 2005-09-27  Jim Meyering  <jim@meyering.net>
2044
2045         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2046
2047         * intprops.h (signed_type_or_expr__): Define.
2048         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2049         for unsigned types.
2050
2051 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2052
2053         * verify.h (verify_expr): Remove, replacing with:
2054         (verify_true): New macro that returns true instead of void.
2055         (verify_type__): Remove.
2056         (verify): Use verify_true rather than verify_type__.
2057
2058 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2059
2060         * utimens.c (ENOSYS): Define if not already defined.
2061         (futimens): Support having a null PATH if the file descriptor
2062         is nonnegative.
2063
2064         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2065         Remove.
2066         (__attribute): Define to empty unless GCC 3.1 or later.
2067         This works around a core dump on OpenBSD 3.4, which has GCC
2068         2.95.3, which dumps core when given __attribute__(()).  It also
2069         simplifies other tests, since we really don't want to bother with
2070         worrying about which ancient version of GCC supported what.
2071         Original problem reported by Yoann Vandoorselaere, with part of
2072         the fix suggested by Derek Price.
2073
2074 2005-09-24  Jim Meyering  <jim@meyering.net>
2075
2076         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2077         so we can once again use a positive bitfield width of 1 -- now we
2078         don't have to explain why we were using a bitfield width of 2.
2079
2080 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2081
2082         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2083         Problem reported by Eric Blake.
2084         (getaddrinfo): Initialize se so that it's not garbage.
2085         Redo internal storage allocation so that it doesn't make unportable
2086         assumptions about alignment.
2087         Fix a memory leak.
2088
2089         * utimens.c (futimens): Use futimesat if available.
2090         Prefer it to futimes since it doesn't have the futimes bug.
2091
2092         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2093         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2094         Instead, declare a function that returns a pointer to an array,
2095         and use verify_type__ to declare the size of the array.
2096         Problem and germ of a solution reported by Bruno Haible.
2097         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2098         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2099
2100 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2101
2102         Sync from coreutils.
2103
2104         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2105         stat-time.h.
2106         * argmatch.h: Include verify.h
2107         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2108         (ARGMATCH_ASSERT): Remove; unused.
2109         * canonicalize.c: Assume STDC_HEADERS.
2110         * exclude.c: Include "strcase.h".
2111         * regex_internal.h [!defined _LIBC]: Likewise.
2112         * getusershell.c: Include stdio--.h rather than stdio.h
2113         and stdio-safer.h.
2114         (getusershell): Call fopen, not fopen_safer.
2115         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2116         Do not include unistd-safer.h.
2117         (save_cwd): Don't call fd_safer; no longer needed
2118         now that we include fcntl--.h.
2119
2120         * getdate.y (relative_time): New type.
2121         (RELATIVE_TIME_0): New constant.
2122         (parser_control): Use relative_time instead of doing it ourselves.
2123         (%union): Add new relative_time rel member.
2124         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2125         Now typeless.
2126         (relunit, relunit_snumber): Now of type rel.
2127         (zone, rel, relunit, get_date): Adjust to above changes.
2128
2129         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2130         Do not include unistd-safer.h.
2131         (getloadavg): Don't call fd_safer; no longer needed
2132         now that we include fcntl--.h.
2133
2134         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2135         (make_dir_parents): Treat ENOSYS like EEXIST.
2136
2137         Improve quality of diagnostics on restore_cwd failure.
2138         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2139         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2140         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2141         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2142         each time through the loop.  Do not diagnose restore_cwd failure;
2143         that is the caller's job (and perhaps the caller does not care).
2144
2145         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2146         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2147         If the file already exists but is not a directory, don't bother
2148         to try to make its parents.
2149         Close potential file descriptor leak if we can't chdir("/") (!).
2150         Don't always return true if chdir($PWD) fails; return true only
2151         if the requested action was done successfully (except for the
2152         chdir($PWD)).
2153         Don't log final directory unless we actually made it.
2154         Refactor to avoid duplicate code to fix up permissions.
2155         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2156
2157         * strftime.c (my_strftime): Rewrite the previous change slightly,
2158         to make it a bit faster and (I hope) clearer.
2159         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2160         Fix bug in formats like %2N.
2161
2162         * verify.h: New file.
2163
2164 2005-09-22  Jim Meyering  <jim@meyering.net>
2165
2166         Sync from coreutils.
2167
2168         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2169
2170         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2171         the .tm_year member, since otherwise gcc-4.0 would now warn about
2172         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2173
2174         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2175         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2176
2177         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2178         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2179         when run in a time zone for which daylight savings time is in effect
2180         for the starting date.
2181
2182         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2183         stop us from restricting permissions of just-created absolute-named
2184         directories.
2185         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2186         to restore initial working directory.
2187         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2188         to tell caller if/when we change the working directory and are
2189         unable to return to the initial one.
2190         * mkdir-p.h (make_dir_parents): Update prototype.
2191         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2192         `return false'.  This fixes a bug introduced on 2004-07-30.
2193
2194         * openat.c (fdopendir): Be sure to close the supplied
2195         file descriptor before returning.  This makes our replacement
2196         implementation a little closer to Solaris's, where fdopendir
2197         ties the file descriptor to the returned DIR* pointer.
2198         * openat.c (unlinkat): New function.
2199         * openat.h (unlinkat): Add prototype.
2200         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2201         (openat_restore_fail): Rename from openat_restore_die.
2202         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2203
2204         Provide an alternative to exiting immediately upon save_cwd or
2205         restore_cwd failure.  Now, an application can arrange e.g.,
2206         to perform a longjump in that case.
2207         * openat.c: Include dirname.h.
2208         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2209         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2210         and openat_restore_die rather than calling error directly.
2211         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2212
2213         * openat-die.c (openat_save_die, openat_restore_die): New file.
2214         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2215
2216         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2217         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2218                             int utc, int nanoseconds);
2219         Background:
2220         date should not have to allocate a megabyte of virtual memory to
2221         handle a format argument like +%1048575T.  When implemented with
2222         strftime, it must allocate such a buffer, use strftime to fill it
2223         in, print it, then free it.
2224         With fprintftime, it simply prints everything and exits.
2225         With no need for memory allocation, that's one fewer way to fail.
2226         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2227         optional field width, not before, so we accept %9:z, not %:9z.
2228         (my_strftime): Be sure to use L_('x') for literals.
2229
2230         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2231         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2232         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2233         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2234         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2235         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2236         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2237         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2238         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2239
2240         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2241         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2242         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2243         and don't include <sys/file.h>).
2244
2245 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2246
2247         Sync from coreutils.
2248
2249         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2250         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2251         [!LDAV_DONE]: Avoid unused variable warning.
2252
2253 2005-09-21  Bruno Haible  <bruno@clisp.org>
2254
2255         * unicodeio.h (unicode_to_mb): New declaration.
2256
2257 2005-09-20  Derek Price  <derek@ximbiot.com>
2258
2259         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2260
2261 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2262
2263         Use a consistent style for including <config.h>.
2264         * __fpending.c, acl.c, argmatch.c,
2265         argp-help.c, argp-parse.c,
2266         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2267         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2268         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2269         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2270         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2271         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2272         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2273         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2274         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2275         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2276         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2277         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2278         modechange.c, mountlist.c, open-safer.c, physmem.c,
2279         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2280         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2281         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2282         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2283         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2284         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2285         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2286         userspec.c, utimecmp.c, version-etc-fsf.c,
2287         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2288         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2289         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2290         Standardize inclusion of config.h.
2291         * __fpending.h, dirfd.h, getdate.h, human.h,
2292         inttostr.h:  Removed inclusion of config.h from header files.
2293         * inttostr.c:  Adjusted in-tree users.
2294         * timespec.h: Remove superfluous warning to include config.h.
2295         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2296         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2297         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2298         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2299
2300 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2301
2302         * stat-time.h: New file.
2303         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2304         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2305         in a different way.
2306         (timespec_cmp): New function.
2307         * utimecmp.c: Include stat-time.h.
2308         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2309         members exist, not on the obsolescent ST_MTIM_NSEC.
2310         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2311
2312 2005-09-15  Derek Price  <derek@ximbiot.com>
2313             Paul Eggert  <eggert@cs.ucla.edu>
2314
2315         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2316         changes, consolidating in...
2317         * regex_internal.h: ...this file.
2318
2319 2005-09-15  Derek Price  <derek@ximbiot.com>
2320
2321         * regex_internal.h: Blank `pure' for GNUC < 3.
2322         * regex_internal.c: Ditto, using this...
2323         (__GNUC_PREREQ): ...new macro.
2324         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2325         (__GNUC_PREREQ): ...this new macro.
2326
2327         * strstr.h: Include string.h. Define strstr as a macro here.
2328
2329 2005-09-13  Derek Price  <derek@ximbiot.com>
2330
2331         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2332         failure.
2333         Reported by Jim Meyering  <jim@meyering.net>.
2334
2335 2005-09-13  Jim Meyering  <jim@meyering.net>
2336
2337         * canon-host.c: Filter through gnu indent and reword comments slightly.
2338         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2339
2340 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2341
2342         * lib/base64.c: Typo.
2343         (base64_encode): Put b64str in initialized data section.
2344
2345 2005-09-12  Derek Price  <derek@ximbiot.com>
2346
2347         Return usable errors from canon-host.
2348         * canon-host.h: New file.
2349         * canon-host.c (canon_host): Wrap...
2350         (canon_host_r): ...this new function, which now relies exclusively on
2351         getaddrinfo.
2352         (ch_strerror): New function.
2353         (last_cherror): New global.
2354         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2355         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2356         void *.
2357         (freeaddrinfo): Free ai->ai_canonname when set.
2358
2359 2005-09-12  Derek Price  <derek@ximbiot.com>
2360             Paul Eggert  <eggert@cs.ucla.edu>
2361
2362         * glob-libc.h: Renamed from glob_.h.  The new version is
2363         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2364         protecting things that should be done only in gnulib contexts.
2365         * glob_.h: New file, containing only the glob things needed for
2366         gnulib.
2367         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2368         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2369         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2370         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2371         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2372         and to respect the namespace rules better.
2373
2374 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2375
2376         Merge glibc and coreutils changes into gnulib, plus a few
2377         extra fixes.
2378         * md5.c: Use #error rather than a string.
2379         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2380         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2381         (__attribute__): Define to empty for non recent-GCC.
2382         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2383         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2384         Renamed from their non-__ counterparts, with new macros replacing
2385         them if not _LIBC.  Add __THROW attribute.
2386         (rol): Remove.
2387         (struct md5_ctx): Align buffer if using GCC.
2388         * sha1.h (struct sha1_ctx): Likewise.
2389         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2390         The old name was backwards.
2391         (NOTSWAP): Remove; not used.
2392         (rol): New macro, moved here from md5.h.
2393         (sha1_process_block): Remove a FIXME that doesn't make sense.
2394
2395 2005-09-12  Derek Price  <derek@ximbiot.com>
2396
2397         * gai_strerror.c: Include config.h when available.  Include
2398         getaddrinfo.h before other headers to test interface.
2399         Reported by Larry Jones <lawrence.jones@ugs.com>.
2400
2401 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2402
2403         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2404         definitions, since that's the preferred style in glibc.
2405         Fix a minor spacing issue, and update copyright notice to match glibc's.
2406
2407 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2408
2409         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2410
2411 2005-09-06  Simon Josefsson  <jas@extundo.com>
2412
2413         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2414         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2415
2416 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2417
2418         Change bitset word type from unsigned int to unsigned long int,
2419         as this has better performance on typical 64-bit hosts.
2420         Port bitset code to hosts with unusual word sizes.
2421         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2422         (build_collating_symbol):
2423         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2424         argument is a bitset.  This is merely a style issue, but it makes
2425         it clearer that an entire array is expected.
2426         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2427         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2428         Port to the case where bitset_word is not the same as unsigned int.
2429         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2430         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2431         Likewise.
2432         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2433         (build_trtable, group_nodes_into_DFAstates):
2434         Likewise.
2435         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2436         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2437         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2438         * regexec.c (group_nodes_into_DFAstates): Likewise.
2439         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2440         * regcomp.c (optimize_subexps, lower_subexp):
2441         Work even if bitset_word has holes in its bitwise representation.
2442         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2443         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2444         Likewise.
2445         * regex_internal.c (re_string_reconstruct):
2446         Don't assume UCHAR_MAX == 255.
2447         * regex_internal.h (bitset_set_all): Likewise.
2448         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2449         All uses changed.
2450         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2451         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2452         All uses changed.
2453         (BITSET_WORD_MAX): New macro.
2454         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2455         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2456         (bitset_empty, bitset_copy):
2457         Prefer sizeof (bitset) to multiplying it out ourselves.
2458         (bitset_not_merge): Remove; unused.
2459         (bitset_contain): Return bool, not unsigned int with one bit on.
2460         All callers changed.
2461         * regexec.c (build_trtable): Don't assume bitset has no stricter
2462         alignment than re_node_set; do this by defining a new internal
2463         type struct dests_alloc and using it to allocate memory.
2464
2465 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2466
2467         Check for arithmetic overflow when calculating sizes, to prevent
2468         some buffer-overflow issues.  These patches are conservative, in the
2469         sense that when I couldn't determine whether an overflow was possible,
2470         I inserted a run-time check.
2471         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2472         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2473         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2474         (re_xnrealloc, re_x2nrealloc): New inline functions.
2475         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2476         (build_equiv_class, build_charclass): Check for arithmetic overflow
2477         in size expression calculations.
2478         * lib/regex_internal.c (re_string_realloc_buffers):
2479         (build_wcs_upper_buffer, re_node_set_add_intersect):
2480         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2481         (re_dfa_add_node, register_state): Likewise.
2482         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2483         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2484         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2485         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2486
2487 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2488
2489         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2490         to avoid a collision with bits/local_lim.h in glibc.
2491         All uses changed.  Problem reported by Dmitry V. Levin in
2492         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2493
2494         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2495         bugs in int versus size_t comparisons.
2496         (re_string_context_at): Fix bug where the code assumed that
2497         Idx is signed.
2498
2499         Use bool where appropriate.
2500         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2501         All callers changed.
2502         (calc_eclosure_iter): Likewise, for ROOT arg.
2503         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2504         (build_charclass_op): Likewise, for NON_MATCH arg.
2505         * regex_internal.c (re_string_allocate, re_string_construct):
2506         (re_string_construct_common): Likewise, for ICASE arg.
2507         * regexec.c (re_search_2_stub, re_search_stub):
2508         Likewise, for RET_LEN arg.
2509         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2510         (set_regs): Likewise, for FL_BACKTRACK arg.
2511         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2512         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2513         (calc_eclosure_iter, parse_bracket_exp):
2514         Use bool for internal variables that are booleans.
2515         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2516         (set_regs, build_sifted_states, sift_states_bkref):
2517         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2518         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2519         (find_collation_sequence_value):
2520         Likewise.
2521         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2522         (re_node_set_compare):
2523         Return bool, not int. All callers changed.
2524         * regexec.c (check_halt_node_context, check_dst_limits):
2525         (build_trtable, check_node_accept): Likewise.
2526         * regex_internal.h: Include stdbool.h.
2527
2528         Fix bugs uncovered when converting to bool.
2529         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2530         failure instead of charging ahead blindly.
2531         * regex_internal.c (register_state): Likewise.
2532         * regexec.c (re_search_2_stub): Use simpler method than boolean
2533         for freeing internal storage.
2534         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2535         bitset pieces used as boolean, to avoid undefined behavior
2536         on hosts that do int overflow checking.
2537
2538 2005-08-31  Derek Price  <derek@ximbiot.com>
2539
2540         * getdelim.c (getdelim): Return EOF on EOF.
2541         Reported by Larry Jones <lawrence.jones@ugs.com>.
2542
2543 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2544
2545         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2546         lengths fit in regoff_t; this isn't true if regoff_t is the same
2547         width as size_t.
2548         * regex.c (re_search_internal): 5th arg is LAST_START
2549         (= START + RANGE) instead of RANGE.  This avoids overflow
2550         problems when regoff_t is the same width as size_t.
2551         All callers changed.
2552         (re_search_2_stub): Check for overflow when adding the
2553         sizes of the two strings.
2554         (re_search_stub): Check for overflow when adding START
2555         to RANGE; if it occurs, substitute the extreme value.
2556
2557 2005-08-31  Jim Meyering  <jim@meyering.net>
2558
2559         * regcomp.c (search_duplicated_node): Make first pointer arg
2560         a pointer-to-const.
2561         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2562         (register_state): Likewise.
2563         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2564         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2565         (group_nodes_into_DFAstates): Likewise.
2566
2567 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2568
2569         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2570         old glibc regex code mishandles strings longer than 2**31 bytes.
2571         This patch fixes this when the regex code is used in gnulib
2572         (i.e., outside glibc).
2573
2574         This patch should not affect the use of the regex code inside
2575         glibc.  No doubt this problem also needs to be handled for glibc
2576         as well, but the result will be an incompatible change to the
2577         glibc ABI, and the old ABI will have to be supported too.  That
2578         can be the the subject for another patch.
2579
2580         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2581         governing whether the rest of this patch is active.  By default,
2582         the macro is disabled and the patch has no effect.
2583         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2584         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2585         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2586         (re_match_2, re_set_registers): Use the new types.
2587         * regex_internal.h (Idx, re_hashval_t): New types.
2588         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2589         New macros.
2590         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2591         (re_string_context_at, bin_tree_t, re_dfastate_t):
2592         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2593         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2594         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2595         (re_string_char_size_at, re_string_wchar_at):
2596         (re_string_elem_size_at):
2597         Use the new types and macros to port to 64-bit hosts.
2598         Use unsigned types for internal values, so that the code
2599         mostly works even for arrays larger than SSIZE_MAX.
2600         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2601         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2602         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2603         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2604         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2605         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2606         (calc_inveclosure, parse_dup_op, build_range_exp):
2607         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2608         (fetch_number, create_token_tree, mark_opt_subexp):
2609         Likewise.
2610         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2611         (create_cd_newstate, re_string_allocate, re_string_construct):
2612         (re_string_realloc_buffers, build_wcs_upper_buffer):
2613         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2614         (re_string_reconstruct, re_string_peek_byte_case):
2615         (re_string_fetch_byte_case, re_string_context_at):
2616         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2617         (re_node_set_init_copy, re_node_set_add_intersect):
2618         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2619         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2620         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2621         (re_acquire_state, re_acquire_state_context, register_state):
2622         Likewise.
2623         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2624         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2625         (re_search_internal, re_search_2_stub, re_search_stub)
2626         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2627         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2628         (update_cur_sifted_state, check_dst_limits):
2629         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2630         (check_subexp_limits, sift_states_bkref, merge_state_array):
2631         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2632         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2633         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2634         (expand_bkref_cache, check_node_accept_bytes):
2635         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2636         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2637         (acquire_init_state_context, check_halt_node_context):
2638         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2639         (sift_states_backward, clean_state_log_if_needed):
2640         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2641         (find_recover_state, transit_state_sb, transit_state_mb):
2642         (transit_state_bkref, build_trtable, match_ctx_clean):
2643         Likewise.
2644         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2645         to work around an assumption that REG_MISSING is negative.
2646
2647         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2648         (seek_collating_symbol_entry) [defined _LIBC]:
2649         (lookup_collation_sequence_value) [defined _LIBC]:
2650         (build_range_exp, build_collating_symbol) [defined _LIBC]:
2651         Use prototypes rather than old-style function definitions.
2652         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2653         (transit_state_sb) [0]:
2654         (find_collation_sequence_value) [defined _LIBC]: Likewise.
2655
2656         * regexec.c (re_search_internal): Simplify update of rm_so and
2657         rm_eo.
2658
2659         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2660         (optimize_subexps, lower_subexp):
2661         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2662         since the signed shift might overflow.  Use 1u<<31 instead.
2663         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2664         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2665         Likewise.
2666
2667         * regcomp.c (optimize_subexps, lower_subexp):
2668         Use CHAR_BIT rather than 8, for clarity.
2669         * regexec.c (check_dst_limits_calc_pos_1):
2670         (check_subexp_matching_top): Likewise.
2671         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2672         have to worry about portability issues when shifting it left.
2673         Remove no-longer-needed test for table_size > 0.
2674         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2675         in a word, as the resulting behavior is undefined.
2676         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2677         in one case, a <= should have been an <, and in another case the
2678         whole test was missing.
2679         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
2680         the standard name CHAR_BIT.
2681         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2682         this is not true on one's complement and signed-magnitude hosts.
2683
2684         * regex_internal.h (re_sub_match_top_t): Remove unused member
2685         next_last_offset.
2686         (struct re_dfa_t): Remove unused member states_alloc.
2687         * regcomp.c (init_dfa): Don't initialize unused members.
2688
2689 2005-08-31  Bruno Haible  <bruno@clisp.org>
2690
2691         * strstr.c: Include <stddef.h>, for NULL.
2692         * strcasestr.c: Likewise.
2693         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2694
2695 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
2696
2697         * iconvme.h: Add prototype for iconv_alloc.
2698
2699 2005-08-29  Simon Josefsson  <jas@extundo.com>
2700
2701         * iconvme.c: Fix errno.
2702
2703 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
2704
2705         * iconvme.c: Split iconv_string into iconv_alloc.
2706
2707 2005-08-27  Jim Meyering  <jim@meyering.net>
2708
2709         * fopen-safer.c: Merge minor changes from coreutils.
2710         * dup-safer.c: Likewise.
2711         * fd-safer.c: Likewise.
2712
2713         Merge from coreutils.
2714         * stdio--.h: New file.
2715         * stdlib--.h: New file.
2716         * mkstemp-safer.c: New file.
2717
2718         GNU tar needs these.
2719         * pipe-safer.c: New file.
2720         * creat-safer.c: New file.
2721         * fcntl--.h (creat): Define to creat_safer.
2722         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
2723         * unistd--.h (pipe): Define to pipe_safer.
2724         * unistd-safer.h: Declare pipe_safer.
2725
2726 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
2727
2728         * regex_internal.h: Remove all references to
2729         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
2730         or better.
2731         (bitset_not, bitset_merge, bitset_not_merge):
2732         (bitset_mask, re_string_allocate, re_string_construct):
2733         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
2734         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
2735         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
2736         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
2737         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2738         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2739         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
2740         (re_acquire_state_context):
2741         Remove unnecessary forward decls.
2742         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
2743         Put __attribute at function definition,
2744         now that the function decl has been removed.
2745         * lib/regex_internal.c (re_string_peek_byte_case):
2746         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
2747         Likewise.
2748
2749 2005-08-26  Simon Josefsson  <jas@extundo.com>
2750
2751         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
2752         Haible <bruno@clisp.org>.
2753
2754 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2755
2756         * regexec.c (set_regs): Don't alloca with an unbounded size.
2757
2758         alloca modernization/simplification for regex.
2759         * regex.c: Remove portability cruft for alloca.  This no longer
2760         needs to be at the start of the file, and can be moved into
2761         regex_internal.h and simplified.
2762         * regex_internal.h: Include <alloca.h>.
2763         (__libc_use_alloca) [!defined _LIBC]: New macro.
2764         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
2765         now works outside glibc.
2766
2767 2005-08-24  Simon Josefsson  <jas@extundo.com>
2768
2769         * getpass.c: Add WIN32 implementation.  Conditionalize use of
2770         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
2771         GLIBC specific code.
2772
2773 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2774
2775         Make regex safe for g++.  This fixes one real bug (an "err"
2776         that should have been "*err").  g++ problem reported by
2777         Sam Steingold.
2778         * regex_internal.h (re_calloc): New macro, consistent with
2779         re_malloc etc.  All callers of calloc changed to use re_calloc.
2780         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
2781         not int.  All callers changed.
2782         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
2783         just use an array of size MB_LEN_MAX.
2784         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
2785         (find_recover_state): Change "err" to "*err"; this fixes what
2786         appears to be a real bug.
2787         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
2788         versus int.
2789
2790 2005-08-25  Jim Meyering  <jim@meyering.net>
2791
2792         * open-safer.c: Include <config.h>.
2793         Otherwise, we'd lose LARGEFILE support in any file using
2794         e.g. "fcntl--.h"
2795
2796 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2797
2798         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
2799         * regex.h (regerror): Likewise.
2800
2801         * regex.c: Do not include <sys/types.h>, as POSIX no longer
2802         requires this.  (The code never needed it.)
2803
2804         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
2805         All uses of recently-renamed identifiers changed to use the new,
2806         POSIX-compliant names.  The code will build and run just fine
2807         without these changes, but it's better to eat our own dog food
2808         and use the standard-conforming names.
2809
2810         * regex.h: Fix a multitude of POSIX name space violations.
2811         These changes have an effect only for programs that define
2812         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
2813         do not change anything for programs compiled in the normal way.
2814         Also, there is no effect on the ABI.
2815
2816         (_REGEX_SOURCE): New macro.
2817         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
2818         defined and _GNU_SOURCE is not; this fixes a name space violation.
2819
2820         Rename the following macros to obey POSIX requirements.
2821         The old names are still visible as macros if _REGEX_SOURCE is defined.
2822         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
2823         RE_BACKSLASH_ESCAPE_IN_LISTS.
2824         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
2825         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
2826         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
2827         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
2828         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
2829         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
2830         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
2831         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
2832         (REG_INTERVALS): renamed from RE_INTERVALS.
2833         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
2834         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
2835         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
2836         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
2837         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
2838         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
2839         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
2840         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
2841         RE_UNMATCHED_RIGHT_PAREN_ORD.
2842         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
2843         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
2844         (REG_DEBUG): renamed from RE_DEBUG.
2845         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
2846         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
2847         unusual, since we can't clash with the POSIX REG_ICASE.
2848         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
2849         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
2850         (REG_NO_SUB): renamed from RE_NO_SUB.
2851         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
2852         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
2853         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
2854         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
2855         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
2856         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
2857         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
2858         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
2859         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
2860         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
2861         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
2862         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
2863         RE_SYNTAX_POSIX_MINIMAL_BASIC.
2864         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
2865         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
2866         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
2867         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
2868         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
2869         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
2870         (REG_FIXED): Renamed from REGS_FIXED.
2871         (REG_NREGS): Renamed from RE_NREGS.
2872
2873         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
2874         of other REG_* macros, since POSIX says the user is allowed to
2875         #undef these macros selectively.
2876
2877         (reg_errcode_t): Update comment stating what other tables need
2878         to be consistent.
2879
2880         Rename the following enum values to obey POSIX requirements.
2881         The old names are still visible as macros.
2882         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
2883         is not defined, since GNU is supposed to be a superset of POSIX as
2884         much as possible, and since we want reg_errcode_t to be a signed
2885         type for implementation consistency.
2886         (_REG_NOERROR): Renamed from REG_NOERROR.
2887         (_REG_NOMATCH): Renamed from REG_NOMATCH.
2888         (_REG_BADPAT): Renamed from REG_BADPAT.
2889         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
2890         (_REG_ECTYPE): Renamed from REG_ECTYPE.
2891         (_REG_EESCAPE): Renamed from REG_EESCAPE.
2892         (_REG_ESUBREG): Renamed from REG_ESUBREG.
2893         (_REG_EBRACK): Renamed from REG_EBRACK.
2894         (_REG_EPAREN): Renamed from REG_EPAREN.
2895         (_REG_EBRACE): Renamed from REG_EBRACE.
2896         (_REG_BADBR): Renamed from REG_BADBR.
2897         (_REG_ERANGE): Renamed from REG_ERANGE.
2898         (_REG_ESPACE): Renamed from REG_ESPACE.
2899         (_REG_BADRPT): Renamed from REG_BADRPT.
2900         (_REG_EEND): Renamed from REG_EEND.
2901         (_REG_ESIZE): Renamed from REG_ESIZE.
2902         (_REG_ERPAREN): Renamed from REG_ERPAREN.
2903         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
2904         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
2905         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
2906         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
2907
2908         (_REG_RE_NAME, _REG_RM_NAME): New macros.
2909         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
2910         changed.  But support the old name if the new one is not defined
2911         and if _REGEX_SOURCE.
2912
2913         Change the following member names in struct re_pattern_buffer.
2914         The old names are still supported if !_REGEX_SOURCE.
2915         The new names are always supported, regardless of _REGEX_SOURCE.
2916         (re_buffer): Renamed from buffer.
2917         (re_allocated): Renamed from allocated.
2918         (re_used): Renamed from used.
2919         (re_syntax): Renamed from syntax.
2920         (re_fastmap): Renamed from fastmap.
2921         (re_translate): Renamed from translate.
2922         (re_can_be_null): Renamed from can_be_null.
2923         (re_regs_allocated): Renamed from regs_allocated.
2924         (re_fastmap_accurate): Renamed from fastmap_accurate.
2925         (re_no_sub): Renamed from no_sub.
2926         (re_not_bol): Renamed from not_bol.
2927         (re_not_eol): Renamed from not_eol.
2928         (re_newline_anchor): Renamed from newline_anchor.
2929
2930         Change the following member names in struct re_registers.
2931         The old names are still supported if !_REGEX_SOURCE.
2932         The new names are always supported, regardless of _REGEX_SOURCE.
2933         (rm_num_regs): Renamed from num_regs.
2934         (rm_start): Renamed from start.
2935         (rm_end): Renamed from end.
2936
2937         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
2938         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
2939         Prepend __ to parameter names.
2940
2941         Undo yesterday's changes.
2942
2943 2005-08-24  Jim Meyering  <jim@meyering.net>
2944
2945         Sync from coreutils.
2946         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
2947
2948 2005-08-21  Bruno Haible  <bruno@clisp.org>
2949
2950         * lock.h: Add multiple inclusion guard.
2951         * tls.h: Add multiple inclusion guard.
2952
2953 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2954
2955         * regex.h (REG_NOSYS)
2956         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
2957         Define, since POSIX requires it as of 2001.
2958         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
2959         New private symbol, used to keep the enum signed in all cases.
2960         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
2961         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
2962
2963         * regex_internal.c (re_string_skip_chars, register_state):
2964         (calc_state_hash):
2965         Remove forward decls; no longer needed now that we use prototypes.
2966         * regexec.c (acquire_init_state_context, check_halt_node_context):
2967         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
2968         (clean_state_log_if_needed): Likewise.
2969
2970 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2971
2972         Fix problems reported by Sam Steingold in
2973         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
2974         * regexec.c (sift_states_bkref): Fix portability bug: the code
2975         assumed that reg_errcode_t is a signed type, which is not
2976         necessarily true if _XOPEN_SOURCE is not defined.
2977         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
2978         some compilers warn about it otherwise.
2979
2980 2005-08-20  Jim Meyering  <jim@meyering.net>
2981
2982         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
2983         of unused local, dfa.
2984
2985 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2986
2987         * regcomp.c (create_initial_state): Remove duplicate decl.
2988         (init_word_char, create_initial_state, duplicate_node_closure):
2989         (fetch_token, peek_token_bracket, build_range_exp):
2990         (build_collating_symbol): Remove forward decls; no longer needed
2991         now that we use prototypes.
2992
2993         * regcomp.c:
2994         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
2995         (re_compile_fastmap_iter, regcomp, regerror, regfree):
2996         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
2997         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
2998         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
2999         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3000         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3001         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3002         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3003         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3004         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3005         (build_charclass, build_charclass_op, fetch_number, create_tree):
3006         (create_token_tree, mark_opt_subexp, duplicate_tree):
3007         Use prototypes rather than old-style definitions.
3008
3009         * regex_internal.c:
3010         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3011         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3012         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3013         (re_string_reconstruct, re_string_peek_byte_case):
3014         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3015         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3016         (re_node_set_init_copy, re_node_set_add_intersect):
3017         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3018         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3019         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3020         (re_acquire_state, re_acquire_state_context, register_state):
3021         (create_ci_newstate, create_cd_newstate, free_state):
3022         Likewise.
3023         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3024         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3025         (re_search_internal, prune_impossible_nodes):
3026         (acquire_init_state_context, check_matching, static):
3027         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3028         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3029         (update_regs, sift_states_backward, build_sifted_states):
3030         (clean_state_log_if_needed, merge_state_array):
3031         (update_cur_sifted_state, add_epsilon_src_nodes):
3032         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3033         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3034         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3035         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3036         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3037         (check_arrival, check_arrival_add_next_nodes):
3038         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3039         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3040         (check_node_accept_bytes, check_node_accept, extend_buffers):
3041         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3042         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3043         (sift_ctx_init):
3044         Likewise.
3045
3046         * regex_internal.h:
3047         (re_string_allocate, re_string_construct, re_string_reconstruct):
3048         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3049         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3050         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3051         (re_string_context_at, re_string_peek_byte_case):
3052         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3053         is defined, since we now use prototypes always.
3054
3055         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3056         C89 or better.  All uses removed.
3057
3058 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3059
3060         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3061         [defined lint]: Suppress bogus uninitialized-variable warnings.
3062
3063         * regcomp.c (duplicate_node): Return new index, not an error code,
3064         and let the caller return REG_ESPACE if out of space.  This
3065         removes an uninitialied-variable warning with GCC 4.0.1, and also
3066         avoids taking the address of a local variable.  All callers
3067         changed.
3068
3069 2005-08-19  Jim Meyering  <jim@meyering.net>
3070
3071         * regexec.c (proceed_next_node): Redo local variables to
3072         avoid GCC shadowing warnings.
3073
3074 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3075
3076         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3077         (re_node_set_insert_last, re_dfa_add_node):
3078         Rename local variables to avoid GCC shadowing warnings.
3079
3080 2005-08-18  Bruno Haible  <bruno@clisp.org>
3081
3082         * strstr.c (strstr): Fix return value in multibyte case.
3083         * strcasestr.c (strcasestr): Likewise.
3084
3085 2005-08-17  Jim Meyering  <jim@meyering.net>
3086
3087         Make the %s format (seconds since the epoch) work for a negative
3088         number and when used with a zero-padded field width, e.g. %015s.
3089
3090         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3091         label so that it precedes the code to set `digits'.  Otherwise,
3092         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3093         print `00-22'.  Now, it prints `-0022', as it should.
3094
3095 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3096
3097         * regex.h: Remove useless space-before-tab.  From coreutils.
3098
3099 2005-08-17  Bruno Haible  <bruno@clisp.org>
3100
3101         * strcasestr.h: New file.
3102         * strcasestr.c: New file.
3103
3104 2005-08-17  Bruno Haible  <bruno@clisp.org>
3105
3106         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3107         * strstr.c: Completely rewritten, with multibyte locale support.
3108
3109 2005-08-17  Bruno Haible  <bruno@clisp.org>
3110
3111         * strcasecmp.c: Use mbuiter.h.
3112
3113 2005-08-17  Bruno Haible  <bruno@clisp.org>
3114
3115         * mbuiter.h: New file.
3116
3117 2005-08-16  Bruno Haible  <bruno@clisp.org>
3118
3119         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3120         (mbi_init): Update.
3121         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3122         NUL byte, not after it.
3123
3124 2005-08-16  Bruno Haible  <bruno@clisp.org>
3125
3126         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3127         the valid ones. Makes the comparison operations transitive:
3128         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3129         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3130
3131 2005-08-16  Bruno Haible  <bruno@clisp.org>
3132
3133         * strcase.h (strcasecmp): Add note in comments.
3134         * strncasecmp.c: Use code from strcasecmp.c.
3135         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3136         (strcasecmp): Work correctly in multibyte locales.
3137
3138 2005-08-16  Bruno Haible  <bruno@clisp.org>
3139
3140         * strnlen1.h: New file.
3141         * strnlen1.c: New file.
3142
3143 2005-08-16  Bruno Haible  <bruno@clisp.org>
3144
3145         * mbfile.h: New file.
3146
3147 2005-08-16  Bruno Haible  <bruno@clisp.org>
3148
3149         * mbiter.h: New file.
3150
3151 2005-08-16  Bruno Haible  <bruno@clisp.org>
3152
3153         * mbchar.h: New file.
3154         * mbchar.c: New file.
3155
3156 2005-08-16  Bruno Haible  <bruno@clisp.org>
3157
3158         * tls.h: New file, from GNU gettext.
3159         * tls.c: New file, from GNU gettext.
3160
3161 2005-08-15  Bruno Haible  <bruno@clisp.org>
3162
3163         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3164         is defined.
3165
3166 2005-08-14  Jim Meyering  <jim@meyering.net>
3167
3168         Sync from coreutils.
3169
3170         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3171         Use the hash-table-based cycle-detection code not just when
3172         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3173         Reported by James Youngman in
3174         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3175         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3176         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3177         This lets us compile with -DFTS_DEBUG, once again.
3178         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3179         * fts.c (fd_safer): Remove decl.
3180         Include fcntl--.h rather than unistd-safer.h
3181         (fts_safe_changedir): Don't call fd_safer; no longer needed
3182         now that we include fcntl--.h.
3183
3184 2005-08-11  Simon Josefsson  <jas@extundo.com>
3185
3186         * readline.h, readline.c: New file.
3187
3188 2005-08-11  Bruno Haible  <bruno@clisp.org>
3189
3190         * strnlen.h (strnlen): Change parameter name to match comment.
3191
3192 2005-08-10  Simon Josefsson  <jas@extundo.com>
3193
3194         * strndup.c: Use strnlen.h.
3195
3196         * strnlen.h: New file.
3197
3198 2005-08-02  Simon Josefsson  <jas@extundo.com>
3199
3200         * getline.h, getline.c: Rewrite.
3201
3202         * getdelim.h, getdelim.c: New files, ported from glibc.
3203
3204 2005-07-31  Bruno Haible  <bruno@clisp.org>
3205
3206         * lock.h (gl_lock_initializer): New macro.
3207         (gl_lock_define_initialized): Use it.
3208         (gl_rwlock_initializer): New macro.
3209         (gl_rwlock_define_initialized): Use it.
3210         (gl_recursive_lock_initializer): New macro.
3211         (gl_recursive_lock_define_initialized): Use it.
3212
3213 2005-07-26  Bruno Haible  <bruno@clisp.org>
3214
3215         * lock.h: Update from GNU gettext.
3216         * lock.c: Update from GNU gettext.
3217
3218 2005-07-18  Bruno Haible  <bruno@clisp.org>
3219
3220         * lock.h (gl_once_t): New type.
3221         (gl_once_define, gl_once): New macros.
3222         * lock.c (fresh_once): New variable.
3223         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3224         functions.
3225
3226 2005-07-18  Simon Josefsson  <jas@extundo.com>
3227
3228         * check-version.c (check_version): Accept identical versions too.
3229
3230 2005-07-18  Bruno Haible  <bruno@clisp.org>
3231
3232         * lock.h: New file, from GNU gettext.
3233         * lock.c: New file, from GNU gettext.
3234
3235 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3236
3237         * quotearg.c: Add translator comment suggested by Bruno Haible,
3238         with a minor change.
3239
3240 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3241
3242         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3243         copyright symbol and the year.
3244         * version-etc.c (COPYRIGHT_YEAR): New constant.
3245         (version_etc_va): Use parameterized copyright notice.
3246         Reword to conform to the current GNU coding standards.
3247
3248 2005-07-11  Simon Josefsson  <jas@extundo.com>
3249
3250         * size_max.h: New file.
3251
3252 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3253
3254         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3255         block of defines.
3256
3257 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3258        and  Paul Eggert  <eggert@cs.ucla.edu>
3259
3260         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3261         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3262
3263 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3264
3265         * regex.c, regex.h: Sync from libc.
3266         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3267         New files, synced from libc, except that regex_internal.h
3268         currently has a small porting fix.
3269
3270 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3271
3272         Remove the dependency of the strftime module on the tzset module.
3273         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3274         Copy the input structure, to work around some of the bug with
3275         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3276         Solaris releases, you should also use the tzset module, but we won't
3277         require it as a dependency any more since we don't want LGPLed code
3278         to depend on GPLed code.
3279
3280 2005-07-02  Jim Meyering  <jim@meyering.net>
3281
3282         * backupfile.c (backup_args): Change a `0' to NULL.
3283
3284 2005-07-01  Jim Meyering  <jim@meyering.net>
3285
3286         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3287         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3288         * save-cwd.c, tempname.c:
3289         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3290         and don't include <sys/file.h>).
3291
3292 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3293
3294         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3295         declares only 'struct timespec;' (!).
3296
3297 2005-06-29  Jim Meyering  <jim@meyering.net>
3298
3299         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3300         type name.  Use the variable name instead.
3301         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3302
3303 2005-06-28  Simon Josefsson  <jas@extundo.com>
3304
3305         * check-version.h, check-version.c: New files.
3306
3307 2005-06-28  Simon Josefsson  <jas@extundo.com>
3308
3309         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3310         collision with global variable.  Better indentation.  Don't
3311         increment buffer pointer beyond buffer end.  Based on comments
3312         from Paul Eggert <eggert@cs.ucla.edu>.
3313
3314         * base64.h: Indent.
3315
3316 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3317
3318         * canon-host.c (canon-host): Append trailing "," to 0 in
3319         initializer of struct addrinfo, as an indication that we don't
3320         care how many members the structure has.
3321
3322 2005-06-24  Derek Price  <derek@ximbiot.com>
3323         and Bruno Haible  <bruno@clisp.org>
3324
3325         Remove stat module & update lstat.
3326         * stat.c: Remove this file...
3327         (slash_aware_lstat): ...moving this content and its support...
3328         * lstat.c (rpl_lstat): ...into here.
3329         * lstat.h: New file.
3330
3331 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3332
3333         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3334         (ranged_convert): Don't save conversion in a temporary struct.
3335         This causes a warning with GCC 4.0.0, and anyway in the typical
3336         case it's not worth the extra 100 bytes or so of code.
3337         (ranged_convert, __mktime_internal): When calling a function via a
3338         pointer P, use P () rather than (*P) (), as we now assume C89 or
3339         better.
3340
3341 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3342
3343         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3344         "who -r" failed to give output.  Problem reported by Tim Waugh.
3345
3346         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3347         (xcalloc): Use it to avoid needless tests.
3348         Problem reported by Jim Meyering.
3349
3350 2005-06-16  Jim Meyering  <jim@meyering.net>
3351
3352         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3353         when either N or S is zero.
3354
3355 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3356
3357         * argp.h (__option_is_short): Check upper limit of
3358         __key. Isprint() requires its argument to have the value
3359         of an unsigned char or EOF.
3360
3361 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3362
3363         * fnmatch.c (fnmatch): If there is an encoding error in a
3364         multibyte string or pattern, fall back on unibyte matching.
3365         Problem reported by James Youngman.
3366
3367 2005-06-08  Bruno Haible  <bruno@clisp.org>
3368
3369         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3370         warning on mingw.
3371
3372 2005-06-08  Bruno Haible  <bruno@clisp.org>
3373
3374         * csharpcomp.h: New file, from GNU gettext.
3375         * csharpcomp.c: New file, from GNU gettext.
3376         * csharpcomp.sh.in: New file, from GNU gettext.
3377
3378 2005-06-07  Derek Price  <derek@ximbiot.com>
3379
3380         Sync from CVS.
3381         * glob_.h: Indent nested #ifdef.
3382
3383 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3384
3385         Sync from coreutils.
3386         Use "file name" when talking about file names, instead of "filename"
3387         or "path", as per the GNU coding standards.
3388         * mkdir-p.c: Renamed from makepath.c.
3389         (make_dir_parents): Renamed from make_path.  All callers changed.
3390         * mkdir-p.h: Likewise.  All includers changed.
3391         * filenamecat.c: Renamed from path-concat.c.
3392         (file_name_concat): Renamed from path_concat.  All callers changed.
3393         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3394         * filenamecat.h: Likewise.  All includers changed.
3395         * acl.c: Don't use "path" or "filename" to mean "file name"
3396         in comments or local variable names.
3397         * basename.c: Likewise.
3398         * canonicalize.c, canonicalize.h: Likewise.
3399         * dirname.c, dirname.h: Likewise.
3400         * euidaccess.c: Likewise.
3401         * exclude.c: Likewise
3402         * fnmatch_.h, fnmatch_loop.c: Likewise.
3403         * fsusage.c, fsuage.h: Likewise.
3404         * fts.c, fts_.h: Likewise.
3405         * getcwd.c: Likewise.
3406         * getloadavg.c: Likewise.
3407         * mkstemp.c: Likewise.
3408         * mountlist.c, mountlist.h: Likewise.
3409         * openat.c, openat.h: Likewise.
3410         * readlink-stub.c: Likewise.
3411         * readutmp.c, readutmp.h: Likewise.
3412         * rename.c: Likewise.
3413         * rmdir.c: Likewise.
3414         * same.c: Likewise.
3415         * savedir.c: Likewise.
3416         * stripslash.c: Likewise.
3417         * tempname.c: Likewise.
3418         * xreadlink.c: Likewise.
3419         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3420         All uses changed.
3421         * exclude.h: Likewise.
3422
3423         * euidaccess.c (getuid, getgid, getuid, getegid)
3424         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3425         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3426         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3427         * pathmax.h: Include <limits.h> unconditionally, since other
3428         files have been getting away with it for years (MORE/BSD 4.3
3429         is extinct now).
3430         * userspec.c (getpwnam, getgrnam, getgrgid)
3431         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3432
3433         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3434         Define to 256, not 255, as per modern POSIX.
3435
3436 2005-06-01  Bruno Haible  <bruno@clisp.org>
3437
3438         * csharpexec.h: New file, from GNU gettext.
3439         * csharpexec.c: New file, from GNU gettext.
3440         * csharpexec.sh.in: New file, from GNU gettext.
3441
3442 2005-05-31  Derek Price  <derek@ximbiot.com>
3443             Paul Eggert  <eggert@cs.ucla.edu>
3444
3445         Sync from cvs.
3446         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3447
3448 2005-05-29  Derek Price  <derek@ximbiot.com>
3449             Paul Eggert  <eggert@cs.ucla.edu>
3450
3451         * glob_.h, glob.c: New files.
3452
3453 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3454
3455         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3456
3457         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3458         the configuration hassle isn't worth it.
3459         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3460         (LONGEST_MODIFIER, PRIuMAX): Remove.
3461
3462 2005-05-27  Bruno Haible  <bruno@clisp.org>
3463
3464         * getlogin_r.h: Remove second include of <stddef.h>.
3465
3466 2005-05-25  Bruno Haible  <bruno@clisp.org>
3467             Derek Price  <derek@ximbiot.com>
3468
3469         * getlogin_r.h: Simplify API documentation.
3470
3471 2005-05-25  Derek Price  <derek@ximbiot.com>
3472             Paul Eggert  <eggert@cs.ucla.edu>
3473
3474         * getlogin_r.c, getlogin_r.h: New files.
3475
3476 2005-05-22  Bruno Haible  <bruno@clisp.org>
3477
3478         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3479         Also include <sys/param.h> if it defines MIN, MAX.
3480         Based on a patch by Derek Price <derek@ximbiot.com>.
3481
3482 2005-05-22  Bruno Haible  <bruno@clisp.org>
3483
3484         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3485         (INT64_MIN): Fix definition.
3486         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3487
3488         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3489         NEED_SIGNED_INT_TYPES.
3490
3491         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3492         HAVE_SYSTEM_INTTYPES.
3493
3494 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3495
3496         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3497         so that unistd-safer.h (GPL'ed code) need not be included.
3498
3499 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3500
3501         New fts module.
3502         * fts.c: Don't include "cycle-check.h" or "hash.h".
3503         (setup_dir, free_dir): New functions.
3504         (enter_dir, leave_dir): Define trivial
3505         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3506         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3507         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3508         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3509         Move to fts-cycle.c.
3510         (fts_open): Use setup_dir.
3511         (fts_close): Use free_dir.
3512         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3513         This adds a label and some gotos, but the alternatives were messier.
3514         Check for memory allocation failure when entering a dir.
3515         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3516         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3517         (FTS): New member fts_cycle, that is a union that contains the
3518         old active_dir_ht and cycle_state.  All uses changed to mention
3519         fts_cycle.ht and fts_cycle.state.
3520         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3521         fts.c, with the following changes:
3522         (setup_dir, free_dir): New functions.
3523         (enter_dir): Now returns bool.  Return true if successful, false
3524         if memory exhausted.  All callers changed.
3525         Do not bother partly cleaning up on
3526         memory allocation failure; that is free_dir's job.
3527         However, free ad if hash_insert fails, to avoid memory leak.
3528         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3529         fts->fts_options to see which union member to use.
3530
3531 2005-05-20  Jim Meyering  <jim@meyering.net>
3532
3533         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3534         Now a macro, to pacify GCC.
3535
3536 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3537
3538         * chown.c (rpl_chown): Return -1 on failure.
3539
3540 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3541
3542         * canonicalize.c: Include canonicalize.h first, to test interface.
3543         Include <stddef.h> unconditionally, since we assume C89 now.
3544         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3545         * fts.c: Include fts_.h first, to check interface.
3546         Do not include intprops.h; no longer needed.
3547         Include cycle-check.h and hash.h, since fts_.h no longer does.
3548         Remove unnecessary casts of closedir to void.
3549         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3550         decide whether to decrement nlinks.
3551         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3552         (FTS): Use struct hash_table * instead of Hash_table, so that
3553         we no longer need to include hash.h here.
3554
3555 2005-05-17  Jim Meyering  <jim@meyering.net>
3556
3557         * fts.c, fts_.h: New files, from coreutils.
3558
3559 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3560
3561         Sync from coreutils.
3562         * unlinkdir.c, unlinkdir.h: New files.
3563         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3564         regex.h, unlocked-io.h, xtime.h:
3565         White space changes only.
3566         * makepath.c (make_path): Port to hosts where leading "//" is special.
3567         * yesno.c: Include getline.h, not ctype.h.
3568         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3569         Use getline to remove arbitrary restriction on response length.
3570
3571 2005-05-13  Bruno Haible  <bruno@clisp.org>
3572
3573         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3574         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3575         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3576         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3577         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3578         Add support for 64-bit integers in the MSVC compiler.
3579
3580 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3581
3582         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3583         Change the initial comment to refer to GPL, not LGPL.
3584         gnulib-tool will change it to LGPL as needed.
3585
3586         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3587         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3588         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3589         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3590         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3591         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3592         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3593         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3594         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3595         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3596         concatpath.c, config.charset, copy-file.c, copy-file.h,
3597         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3598         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3599         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3600         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3601         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3602         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3603         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3604         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3605         full-read.c, full-read.h, full-write.c, full-write.h,
3606         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3607         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3608         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3609         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3610         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3611         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3612         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3613         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3614         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3615         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3616         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3617         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3618         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3619         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3620         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3621         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3622         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3623         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3624         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3625         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3626         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3627         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3628         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3629         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3630         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3631         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3632         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3633         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3634         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3635         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3636         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3637         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3638         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3639         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3640         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3641         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3642         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3643         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3644         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3645         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3646         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3647         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3648         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3649         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3650         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3651         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3652         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3653         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3654         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3655         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3656         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3657         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3658         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3659         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3660         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3661         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3662         Update FSF postal mail address.
3663
3664 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3665
3666         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3667         specified in ai_socktype. Fix invalid ai_protocol
3668         check. ai_protocol is usually set to 0 or depending on
3669         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
3670         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
3671         ai_socktype / ai_protocol in the returned addrinfo structure.
3672
3673 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3674             Bruno Haible  <bruno@clisp.org>
3675
3676         * inet_ntop.h: New file.
3677         * inet_ntop.c: New file, from glibc with modifications.
3678
3679 2005-05-08  Jim Meyering  <jim@meyering.net>
3680
3681         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3682
3683 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
3684
3685         Merge from coreutils.  Among other things,
3686         add bulletproofing for cases where stdin, stdout, or stderr are closed.
3687         * fd-safer.c: New file.
3688         * fcntl-safer.h, open-safer.c: Remove.
3689         * chdir-long.c: Fix comment "fetish" -> "coreutils".
3690         * dup-safer.c: Include unistd-safer.h first.
3691         Don't include errno.h.
3692         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3693         * file-type.h: Don't assume invoker included sys/stat.h first.
3694         * file-type.c: Rely on file-type.h change.
3695         * getloadavg.c: Include unistd-safer.h.
3696         (getloadavg): Use safer open.
3697         * getusershell.c: Include "stdio-safer.h".
3698         (getusershell): Use safer fopen.
3699         * long-options.c (long_options): Use NULL rather than 0.
3700         * modechange.h (mode_free): Remove; all callers changed to invoke
3701         'free'.
3702         * modechange.c: Likewise.
3703         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
3704         (MODE_DONE): New constant.
3705         (struct mode_change): Remove 'next' member.
3706         (make_node_op_equals): New function; like the old one of the
3707         same name, except it allocates an array.
3708         (mode_compile, mode_create_from_ref): Use it.
3709         (mode_compile): Allocate result as an array, not a linked list.
3710         Parse octal string ourself, so that we catch mistakes like "+0".
3711         (mode_adjust): Arg is an array, not a linked list.
3712         * modechange.c: Include stat-macros.h, xalloc.h.
3713         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
3714         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
3715         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
3716         Remove.  This is now stat-macros.h's job.
3717         (talloc): Remove.  All callers replaced by xalloc, so that
3718         our invokers don't have to worry about reporting memory failures.
3719         (make_node_op_equals): Remove.
3720         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3721         New constants.
3722         (struct mode_change): Moved here from modechange.h.
3723         (mode_append_entry): Remove.
3724         (mode_compile): Remove MASKED_OPS arg, since it encouraged
3725         apps to have incorrect behavior.  Use simpler algorithm for head
3726         and tail.  Don't futz with umask; that's now the job of mode_adjust.
3727         Detect more invalid usages rather than having somewhat-random behavior.
3728         Don't insert an "a=" action, as that leads to incorrect behavior.
3729         (mode_compile, mode_create_from_ref): Return NULL on error instead
3730         of an enum, since now there's only one way to have an error.  All
3731         callers changed.
3732         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
3733         at the correct time.  Simplify calculation of "+u" and its ilk.
3734         Don't mishandle "+X".
3735         (mode_free): Remove "register" and localize decls.
3736         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3737         (struct mode_change): Move to modechange.c; callers don't
3738         need to see this stuff.
3739         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
3740         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
3741         (mode_change, mode_adjust): Reflect the new signatures noted above.
3742         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
3743         that might redefine system include files.
3744         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
3745         (my_usleep): Use NULL rather than (void *) 0.
3746         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
3747         Use siginterrupt to specify that system calls should be interrupted.
3748         (rpl_nanosleep): Move initialization of suspended closer to call of
3749         my_usleep.
3750         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
3751         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
3752         (desirable_utmp_entry): New function.
3753         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
3754         using x2nrealloc, to simplify logic.
3755         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
3756         size calculation.  Do not assume utmp file is a regular file.
3757         * readutmp.h (UT_PID): Moved here from ../src/who.c.
3758         (READ_UTMP_CHECK_PIDS): New constant.
3759         * save-cwd.c: Include unistd-safer.h.
3760         (save_cwd): Use fd_safer.
3761         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
3762         [!_LIBC] Include "stat-macros.h" instead.
3763         * unistd-safer.h (fd_safer): New decl.
3764
3765 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
3766
3767         * byteswap_.h: New file.
3768
3769 2005-04-25  Albert Chin  <china@thewrittenword.com>
3770
3771         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
3772         Toolkit C bug.
3773
3774 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
3775
3776         * getdate.y (zone): Allow relunit_snumber after tZONE, so
3777         that "UTC +1 second" continues to work.  Problem reported
3778         by Dmitry V. Levin.
3779         (relunit_snumber): New rule.
3780         (relunit): Use it.
3781
3782 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
3783
3784         * getdate.y (universal_time_zone_table): New constant.
3785         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
3786         universal_time_zone_table.
3787         (lookup_zone): Prefer universal_time_zone_table to
3788         local_time_zone_table, so that "GMT" time stamps are allowed in
3789         London during the summer.  Problem reported by Ian Abbott.
3790
3791 2005-04-12  Jim Meyering  <jim@meyering.net>
3792
3793         * human.c (humblock): Set *options even when returning due to
3794         xstrtoumax conversion failure.  Thanks to a used-uninitialized
3795         warning from gcc-4.
3796
3797 2005-04-09  Jim Meyering  <jim@meyering.net>
3798
3799         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
3800         -Wuninitialized: initialize tm0.tm_year.
3801
3802 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
3803
3804         * getdate.y (parser_control): rels_seen is now a boolean, not a
3805         count, since there's no maximum.  All uses changed.
3806         Add member dsts_seen.
3807         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
3808         not being INT_MAX.
3809         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
3810         Use pc_rels_seen to decide whther a date is absolute.
3811
3812         * getdate.y (number): Don't overwrite year.
3813         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
3814         check.
3815
3816 2005-04-02  Simon Josefsson  <jas@extundo.com>
3817
3818         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
3819         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
3820
3821 2005-03-27  Jim Meyering  <jim@meyering.net>
3822
3823         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
3824
3825 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
3826
3827         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
3828         "one's complement" -> "ones' complement" in comment, as per Knuth.
3829         "value of type" -> "type or expression" in comment.
3830         * mktime.c, strftime.c: Propagate intprops.h comment nits.
3831
3832 2005-03-26  Jim Meyering  <jim@meyering.net>
3833
3834         Comment nits.
3835         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
3836         Correct typos: s/or/of/.
3837
3838 2005-03-23  Jim Meyering  <jim@meyering.net>
3839
3840         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
3841
3842 2005-03-21  Jim Meyering  <jim@meyering.net>
3843
3844         Changes imported from coreutils.
3845
3846         * cycle-check.c: Don't include xalloc.h.
3847
3848         * path-concat.c: Don't include assert.h.
3849         (path_concat): Remove assertion that would have triggered
3850         for ABASE starting with more than one slash.
3851         Reported by Andreas Schwab.
3852
3853         * path-concat.c (path_concat): Set *BASE_IN_RESULT
3854         properly when ABASE is an absolute file name.
3855         Correct the description of this function.
3856         Include <assert.h>.
3857         Add an assertion and a test driver.
3858         This fixes a bug introduced on 2004-07-02.
3859         Andreas Schwab reported the resulting failure of cp --parents:
3860         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
3861
3862 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
3863
3864         * strftime.c (my_strftime): If the underlying strftime returns 0
3865         (which shouldn't happen), generate nothing instead of returning 0
3866         immediately, so that nstrftime (NULL, ...) doesn't return 0.
3867
3868 2005-03-16  Bruno Haible  <bruno@clisp.org>
3869
3870         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
3871
3872 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
3873
3874         * strftime.c (my_strftime): Prepend space to format so that we can
3875         reliably distinguish strftime failure from empty output on POSIX
3876         hosts.
3877
3878 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
3879
3880         * iconvme.c (SIZE_MAX): New macro, if not already defined.
3881         (iconv_string): Don't guess a size-zero buffer, as that might cause
3882         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
3883         result would be 'too large', where 'too large' is (heuristically)
3884         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
3885         overflow concerns.  This will prevent some unwanted malloc failures
3886         when the inputs are very large.
3887
3888 2005-03-15  Bruno Haible  <bruno@clisp.org>
3889
3890         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
3891         'negate'.
3892
3893         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
3894         variable.
3895
3896         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
3897
3898 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
3899
3900         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
3901         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
3902         intprops.h.
3903         * strtol.c: Likewise.
3904
3905 2005-03-14  Simon Josefsson  <jas@extundo.com>
3906
3907         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
3908         <fx@gnu.org>.
3909
3910 2005-03-14  Jim Meyering  <jim@meyering.net>
3911
3912         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
3913         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
3914         to be nonzero so that we (and caller) can detect the difference
3915         between a valid zero-length expansion and an error return, even
3916         when the underlying strftime fails before writing anything into
3917         that location.
3918
3919 2005-03-10  Jim Meyering  <jim@meyering.net>
3920
3921         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
3922         so that this module works on systems without fchdir.
3923
3924 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
3925
3926         Factor int-properties macros into a single file, except for
3927         glibc-related files.
3928         * intprops.h: New file.
3929         * getloadavg.c: Include it instead of limits.h.
3930         (INT_STRLEN_BOUND): Remove.
3931         * human.c: Include intprops.h.
3932         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
3933         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
3934         * inttostr.h: Include intprops.h instead of limits.h.
3935         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
3936         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
3937         for consistency with intprops.h.
3938         (time_t_is_integer, twos_complement_arithmetic): Use them.
3939         * sig2str.h: Include <signal.h>, intprops.h.
3940         (INT_STRLEN_BOUND): Remove.
3941         * strftime.c (TYPE_SIGNED): Remove.
3942         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
3943         * strtol.c: Adjust comments to match intprops.h.
3944         * userspec.c: Include intprops.h.
3945         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
3946         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
3947         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
3948         instead of rolling our own expressions.
3949         * xstrtol.c: Include xstrtol.h first, to test interface.
3950
3951         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
3952         instead of int.
3953         (my_strftime): Do not mishandle years close to INT_MAX, by doing
3954         the right thing even if adding 1900 would overflow.  Similarly
3955         for tm_mon + 1 and tm_yday + 1.
3956         Make %Y always equivalent to %C%y, and similarly for %G and %g.
3957         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
3958         (DO_SIGNED_NUMBER): New macro.
3959         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
3960
3961 2005-03-07  Bruno Haible  <bruno@clisp.org>
3962
3963         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
3964
3965 2005-03-03  Derek R. Price  <derek@ximbiot.com>
3966             Bruno Haible  <bruno@clisp.org>
3967
3968         * pagealign_alloc.h: New file.
3969         * pagealign_alloc.c: New file.
3970
3971 2005-01-28  Bruno Haible  <bruno@clisp.org>
3972
3973         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
3974         stpncpy.c uses it.
3975
3976 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
3977
3978         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
3979         The workaround isn't strictly needed for POSIX conformance, and
3980         it's too much of a pain to configure and maintain.  We'll ask
3981         people to fix their kernels instead.
3982         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
3983         (NANOSLEEP_BUG_WORKAROUND): Remove.
3984         (xnanosleep): Remove the workaround.
3985
3986 2005-02-12  Bruno Haible  <bruno@clisp.org>
3987
3988         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
3989
3990 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
3991
3992         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
3993         * timespec.h (gettime): Return void, since it always
3994         succeeds now.  All uses changed.
3995         * gettime.c (gettime) Likewise.
3996         [HAVE_NANOTIME]: Prefer nanotime.
3997         Assume gettimeofday succeeds, as POSIX requires.
3998         Assime time () succeeds, since other code already does.
3999         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4000         (timespec_subtract): Remove.
4001         (NANOSLEEP_BUG_WORKAROUND): New constant.
4002         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4003         things considerably.  Use it only on GNU/Linux hosts, since the
4004         workaround shouldn't be needed elsewhere.
4005
4006 2005-02-24  Bruno Haible  <bruno@clisp.org>
4007
4008         * gettext.h: Update from GNU gettext 0.14.2.
4009
4010 2005-02-24  Bruno Haible  <bruno@clisp.org>
4011
4012         * localcharset.c: Update from GNU gettext 0.14.2.
4013         * config.charset: Update from GNU gettext 0.14.2.
4014
4015 2005-02-22  Simon Josefsson  <jas@extundo.com>
4016
4017         * iconvme.h, iconvme.c: New files, from libc.
4018
4019 2005-02-20  Neil Conway  <neilc@samurai.com>
4020
4021         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4022         returned by OSX/Darwin if the specified buffer is not large
4023         enough for the hostname.
4024
4025 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4026
4027         * memrchr.h: New file.
4028         * chdir-long.c: Include it.
4029         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4030         Don't bother including stddef.h.
4031
4032 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4033
4034         * argp-help.c (__argp_help): Create a fake struct argp_state and
4035         pass it to _help, otherwise the latter coredumps trying to
4036         dereference state.root_argp.
4037
4038 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4039
4040         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4041         inclusion.
4042         Include <sys/types.h>, for dev_t.
4043         (ME_DUMMY, ME_REMOTE): Move from here....
4044         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4045         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4046         Dmitry V. Levin.
4047         Include mountlist.h first, to test the interface.
4048
4049 2005-01-29  Bruno Haible  <bruno@clisp.org>
4050
4051         * progname.c (program_name): Initialize.
4052         Needed when linking statically on MacOS X.
4053
4054 2005-01-28  Bruno Haible  <bruno@clisp.org>
4055
4056         * javacomp.sh.in: New file, from GNU gettext.
4057         * javacomp.h: New file, from GNU gettext.
4058         * javacomp.c: New file, from GNU gettext.
4059
4060 2005-01-26  Bruno Haible  <bruno@clisp.org>
4061
4062         * javaexec.sh.in: New file, from GNU gettext.
4063         * javaexec.h: New file, from GNU gettext.
4064         * javaexec.c: New file, from GNU gettext.
4065
4066 2005-01-26  Simon Josefsson  <jas@extundo.com>
4067
4068         * gai_strerror.c: Use GPL in header.
4069
4070 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4071
4072         * argp-help.c (hol_entry_help): Avoid using non-constant
4073         initializers for struct pentry_state.
4074         (__argp_error): Check return value of __asprintf
4075         (__argp_failure): Translate error message
4076
4077         * argp-parse.c: Removed braces around the expansion of N_()
4078
4079 2005-01-21  Jim Meyering  <jim@meyering.net>
4080
4081         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4082         same value as for Solaris 9.
4083
4084         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4085         component length.  This included changing the parameter to be
4086         of type `char *' rather than `char const *'.
4087         * chdir-long.h (chdir_long): Update prototype.
4088
4089         * openat.c (fdopendir, fstatat): New functions.
4090         * openat.h: Include headers required for use of DIR and struct stat.
4091         [AT_SYMLINK_NOFOLLOW]: Define.
4092         (fdopendir, fstatat): Add prototypes.
4093
4094 2005-01-21  Bruno Haible  <bruno@clisp.org>
4095
4096         * classpath.h: New file, from GNU gettext.
4097         * classpath.c: New file, from GNU gettext.
4098
4099 2005-01-20  Simon Josefsson  <jas@extundo.com>
4100
4101         * version-etc-fsf.c: New file, with version_etc_copyright.
4102         * version-etc.c: Remove version_etc_copyright.
4103         * version-etc.h (version_etc_copyright): Use [] instead of * in
4104         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4105
4106 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4107
4108         * save-cwd.c (save_cwd): Remove code to support the case
4109         where fchdir is missing or flaky.
4110
4111 2005-01-20  Simon Josefsson  <jas@extundo.com>
4112
4113         * base64.h (isbase64): Add.
4114
4115         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4116         using a unsigned prototype, don't inline.
4117         (base64_decode): Use it.
4118
4119 2005-01-19  Bruno Haible  <bruno@clisp.org>
4120
4121         * sh-quote.h: New file, from GNU gettext.
4122         * sh-quote.c: New file, from GNU gettext.
4123
4124 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4125
4126         Merge changes from coreutils, as described below in several
4127         changelogs dated today.
4128
4129         * save-cwd.c: Include "save-cwd.h" before other include files.
4130         (O_DIRECTORY): Remove; not needed here, since "." must be
4131         a directory.  All uses removed.
4132         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4133         universal on Suns, and we also need to test for IRIX.
4134         Revamp code to use 'if' rather than '#if'.
4135         Avoid unnecessary comparison of cwd->desc to 0.
4136
4137         * utimens.c (futimens): Robustify the previous patch, by checking
4138         for known valid error numbers rather than observed invalid ones.
4139
4140 2005-01-18  Jim Meyering  <jim@meyering.net>
4141
4142         * version-etc.c (version_etc_copyright): Update copyright date.
4143
4144         * utimens.c (futimens): Account for the fact that futimes
4145         can also fail with errno == ENOSYS or errno == ENOENT.
4146         Patch from Dmitry V. Levin.
4147
4148         Change the name of the robust chdir function from chdir to chdir_long.
4149         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4150         (restore_cwd): Use chdir_long, not chdir.
4151         * chdir-long.c: Renamed from chdir.c.
4152         * chdir-long.h: Renamed from chdir.h.
4153         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4154         Hurd.
4155
4156 2005-01-18  Bob Proulx  <bob@proulx.com>
4157
4158         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4159         offsetof() macro construct to avoid compile failure with native HP-UX
4160         11.0 ANSI C compiler.
4161
4162 2005-01-06  Bruno Haible  <bruno@clisp.org>
4163
4164         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4165         because stpncpy.m4 takes care of it.
4166
4167 2004-01-24  Bruno Haible  <bruno@clisp.org>
4168
4169         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4170
4171 2003-10-09  Bruno Haible  <bruno@clisp.org>
4172
4173         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4174
4175 2005-01-06  Bruno Haible  <bruno@clisp.org>
4176
4177         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4178         * fwriteerror.c: Include <stdbool.h>.
4179         (fwriteerror): At the end, close the file stream. Record whether
4180         stdout was already closed.
4181
4182 2004-05-27  Bruno Haible  <bruno@clisp.org>
4183
4184         * execute.c (environ): Declare if needed.
4185         * pipe.c (environ): Likewise.
4186         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4187
4188 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4189
4190         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4191         definitions to be after all include files, to avoid collisions.
4192         Problem reported by Bob Proulx.
4193
4194 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4195
4196         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4197         not needed.  This removes a dependency on the gettext module.
4198         [defined _LIBC]: Do not include <libintl.h>; not needed.
4199
4200 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4201
4202         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4203         HAVE_DECL_STRTOLD.
4204
4205 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4206
4207         * argp-parse.c: Include <stddef.h>.
4208         (alignof, alignto): New macros.
4209         (parser_init): Don't assume that void * is aligned sufficiently
4210         for struct option.
4211
4212         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4213         need to extend the stack.
4214         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4215         large.
4216
4217 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4218
4219         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4220
4221 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4222
4223         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4224         Remove now-obsolete comment about AIX.
4225         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4226         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4227         (YYMAXDEPTH): New macro.
4228
4229 2004-12-18  Bruno Haible  <bruno@clisp.org>
4230
4231         * fatal-signal.c (fatal_signals): Make non-const.
4232         (init_fatal_signals): New function.
4233         (uninstall_handlers, install_handlers): Ignore signals that were set to
4234         SIG_IGN.
4235         (at_fatal_signal): Call init_fatal_signals.
4236         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4237         SIG_IGN.
4238         Reported by Paul Eggert.
4239
4240 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4241
4242         * getdate.y (textint): New member "negative".
4243         (time_zone_hhmm): New function.
4244         Expect 14 shift-reduce conflicts, not 13.
4245         (o_colon_minutes): New rule.
4246         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4247         (yylex): Set the "negative" member of signed numbers.
4248
4249 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4250
4251         Changes imported from coreutils.
4252         * hard-locale.c: Assume <locale.h> exists.
4253         Include "strdup.h".
4254         (GLIBC_VERSION): New macro.
4255         (hard_locale): Assume setlocale exists.
4256         Rewrite to avoid #ifdef.
4257         Use strdup rather than malloc + strcpy.
4258         * human.c: Assume <locale.h> exists.
4259         (human_readable): Assume localeconv exists.
4260
4261 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4262
4263         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4264         convert T2, not T.  (Imported from libc.)
4265
4266 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4267
4268         * getcwd.c (is_ENAMETOOLONG): New macro.
4269         (__getcwd.c): Don't restore errno; glibc doesn't.
4270         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4271         first, falling back to our code only if its results look suspicious.
4272         Ensure that the resulting buffer is only as large as necessary.
4273
4274         * readutmp.c: Include readutmp.h first.
4275         Include <errno.h>, since readutmp.h no longer does that.
4276         * readutmp.h: Don't include <errno.h>,
4277         <sys/param.h>, <time.h>; not needed to establish interface.
4278         (errno): Remove decl.
4279         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4280         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4281         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4282
4283 2004-11-28  Simon Josefsson  <jas@extundo.com>
4284
4285         * base64.h, base64.c: New file.
4286
4287 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4288
4289         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4290
4291 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4292
4293         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4294         HP's ANSI C compiler.
4295         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4296         Declaring int functions causes warnings on some modern systems and
4297         shouldn't be needed to compile on ancient ones.
4298         * same.c (MIN) [defined MIN]: Don't define, since it's already
4299         defined.
4300
4301         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4302         with the following changes.
4303         (__set_errno): Parenthesize properly.
4304         Include <stdbool.h>.
4305         (MIN, MAX, MATCHING_INO): New macros.
4306         (__getcwd): Define with prototype, not K&R form.
4307         Use heuristics to allocate default buffer on stack if possible.
4308         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4309         behavior, and to avoid the PATH_MAX limit when computing
4310         ../../../../...
4311         Use MATCHING_INO to compare inode number to file.
4312         Check for arithmetic overflow in size calculations.
4313         Fix bug in reallocation of dot array that caused getcwd to fail
4314         on directories nested deeper than 75.
4315         Be more careful about saving errno on error.
4316         Do not use realloc; use only free+malloc, as this is a bit
4317         more flexible and avoids a needless copy operation.
4318         Do not inspect st_dev and st_ino for symbolic links; POSIX
4319         doesn't specify the latter.
4320         Check for closedir errors.
4321         Avoid needless casts.
4322         Use "#ifdef weak_alias" around weak_alias, to be like other
4323         glibc code.
4324         The following changes to getcwd.c have effect only when used in
4325         gnulib; they have no effect inside glibc proper.
4326         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4327         as alloca isn't used.
4328         (alloca, __alloca): Likewise.
4329         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4330         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4331         unconditionally, as gnulib assumes C89 or better.
4332         Do not include <sys/param.h>.
4333         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4334         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4335         better.
4336         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4337         Include <dirent.h> in a way that is compatible with modern Autoconf.
4338         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4339         New macros, if not already defined.
4340         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4341         Use "_LIBC", not "defined _LIBC", for consistency.
4342         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4343         a mempcpy module.
4344         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4345         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4346         * xgetcwd.c: David MacKenzie's old code was removed, so give
4347         credit only to Jim Meyering and adjust the copyright dates.
4348         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4349         <stdlib.h>, <unistd.h>, "pathmax.h".
4350         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4351         (INITIAL_BUFFER_SIZE): Remove.
4352         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4353
4354 2004-11-23  Jim Meyering  <jim@meyering.net>
4355
4356         * getopt_.h: Remove trailing blanks.
4357
4358 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4359
4360         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4361         (futimens): New function, which uses futimes if available.
4362         (futimens, utimens): Support timespec==NULL, with same semantics
4363         as utime and utimens.
4364         * utimens.h (futimens): New decl.
4365
4366 2004-11-23  Jim Meyering  <jim@meyering.net>
4367
4368         * __fpending.c: Add comment.
4369
4370 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4371
4372         * getopt_.h: Re-addition of __getopt_argv_const caused
4373         redefinition warnings. To avoid them, include the defines
4374         in `#if !defined __need_getopt ... #endif'. The only place
4375         where __getopt_argv_const is used is in definitions
4376         of getopt_long and getopt_long_only below, which are as well
4377         protected by `#ifndef __need_getopt'.
4378         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4379         __need_getopt after including <stdio.h> and <unistd.h> These
4380         headers might have defined it.
4381
4382 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4383
4384         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4385         New macros.
4386         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4387         optopt): Use them instead of invoking ## directly; otherwise, the
4388         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4389
4390 2004-11-19  Bruno Haible  <bruno@clisp.org>
4391
4392         * strtok_r.c: Move comments from here...
4393         * strtok_r.h: ... to here.
4394
4395 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4396
4397         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4398         might fail.  Problem reported by Yoann Vandoorselaere.
4399         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4400         that mishandle size_t overflow.
4401
4402 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4403
4404         * canon-host.c: Include "strdup.h".
4405         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4406         Use strdup instead of malloc/strcpy to duplicate strings.
4407
4408         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4409         (human_space_before_unit): New constant.
4410         * human.c (human_readable): Support it.
4411
4412         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4413         (xgetcwd): Set errno correctly when failing.
4414         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4415         the failure is actually due to a PATH_MAX problem.
4416
4417         Further getopt changes to make it more likely that glibc will
4418         buy the changes back.
4419         * getopt.c (POSIXLY_CORRECT): New constant.
4420         (getopt): Use it, so to preserve glibc semantic
4421         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4422         when compiling for libc.
4423         * getopt_.h (__getopt_argv_const): Bring it back.
4424         (getopt_long, getopt_long_only): Use it.
4425
4426         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4427         New arg POSIXLY_CORRECT.  All callers changed.
4428         (getopt): Argv is now char * const *, as per standard.
4429         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4430         not char *__getopt_argv_const *.
4431         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4432         _getopt_long_only_r): Likewise.
4433         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4434         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4435         _getopt_long_r, _getopt_long_only_r): Likewise.
4436         * getopt_.h (__getopt_argv_const): Remove.
4437         (getopt): Argv is now char * const *, as per standard.
4438
4439         * getdate.y (tORDINAL): New token.
4440         (day, relunit): Allow it for relative times.
4441         (relative_time_table): Use tORDINAL for ordinals.
4442
4443 2004-11-15  Jim Meyering  <jim@meyering.net>
4444
4445         * closeout.c: Include "__fpending.h" once again.
4446         Include <stdbool.h>.
4447         (close_stdout): Don't fail just because stdout was closed initially,
4448         since some programs don't write to stdout in the normal course of
4449         operation (other than --version and --help), and we don't want this
4450         function to make e.g. `touch file >&-' fail.
4451         But do fail if it was closed and someone has tried to write to it.
4452         E.g., `printf foo >&-' must fail.
4453
4454 2004-11-11  Simon Josefsson  <jas@extundo.com>
4455
4456         * strtok_r.h, strtok_r.c: New file.
4457
4458 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4459
4460         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4461         we can stop lying to compilers about the constness of argv when we
4462         are compiled outside glibc.
4463         (getopt, getopt_long, getopt_long_only): Use it.
4464         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4465         getopt): Likewise.
4466         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4467         _getopt_long_only_r): Likewise.
4468         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4469         _getopt_long_only_r): Likewise.
4470
4471         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4472         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4473         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4474         the other external symbols.
4475         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4476         declaration, since the above renaming now works around collisions.
4477
4478 2004-11-11  Jim Meyering  <jim@meyering.net>
4479
4480         * linebreak.c: Remove trailing blanks.
4481         * alloca_.h: Likewise.
4482         * acosl.c: Likewise.
4483         * euidaccess.c: Likewise.
4484         * allocsa.h: Likewise.
4485
4486 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4487
4488         * mktime.c (SHR): New macro, which is a portable
4489         substitute for >> that should work even on Crays.
4490         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4491         Problem reported by Mark D. Baushke in
4492         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4493         * getdate.y (SHR): Likewise.
4494         (tm_diff): Use it.
4495         * strftime.c (SHR): Likewise.
4496         (tm_diff): Use it.
4497         * quotearg.c (struct quoting_options): Use unsigned int for
4498         quote_these_too, so that right shifts are well defined.  All uses
4499         changed.
4500
4501 2004-11-10  Simon Josefsson  <jas@extundo.com>
4502
4503         * getaddrinfo.h, getaddrinfo.c: New files.
4504
4505 2004-11-10  Jim Meyering  <jim@meyering.net>
4506
4507         Ensure that no close failure goes unreported.
4508         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4509         return early when it seems there's nothing to flush.
4510         Don't include __fpending.h.
4511
4512 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4513
4514         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4515
4516 2004-11-05  Bruno Haible  <bruno@clisp.org>
4517
4518         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4519         Reported by Mark D. Baushke <mdb@cvshome.org>.
4520
4521 2004-11-04  Bruno Haible  <bruno@clisp.org>
4522
4523         2004-09-11  Bruno Haible  <bruno@clisp.org>
4524                 * allocsa.valgrind: New file.
4525         2004-02-06  Bruno Haible  <bruno@clisp.org>
4526                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4527                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4528                 Reported by Christopher Seip <chris.seip@hp.com>.
4529
4530 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4531
4532         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4533         with errno == ERANGE if the buffer is too small.
4534         Problem reported by Mark D. Baushke.
4535
4536 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4537
4538         * xreadlink.c (MAXSIZE): New macro.
4539         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4540         size does not exceed MAXSIZE.  Avoid cast.
4541         As suggested by Mark D. Baushke in
4542         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4543         if readlink fails with buffer size just under MAXSIZE, try again
4544         with MAXSIZE.
4545
4546 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4547         and  Paul Eggert  <eggert@cs.ucla.edu>
4548
4549         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4550         (get_date): Overparenthesize to avoid GCC warning.
4551
4552 2004-11-02  Bruno Haible  <bruno@clisp.org>
4553
4554         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4555         function returns void.
4556
4557 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4558
4559         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4560         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4561         already declared.
4562
4563 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4564
4565         * getdate.y: Add support for TZ="foo" within a date string.
4566         Fix some bugs near time_t boundaries.  Reject dates with
4567         out-of-range components, e.g., "Sept 31".
4568         Include <stdlib.h>, "setenv.h", "xalloc.h".
4569         (ISDIGIT_LOCALE): Remove; unused.
4570         Note that the TZ and time functions used here are not reentrant.
4571         (mktime_ok, get_tz): New functions.
4572         (TZBUFSIZE): New constant.
4573         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4574         This requires that we sometimes generate our own TZ="XXX..." setting.
4575
4576 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4577
4578         * mktime.c (not_equal_tm): Remove redundant check.
4579
4580 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4581
4582         * getdate.y: Use Bison 1.875 features, and some minor
4583         code cleanups.  This change does not affect semantics.
4584         Don't include <stdlib.h>; no longer needed.
4585         Don't include unlocked-io.h; only the "#if TEST" code uses
4586         stdio, and performance isn't crucial there.
4587         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4588         Bison 1.875 features as described below.
4589         All uses of "PC." replaced by "pc->".
4590         (YYSTYPE): Add a forward declaration.
4591         (yylex, yyerror): Use full prototypes in forward decls.
4592         Use "%pure-parser" rather than obsolescent "%pure_parser".
4593         Use %parse-param and %lex-param instead of obsolescent
4594         YYPARSE_PARAM and YYLEX_PARAM.
4595         (meridian_table, month_and_day_table, time_units_table,
4596         relative_time_table, time_zone_table, military_table,
4597         lookup_zone, lookup_word, get_date):
4598         Use NULL instead of 0 where appropriate.
4599         (to_hour): Avoid abort (), to avoid a dependency on
4600         stdlib.h.
4601         (yyerror, yylex): Now accepts parser_control * arg.
4602         (main) [TEST]: Use '\0' rather than 0 for char.
4603
4604 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4605
4606         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4607         It's now the caller's responsibility to handle the case where
4608         !HAVE_GETPAGESIZE && !defined getpagesize.
4609
4610         * mktime.c (leapyear): Arg is long int, not int.
4611
4612 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4613
4614         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4615
4616 2004-10-12  Simon Josefsson  <jas@extundo.com>
4617
4618         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4619         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4620         to real functions.
4621
4622 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4623
4624         * vsnprintf.h: New file.
4625         * vsnprintf.c: New file.
4626
4627 2004-10-07  Bruno Haible  <bruno@clisp.org>
4628
4629         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4630         into the provided buffer.
4631
4632 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4633
4634         * diacrit.c, diacrit.h: Add GPL notice.
4635
4636         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4637         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4638         * logl.c (logl): Keep the code as similar to glibc as possible.
4639         This avoids a potential constant-folding bug.
4640
4641 2004-10-05  Bruno Haible  <bruno@clisp.org>
4642
4643         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4644
4645 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4646
4647         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
4648         * xmalloc.c (xmemdup): Likewise.
4649         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4650         XFREE): Remove these long-obsolescent macros.
4651         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4652         * xstrdup.c: Remove.
4653
4654         * regex.c (re_comp): Cast gettext return value to char *,
4655         Problem reported by Martin Neitzel via Mark D. Baushke.
4656
4657 2004-10-04  Simon Josefsson  <jas@extundo.com>
4658
4659         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4660         '#ifdef USE_UNLOCKED_IO'.
4661
4662 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4663
4664         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4665         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4666         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4667         regex.c, sha1.c, version-etc.c, yesno.c:
4668         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4669         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4670         the includer's responsibility.
4671
4672         Sync from coreutils.
4673
4674         * modechange.c (mode_compile): Don't decrement a pointer that
4675         points to the start of a string, as the C Standard says the
4676         resulting behavior is undefined.
4677
4678         * backupfile.h (enum backuptype): Rename none -> no_backups,
4679         simple -> simple_backups, numbered_existing ->
4680         numbered_existing_backups, numbered -> numbered_backups
4681         to avoid shadowing problems.  All uses changed.
4682         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4683         * backupfile.c (check_extension, numbered_backup):
4684         Rename locals to avoid shadowing 'basename'.
4685         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4686         once.
4687
4688         * .cppi-disable: Add getopt_.h, getopt_int.h.
4689         * .cvsignore: Add getopt.h.
4690
4691 2004-10-04  Simon Josefsson  <jas@extundo.com>
4692
4693         * memmem.h: New file.
4694         * memmem.c: New file, taken from glibc.
4695
4696 2004-10-02  Jim Meyering  <jim@meyering.net>
4697
4698         * dirfd.h, getpagesize.h: Add copyright notice.
4699
4700 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
4701
4702         * snprintf.c: Remove comments as to why each header is needed.
4703
4704 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
4705
4706         * strsep.h: New file.
4707         * strsep.c: New file.
4708
4709 2004-10-01  Simon Josefsson  <jas@extundo.com>
4710
4711         * snprintf.c (snprintf): Handle size==0.
4712
4713 2004-10-01  Simon Josefsson  <jas@extundo.com>
4714             Bruno Haible  <bruno@clisp.org>
4715
4716         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
4717         (snprintf): Declare 'args'.
4718
4719 2004-09-30  Simon Josefsson  <jas@extundo.com>
4720
4721         * snprintf.h, snprintf.c: New files.
4722
4723 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4724
4725         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
4726         (hol_entry_help): Never translate an empty string.
4727         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
4728         * argp.h (OPTION_NO_TRANS): New option.
4729
4730 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
4731
4732         * xvasprintf.c: Include xalloc.h.
4733         (xvasprintf): Use xalloc_die, not xmalloc_die.
4734
4735 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
4736
4737         * dummy.c: Change copyright notice to FSF, and license to GPL.
4738
4739 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
4740
4741         * argp-pvh.c (argp_program_version_hook): Provide initial value.
4742         Problem reported by Bruno Haible in:
4743         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
4744
4745 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
4746
4747         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
4748         in case some system header has #define'd it.  Problem reported by
4749         Soeren D. Schulze in
4750         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
4751
4752 2004-09-08  Bruno Haible  <bruno@clisp.org>
4753
4754         * stdint_.h: New file, taken from GNU clisp.
4755
4756 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
4757
4758         * xvasprintf.h: New file.
4759         * xvasprintf.c: New file.
4760         * xasprintf.c: New file.
4761
4762 2004-09-08  Bruno Haible  <bruno@clisp.org>
4763
4764         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
4765         is > INT_MAX.
4766         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
4767
4768 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
4769
4770         Import from coreutils.
4771         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
4772         strings on unbounded length.  alloca's performance benefits aren't
4773         that important here.
4774         (V_STRDUP): Remove.
4775         (parse_with_separator): New function, with most of the internals
4776         of the old parse_user_spec.  Allow user to omit both user and group,
4777         for compatibility with FreeBSD.
4778         Clone only the user name, not the entire spec.
4779         Do not set *uid, *gid unless entirely successful.
4780         Avoid memory leak in some failing cases.
4781         Fix regression for USER.GROUP reported by Dmitry V. Levin in
4782         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
4783         (parse_user_spec): Rewrite to use parse_with_separator.
4784
4785 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
4786
4787         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
4788         its complicated substitute.
4789         * argp-help.c: Include <errno.h>, for program_invocation_short_name
4790         and program_invocation_name.
4791         (__argp_basename) [!_LIBC]: Remove; the only use was
4792         replaced by its body.
4793         (__argp_short_program_name): Change condition from
4794         !defined __argp_short_program_name to
4795         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
4796         to match argp-namefrob.h.
4797         (__argp_failure): Don't assume strerror_r returns char *.
4798         * argp-parse.c (N_): Define unconditionally.
4799         (argp_default_options): Fill out initializers with 0 to avoid
4800         gcc warnings.
4801
4802 2004-08-12  Simon Josefsson  <jas@extundo.com>
4803
4804         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
4805         * getopt_.h: Renamed from getopt.h.
4806
4807 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
4808
4809         Merge from coreutils.
4810
4811         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
4812         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
4813         for Reliant Unix 5.43.
4814
4815         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
4816         (union fooround): Use uintmax_t, not long int.
4817         The rest is a merge from libc:
4818         [defined _LIBC]: Include <shlib-compat.h>.
4819         (_obstack) [defined _LIBC]: Remove after 2.3.4.
4820
4821         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
4822
4823         * strverscmp.c: Convert to UTF-8.
4824
4825 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
4826
4827         * obstack.h (obstack_empty_p):
4828         Don't assume that chunk->contents is suitably aligned.
4829         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
4830         Likewise. Problem reported by Benno in
4831         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
4832
4833         * chown.c (rpl_chown): Work even if the file is writeable but not
4834         readable.  This could be improved further but it'd take some work.
4835
4836 2004-08-08  Simon Josefsson  <jas@extundo.com>
4837
4838         * xgethostname.c: Don't include error.h (not used).
4839
4840         * getpass.h: Add.
4841         * getpass.c: Include getpass.h first.
4842
4843 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
4844
4845         * xalloc-die.c: New files.
4846         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
4847         All uses removed.
4848         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
4849         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
4850         (_, N_, xalloc_die): Move to xalloc-die.c.
4851         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
4852         so that we needn't mess with xalloc_msg_memory_exhausted.
4853
4854         * sha1.h: Renamed from sha.h.
4855         (SHA1_H): Renamed from _SHA_H.
4856         (sha1_ctx): Renamed from sha_ctx.
4857         (sha1_init_ctx): Renamed from sha_init_ctx.
4858         (sha1_process_block): Renamed from sha_process_block.
4859         (sha1_process_bytes): Renamed from sha_process_bytes.
4860         (sha1_finish_ctx): Renamed from sha_finish_ctx.
4861         (sha1_read_ctx): Renamed from sha_read_ctx.
4862         (sha1_stream): Renamed from sha_stream.
4863         (sha1_buffer): Renamed from sha_buffer.
4864         * sha1.c: Likewise; renamed from sha.c.
4865         Do not include <sys/types.h>.
4866         Include <stddef.h> rather than <stdlib.h>.
4867
4868 2004-08-08  Bruno Haible  <bruno@clisp.org>
4869
4870         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
4871         FILESYSTEM_PREFIX_LEN.
4872         * progreloc.c: Likewise.
4873         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
4874
4875 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
4876
4877         Merge from tar.
4878         * argp-help.c (make_hol, hol_append): Don't assume that
4879         SIZE_MAX is a valid preprocessor constant.
4880         (__argp_basename): Change from "#ifndef _LIBC"
4881         to "#ifndef __argp_short_program_name", so that
4882         we don't compile these functions for tar.
4883
4884         More merges from coreutils.
4885         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
4886         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
4887         yesno.h: New files.
4888         * addext.c: Remove; no longer needed.
4889         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
4890         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
4891         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
4892         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
4893         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
4894         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
4895         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
4896         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
4897         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
4898         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
4899         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
4900         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
4901         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
4902         Import changes from coreutils.
4903
4904 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
4905
4906         Merge from coreutils.
4907
4908         * .gdb-history: Remove; this doesn't belong here.
4909
4910         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
4911         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
4912         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
4913
4914         * dirname.h: Include <stdbool.h>.
4915         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
4916         for consistency with POSIX terminology.  All uses changed.
4917         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
4918         (strip_trailing_slashes): Use bool for booleans.
4919         * stripslash.c (strip_trailing_slashes): Likewise.
4920
4921         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
4922         sometimes returns a positive errno value even when it succeeds.
4923         (print_errno_message) [!LIBC]: Fall back on strerror if
4924         __strerror_r fails.
4925
4926         * path-concat.c (mempcpy): Don't define if a system header defines it.
4927         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
4928         (longest_relative_suffix): New function.
4929         (path_concat): Use it.  Assume first argument is not NULL.
4930         Port to DOS.  Omit redundant separators.
4931         Report an error instead of returning NULL.
4932         Use mempcpy instead of memcpy.
4933         (xpath_concat): Remove: not declared or used.
4934
4935         * same.h: Include <stdbool.h>
4936         (same_name): Return bool, not int.
4937         * same.c (same_name): Likewise.
4938         (errno): Don't declare; we assume C89 or better now.
4939
4940         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
4941         if not already defined.
4942
4943         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
4944         * dup-safer.c (errno): Likewise.
4945
4946 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
4947
4948         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
4949         working.
4950
4951 2004-08-03  Simon Josefsson  <jas@extundo.com>
4952
4953         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
4954         * progname.h: Don't include stdbool.h.
4955
4956 2004-08-02  Simon Josefsson  <jas@extundo.com>
4957
4958         * getsubopt.h: New file, with comments from Bruno Haible.
4959         * getsubopt.c: New file, from glibc, but slightly modified based on
4960         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
4961
4962 2004-08-01  Simon Josefsson  <jas@extundo.com>
4963
4964         * xgetdomainname.c: Include stdlib.h, for free().
4965
4966 2004-07-16  Simon Josefsson  <jas@extundo.com>
4967
4968         * dummy.c: New file.
4969
4970 2004-07-16  Bruno Haible  <bruno@clisp.org>
4971
4972         * backupfile.h: Add extern "C" for C++.
4973         * closeout.h: Likewise.
4974         * copy-file.h: Likewise.
4975         * findprog.h: Likewise.
4976         * full-write.h: Likewise.
4977         * pathname.h: Likewise.
4978         * progname.h: Likewise.
4979         * stpcpy.h: Likewise.
4980         * stpncpy.h: Likewise.
4981         * strcase.h: Likewise.
4982         * strstr.h: Likewise.
4983         * xalloc.h: Likewise.
4984
4985         * mbswidth.h: Add extern "C" for C++.
4986         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
4987
4988 2004-07-09  Simon Josefsson  <jas@extundo.com>
4989
4990         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
4991         failed without this.)
4992
4993 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
4994
4995         * fchown-stub.c: New file.
4996
4997 2004-06-24  Jim Meyering  <jim@meyering.net>
4998
4999         * obstack.h (obstack_base): Cast to (void *), per documentation.
5000
5001 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5002
5003         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5004
5005 2004-06-01  Jim Meyering  <jim@meyering.net>
5006
5007         * calloc.c: New file.
5008
5009 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5010
5011         * getdate.y (yylex): Allow space between sign and number.
5012         Problem reported by Dan Jacobson.
5013
5014 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5015         and  Jim Meyering  <jim@meyering.net>
5016
5017         Merge from coreutils CVS.
5018
5019         * stat-macros.h: New file, with contents from file-type.h
5020         and coreutils' system.h.
5021         * file-type.c: Include "stat-macros.h".
5022         * file-type.h (file_type): Move all macro definitions to new file,
5023         stat-macros.h.
5024
5025         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5026         Wrap old code with this conditional.
5027         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5028         function that does not dereference symlinks.
5029         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5030
5031         * xreadlink.c: Include xreadlink.h first, to catch .h file
5032         dependency problems.
5033         (xreadlink): Accept new arg SIZE, for efficiency.
5034         All decls and uses changed.
5035         * xreadlink.h: Include <stddef.h>, for size_t.
5036
5037         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5038         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5039
5040         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5041
5042 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5043
5044         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5045         macros to be defined.
5046         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5047         the allocator returns NULL because the requested size is zero.
5048
5049 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5050
5051         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5052         var.  Add comment explaining why libc still defines it.  This
5053         merges the following patch from glibc:
5054         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5055
5056 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5057
5058         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5059         present in glibc since revision 1.1 of this file.
5060         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5061         obstack_alignment_mask, obstack_alloc, obstack_base,
5062         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5063         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5064         obstack_grow0, obstack_init, obstack_int_grow,
5065         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5066         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5067         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5068         nonexistent functions.
5069
5070 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5071             Paul Eggert  <eggert@cs.ucla.edu>
5072
5073         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5074
5075 2004-05-14  Bruno Haible  <bruno@clisp.org>
5076
5077         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5078         that consists of a '.' followed by an empty digit string.
5079         Patch by Tor Lillqvist <tml@iki.fi>.
5080
5081 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5082
5083         Port obstack to the AS/400, where pointers are 16 bytes wide and
5084         you cannot cast an integer to a valid pointer.  This patch is
5085         currently waiting to be integrated into glibc; see
5086         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5087
5088         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5089         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5090         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5091         (struct obstack): temp member is now a union of a pointer and
5092         an integer, instead of an integer.  All integer uses changed.
5093         This does not affect the physical layout of struct obstack,
5094         except on hosts (like the AS/400) where the size or alignment of
5095         void * is greater than that of ptrdiff_t.
5096         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5097         __STDC__)]: Store temporary in pointer member of union, not
5098         integer member.
5099         * obstack.c: Include <stddef.h>, for offsetof.
5100         (struct fooalign): Remove; it doesn't need a name.
5101         (union fooround): Change double to long double, and add void *.
5102         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5103         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5104         not a macro.  Hence the values are always int; so remove all
5105         casts-to-int in uses.
5106
5107 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5108             Derek Price  <derek@ximbiot.com>
5109
5110         * alloca.c: Include <alloca.h>, to get our interface.
5111         * alloca_.h: Use __alloca on AIX, so that we don't have to
5112         include <alloca.h> first.  Use C89 prototype for alloca; this
5113         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5114         Use #elif for simplicity, since we can assume C89 now.
5115         Don't try to source the system alloca.h since it will not be found
5116         and to prevent recursively including its replacement.
5117         * fnmatch.c: Include <alloca.h> instead of opencoding.
5118         * regex.c: Likewise.
5119
5120 2004-05-16  Derek Price  <derek@ximbiot.com>
5121             Paul Eggert  <eggert@cs.ucla.edu>
5122
5123         getline cleanup.  This changes the getndelim2 API: both order of
5124         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5125         no delimiter).
5126
5127         * getline.c: Don't include stddef.h or stdio.h, since our
5128         interface does that.
5129         (getline): Always use getdelim, so that we don't have two
5130         copies of this code.
5131         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5132         if available.
5133         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5134         (GETNDELIM2_MAXIMUM): New macro.
5135         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5136         instead of the old practice of delim2==0.  All callers changed.
5137         Return -1 on overflow, instead of returning junk.
5138         Do not set *linesize unless allocation succeeds.
5139         * getndelim2.h: Do not include stddef.h; no longer needed, now
5140         that we include sys/types.h.
5141         * getnline.h: Likewise.
5142         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5143         (getndelim2): Reorder arguments.
5144         * getnline.c (getnline, getndelim):
5145         Don't discard the NMAX argument.
5146         (getnline): Invoke getndelim, to avoid code duplication.
5147         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5148         of (size_t) -1 by callers of the getnline family.
5149
5150 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5151
5152         * nanosleep.c (suspended): Change its type from int to
5153         sig_atomic_t volatile.
5154         (first_call): Make it private to rpl_nanosleep, and have it
5155         be zero initially as that's a bit faster.
5156         (my_usleep): Round up fractional times instead of truncating them,
5157         as this is the usual meaning for 'sleep'.
5158
5159         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5160         doesn't work.
5161         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5162         (ENOSYS): Define if not defined.
5163         (settime): Fall back on stime if it exists and settimeofday fails.
5164         But don't bother with fallbacks if a method fails with errno == EPERM.
5165
5166 2004-05-11  Jim Meyering  <jim@meyering.net>
5167
5168         Prior to this change, the save_cwd caller required read access to the
5169         current directory on most systems (ones with the fchdir function).
5170
5171         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5172         fails, try write-only, and finally, resort to using xgetcwd.
5173
5174 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5175
5176         * obstack.c, obstack.h: Import changes from libc.
5177
5178 2004-04-28  Bruno Haible  <bruno@clisp.org>
5179
5180         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5181         implicitly appends .exe to executables.
5182         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5183         accepts Windows pathnames.
5184         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5185         Cygwin like Windows, since it now accepts Windows pathnames.
5186         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5187         Cygwin like Windows, since it now accepts Windows pathnames.
5188         Reported by Derek Robert Price <derek@ximbiot.com>.
5189
5190 2004-04-20  Jim Meyering  <jim@meyering.net>
5191
5192         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5193
5194 2004-04-20  Jim Meyering  <jim@meyering.net>
5195             Bruno Haible  <bruno@clisp.org>
5196
5197         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5198         memory when realloc fails.
5199
5200 2004-04-18  Jim Meyering  <jim@meyering.net>
5201
5202         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5203         don't leak memory and do call END_UTMP_ENT.
5204
5205 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5206
5207         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5208         (CHAR_BIT): Remove, since we assume C89.
5209         Include <stdint.h> if available, as per current Autoconf CVS advice.
5210
5211 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5212
5213         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5214         not bool, to be more consistent with Unix conventions.
5215         Suggested by Bruno Haible.
5216
5217         Merge from coreutils.
5218
5219         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5220         New files.
5221
5222         * getdate.h: Include stdbool.h, and timespec.h instead of
5223         the usual <time.h> dance.
5224         (get_date): Change signature to support fractional time stamps.
5225         All callers changed.
5226         * getdate.y: Include "getdate.h" first, as we can now
5227         assume C89 and don't need to worry about 'const'.
5228         Similarly, include "unlocked-io.h" near start, not in middle.
5229         Include <limits.h>.
5230         (textint.value): Use long int rather than int.
5231         (textint.digits): Use size_t rather than int.
5232         (BILLION, LOG10_BILLION): New constants.
5233         (parser_control): New member rel_ns.  Members day_ordinal,
5234         time_zone, month, day, hour, minutes, rel_year, rel_month,
5235         rel_day, rel_hour, rel_minutes, rel_seconds
5236         are now long int, not int.  Member seconds is now struct timespec,
5237         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5238         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5239         not int.
5240         (%union.intval): Now long int, not int.
5241         New member timespec.
5242         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5243         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5244         (spec): Now is a timespec or an item list.
5245         (timespec, items): New nonterminals.
5246         (time, rel, relunit, number, get_date):
5247         Add support for fractional seconds.
5248         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5249         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5250         (to_hour): First arg is now long int, not int.
5251         (to_year): Returns long int, not int.
5252         Don't treat year -70 like 70.
5253         (tm_diff): Returns long int, not int.
5254         (lookup_word): Use bool instead of int when appropriate.
5255         (yylex): Use size_t for count, not int.
5256         Detect overflow when parsing large integer constants.
5257         Add support for fractions.
5258         (get_date): Make pointers 'const' if possible.
5259         Use more-portable code to detect integer overflow.
5260         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5261         Don't use ctime; it's not reliable if the year has >4 digits.
5262
5263         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5264         This is for compatibility with BSD.
5265
5266         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5267         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5268         From coreutils' system.h.
5269
5270         * userspec.c: Don't include "posixver.h".
5271         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5272         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5273         compatible extension.  Simplify code by removing a boolean int
5274         that was always nonzero if a string was nonnull.
5275
5276 2004-03-30  Jim Meyering  <jim@meyering.net>
5277
5278         Merge from coreutils.
5279
5280         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5281
5282         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5283         an empty input stream.
5284
5285         * readtokens.c: Include <stdbool.h>.
5286         (readtoken): Use `size_t' rather than int/long.
5287         All callers adjusted.
5288         Use `bool' rather than `int' where appropriate.
5289         Use memset rather than an explicit loop.
5290         Use x2nrealloc rather than xrealloc.
5291         Allow the use of `\0' as a delimiter.
5292         (readtokens): Likewise.
5293         * readtokens.h (readtoken, readtokens): Update prototypes.
5294
5295 2004-03-30  Bruno Haible  <bruno@clisp.org>
5296
5297         * getloadavg.c (getloadavg): Don't assume setlocale returns
5298         nonnull.
5299
5300 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5301
5302         Merge changes to getloadavg.c from coreutils and Emacs.
5303
5304         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5305         Define to an expression, not to the empty string.
5306         Include cloexec.h and xalloc.h.
5307         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5308         Use set_cloexec_flag rather than rolling our own.
5309         * cloexec.c, cloexec.h: New files.
5310
5311 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5312
5313         * getopt.h: Sync with libc CVS.
5314
5315 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5316             Bruno Haible  <bruno@clisp.org>
5317
5318         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5319         not on all platforms that have <wchar.h>.
5320         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5321
5322 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5323
5324         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5325         Sync with libc CVS.
5326         * getopt_int.h: New file, also synced from libc.
5327
5328 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5329
5330         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5331         '#if' expressions.  Unlike the code it replaces, it does not
5332         depend on (defined _SC_PAGESIZE).  However, it does depend on
5333         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5334         first reported by Jason Andrade in
5335         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5336
5337 2004-01-18  Simon Josefsson  <jas@extundo.com>
5338
5339         * strdup.h: New file.
5340         * strdup.c: Include it.
5341         * path-concat.c: Include strdup.h. Drop strdup declaration.
5342         * userspec.c: Include strdup.h. Drop strdup declaration.
5343
5344 2004-02-06  Karl Berry  <karl@gnu.org>
5345
5346         * config.charset: update from gettext 0.14.1.
5347
5348 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5349
5350         Add comments and code, prompted by suggestions from Bruno Haible
5351         for sh-quote.
5352         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5353         describing the enum quoting_style values.
5354         * quotearg.c (quotearg_alloc): New function.
5355         (quotearg_buffer_restyled): Treat lone { and } as special.
5356         Treat = as special.  Work around bug with older shells
5357         that "see" a '\' that is really the 2nd byte of a multibyte char.
5358         Quote empty string with shell_quoting_style.
5359
5360 2004-02-03  Bruno Haible  <bruno@clisp.org>
5361
5362         * pipe.h: New file, from GNU gettext.
5363         * pipe.c: New file, from GNU gettext.
5364
5365 2004-01-27  Bruno Haible  <bruno@clisp.org>
5366
5367         * execute.h: New file, from GNU gettext.
5368         * execute.c: New file, from GNU gettext.
5369         * w32spawn.h: New file, from GNU gettext.
5370
5371 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5372
5373         Exit-status fix from coreutils.
5374
5375         Use exit_failure consistently in place of EXIT_FAILURE,
5376         so that program exit statuses are consistent on failure.
5377
5378         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5379         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5380         * argmatch.h: Comment fix to match the above.
5381         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5382         Now a macro referring to exit_failure, instead of a separate
5383         variable.  Include "exitfail.h" to get it.
5384         * xstrtol.h: Include "exitfail.h".
5385         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5386
5387         * long-options.c (parse_long_options): Use prototype
5388         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5389         for clarity.
5390
5391 2004-01-21  Jim Meyering  <jim@meyering.net>
5392
5393         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5394         so as not to conflict with a different-sized __mktime_internal
5395         function in GNU libc.
5396         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5397         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5398
5399 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5400
5401         Merge from diffutils.
5402
5403         * file-type.c (file_type): Add typed memory objects.
5404         * file-type.h (S_TYPEISTMO): New macro.
5405
5406         * c-stack.h (c_stack_action): Remove argv argument.
5407         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5408         (die): Don't calculate message unless segv_action returns.
5409         (get_stack_location, min_address_from_argv, max_address_from_argv,
5410         volatile stack_base, volatile_stack_size): Remove.
5411         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5412         that every segmentation violation is a stack overflow.  (Ouch!)
5413         See Debian bug 136249 (still outstanding) for more info about why
5414         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5415
5416 2003-11-30  Bruno Haible  <bruno@clisp.org>
5417
5418         Safer stack allocation.
5419         * setenv.c: Include allocsa.h.
5420         (alloca): Remove fallback definition.
5421         (freea): Remove macro.
5422         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5423         instead of freea.
5424
5425 2003-10-17  Bruno Haible  <bruno@clisp.org>
5426
5427         * binary-io.h: Avoid warnings on Cygwin.
5428
5429 2003-12-28  Bruno Haible  <bruno@clisp.org>
5430
5431         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5432         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5433
5434 2003-11-28  Bruno Haible  <bruno@clisp.org>
5435
5436         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5437
5438 2003-11-27  Bruno Haible  <bruno@clisp.org>
5439
5440         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5441
5442 2003-11-17  Bruno Haible  <bruno@clisp.org>
5443
5444         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5445
5446 2003-11-24  Bruno Haible  <bruno@clisp.org>
5447
5448         * xallocsa.h: New file, from GNU gettext.
5449         * xallocsa.c: New file, from GNU gettext.
5450
5451 2003-11-24  Bruno Haible  <bruno@clisp.org>
5452
5453         * allocsa.h: New file, from GNU gettext.
5454         * allocsa.c: New file, from GNU gettext.
5455
5456 2003-11-24  Bruno Haible  <bruno@clisp.org>
5457
5458         * eealloc.h: New file.
5459
5460 2004-01-15  Jim Meyering  <jim@meyering.net>
5461
5462         Merge from coreutils.
5463
5464         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5465         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5466         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5467
5468         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5469         optional configure-time default.
5470
5471         * version-etc.c (version_etc_copyright): Update copyright date.
5472
5473         * xreadlink.c (xreadlink): Correct outdated comment.
5474
5475 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5476
5477         Merge from coreutils.
5478
5479         * posixver.c: Include posixver.h.
5480
5481         * same.c: Include <stdbool.h>, <limits.h>.
5482         (_POSIX_NAME_MAX): Define if not defined.
5483         (MIN): New macro.
5484         (same_name): If file names are silently truncated, report
5485         that the file names are the same if they are the same after
5486         the silent truncation.
5487
5488         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5489         conversion function.
5490         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5491         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5492         longer needed.
5493
5494 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5495
5496         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5497         with like-named macro in fnmatch.c.
5498         (EXT): Use an internal constant instead.
5499
5500         Merge fnmatch patches from glibc.
5501         * fnmatch.c (mbsinit): Remove define.
5502         Add libc_hidden_ver (__fnmatch, fnmatch).
5503         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5504         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5505
5506 2003-12-14  Karl Berry  <karl@gnu.org>
5507
5508         * config.charset: update from gettext-runtime.
5509
5510 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5511
5512         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5513         Bug reported by Alfred M. Szmidt.
5514
5515 2003-11-29  Karl Berry  <karl@gnu.org>
5516
5517         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5518
5519 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5520             Bruno Haible  <bruno@clisp.org>
5521
5522         * printf-parse.h: Don't include sys/types.h.
5523         (ARG_NONE): New macro.
5524         (char_directive): Change type of *arg_index fields to size_t.
5525         * printf-parse.c: Don't include sys/types.h.
5526         (SSIZE_MAX): Remove macro.
5527         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5528         Remove unnecessary overflow check.
5529         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5530         fields.
5531
5532 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5533
5534         * alloca.c: Remove dependency on xalloc module.
5535         (xalloc_die): Remove.
5536         (memory_full) [!defined emacs]: New macro.
5537         [!defined emacs]: Don't include xalloc.h.
5538         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5539         address arithmetic overflows.  Change datatypes a bit to avoid
5540         unnecessary casts.
5541
5542 2003-11-22  Jim Meyering  <jim@meyering.net>
5543
5544         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5545
5546 2003-11-17  Bruno Haible  <bruno@clisp.org>
5547
5548         * vasnprintf.c (alloca): Remove fallback definition.
5549         (freea): Remove definition.
5550         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5551         Reported by Paul Eggert.
5552
5553 2003-11-17  Jim Meyering  <jim@meyering.net>
5554
5555         On systems without utime and without a utimes function capable of
5556         dealing with a NULL struct utimbuf* argument, this utime replacement
5557         could -- in unusual circumstances -- leak a file descriptor.
5558         * utime.c: Include <unistd.h> and <errno.h>.
5559         (utime_null): Be sure to close `fd' and to preserve errno.
5560         Reported by Geoff Collyer via Arnold Robbins.
5561
5562 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5563             Bruno Haible  <bruno@clisp.org>
5564
5565         Protect against address arithmetic overflow.
5566         * printf-args.h: Include stddef.h.
5567         (arguments): Change type of field 'count' to size_t.
5568         * printf-args.c (printf_fetchargs): Use size_t instead of
5569         'unsigned int' where appropriate.
5570         * printf-parse.h: Include sys/types.h.
5571         (char_directive): Change type of *arg_index fields to ssize_t.
5572         (char_directives): Change type of fields 'count', max_*_length to
5573         size_t.
5574         * printf-parse.c: Include sys/types.h and xsize.h.
5575         (SSIZE_MAX): Define fallback value.
5576         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5577         instead of 'int' where appropriate. Check a_allocated, d_allocated
5578         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5579         * vasnprintf.c: Include xsize.h.
5580         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5581         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5582         overflow. Avoid wraparound when converting a width or precision from
5583         decimal to binary.
5584
5585 2003-11-16  Bruno Haible  <bruno@clisp.org>
5586
5587         Update from GNU gettext.
5588         * printf-parse.c: Generalize to it can be compiled for wide strings.
5589         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5590         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5591         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5592         SNPRINTF): New macros.
5593         Don't include <alloca.h> if the file is used inside libintl.
5594         (local_wcslen): New function, for Solaris 2.5.1.
5595         (VASNPRINTF): Use it instead of wcslen.
5596
5597 2003-11-16  Bruno Haible  <bruno@clisp.org>
5598
5599         * xsize.h (xmax): New function.
5600         (xsum, xsum3, xsum4): Declare as "pure" functions.
5601
5602 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5603
5604         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5605         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5606         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5607         heuristic is just as accurate as far as we know, and it removes a
5608         dependency on size_max.m4 and ptrdiff_max.m4.
5609
5610 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5611
5612         * xstrtol.c (__xstrtol): Remove "break" immediately after
5613         "return", to pacify some unknown compiler.  Problem reported
5614         by Joerg Schilling.
5615
5616 2003-11-11  Bruno Haible  <bruno@clisp.org>
5617
5618         * xsize.h (SIZE_MAX): Remove fallback definition.
5619         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5620         defined.
5621
5622 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5623
5624         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5625         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5626         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5627         From Bruno Haible.
5628         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5629         not (size_t) -1, since it's defined here.
5630
5631 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5632
5633         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5634         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5635         Reject sizes of exactly SIZE_MAX bytes.
5636         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5637         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5638
5639 2003-11-05  Bruno Haible  <bruno@clisp.org>
5640
5641         * xsize.h: Include limits.h, to avoid a possible collision with
5642         SIZE_MAX defined in <limits.h> on Solaris.
5643
5644 2003-11-04  Bruno Haible  <bruno@clisp.org>
5645
5646         * xsize.h: New file.
5647         * linebreak.c: Include xsize.h.
5648         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5649         argument for overflow.
5650         Suggested by Paul Eggert.
5651
5652 2003-10-31  Bruno Haible  <bruno@clisp.org>
5653
5654         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5655         to avoid (extremely rare) race condition.
5656         Suggested by Paul Eggert.
5657
5658 2003-11-03  Jim Meyering  <jim@meyering.net>
5659
5660         * userspec.c: Include "userspec.h".
5661         * userspec.h: New file.
5662
5663 2003-10-31  Paul Eggert  <eggert@twinsun.com>
5664
5665         * mountlist.h (struct mount_entry.me_type_malloced): New member.
5666         * mountlist.c (SIZE_MAX): Define if not defined already.
5667         (read_filesystem_list): Set and use me_type_malloced.
5668         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5669         whatever the type happens to be), for brevity and consistency.
5670         Check for size calculation overflow on Alphas running OSF/1.
5671
5672 2003-10-31  Jim Meyering  <jim@meyering.net>
5673
5674         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5675
5676         * linebuffer.c: Include <string.h> for declaration of memset.
5677
5678 2003-10-30  Paul Eggert  <eggert@twinsun.com>
5679             Bruno Haible  <bruno@clisp.org>
5680
5681         * vasprintf.c: Include <limits.h>, <stdlib.h>.
5682         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5683
5684 2003-10-29  Paul Eggert  <eggert@twinsun.com>
5685
5686         * xalloc.h (xalloc_oversized): Now a macro, not a function,
5687         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
5688         no longer needed.
5689         * quotearg.c (quotearg_n_options): Use it.
5690         * group-member.c: Include <stdbool.h>.
5691         (free_group_info): Arg is now const *; don't free arg.
5692         (get_group_info): Now returns bool and accepts struct group_info *,
5693         rather than returning a malloc'ed struct group_info *.
5694         All uses changed.  Check for overflow in internal size calculation.
5695
5696         * getusershell.c (readname): Simplify the code by using x2nrealloc
5697         rather than xmalloc/xrealloc.
5698         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
5699         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
5700         conformance bug: the old code used a pointer after freeing the
5701         storage that it addressed.
5702         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
5703         rather than doing it by hand.
5704         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
5705         the buffer preserved.  Use free and xmalloc instead.
5706         * quotearg.c (quotearg_n_options): Likewise.
5707         Use a simpler test for size overflow.  Don't use xalloc_oversized
5708         because unsigned int might be wider than size_t (!); this suggests
5709         that we should switch from unsigned int to size_t for slot numbers.
5710
5711 2003-10-27  Bruno Haible  <bruno@clisp.org>
5712
5713         * stdbool_.h: Better support for BeOS.
5714
5715 2003-10-27  Paul Eggert  <eggert@twinsun.com>
5716
5717         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
5718         to allocate the returned structure.  Do not allocate a subarray,
5719         as x2nrealloc will do that.
5720         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
5721         instead of xnrealloc.
5722         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
5723
5724 2003-10-26  Paul Eggert  <eggert@twinsun.com>
5725
5726         * xalloc.h (xalloc_oversized): New static inline function, for
5727         callers that want to do their own size-overflow checking.  Include
5728         <stdbool.h>, since xalloc_oversized returns bool.
5729         * xalloc.c (array_size_overflow): Remove.  All callers changed
5730         to use xalloc_oversized.
5731
5732         Add two functions x2realloc, x2nrealloc, for programs that grow
5733         arrays dynamically by doubling their sizes.
5734         * xalloc.h (x2realloc, x2nrealloc): New decls.
5735         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
5736         New functions.
5737
5738         Port to C99 semantics for 'inline' of external functions.
5739         Bug reported by Bruno Haible.
5740         * xmalloc.c (xnmalloc_inline): New static inline function,
5741         with the old contents of xnmalloc.
5742         (xnmalloc, xmalloc): Use it.
5743         (xnrealloc_inline): New static inline function,
5744         with the old contents of xnrealloc.
5745         (xnrealloc, xrealloc): Use it.
5746
5747         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
5748
5749 2003-10-25  Paul Eggert  <eggert@twinsun.com>
5750
5751         Fix several address-calculation bugs in the hash modules,
5752         plus some minor code cleanup.
5753
5754         * hash.h: Include <stdbool.h>, for bool.
5755         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
5756         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
5757         hash_get_n_entries, hash_get_max_bucket_length,
5758         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
5759         hash_rehash): Use size_t rather than unsigned.
5760         * hash.c (struct hash_table, hash_get_n_buckets,
5761         hash_get_n_buckets_used, hash_get_n_entries,
5762         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
5763         hash_get_entries, hash_do_for_each, hash_string, is_prime,
5764         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
5765         Likewise.
5766         (SIZE_MAX): Define if not defined.
5767         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
5768         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
5769         hash_print):
5770         Use const * when possible.
5771         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
5772         (check_tuning): Fix bug: if tuning parameters were very close to
5773         0 or 1, rounding errors could have caused subscript violations.
5774         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
5775         (hash_initialize): Add 'fail:' label
5776         to free table and return NULL, and use it to simplify code.
5777         Use calloc rather than clearing the storage ourself.
5778         (hash_initialize, hash_rehash): Check for arithmetic overflow in
5779         buffer size calculations.
5780         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
5781         Include <stddef.h>, for size_t.
5782         * hash-pjw.c (hash_pjw): Likewise.
5783         Switch to method described by Bruno Haible.
5784         Include <limits.h>, for CHAR_BIT.
5785         (SIZE_BITS): New macro.
5786
5787 2003-10-21  Paul Eggert  <eggert@twinsun.com>
5788
5789         * getndelim2.c (getndelim2): When size calculation overflows,
5790         ceiling the allocation at NMAX bytes rather than silently
5791         discarding input bytes before NMAX is reached.  This makes
5792         a difference only if NMAX exceeds SIZE_MAX / 2.
5793
5794         * obstack.c: Merge from glibc.
5795         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
5796         Add libc_hidden_def (_obstack_newchunk).
5797         (_obstack_free) [! defined _LIBC]: Remove.
5798         [defined _LIBC]: Make a strong alias from obstack_free, rather than
5799         a clone of the function body.
5800         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
5801         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
5802
5803         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
5804         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
5805         arg to memcpy.
5806
5807         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
5808         (obstack_ptr_grow_fast, obstack_int_grow_fast):
5809         Don't use lvalue casts, as GCC plans to remove support for them
5810         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
5811         was also present in the non-GCC version, indicating that this
5812         code had always been buggy and had never been widely used.
5813         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
5814         Use the fast variant of each macro, rather than copying the
5815         definiens of the fast variant; that way, we'll be more likely to
5816         catch future bugs in the fast variants.
5817
5818 2003-10-20  Bruno Haible  <bruno@clisp.org>
5819
5820         * wait-process.h: New file, from GNU gettext.
5821         * wait-process.c: New file, from GNU gettext.
5822
5823 2003-10-19  Jim Meyering  <jim@meyering.net>
5824
5825         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
5826
5827 2003-10-16  Paul Eggert  <eggert@twinsun.com>
5828
5829         * getgroups.c: Include <errno.h>, <stdlib.h>.
5830         (getgroups): First arg is int, not size_t.
5831         Don't let 'free' mangle errno.
5832
5833 2003-10-16  Jim Meyering  <jim@meyering.net>
5834
5835         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
5836
5837 2003-10-15  Paul Eggert  <eggert@twinsun.com>
5838
5839         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
5840         (SIZE_MAX): Remove.
5841         (new_exclude, add_exclude_file): Initial size no longer needs to
5842         be a power of 2.
5843         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
5844         our own address arithmetic overflow checking.
5845
5846         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
5847         (fnmatch): Do not alloca more than 2000 wide characters;
5848         instead, use malloc for large buffers.
5849         Check for address arithmetic overflow, and return -1
5850         with errno set to ENOMEM in that case.
5851         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
5852         (NEW_PATTERN): Do not alloca more than 8000 bytes;
5853         instead, return -1.  Check for address arithmetic overflow.
5854
5855 2003-10-14  Paul Eggert  <eggert@twinsun.com>
5856
5857         Handle invalid suffixes and overflow independently, so that
5858         callers can treat them independently as needed.  Fix some bugs in
5859         suffix handling, e.g., "100k@" was not diagnosed as an invalid
5860         suffix for a human-readable blocksize.  The major caller-visible
5861         change is the addition of a new
5862         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
5863         that both overflow and suffix chars were found.
5864
5865         * human.c (humblock): Don't check separately for invalid suffix
5866         char; that is xstrtoumax's job (now that its bug is fixed).
5867         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
5868         INTMAX_MAX]: New macros.
5869         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
5870         TYPE_MAXIMUM): New macros.
5871         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
5872         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
5873         if overflow occurs, as it's what __strtol does and it's more useful
5874         in practice.
5875         (__xstrtol): If __strtol reports some error other than ERANGE,
5876         reflect it to the caller as LONGINT_INVALID.  If it reports
5877         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
5878         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
5879         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
5880         value.
5881         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
5882         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
5883         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
5884         [defined UINTMAX_MAX]: New macros.
5885
5886 2003-10-14  Bruno Haible  <bruno@clisp.org>
5887
5888         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
5889         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
5890         Also use volatile where needed.
5891
5892 2003-10-12  Paul Eggert  <eggert@twinsun.com>
5893
5894         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
5895         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
5896         and define in terms of the other primitives.
5897         * xmalloc.c: Include stdbool.h; do not include exit.h.
5898         (SIZE_MAX): Define if not already defined.
5899         (array_size_overflow): New function.
5900         (xalloc_die): Abort instead of exiting if 'error' returns.
5901         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
5902         (xmalloc, xrealloc): Use them.
5903         (xcalloc): Check for address arithmetic overflow.
5904         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
5905         a bit faster than strcpy.
5906
5907 2003-10-08  Paul Eggert  <eggert@twinsun.com>
5908
5909         Merge getpass from libc, plus a few fixes.
5910
5911         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
5912         Include <stdbool.h>.
5913         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
5914         __fsetlocking to empty.
5915         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
5916         do include <bits/libc-lock.h>.
5917         Do not include <fcntl.h>; not needed.
5918         [_LIBC]: Include <wchar.h>.
5919         (NOTCANCEL_MODE): New macro.
5920         (flockfile, funlockfile) [_LIBC]: New macros.
5921         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
5922         [!_LIBC]: New macros.
5923         (call_fclose): New function.
5924         (getpass): Use it.  Save tty stream separately; this simplifies the
5925         code and makes it more reliable if stdin happens to equal stdout.
5926         Invoke __fsetlocking on tty.
5927         Handle thread cancellation if needed.
5928         Namespace cleanup (use __tcgetattr, __getline).
5929         Use bool for Booleans.
5930         [USE_IN_LIBIO]: Handle wide streams.
5931         [!_LIBC]: Unconditionally do the fseek, since we don't know what
5932         stream might go where.
5933
5934         * unlocked-io.h: Include <stdio.h>, so that the caller
5935         doesn't have to include <stdio.h> before us.
5936         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
5937         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
5938         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
5939         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
5940         if not declared, so that we can use getpass.c code from libc without
5941         rewriting it.
5942         (flockfile, ftrylockfile, funlockfile): New macros.
5943
5944 2003-10-06  Bruno Haible  <bruno@clisp.org>
5945
5946         * version-etc-2.h: Remove file.
5947         * version-etc-2.c: Remove file.
5948
5949 2003-09-25  Jim Meyering  <jim@meyering.net>
5950             Bruno Haible  <bruno@clisp.org>
5951
5952         This lets translators provide better translations for the
5953         "Written by ..." part of --version output.
5954         * version-etc.h: Include stdarg.h.
5955         (version_etc_copyright): Declare as readonly.
5956         (version_etc): Make this function variadic with a NULL-terminated list
5957         of author name strings.
5958         (version_etc_va): New declaration.
5959         * version-etc.c: Include stdarg.h, stdlib.h.
5960         (version_etc_copyright): Declare as readonly.
5961         (version_etc_va): New function. Provide a different translatable string
5962         for each possible number of authors < 10. Abbreviate when there are 10
5963         authors or more.
5964         (version_etc): Make this function variadic. Call version_etc_va.
5965         Suggestion from Gary V. Vaughan.
5966
5967         * long-options.h (parse_long_options): Change prototype: the authors
5968         string is moved to the end and becomes variadic.
5969         * long-options.c: Include stdarg.h.
5970         (parse_long_options): Make this function variadic, too.
5971         Call version_etc_va, not version_etc.
5972
5973 2003-10-06  Bruno Haible  <bruno@clisp.org>
5974
5975         * fatal-signal.h: New file, from GNU gettext.
5976         * fatal-signal.c: New file, from GNU gettext.
5977
5978 2003-10-04  Karl Berry  <karl@gnu.org>
5979
5980         * argp*: update from libc.
5981
5982 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
5983
5984         * getpass.c (getpass): Use a no-op fseek when switching from input to
5985         output mode on the same stream.
5986
5987 2003-09-29  Paul Eggert  <eggert@twinsun.com>
5988
5989         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
5990         Fix arg typo in previous patch.
5991
5992 2003-09-28  Jim Meyering  <jim@meyering.net>
5993
5994         * error.c: Correct cpp indentation.
5995
5996 2003-09-27  Paul Eggert  <eggert@twinsun.com>
5997
5998         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
5999         Omit the special code that used __typeof__, since we worry that
6000         it could be more trouble than it's worth.  See:
6001         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6002         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6003
6004         * free.c: New file.
6005
6006 2003-09-26  Jim Meyering  <jim@meyering.net>
6007
6008         * error.c (error_tail): Move some declarations
6009         into inner scope where the local variables are used.
6010
6011 2003-09-26  Bruno Haible  <bruno@clisp.org>
6012
6013         * stpncpy.h (gnu_stpncpy): New declaration.
6014         (stpncpy): Define as alias for gnu_stpncpy.
6015         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6016
6017 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6018
6019         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6020         (error_tail): Do not loop, reallocating temporary buffer, since
6021         the output cannot contain more wide characters than the input
6022         contains bytes, the size must be big enough already.  This avoids
6023         one potential size overflow calculation.  Check for size overflow
6024         when calculating temporary buffer size.  Free temporary buffer
6025         when done, if it was allocated with malloc; this plugs a memory
6026         leak.  Remove casts from void * to pointers, that are no longer
6027         needed now that we're assuming C89 or better.
6028
6029         Merge error changes from glibc.
6030
6031         * error.c, error.h: Update copyright notice header to match glibc.
6032         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6033         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6034         Disable cancellation while printing error.
6035         * error.h: Prepend __ to parameter names.
6036
6037 2003-09-25  Karl Berry  <karl@gnu.org>
6038
6039         * argp-fmtstream.c, argp-help.c: update from libc.
6040
6041 2003-09-25  Bruno Haible  <bruno@clisp.org>
6042
6043         * version-etc-2.h: New file, from version-etc.h with modifications.
6044         * version-etc-2.c: New file, from version-etc.c with modifications.
6045
6046 2003-09-25  Simon Josefsson  <jas@extundo.com>
6047
6048         * xgetdomainname.h: New file.
6049         * xgetdomainname.c: New file.
6050
6051 2003-09-25  Simon Josefsson  <jas@extundo.com>
6052             Bruno Haible  <bruno@clisp.org>
6053
6054         * getdomainname.h: New file.
6055         * getdomainname.c: New file.
6056
6057 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6058
6059         * linebuffer.c (freebuffer): Don't free the argument, just
6060         the buffer associated with the argument.  Bug reported by
6061         Simon Josefsson.
6062
6063 2003-09-19  Karl Berry  <karl@gnu.org>
6064
6065         * argp.h: update from libc.
6066
6067 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6068
6069         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6070         input error, instead of returning NULL the next time we are called
6071         (and therefore losing track of errno).
6072
6073 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6074
6075         * getndelim2.c (getndelim2): Don't trash errno when a read
6076         fails, so that the caller gets the proper errno.
6077
6078         * readutmp.c (read_utmp): Likewise.
6079         Check for fstat error.  Close stream and free storage
6080         when failing.
6081
6082 2003-09-14  Bruno Haible  <bruno@clisp.org>
6083
6084         * fwriteerror.h: New file.
6085         * fwriteerror.c: New file.
6086
6087 2003-09-14  Jim Meyering  <jim@meyering.net>
6088
6089         * getloadavg.c: Correct cpp indentation.
6090         * strdup.c: Likewise.
6091         * vasnprintf.c: Likewise.
6092
6093 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6094
6095         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6096         * obstack.c [!defined _LIBC]: Likewise.
6097         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6098         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6099         * exitfail.c: Don't include stdlib.h; no longer needed.
6100
6101         More changes to assume C89 or better.
6102
6103         * error.c (error_tail): Assume vprintf.
6104
6105         * argmatch.c (getenv): Remove decl.
6106         * progreloc.c (get_full_program_name): Define via prototype.
6107         * setenv.c (clearenv): Likewise.
6108         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6109         needed.
6110         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6111         (malloc, memcpy): Remove decls.
6112         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6113         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6114         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6115         (memcpy): Remove macro.
6116         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6117         (__P): Remove.  All uses removed.
6118         (PTR): Remove.  All uses changed to void *.
6119         (CHAR_BIT, NULL): Remove.
6120         (spaces, zeros, memset_space, memset_zero)
6121         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6122         Remove.
6123         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6124         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6125         Define with prototype.
6126         Remove now-unnecessary prototype decl.
6127         (extra_args_spec): Assume ANSI C.  All uses changed.
6128         (extra_args_spec_iso): Remove.
6129         (my_strftime, emacs_strftimeu): Define via prototype.
6130         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6131         unconditionally.
6132         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6133         * strtoimax.c: Include <stdlib.h> unconditionally.
6134         (strtoul, strtol): Remove decls.
6135         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6136         LONG_MAX): Remove.
6137         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6138         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6139         (LOCALE_PARAM_PROTO): New macro.
6140         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6141         (INTERNAL (strtol), strtol): Define with a prototype.
6142         (PARAMS): Remove.  All uses removed.
6143         * tempname.c: Include <string.h> unconditionally.
6144         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6145         * xgethostname.c (main): Define with a prototype.
6146         * xmalloc.c: Include "xalloc.h" first, to check interface.
6147         Include <stdlib.h> unconditionally.
6148         (calloc, malloc, realloc, free): Remove decls.
6149         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6150         Include <stdlib.h> unconditionally.  Sort include file names.
6151         (strtod): Remove.
6152         (xstrtod): Define with a prototype.
6153         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6154         (strtol, strtoul): Remove decls.
6155
6156 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6157
6158         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6159         Include <stdlib.h>, <string.h> unconditionally.
6160         Remove now-unnecessary cast to char *.
6161         * strnlen.c: Include <string.h> unconditionally.
6162         * yesno.c (yesno): Define with a prototype.
6163
6164 2003-09-10  Bruno Haible  <bruno@clisp.org>
6165
6166         * strcspn.c: Include <string.h> unconditionally.
6167         * strpbrk.c: Include <string.h> unconditionally.
6168         * strstr.c: Include <string.h> unconditionally.
6169         * unicodeio.c: Include <string.h> unconditionally.
6170         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6171         * unsetenv.c: Likewise.
6172         * xreadlink.c: Include <stdlib.h> unconditionally.
6173         * yesno.c: Include <stdlib.h> unconditionally.
6174         (rpmatch): Add prototype.
6175
6176 2003-09-10  Jim Meyering  <jim@meyering.net>
6177
6178         * error.c: Correct indentation of cpp directives.
6179
6180 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6181
6182         More K&R removal.
6183
6184         * acosl.c (main): Use a prototype.
6185         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6186         tanl.c: Likewise.
6187
6188         * getloadavg.c (getloadavg, main): Define via prototypes.
6189
6190         * getopt.h (struct option.name): Assume C89, and use 'const'.
6191         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6192         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6193         with a prototype.
6194         * getopt.c (const): Remove macro.
6195         Include <string.h> unconditionally.
6196         (my_index): Remove; all uses changed to strchr.
6197         (strlen): Remove decl.
6198         (exchange): Remove forward decl; no longer needed.
6199         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6200         Define with prototype.
6201         * getopt1.c (const): Remove macro.
6202         (getopt_long, getopt_long_only, main): Define with prototype.
6203
6204         * getugroups.c: Include <string.h> unconditionally.
6205
6206         * getusershell.c: Include <stdlib.h> unconditionally.
6207         (getusershell, setusershell, endusershell, readname, main):
6208         Define with prototypes.
6209
6210         * group-member.c: Include group-member.h first.
6211         Include <stdlib.h> unconditionally.
6212
6213         * hard-locale.c: Include hard-locale.h first.
6214         Include <stdlib.h>, <string.h> unconditionally.
6215
6216         * hash.c (free, malloc): Remove decls.
6217         Include <stdlib.h> unconditionally.
6218
6219         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6220         (getenv): Do not declare.
6221
6222         * idcache.c: Include <string.h> unconditionally.
6223
6224         * long-options.c: Include long-options.h first, to test interface.
6225         Include <stdlib.h> unconditionally.
6226
6227         * makepath.c: Include makepath.h first, to test interface.
6228         Include <stdlib.h> and <string.h> unconditionally.
6229
6230         * linebuffer.c: Include <stdlib.h>.
6231         (free): Remove decl.
6232
6233         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6234         rpl_malloc returns void *, not char *.
6235         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6236
6237         * md5.h: Include <limits.h> unconditionally.
6238         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6239         (__P): Remove; all uses removed.
6240         * md5.c: Include "md5.h" first.
6241         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6242         md5_buffer, md5_process_bytes, md5_process_block):
6243         Define with prototypes.
6244         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6245         * sha.c: Include "sha.h" first.
6246         Include <stdlib.h>, <string.h> unconditionally.
6247
6248         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6249         * memcmp.c (__ptr_t): Likewise.
6250         * memrchr.c (__ptr_t): Likewise.
6251         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6252         Include <string.h> unconditionally.
6253         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6254         * memchr.c: Include <stdlib.h> unconditionally.
6255         * memchr.c (LONG_MAX): Remove.
6256         * memrchr.c (LONG_MAX): Likewise.
6257         * memchr.c (__memchr): Define via a prototype.
6258         * memrchr.c (__memrchr): Likewise.
6259         * memcmp.c (__P): Remove, and remove all uses.
6260         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6261         Remove forward decls; no longer needed.
6262         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6263         Use types required by C89 in prototype.
6264
6265         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6266         * savedir.c: Likewise.
6267         * mkdir.c (free): Remove decl.
6268         * rmdir.c (rmdir): Define with a prototype.
6269         * savedir.c: Include savedir.h first, to test interface.
6270
6271         * mktime.c (STDC_HEADERS): Remove.
6272         Include <stdlib.h>, <string.h> unconditionally.
6273
6274         * modechange.c: Include <stdlib.h> unconditionally.
6275         (malloc): Remove decl.
6276
6277         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6278         (free): Remove decl.
6279
6280         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6281         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6282         (This type really should be intptr_t, but that's a C99ism.)
6283         (_obstack_memcpy): Remove: all uses changed to memcpy.
6284         Include <string.h> unconditionally.
6285         (struct obstack): Assume __STDC__ for types of members
6286         chunkfun, freefun, extra_arg.
6287         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6288         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6289         obstack_begin, obstack_specify_allocation,
6290         obstack_specify_allocation_with_arg, obstack_chunkfun,
6291         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6292         Remove unprototyped decls and the macros that use them.
6293         * obstack.c (POINTER): Remove.  All uses changed to void *.
6294         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6295         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6296         (defined __STDC__ && __STDC__)]:
6297         Remove nonprototyped code.
6298         Include <stdlib.h> unconditionally.
6299         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6300         _obstack_allocated_p, _obstack_free, obstack_free,
6301         _obstack_memory_used, print_and_abort):
6302         Define using prototypes.
6303         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6304         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6305         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6306         obstack_next_free, obstack_object_size, obstack_room) [0]:
6307         Remove unused, unprototyped code.
6308
6309         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6310
6311         * physmem.c (physmem_total, physmem_available, main): Define
6312         with prototypes.
6313
6314         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6315         (main): Define with a prototype.
6316
6317         * posixver.c (getenv): Remove decl.
6318
6319         * putenv.c (malloc): Returns void *, not char *.
6320         Include <string.h> unconditionally.
6321         (strchr, memcpy, NULL): Do not define.
6322
6323         * readtokens.c: Include readtokens.h first, to test interface.
6324         Include <stdlib.h>, <string.h> unconditionally.
6325         (init_tokenbuffer): Define with a prototype.
6326
6327         * regex.c (PARAMS): Remove.  All uses removed.
6328         All uses of _RE_ARGS removed, too.
6329         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6330         unconditionally.
6331         (bzero): Assume memset exists.
6332         (memcmp, memcpy, NULL): Remove.
6333         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6334         char, or assignments to local vars of type signed char.
6335         (init_syntax_once, PREFIX(extract_number_and_incr),
6336         PREFIX(print_partial_compiled_pattern),
6337         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6338         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6339         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6340         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6341         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6342         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6343         wcs_compile_range, byte_compile_range, truncate_wchar,
6344         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6345         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6346         count_mbs_length, wcs_re_match_2_internal,
6347         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6348         PREFIX(alt_match_null_string_p),
6349         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6350         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6351         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6352         now-unnecessary declaration, if any.
6353         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6354         regcomp, regexec):
6355         Remove now-unnecessary casts among pointer types.
6356         * regex.h (_RE_ARGS): Remove.  All uses removed.
6357
6358         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6359         (free): Remove decl.
6360
6361         * rpmatch.c: Include <stdlib.h> unconditionally.
6362
6363         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6364         (free): Remove decl.
6365
6366         * save-cwd.c: Include <stdlib.h> unconditionally.
6367         * xgetcwd.c: Likewise.
6368
6369         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6370         (free): Remove decl.
6371
6372         * strchrnul.c (strchrnul): Define with a prototype.
6373         Fix bug: c_in was not converted to char before searching.
6374
6375         The following changes are not K&R related:
6376
6377         * group-member.h: Include <sys/types.h>, so that this file is
6378         self-contained.
6379         * makepath.h: Likewise.
6380
6381         * getusershell.c (readname, default_index, line_size, readname):
6382         Use size_t, not int, for sizes.
6383         (readname): If the size overflows, report an error instead of
6384         looping forever.
6385
6386 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6387
6388         * getndelim2.c: Assume stdlib.h per the C89 spec.
6389
6390 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6391
6392         Assume C89 or better; remove K&R cruft.
6393         A few of these changes were first proposed by Derek Robert Price
6394         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6395
6396         * addext.c: Include <string.h> unconditionally.
6397         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6398         Don't declare getenv or malloc.
6399
6400         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6401         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6402         (NULL): Remove.
6403         (find_stack_direction, alloca): Use prototypes.
6404
6405         * atexit.c (atexit): Define using a prototype.
6406
6407         * basename.c, dirname.c, stripslash.c:
6408         Include <string.h> unconditionally.
6409
6410         * bcopy.c: Include <stddef.h>.
6411         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6412
6413         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6414
6415         * error.h (error, error_at_line, error_print_progname)
6416         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6417         * error.c: Include error.h first, to check interface.
6418         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6419         (VA_START): Remove; all uses changeed to va_start.
6420         (exit, strerror): Remove decls.
6421         (error_print_progname): Prototype uncondionally.
6422         Don't include <errno.h>; no longer needed.
6423         (private_strerror): Remove.
6424         (error_tail): Always define.
6425         (error, error_at_line): Assume C89 or better; always use prototypes.
6426         * fatal.c: Include "fatal.h" first, to test interface.
6427         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6428         (VA_START): Remove; all uses changed to va_start.
6429         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6430         this case.
6431         (exit): Remove decl.
6432         (fatal): Prototype unconditionally.  Assume va_start works.
6433         Abort at end, to pacify gcc.
6434
6435         * euidaccess.c (main): Define with a prototype.
6436
6437         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6438
6439         * exitfail.c: Include <stdlib.h> unconditionally.
6440
6441         * fnmatch_.h (__P): Remove.  All uses changed to assume
6442         prototypes.
6443         * fnmatch.c: Include fnmatch.h first, to test interface.
6444         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6445         (getenv): Remove decl.
6446         (fnmatch): Define using a prototype.
6447         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6448         (FCT): Define using a prototype.
6449
6450         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6451
6452         * gethostname.c: Include <stddef.h>.
6453         (gethostname): Define with prototype.  Length is size_t, not int.
6454
6455 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6456
6457         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6458         getversion.c should have been removed then, but was accidentally
6459         preserved.
6460
6461         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6462         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6463
6464 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6465
6466         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6467         copy_tm_result.  Bug reported by Simon Josefsson in
6468         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6469
6470 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6471
6472         * time_r.c, time_r.h: New files.
6473
6474         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6475         __localtime_r.
6476         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6477         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6478
6479         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6480         __gmtime_r.
6481         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6482         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6483         Include <time_r.h>.
6484
6485         * timegm.c: Switch to glibc implementation, with the following changes:
6486         [defined HAVE_CONFIG_H]: Include <config.h>.
6487         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6488         (__mktime_internal) [!defined _LIBC]: New decl.
6489         (__gmtime_r) [!defined _LIBC]: New macro and function.
6490         (timegm): Use a prototype, since gnulib assumes C89.
6491         Do not bother declaring tmp to be const, as it's not really usefu.
6492         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6493         (timegm): Declare only if HAVE_DECL_TIMEGM.
6494
6495 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6496
6497         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6498         Bug reported by Lute Kamstra in
6499         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6500
6501         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6502         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6503         course with correspondingly smaller numbers for tomorrow and
6504         yesterday.  From Tadayoshi Funaba.  Originally installed into
6505         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6506         coreutils merge?).
6507
6508 2003-08-31  Simon Josefsson  <jas@extundo.com>
6509
6510         * timegm.h: New file.
6511         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6512
6513 2003-08-31  Karl Berry  <karl@gnu.org>
6514
6515         * argp.h: update from libc.
6516
6517 2003-08-28  Bruno Haible  <bruno@clisp.org>
6518
6519         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6520         warning on QNX, which defines O_BINARY to 000000.
6521
6522 2003-08-24  Bruno Haible  <bruno@clisp.org>
6523
6524         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6525         MSVC7 <stdio.h> is included later.
6526
6527 2003-08-20  Bruno Haible  <bruno@clisp.org>
6528
6529         * progname.h: New file, from GNU gettext.
6530         * progname.c: New file, from GNU gettext.
6531         * progreloc.c: New file, from GNU gettext.
6532
6533 2003-08-19  Bruno Haible  <bruno@clisp.org>
6534
6535         * xstrdup.c: Assume <string.h> exists.
6536
6537 2003-08-18  Jim Meyering  <jim@meyering.net>
6538
6539         * setenv.h: Indent nested cpp directive.
6540         * vasnprintf.c: Remove trailing blanks.
6541
6542 2003-08-17  Simon Josefsson  <jas@extundo.com>
6543             Bruno Haible  <bruno@clisp.org>
6544
6545         * xstrndup.h: New file.
6546         * xstrndup.c: New file.
6547
6548 2003-08-17  Bruno Haible  <bruno@clisp.org>
6549
6550         * strndup.h: New file.
6551
6552 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6553
6554         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6555         space, undoing this 2003-08-12 change:
6556         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6557
6558 2003-08-16  Jim Meyering  <jim@meyering.net>
6559
6560         Merge from coreutils.
6561         * xstrtoimax.c: #else #if -> #elif.
6562         * xstrtoumax.c: Likewise.
6563
6564 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6565
6566         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6567         rather than tab, after '#' in shell-script copyright notices.
6568         Suggested by Bruno Haible.
6569
6570 2003-08-15  Jim Meyering  <jim@meyering.net>
6571         and Paul Eggert  <eggert@twinsun.com>
6572
6573         Merge from coreutils.
6574         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6575         member but strut utmpx does not.  Needed for AIX 4.3.3.
6576         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6577
6578 2003-08-15  Jim Meyering  <jim@meyering.net>
6579
6580         Merge from coreutils.
6581         * xgethostname.c: Include <stdlib.h>.
6582         (xghostname): Don't exit for anything other than memory-related
6583         failure; just return NULL.
6584         * userspec.c: Include "posixver.h".
6585         (parse_user_spec): Accept `.' as a separator only
6586         in pre-POSIX-200112 mode.
6587         * strtoimax.c: Use #elif rather than #else #if.
6588         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6589         Remove function, now that we can rely on a working tzset function.
6590         [!_LIBC]: Ensure that the required autoconf test has been run.
6591         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6592         Use underlying_strftime for %r.
6593         * sha.c: Merge in some clean-up and optimization changes from glibc.
6594         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6595         Ensure that it is a multiple of 64.
6596         Rearrange loop exit tests so as to avoid performing an
6597         additional fread after encountering an error or EOF.
6598         * realloc.c: Update copyright date.
6599
6600 2003-08-14  Jim Meyering  <jim@meyering.net>
6601
6602         Merge from coreutils.
6603         * obstack.h: Whitespace changes.
6604         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6605         and xcalloc return values.
6606         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6607         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6608         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6609         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6610         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6611         error from mntctl.
6612         Use mntctl's return value to drive the entry-processing loop, since
6613         we can't rely on the value of the vmt_length member in the last
6614         entry.  On some systems doing so could result in exhausting
6615         virtual memory.  Based in part on a patch from Mike Jetzer.
6616
6617 2003-08-14  Jim Meyering  <jim@meyering.net>
6618         and Paul Eggert  <eggert@twinsun.com>
6619
6620         Merges from coreutils, plus other fixes.
6621         * physmem.c: Merge in portability changes from gcc/libiberty
6622         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6623         for credits and details.  Thanks to Kaveh Ghazi for helping
6624         to keep these files in sync.
6625         (ARRAY_SIZE): Define it.
6626         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6627         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6628         (memcasecmp): Don't assume size_t fits in unsigned int.
6629         Remove casts and duplicate code.
6630         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6631         (memcpy): Remove definition.
6632         Merge in some clean-up and optimization changes from glibc.
6633         [BLOCKSIZE]: Move definition to top of file.
6634         Ensure that it is a multiple of 64.
6635         Rearrange loop exit tests so as to avoid performing an
6636         additional fread after encountering an error or EOF.
6637         * md5.h (md5_uintptr): Define.
6638         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6639         return to the initial working directory.  Preserve errno
6640         for caller.
6641         * idcache.c: Include "xalloc.h".
6642         (xmalloc, xrealloc): Remove decls.
6643         (getuser): Remove casts no longer required in C89.
6644         * human.c: Include stdio.h, for sprintf.
6645         * group-member.c: Include "xalloc.h".
6646         (xmalloc, xrealloc): Remove decls.
6647         (get_group_info): Remove casts no longer required in C89.
6648         * getusershell.c (readname): Remove casts no longer required in C89.
6649         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6650         * getline.c: Whitespace fix, from coreutils.
6651
6652 2003-08-13  Paul Eggert  <eggert@twinsun.com>
6653
6654         * exclude.c: Include <ctype.h>
6655         (IN_CTYPE_DOMAIN): New macro.
6656         (is_space): New fn.
6657         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6658         and empty lines.
6659
6660         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6661         Undo previous (whitespace-only) change.
6662
6663 2003-08-12  Paul Eggert  <eggert@twinsun.com>
6664
6665         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6666         Normalize leading white space and remove trailing white space.
6667         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6668         notice, as per ../config/srclist-update.
6669
6670         Merge from coreutils.
6671         * euidaccess.h: New file.
6672         * euidaccess.c: Include it.
6673         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6674         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
6675         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6676
6677 2003-08-11  Bruno Haible  <bruno@clisp.org>
6678
6679         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6680         (vasnprintf): Use it instead of wcslen.
6681
6682 2003-08-11  Bruno Haible  <bruno@clisp.org>
6683
6684         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6685         value to ensure that _Bool promotes to int. Use #define for _Bool when
6686         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6687
6688 2003-08-10  Karl Berry  <karl@gnu.org>
6689
6690         * regex.h: update from libc (whitespace fix).
6691
6692 2003-08-09  Paul Eggert  <eggert@twinsun.com>
6693
6694         Merge some files from coreutils.  These changes were
6695         originally made by Jim Meyering.
6696         * acl.c: Include <sys/types.h> before <sys/stat.h>;
6697         many older Unixes require this.
6698         * alloca.c (alloca): Remove cast to argument of free;
6699         no longer needed in C89.
6700         * alloca_.h, regex.h: Fix white space to match
6701         what GNU indent does.
6702
6703 2003-08-05  Paul Eggert  <eggert@twinsun.com>
6704
6705         * bumpalloc.h: Remove.
6706
6707 2003-08-04  Paul Eggert  <eggert@twinsun.com>
6708
6709         * getloadavg.c: Change copyright notice and spacing to conform to
6710         GNU coding style.
6711
6712         Merge from coreutils.
6713         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
6714         From glibc.
6715         * getdate.y (date): Also accept dates like May-23-2003; suggestion
6716         from Karl Berry, implemented by Jim Meyering.
6717         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
6718         from Dmitry V. Levin.
6719         Remove anachronistic cast of xrealloc.
6720         * fnmatch_.h (__const): Remove.  Use 'const'.
6721         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
6722         type. Otherwise, it wouldn't compile with at least /bin/cc on
6723         ymp-cray-unicos9.0.2.X.
6724         Combine two mostly-identical uses of alloca into one.
6725         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
6726
6727 2003-08-04  Dave Love <d.love@dl.ac.uk>
6728
6729         [From Emacs.]
6730
6731         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
6732         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
6733         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
6734         obsolete NLIST_NAME_UNION.
6735         [__GNU__]: Undef BSD and FSCALE.
6736         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
6737
6738 2003-08-03  Paul Eggert  <eggert@twinsun.com>
6739
6740         * stdbool_.h (_Bool): Make it signed char, instead of
6741         an enum type, so that it's guaranteed to promote to int.  See:
6742         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
6743
6744 2003-07-31  Paul Eggert  <eggert@twinsun.com>
6745
6746         * strerror.c: Include config.h, limits.h.  Declare sprintf.
6747         (strerror): Don't assume that a printable int fits in 14 bytes.
6748
6749 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
6750             Bruno Haible  <bruno@clisp.org>
6751
6752         * getline.h (getline, getdelim): Change return type to ssize_t.
6753         * getline.c (getline, getdelim): Likewise.
6754         Remove _GNU_SOURCE define; now it's defined in config.h through
6755         m4/getline.m4.
6756
6757 2003-07-22  Paul Eggert  <eggert@twinsun.com>
6758
6759         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
6760         over-parenthesization in macros.
6761
6762         Sync with coreutils.
6763
6764         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
6765         required by C99.
6766
6767         Use `exit_failure' for xalloc and xmemcoll instead of their own
6768         private exit-failure variables.
6769         * xalloc.h (xalloc_exit_failure): Remove.
6770         * xmalloc.c: Likewise.  Include exitfail.h.
6771         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
6772         * xmemcoll.h (xmemcoll_exit_failure): Remove.
6773         * xmemcoll.c: Likewise.  Include exitfail.h.
6774         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
6775
6776 2003-07-18  Paul Eggert  <eggert@twinsun.com>
6777
6778         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
6779         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
6780         to test that it can stand by itself.  Include "exitfail.h".
6781         Clients should set exit_failure instead.
6782         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
6783
6784 2003-07-18  Andreas Schwab  <schwab@suse.de>
6785
6786         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
6787
6788 2003-07-18  Bruno Haible  <bruno@clisp.org>
6789
6790         * getndelim2.h: New file.
6791         * getndelim2.c: Make into a module of its own. Include config.h,
6792         getndelim2.h.
6793         (getndelim2): Make non-static. Change return type to ssize_t.
6794         * getline.h: Change argument names.
6795         * getline.c: Include getndelim2.h instead of getndelim2.c.
6796         * getnline.c: Include getndelim2.h.
6797
6798 2003-07-17  Bruno Haible  <bruno@clisp.org>
6799
6800         * Makefile.am: Remove file.
6801         * Makefile.in: Remove file.
6802
6803 2003-07-17  Bruno Haible  <bruno@clisp.org>
6804
6805         * getnline.h: New file.
6806         * getnline.c: New file.
6807         * getndelim2.c: New file, extracted from getline.c.
6808         (getndelim2): Renamed from getdelim2, with added nmax argument.
6809         * getline.c: Include getndelim2.c.
6810         (getdelim2): Moved out to getndelim2.c.
6811         (getline, getdelim): Update.
6812
6813 2003-07-15    <karl@gnu.org>
6814
6815         * vasnprintf.c: update from gettext.
6816
6817 2003-07-15  Jim Meyering  <jim@meyering.net>
6818
6819         * makepath.c (make_path): Enclose diagnostic in _(...).
6820
6821 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6822
6823         * asnprintf.c, asprintf.c, config.charset, gettext.h,
6824         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
6825         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
6826         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
6827         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
6828         updated automatically by ../config/srclist-update.  This changes
6829         their license from LPGL to GPL.
6830
6831 2003-07-14  Jim Meyering  <jim@meyering.net>
6832
6833         Don't emit diagnostics.  Let callers do that.
6834         * save-cwd.c: Don't include "error.h".
6835         (save_cwd): Don't call error.  Ensure that errno is valid
6836         when returning nonzero.
6837
6838         * save-cwd.h (restore_cwd): Update prototype.
6839         * save-cwd.c (restore_cwd): Remove two parameters.
6840         Simplify.  Don't call error upon failure.  Let callers do that.
6841         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
6842         when auditing is enabled.  But don't bother updating the #if.
6843
6844 2003-07-14  Simon Josefsson  <jas@extundo.com>
6845
6846         * mempcpy.h: New file.
6847         * mempcpy.c: New file.
6848
6849 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6850
6851         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
6852         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
6853         unicodeio.c, unicodeio.h, unlocked-io.h:
6854         Switch from LGPL to GPL.
6855
6856 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
6857
6858         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
6859         it breaks C++ compilation.
6860         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
6861
6862 2003-07-10  Jim Meyering  <jim@meyering.net>
6863
6864         * vasnprintf.c: Remove trailing blanks.
6865         Make cpp indentation consistent.
6866
6867 2003-07-09  Paul Eggert  <eggert@twinsun.com>
6868
6869         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
6870         posixver.c, strftime.c, strnlen.c, strverscmp.c:
6871         Switch from LGPL to GPL.
6872
6873 2003-07-07  Paul Eggert  <eggert@twinsun.com>
6874
6875         * mktime.c: Fix some boundary cases and remove need for floating point.
6876
6877         Issue a compile-time diagnostic if time_t is floating point, or if
6878         two's complement arithmetic is not in effect, or if arithmetic
6879         right shift does not propagate the sign.  These assumptions were
6880         all in the original code but they weren't checked.
6881
6882         (TIME_T_MIDPOINT, verify): New macros.
6883         (__isleap): Remove; it has integer overflow problems.
6884         (leapyear): New function, without those problems.
6885         (ydhms_tm_diff): Remove; splitting into two parts.
6886         (ydhms_diff): New function, containing the arithmetic part of
6887         the old ydhms_tm_diff function.  Issue a compile-time
6888         diagnostic if we are not using C99 integer division.
6889         Avoid casts when possible.
6890         (guess_time_tm): New function, containing the checking part of
6891         the old ydhms_tm_diff function.  Return the new value, rather than
6892         the difference between it and the old.  Accept a new argument T
6893         so that *T specifies the old value.  Check for overflow in the result.
6894
6895         (__mktime_internal): Use a time_t offset, not a long int offset.
6896         This undoes the 2003-06-04 change, which is no longer needed now
6897         that we have better overflow checking.
6898         (localtime_offset): Likewise.
6899
6900         (__mktime_internal): Avoid harmful overflow on hosts where time_t
6901         and long are 64-bit but int is only 32-bit.
6902         (ydhms_diff): Use long int to store year1 and yday1.
6903         Issue a compile-time diagnostic if long int is not wide enough.
6904
6905         (__mktime_internal): Use long int to store adjusted year and yday.
6906         Use plain C rather than preprocessor commands, if that doesn't
6907         affect efficiency.
6908         Check for overflow (and try to repair) after each probe
6909         rather than checking only at the very end.  This avoids some bugs
6910         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
6911         does not equal GMT offset at maximum time).
6912         Use integer to check for overflow rather than floating point; this
6913         is more portable to non-IEEE hosts, and is a tad faster.
6914         When we detect that we are oscillating between two values,
6915         don't check whether tm_isdst has the requested value, since
6916         we already know the answer.  When tm_isdst has the wrong value,
6917         use a different heuristic to find the right one, based on the
6918         extreme values actually observed in practice in tz2003a,
6919         rather than the (overly optimistic) "previous 3 calendar quarters".
6920
6921         (not_equal_tm, print_tm, check_result): Use "const T" rather than
6922         "T const" to accommodate glibc style.
6923         (check_result): Use less-confusing report format.  "long" -> "long int.
6924         (main): Likewise.
6925         Don't loop if the iteration overflows time_t.
6926         Allow a negative step in the iteration.
6927
6928 2003-07-01  Paul Eggert  <eggert@twinsun.com>
6929
6930         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
6931         having it depend on HAVE_SYS_TYPES_H.
6932
6933 2003-06-25  Bruno Haible  <bruno@clisp.org>
6934
6935         * readlink.c: New file.
6936
6937 2003-06-20  Bruno Haible  <bruno@clisp.org>
6938
6939         Assume C89, so PARAMS isn't needed.
6940         * unicodeio.h (PARAMS): Remove.
6941         * unicodeio.c: Don't use PARAMS.
6942
6943 2003-06-18  Jim Meyering  <jim@meyering.net>
6944
6945         Merge changes from coreutils.
6946         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
6947         Remove explicit declarations of xmalloc and realloc.
6948         Include xalloc.h.
6949         (read_utmp): Remove anachronistic cast of xmalloc.
6950
6951 2003-06-17  Paul Eggert  <eggert@twinsun.com>
6952
6953         Assume C89, so PARAMS isn't needed.
6954         * backupfile.h (PARAMS): Remove.  All uses removed.
6955         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
6956         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
6957         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
6958         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
6959         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
6960         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
6961         xstrtol.h: Likewise.
6962         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
6963         same.h, strverscmp.h: Do not include config.h; no longer needed.
6964         Anyway, config.h should always be included before any other file.
6965
6966 2003-06-11  Simon Josefsson  <jas@extundo.com>
6967
6968         * sysexit_.h: New file.
6969
6970 2003-05-20  Derek Price  <derek@ximbiot.com>
6971
6972         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
6973
6974 2003-06-10  Simon Josefsson  <jas@extundo.com>
6975
6976         * strchrnul.h: New file.
6977         * strchrnul.c: New file.
6978
6979 2003-06-10  Simon Josefsson <jas@extundo.com>
6980
6981         * argp.h: New file, from glibc.
6982         * argp-ba.c: New file, from glibc.
6983         * argp-eexst.c: New file, from glibc.
6984         * argp-fmtstream.c: New file, from glibc.
6985         * argp-fmtstream.h: New file, from glibc.
6986         * argp-fs-xinl.c: New file, from glibc.
6987         * argp-help.c: New file, from glibc.
6988         * argp-namefrob.h: New file, from glibc.
6989         * argp-parse.c: New file, from glibc.
6990         * argp-pv.c: New file, from glibc.
6991         * argp-pvh.c: New file, from glibc.
6992         * argp-xinl.c: New file, from glibc.
6993
6994 2003-06-07  Jim Meyering  <jim@meyering.net>
6995
6996         * readtokens.h: Put `Free Software Foundation, Inc.'
6997         in place of my name in the copyright comment.
6998         Remove definition and uses of __P.
6999
7000         From coreutils.
7001         * stat.c: Don't declare xmalloc explicitly.
7002         Instead, include "xalloc.h".
7003         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7004         xrealloc, and xcalloc return values.
7005         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7006         Improve comment.
7007         * xgetcwd.h: Remove definition/uses of PARAMS.
7008
7009 2003-06-06  Jim Meyering  <jim@meyering.net>
7010
7011         * stdbool_.h: Renamed from stdbool.h.in.
7012
7013 2003-06-06  Jim Meyering  <jim@meyering.net>
7014
7015         Merge from coreutils.
7016         * same.c: (same_name): Declare *_basename locals to be `const'.
7017         Consolidate declarations and initializations of *_base* locals.
7018
7019         Merge from coreutils.
7020         This avoids a core dump on systems without GNU putenv,
7021         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7022         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7023         (unsetenv): New static function, from GNU libc.
7024         (rpl_putenv): Use it.
7025
7026         * modechange.c: Remove trailing blanks.
7027
7028         Merge from coreutils.
7029         * fsusage.c: Remove declaration of statfs.
7030         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7031
7032         * posixtm.c: Include <stdbool.h> unconditionally.
7033
7034 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7035
7036         * mktime.c (__mktime_internal): When resolving a tm_isdst
7037         mismatch, look in future quarters as well as past.  This fixes a
7038         bug when processing fall-backwards gaps immediately after a long
7039         period of daylight-saving time.
7040
7041         * mktime.c: Assume freestanding C89 or better.
7042         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7043         (__P): Remove; not used.
7044         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7045         (mktime, not_equal_tm, print_tm, check_result,
7046         main): Use prototypes.  Use const * where appropriate.
7047         (main): Fix typo in testing code that uncovered by above changes.
7048         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7049
7050 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7051
7052         * mktime.c: Fix Debian bug 177940
7053         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7054         (localtime_offset): Now long int, not time_t, because we want it
7055         to be guaranteed to be signed.  All uses changed.
7056         (__mktime_internal): If overflow would occur when adding offset,
7057         don't add it.
7058
7059         Merge 'human' changes from coreutils.  Rewrite to support
7060         locale-specific notations like thousands separators.
7061         * human.c: Simplify authorship notice.
7062         Include human.h immediately after config.h.
7063         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7064         <limits.h>: Do not include, since human.h does.
7065         (SIZE_MAX, UINTMAX_MAX): New macros.
7066         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7067         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7068         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7069         (power_letter): Renamed from suffixes.
7070         (generate_suffix_backwards): Remove.
7071         (adjust_value): Now takes int style (because of human.h changes)
7072         and long double value (for greater precision on some platforms).
7073         (group_number): New function.
7074         (human_readable): Use it.  Use integer options, not enum.
7075         Put the options before the sizes in the arg list.
7076         Support all the new options.
7077         The old human_readable function has been removed;
7078         use inttostr.h instead.
7079         (human_readable, default_block_size, humblock):
7080         Use uintmax_t, not int, for block sizes.
7081         (human_readable_inexact, block_size_types): Remove.
7082         (block_size_opts): New constant.
7083         (human_options): Renamed from human_block_size, with new signature
7084         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7085         * human.h: Add copyright and authorship notice.
7086         Include <limits.h> and <stdbool.h> unconditionally.
7087         (PARAMS): Remove.  All uses removed.
7088         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7089         (enum human_inexact_style): Remove tag; now a nameless enum.
7090         (human_floor, human_ceiling, human_round_to_even): Now have
7091         values 2, 0, 1 rather than -1, 1, 0.
7092         (human_group_digits, human_suppress_point_zero, human_autoscale,
7093         human_base_1024, human_SI, human_B): New constants.
7094         (human_readable_inexact, human_block_size): Remove.
7095         (human_readable): Size args are now uintmax_t, not int.
7096         (human_options): New decl.
7097
7098         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7099         unnecessary now that we assume C89 or better.  This change
7100         imported from coreutils.
7101
7102         * mktime.c (__mktime_internal): Do not reject negative timestamps
7103         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7104         in the 2003-05-30 sync from glibc.
7105
7106         .h files should stand alone, but we shouldn't include <sys/types.h>
7107         if we can get away with just <stddef.h>.
7108
7109         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7110         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7111         rather than <sys/types.h>, as we merely need size_t.
7112         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7113         to get size_t.
7114         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7115         Include <stdio.h>, to get FILE.
7116         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7117         memcasecmp.h has included <stddef.h> and all we need is size_t.
7118         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7119         our interface, instead of including <sys/types.h>
7120
7121 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7122
7123         [from coreutils]
7124         Fix some minor time-related bugs with POSIX time arguments.
7125         Some valid time stamps were being rejected (notably -1, and
7126         time stamps before 1900 on 64-bit hosts).  And some invalid
7127         time stamps were being accepted, e.g. September 31.
7128
7129         * posixtm.h (posixtime): Return bool instead of time_t, so
7130         that we can return (time_t) -1 successfully.
7131         * posixtm.c: Likewise.
7132         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7133         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7134         (t): Remove static var.
7135         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7136         of static var.  All uses changed.
7137         (year): Do not reject years before 1900; they can occur with
7138         64-bit time_t.
7139         (posix_time_parse): Do not check for out-of-range components;
7140         that is now the caller's responsibility, since our checks were
7141         only approximations.
7142         (posixtime): Use mktime to check for out-of-range components,
7143         since it knows them exactly.
7144         If mktime returns (time_t) -1, check whether an error actually occurred
7145         by invoking localtime on -1.
7146         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7147         posixtime failures better.
7148         Improve the test data (in comments only).
7149
7150 2003-05-30    <karl@gnu.org>
7151
7152         * mktime.c: update from libc.
7153
7154 2003-05-30  Bruno Haible  <bruno@clisp.org>
7155
7156         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7157         * localcharset.h: Likewise.
7158         * localcharset.c: Likewise.
7159
7160 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7161
7162         Assume the headers required for C89 freestanding compilers.
7163         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7164         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7165         without checking for HAVE_LIMITS_H.
7166         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7167         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7168         to do that.
7169         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7170         * exclude.c: Include <stdbool.h> unconditionally.
7171         * tempname.c: Include <stddef.h> unconditionally.
7172         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7173         * modechange.c, rpmatch.c (NULL): Don't define, since
7174         <stddef.h> does that.
7175         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7176         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7177         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7178         * xstrtol.c: Likewise.
7179         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7180         * savedir.c: Include <stddef.h> instead of defining NULL.
7181
7182         * addext.c (addext): Use assignment rather than cast, to avoid
7183         warnings on some platforms.
7184
7185         * mktime.c (__mktime_internal): Do not reject negative timestamps
7186         arbitrarily.
7187
7188 2003-05-10  Bruno Haible  <bruno@clisp.org>
7189
7190         * linebreak.c (iconv_string_length): Don't return -1 just because the
7191         string is longer than 4 KB.
7192
7193 2003-05-12  Jim Meyering  <jim@meyering.net>
7194
7195         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7196         the space-padded-by-default conversion specifiers, %e, %k, %l.
7197
7198 2003-05-03  Bruno Haible  <bruno@clisp.org>
7199
7200         Upgrade to Unicode-4.0.
7201         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7202         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7203         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7204         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7205         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7206         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7207         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7208         Change width of U+E0100..U+E01EF from 1 to 0.
7209
7210 2003-04-25  Bruno Haible  <bruno@clisp.org>
7211
7212         * copy-file.c: Include <stddef.h>, for size_t.
7213
7214 2003-04-25  Jim Meyering  <jim@meyering.net>
7215
7216         * copy-file.c (copy_file_preserving): Declare buf_size to be
7217         of type size_t, not int.
7218
7219 2003-04-11  Jim Meyering  <jim@meyering.net>
7220
7221         Merge changes from Coreutils.
7222
7223         2003-03-22  Jim Meyering  <jim@meyering.net>
7224
7225         * strftime.c (widen): Cast alloca return value to proper type.
7226
7227         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7228
7229         From GNU libc.
7230         * strftime.c (my_strftime): Handle very large width
7231         specifications for numeric values correctly.  Improve checks for
7232         overflow.
7233
7234         2003-01-19  Jim Meyering  <jim@meyering.net>
7235
7236         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7237         (nl_get_alt_digit) [! defined my_strftime]: Define.
7238         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7239         _nl_get_alt_digit and _nl_get_walt_digit.
7240
7241         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7242         These changes have no effect outside of _LIBC.
7243
7244 2003-04-10  Bruno Haible  <bruno@clisp.org>
7245
7246         * findprog.h: New file, from GNU gettext.
7247         * findprog.c: New file, from GNU gettext.
7248
7249 2003-04-05  Jim Meyering  <jim@meyering.net>
7250
7251         Merge changes from Coreutils.
7252
7253         * exclude.h (PARAMS): Remove definition and uses.
7254         * exclude.c: Remove uses of `PARAMS'.
7255
7256         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7257         Add test-cases for DOS filenames. Declare program_name.
7258         (main): Set up program_name.  Patch by Rich Dawe.
7259
7260         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7261         error from mntctl.
7262         Use mntctl's return value to drive the entry-processing loop, since
7263         we can't rely on the value of the vmt_length member in the last
7264         entry.  On some systems doing so could result in exhausting
7265         virtual memory.  Based in part on a patch from Mike Jetzer.
7266
7267 2003-04-04  Bruno Haible  <bruno@clisp.org>
7268
7269         * linebreak.h: New file, from GNU gettext.
7270         * linebreak.c: New file, from GNU gettext with slight modifications.
7271         * lbrkprop.h: New file, from GNU gettext.
7272
7273 2003-04-03  Bruno Haible  <bruno@clisp.org>
7274
7275         * utf8-ucs4.h: New file, from GNU gettext.
7276         * utf16-ucs4.h: New file, from GNU gettext.
7277         * ucs4-utf8.h: New file, from GNU gettext.
7278         * ucs4-utf16.h: New file, from GNU gettext.
7279
7280 2003-04-02  Bruno Haible  <bruno@clisp.org>
7281
7282         * binary-io.h: New file, from GNU gettext.
7283
7284 2003-04-01  Bruno Haible  <bruno@clisp.org>
7285
7286         * pathname.h: New file, from GNU gettext.
7287         * concatpath.c: New file, from GNU gettext.
7288
7289 2003-03-30  Bruno Haible  <bruno@clisp.org>
7290
7291         * copy-file.c (copy_file_preserving): Don't set owner if the function
7292         chown() doesn't exist.
7293
7294 2003-03-28  Bruno Haible  <bruno@clisp.org>
7295
7296         * copy-file.h: New file, from GNU gettext.
7297         * copy-file.c: New file, from GNU gettext.
7298
7299 2003-03-18  Jim Meyering  <jim@meyering.net>
7300
7301         * quote.c (quote_n): Fix typo in comment.
7302
7303 2003-03-14  Jim Meyering  <jim@meyering.net>
7304
7305         Merge changes from Coreutils.
7306         * obstack.h (obstack_object_size): Declare temporary, __o,
7307         to be const, in order to avoid warnings.
7308         (obstack_room): Likewise.
7309         (obstack_empty_p): Likewise.
7310
7311 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7312
7313         Merge changes from Bison.
7314         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7315         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7316         when compiling Bison 1.875's `bitset bset = obstack_alloc
7317         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7318         * hash.c: Include <stdbool.h> unconditionally.
7319
7320 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7321
7322         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7323         Reported by Bruce Becker; see:
7324         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7325
7326 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7327             Bruno Haible  <bruno@clisp.org>
7328
7329         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7330         Reported by John Hughes, see
7331         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7332
7333 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7334
7335         * poll_.h: New file.
7336         * poll.c: New file.
7337
7338 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7339
7340         * mathl.h: New file.
7341         * acosl.c: New file.
7342         * asinl.c: New file.
7343         * atanl.c: New file.
7344         * ceill.c: New file.
7345         * cosl.c: New file.
7346         * expl.c: New file.
7347         * floorl.c: New file.
7348         * frexpl.c: New file.
7349         * ldexpl.c: New file.
7350         * logl.c: New file.
7351         * sincosl.c: New file.
7352         * sinl.c: New file.
7353         * sqrtl.c: New file.
7354         * tanl.c: New file.
7355         * trigl.c: New file.
7356         * trigl.h: New file.
7357
7358 2003-02-17  Bruno Haible  <bruno@clisp.org>
7359
7360         * mkdtemp.h: New file, from GNU gettext.
7361         * mkdtemp.c: New file, from GNU gettext.
7362
7363 2003-01-31  Bruno Haible  <bruno@clisp.org>
7364
7365         * rename.c: #undef rename before defining rpl_rename.
7366         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7367
7368 2003-01-30  Bruno Haible  <bruno@clisp.org>
7369
7370         * printf-args.h: New file, from GNU gettext.
7371         * printf-args.c: New file, from GNU gettext.
7372         * printf-parse.h: New file, from GNU gettext.
7373         * printf-parse.c: New file, from GNU gettext.
7374         * vasnprintf.h: New file, from GNU gettext.
7375         * vasnprintf.c: New file, from GNU gettext.
7376         * asnprintf.c: New file, from GNU gettext.
7377         * vasprintf.h: New file, from GNU gettext with modifications.
7378         * vasprintf.c: New file, from GNU gettext.
7379         * asprintf.c: New file, from GNU gettext.
7380
7381 2003-01-29  Bruno Haible  <bruno@clisp.org>
7382
7383         * stpncpy.h: New file, from GNU gettext with modifications.
7384         * stpncpy.c: New file, from GNU gettext with modifications.
7385
7386 2003-01-28  Bruno Haible  <bruno@clisp.org>
7387
7388         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7389         Paul Eggert.
7390         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7391         Paul Eggert.
7392
7393 2003-01-27  Bruno Haible  <bruno@clisp.org>
7394
7395         * xsetenv.h: New file, from GNU gettext.
7396         * xsetenv.c: New file, from GNU gettext.
7397
7398 2003-01-23  Bruno Haible  <bruno@clisp.org>
7399
7400         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7401
7402 2003-01-22  Bruno Haible  <bruno@clisp.org>
7403
7404         * exit.h: New file, from GNU gettext.
7405
7406 2003-01-11  Bruno Haible  <bruno@clisp.org>
7407
7408         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7409         * strcase.h (strcasecmp, strncasecmp): Likewise.
7410
7411 2003-01-14  Jim Meyering  <jim@meyering.net>
7412
7413         * same.c (same_name): Tweak a comment.
7414
7415 2003-01-11  Bruno Haible  <bruno@clisp.org>
7416
7417         * same.c (same_name): Reorder tests so as to avoid calling stat()
7418         when a string comparison is sufficient.
7419
7420 2003-01-11  Bruno Haible  <bruno@clisp.org>
7421
7422         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7423         'unsigned int'.
7424
7425 2003-01-11  Bruno Haible  <bruno@clisp.org>
7426
7427         * hash-pjw.c: Add comment about low quality of this function.
7428
7429 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7430
7431         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7432         to avoid collisions with libcurses and libreadline.
7433
7434         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7435         * getstr.h, getstr.c: Remove.
7436         * getline.c: Include "getline.h", to check interface.
7437         Move body of old getstr.c here: this defines MIN_CHUNK and
7438         declares getdelim2, which is renamed from getstr.
7439         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7440
7441         * linebuffer.c (readlinebuffer): Renamed from readline.
7442         All uses changed.
7443         * linebuffer.h: Likewise.
7444         (readline): Remove backward-compatibility macro.
7445
7446 2003-01-12  Jim Meyering  <jim@meyering.net>
7447
7448         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7449
7450 2003-01-10  Bruno Haible  <bruno@clisp.org>
7451
7452         * alloca_.h: New file.
7453         * getdate.y: Unconditionally include alloca.h.
7454         * makepath.c: Likewise.
7455         * setenv.c: Likewise.
7456         * userspec.c: Likewise.
7457
7458 2003-01-09  Bruno Haible  <bruno@clisp.org>
7459
7460         * stdbool.h.in: New file.
7461
7462 2003-01-08  Bruno Haible  <bruno@clisp.org>
7463
7464         * safe-read.c: Include specification header first, to ensure its
7465         selfcontainedness.
7466         * full-write.c: Likewise.
7467
7468 2003-01-08  Jim Meyering  <jim@meyering.net>
7469
7470         * full-write.c: Undefine and define-away `const' after inclusion
7471         of errno.h, not before.  Suggestion from Bruno Haible.
7472
7473 2003-01-07  Jim Meyering  <jim@meyering.net>
7474
7475         * full-write.c: Rework so that it may serve to define full_read, too.
7476         * full-read.c: Simply #define FULL_READ and include full-write.c.
7477
7478 2003-01-06  Jim Meyering  <jim@meyering.net>
7479
7480         * version-etc.c: Update year in translatable copyright string.
7481
7482 2002-12-25  Bruno Haible  <bruno@clisp.org>
7483
7484         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7485         * xstrtol.h: Likewise.
7486         * xstrtoimax.c: Likewise.
7487         * xstrtoumax.c: Likewise.
7488         * human.h: Likewise.
7489
7490         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7491         on systems that have <inttypes.h> but not <stdint.h>.
7492
7493 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7494
7495         * memcoll.c (memcoll): Fall back on a simple algorithm using
7496         memcmp if strcoll doesn't work.
7497
7498 2002-12-23  Bruno Haible  <bruno@clisp.org>
7499
7500         * localcharset.h: New file.
7501         * localcharset.c: Include it.
7502         * unicodeio.c: Likewise.
7503
7504 2002-12-22  Bruno Haible  <bruno@clisp.org>
7505
7506         * utime.c (utime_null): No need to call ftruncate if the file was
7507         nonempty.
7508
7509 2002-12-23  Bruno Haible  <bruno@clisp.org>
7510
7511         * memcoll.c (STRCOLL): New macro.
7512         (memcoll): Use it.
7513
7514 2002-12-22  Bruno Haible  <bruno@clisp.org>
7515
7516         * getstr.h (getstr): Define, to avoid clash with libcurses.
7517         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7518
7519 2002-12-22  Bruno Haible  <bruno@clisp.org>
7520
7521         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7522
7523 2002-12-23  Bruno Haible  <bruno@clisp.org>
7524
7525         * getline.h: Include <stddef.h>, for size_t.
7526
7527         * unicodeio.h: Include <stddef.h>, for size_t.
7528         * unicodeio.c: Don't include <stddef.h>.
7529
7530 2002-12-17  Bruno Haible  <bruno@clisp.org>
7531
7532         * canon-host.c (strdup): Remove unused declaration.
7533
7534         * fsusage.c: Include full_read.h.
7535         (get_fs_usage): Use full_read instead of safe_read.
7536
7537         * utime.c (utime_null): Use SAFE_READ_ERROR.
7538
7539 2002-12-11  Bruno Haible  <bruno@clisp.org>
7540
7541         * setenv.h: Rewritten to cope with systems that have setenv() but not
7542         unsetenv().
7543         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7544         modifications:
7545
7546         2002-12-11  Bruno Haible  <bruno@clisp.org>
7547
7548                 * setenv.c (alloca): Fall back to malloc.
7549                 (freea): New macro.
7550                 (setenv): Use freea() to free memory allocated with alloca().
7551
7552         2002-11-13  Bruno Haible  <bruno@clisp.org>
7553
7554                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7555                 function declarations.
7556                 * unsetenv.c (unsetenv): Likewise.
7557
7558         2002-03-04  Bruno Haible  <bruno@clisp.org>
7559
7560                 Portability to AIX 4.3.3.
7561                 * unsetenv.c: New file, extracted from setenv.c.
7562                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7563
7564         2001-12-20  Bruno Haible  <bruno@clisp.org>
7565
7566                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7567                 use malloc instead. For SunOS 4.
7568
7569         2001-12-11  Bruno Haible  <bruno@clisp.org>
7570
7571                 * setenv.c: Declare alloca.
7572                 (compar_fn_t): New typedef.
7573                 (KNOWN_VALUE, STORE_VALUE): Use it.
7574
7575         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7576         setenv.h.
7577
7578 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7579
7580         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7581         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7582         Choose values that are less likely to collide with system fnmatch
7583         options.
7584         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7585         defined (e.g., a pure POSIX system).
7586         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7587         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7588
7589 2002-12-06  Jim Meyering  <jim@meyering.net>
7590
7591         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7592
7593         Merge in changes from libc's misc/error.c, in preparation
7594         for the merge of gnulib's changes back into libc.
7595
7596         * error.c (_): Define only if not already defined.
7597         Move definition to follow all #include directives.
7598         Include unlocked-io.h only if !_LIBC.
7599         [_LIBC]: Include <libio/libioP.h>.
7600         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7601         (fflush): Tweak definition to use INTUSE.
7602         (putc): Define.
7603
7604 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7605
7606         * alloca.c [defined emacs]: Include "lisp.h".
7607         (xalloc_die) [defined emacs]: New macro.
7608         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7609         [! defined emacs]: Include <xalloc.h>.
7610         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7611         (pointer): Typedef to POINTER_TYPE *.
7612         (malloc): Remove decl; we now always use xmalloc.
7613         (alloca): Use old-style definition, since Emacs needs this.
7614         Check for arithmetic overflow when computing combined size.
7615
7616 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7617
7618         Do not generate unlocked-io.h automatically, since it's easier to
7619         maintain it by hand.
7620
7621         * unlocked-io.h: New file, from GNU diffutils,
7622         but with proper copyright notice and attribution.
7623         * gen-uio: Remove.
7624         * Makefile.am: Add copyright notice.
7625         (libfetish_a_SOURCES): Add unlocked-io.h.
7626         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7627         (DISTCLEANFILES, io_functions): Remove macros.
7628         (EXTRA_DIST): Remove gen_uio.
7629         (unlocked-io.h): Remove rule.
7630
7631 2002-12-04  Jim Meyering  <jim@meyering.net>
7632
7633         Reflect the fact that stat.c and lstat.c are no longer generated.
7634         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7635         (DISTCLEANFILES): Likewise.
7636         (EXTRA_DIST): Likewise.
7637         (all_local): Don't depend on stat.c or lstat.c.
7638         (stat.c, lstat.c): Remove rules.
7639         (EXTRA_DIST): Remove xstat.in.
7640
7641         * xstat.in: Remove file.  Contents moved into stat.c.
7642         * stat.c: New file.  Contents mostly from xstat.in.
7643         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7644         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7645
7646         * safe-read.c: Rework so that it may serve to define safe_write, too.
7647         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7648
7649 2002-12-03  Jim Meyering  <jim@meyering.net>
7650
7651         * safe-read.c, safe-write.c: Change variable names and comments, but
7652         not semantics, to minimize the differences between these two files.
7653         (safe_read): Change comment to mention SAFE_READ_ERROR.
7654
7655         * safe-read.c (IS_EINTR): Define.
7656         (safe_read): Use IS_EINTR in place of in-function cpp directives.
7657
7658 2002-12-02  Bruno Haible  <bruno@clisp.org>
7659
7660         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7661         Define, taken from safe-read.c.
7662         (INT_MAX): Provide fallback.
7663         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7664         * safe-write.h (SAFE_WRITE_ERROR): Define.
7665
7666         * safe-read.c (EINTR): Remove definition.
7667         (safe_read): Don't use EINTR if it is absent.
7668
7669 2002-12-02  Jim Meyering  <jim@meyering.net>
7670
7671         * safe-read.c (EINTR): Define.
7672         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7673         (INT_MAX): Provide fallback.
7674         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7675
7676         * safe-read.h (SAFE_READ_ERROR): Define.
7677
7678 2002-12-01  Jim Meyering  <jim@meyering.net>
7679
7680         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7681         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7682
7683 2002-11-27  Paul Eggert  <eggert@twinsun.com>
7684
7685         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7686         hash_rehash): Replace `if (limit <= value) abort ();' with
7687         `if (! (value < limit)) abort ();', for readability.
7688
7689 2002-11-26    <karl@gnu.org>
7690
7691         * strdup.c: copy from libc again, with jim's ok.
7692         * .cppi-disable: re-add strdup.c
7693
7694 2002-11-25    <karl@gnu.org>
7695
7696         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7697         instead of "strtol.c".
7698
7699 2002-11-25  Jim Meyering  <jim@meyering.net>
7700
7701         * mktime.c: Sync from libc, now that it has the latest fix.
7702
7703 2002-11-24    <karl@gnu.org>
7704
7705         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
7706         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
7707
7708 2002-11-24  Jim Meyering  <jim@meyering.net>
7709
7710         Update from coreutils:
7711
7712         * mktime.c: Merge in changes from libc.
7713
7714         Avoid a link-time failure on some Linux systems.
7715         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
7716         (__mon_yday): Declare with the STATIC attribute.
7717         (__mktime_internal): Likewise.
7718         Based on a report from Greg Schafer.
7719
7720 2002-11-23  Jim Meyering  <jim@meyering.net>
7721
7722         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
7723         Use `unsigned', not `int', as type of index.
7724
7725         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
7726
7727         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
7728
7729 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7730
7731         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
7732         hint that one should use `if (! x) abort ();' rather than `assert
7733         (x);', and anyway it's one less thing to worry about configuring.
7734         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7735         hash_rehash, hash_insert): Use abort rather than assert.
7736
7737 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7738
7739         * quotearg.h: Allow multiple inclusion by surrounding with
7740         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
7741         so that we can be included first.
7742         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
7743         * quotearg.c: Include quotearg.h immediately after config.h.
7744         No need to include stddef.h or sys/types.h any more.
7745         Surround local include files with "", not "<>".
7746         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
7747         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
7748         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
7749         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
7750         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
7751         (ISPRINT): Remove; no longer needed now that we assume C89.
7752
7753         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
7754         Preserve errno.
7755
7756         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
7757         quotearg_char): Use SIZE_MAX rather than
7758         (size_t) -1 when we are talking about "infinity".
7759
7760         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
7761
7762 2002-11-22  Bruno Haible  <bruno@clisp.org>
7763
7764         * safe-read.h: Assume C89. Add comments.
7765         (safe_read): Change return type to size_t.
7766         * safe-read.c (safe_read): Change return type to size_t. Handle byte
7767         counts > SSIZE_MAX correctly.
7768         * safe-write.h: New file.
7769         * safe-write.c: New file.
7770         * full-read.h: New file.
7771         * full-read.c: New file.
7772         * full-write.h: Assume C89. Add comments.
7773         * full-write.c: Include safe-write.h.
7774         (full_write): Rewritten to use safe_write.
7775         Suggested by Jim Meyering and Paul Eggert.
7776
7777 2002-11-21  Bruno Haible  <bruno@clisp.org>
7778
7779         Remove case insensitive option matching.
7780         * argmatch.h (argcasematch): Remove declaration.
7781         (ARGCASEMATCH): Remove macro.
7782         (__xargmatch_internal): Remove case_sensitive argument.
7783         (XARGMATCH): Update.
7784         (XARGCASEMATCH): Remove macro.
7785         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
7786         case_sensitive argument.
7787         (argcasematch): Remove function.
7788         (__xargmatch_internal): Remove case_sensitive argument.
7789         (main): Use XARGMATCH instead of XARGCASEMATCH.
7790
7791         * xmalloc.c: Change compile-time error message. Add comment about
7792         required autoconf version.
7793
7794 2002-11-21  Jim Meyering  <jim@meyering.net>
7795
7796         * strdup.c (strdup): Tweak comment and initial #if/#include.
7797
7798         Merge in changes from the coreutils.
7799
7800         2002-09-25  Paul Eggert  <eggert@twinsun.com>
7801         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
7802         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
7803         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
7804         int.  Work more efficiently if X is the same width as uintmax_t.
7805         Do not compare X to -1, to avoid bogus compiler warning.
7806         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
7807         Don't assume that f_frsize and f_bsize are the same type.
7808
7809         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
7810         on FreeBSD.
7811
7812         * makepath.c (make_path): Restore umask *before* creating the final
7813         component.
7814         (make_path): Minor reformatting.
7815
7816         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
7817         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
7818
7819         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
7820         ones.  At least on GNU/Linux systems, `auto' means something else.
7821         From Michael Stone.
7822
7823 2002-11-20  Paul Eggert  <eggert@twinsun.com>
7824
7825         Merge argmatch cleanups from Bison.  Assume C89.
7826
7827         * argmatch.c: Include config.h here, not in argmatch.h.
7828         Include stdlib.h, for EXIT_FAILURE.
7829         Always include <string.h>, since we assume C89.
7830         (EXIT_FAILURE): Remove pre-C89 bug workaround.
7831         * argmatch.h: Do not include <config.h> or <sys/types.h>.
7832         Include <stddef.h> instead, since it's all we need for size_t.
7833         (PARAMS): Remove.  All uses removed.
7834         (ARRAY_CARDINALITY): Do not bother to #undef.
7835         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
7836         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7837         Remove unnecessary parentheses.
7838         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7839         Insert necessary parentheses.
7840         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
7841         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
7842
7843 2002-11-19  Bruno Haible  <bruno@clisp.org>
7844
7845         * mbswidth.c: Include mbswidth.h right at the beginning.
7846         * mbswidth.h: Include <stddef.h>, for size_t.
7847
7848         * mbswidth.h (PARAMS): Remove macro.
7849         (mbswidth, mbsnwidth): Use ANSI C function declarations.
7850         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
7851
7852         * gcd.h (PARAMS): Remove macro.
7853         (gcd): Use ANSI C function declarations.
7854         * gcd.c (gcd): Likewise.
7855
7856 2002-11-15  Bruno Haible  <bruno@clisp.org>
7857
7858         * strcspn.c: Include <stddef.h>.
7859         (strcspn): Use ANSI C function declaration. Change return type to
7860         size_t. Use NULL.
7861         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
7862         (strpbrk): Use NULL.
7863         * strpbrk.h (PARAMS): Remove macro.
7864         (strpbrk): Use ANSI C function declaration.
7865         * strstr.c: Don't include <sys/types.h>.
7866         * strstr.h (PARAMS): Remove macro.
7867         (strstr): Use ANSI C function declarations.
7868
7869 2002-11-06  Bruno Haible  <bruno@clisp.org>
7870
7871         * gcd.h (gcd): Change argument type to 'unsigned long'.
7872         * gcd.c (gcd): Likewise.
7873
7874 2002-11-05  Bruno Haible  <bruno@clisp.org>
7875
7876         * gcd.h: New file, from gettext-0.11.5.
7877         * gcd.c: New file, from gettext-0.11.5.
7878
7879 2002-11-05  Bruno Haible  <bruno@clisp.org>
7880
7881         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7882         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7883         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7884         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7885
7886         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7887         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7888
7889         * closeout.c: Include gettext.h instead of <libintl.h>.
7890         * human.c: Include gettext.h instead of <libintl.h>.
7891         * quotearg.c: Include gettext.h instead of <libintl.h>.
7892         * rpmatch.c: Include gettext.h instead of <libintl.h>.
7893         * unicodeio.c: Include gettext.h instead of <libintl.h>.
7894         * userspec.c: Include gettext.h instead of <libintl.h>.
7895         * version-etc.c: Include gettext.h instead of <libintl.h>.
7896         * xmalloc.c: Include gettext.h instead of <libintl.h>.
7897         (textdomain): Remove definition.
7898         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
7899
7900         * long-options.c: Remove include of <libintl.h> and definition of _.
7901         * same.c: Remove include of <libintl.h> and definition of _.
7902
7903 2002-11-04  Bruno Haible  <bruno@clisp.org>
7904
7905         * stpcpy.h: New file, from GNU gettext-0.11.5.
7906         * strcase.h: New file, from GNU gettext-0.11.5.
7907         * strpbrk.h: New file, from GNU gettext-0.11.5.
7908         * strstr.h: New file, from GNU gettext-0.11.5.
7909         * xgetcwd.h: New file, from GNU gettext-0.11.5.
7910
7911 2002-05-09  Bruno Haible  <bruno@clisp.org>
7912
7913         * config.charset: Update for newest glibc. Add canonical names
7914         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
7915
7916 2002-05-09  Bruno Haible  <bruno@clisp.org>
7917
7918         * localcharset.c (get_charset_aliases): Add more Windows specific
7919         aliases.
7920
7921 2002-05-08  Owen Taylor  <otaylor@redhat.com>
7922
7923         * config.charset: A few additions for Solaris.
7924
7925 2001-12-05  Bruno Haible  <bruno@clisp.org>
7926
7927         * localcharset.c (locale_charset): Don't return an empty string.
7928
7929 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
7930
7931         * config.charset: msdos in uk_UA uses CP1125.
7932
7933 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
7934
7935         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
7936         * localcharset.c (locale_charset): Declare as extern "C".
7937
7938 2002-02-15  Bruno Haible  <bruno@clisp.org>
7939
7940         * config.charset [msdosdjgpp]: For Russian, use CP866.
7941
7942 2002-02-11  Bruno Haible  <bruno@clisp.org>
7943
7944         * config.charset: Add support for NetBSD.
7945
7946 2002-09-25    <karl@gnu.org>
7947
7948         * strdup.c: copy from libc/string (via ../config/srclist*).
7949         * getopt*: copy from libc/posix.
7950         * gettext.h: copy from gettext.
7951         * .cppi-disable: add strdup.c, gettext.h.
7952
7953 2002-07-01  Jim Meyering  <meyering@lucent.com>
7954
7955         * c-stack.c: Include sys/time.h.
7956         From Volker Borchert.
7957
7958 2002-06-11  Paul Eggert  <eggert@twinsun.com>
7959
7960         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
7961         New macro.  Use it uniformly instead of
7962         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
7963         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
7964         reported by Vin Shelton.
7965
7966 2002-06-22  Jim Meyering  <meyering@lucent.com>
7967
7968         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
7969         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
7970
7971 2002-06-22  Paul Eggert  <eggert@twinsun.com>
7972
7973         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
7974         Do not assume SA_SIGINFO behavior.
7975         Bug reported by Jim Meyering on NetBSD 1.5.2.
7976
7977 2002-06-22  Jim Meyering  <meyering@lucent.com>
7978
7979         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
7980
7981         * exitfail.c, exitfail.h: Likewise.
7982         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
7983
7984         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
7985         of fnmatch.h.
7986         (EXTRA_DIST): Add fnmatch_loop.c.
7987         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
7988
7989         * fnmatch_loop.c: New file, from diffutils-2.8.2.
7990         * fnmatch.c: Update from diffutils-2.8.2.
7991         * fnmatch_.h: New file.  From diffutils-2.8.2.
7992         * fnmatch.h: Remove file.
7993
7994 2002-06-18  Paul Eggert  <eggert@twinsun.com>
7995
7996         * file-type.h: Report an error if neither S_ISREG nor
7997         S_IFREG is defined, instead of using a test specific to glibc
7998         2.2.  This should be safe, since POSIX requires S_ISREG and
7999         Unix Version 7 had S_IFREG.  We don't need to check for
8000         <sys/types.h> since we don't use any symbols that it defines.
8001
8002 2002-06-15  Jim Meyering  <meyering@lucent.com>
8003
8004         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8005         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8006         have been included before this file.
8007
8008 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8009
8010         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8011         so that each temporary file name is unique and valid in the first
8012         8 characters, for operation under DOS.
8013
8014 2002-06-15  Jim Meyering  <meyering@lucent.com>
8015
8016         Work even with DJGPP 2.03, which lacks support for symlinks.
8017         From Richard Dawe.
8018         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8019         is defined.
8020         * lchown.c (S_ISLNK): Likewise.
8021
8022 2002-06-14  Jim Meyering  <meyering@lucent.com>
8023
8024         * file-type.h: Use the version from diffutils-2.8.2.
8025         * file-type.c: Likewise.
8026
8027 2002-05-27  Jim Meyering  <meyering@lucent.com>
8028
8029         Fix a problem seen only on nonconforming systems whereby ls.c's
8030         use of localtime, and then of gettimeofday would cause trouble:
8031         the localtime call used to initialize rpl_gettimeofday's save
8032         mechanism would clobber ls's current local time information so
8033         that in any long listing the first file would always be listed
8034         with date 1970-01-01.  Analysis by Volker Borchert.
8035
8036         * gettimeofday.c (localtime): Undefine.
8037         (rpl_localtime): New function.
8038
8039 2002-05-22  Jim Meyering  <meyering@lucent.com>
8040
8041         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8042         * file-type.h: New file.
8043         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8044
8045 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8046
8047         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8048
8049 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8050
8051         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8052         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8053         of 127, since 64 is the largest conceivable number for ancient
8054         nonstandard hosts.
8055         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8056
8057 2002-04-28  Jim Meyering  <meyering@lucent.com>
8058
8059         * sig2str.c (WTERMSIG): Remove definition (unused).
8060
8061 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8062
8063         * sig2str.h, sig2str.c: New files.
8064         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8065
8066 2002-04-24  Jim Meyering  <meyering@lucent.com>
8067
8068         * gettext.h: New file, from Gettext.
8069         * Makefile.am (INCLUDES): Remove -I../intl.
8070         (libfetish_a_SOURCES): Add gettext.h.
8071
8072 2002-04-16  Jim Meyering  <meyering@lucent.com>
8073
8074         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8075         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8076         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8077
8078 2002-04-12  Jim Meyering  <meyering@lucent.com>
8079
8080         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8081
8082 2002-03-10  Jim Meyering  <meyering@lucent.com>
8083
8084         * makepath.c (make_path): Remove a comma from a diagnostic.
8085         Suggestion from Santiago Vila.
8086
8087 2002-03-08  Jim Meyering  <meyering@lucent.com>
8088
8089         * rename.c: Mention that this wrapper is needed also on
8090         mips-dec-ultrix4.4 systems.
8091
8092 2002-03-02  Jim Meyering  <meyering@lucent.com>
8093
8094         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8095         not HAVE_CLOCK_SETTIME.
8096
8097 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8098
8099         * nanosleep.h: Rename to....
8100         * timespec.h: New name for nanosleep.h.  All uses changed.
8101
8102         * gettime.c: New file.
8103         * settime.c: New file.
8104         * stime.c: Remove.
8105
8106         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8107         timespec.h.  Remove nanosleep.h.
8108
8109 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8110
8111         * acl.c, acl.h: New files.
8112         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8113
8114 2002-02-24  Jim Meyering  <meyering@lucent.com>
8115
8116         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8117         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8118         cause trouble.  Reported by Nelson Beebe.
8119
8120 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8121
8122         * path-concat.c (xpath_concat): Reorder code to pacify
8123         compilers that don't know that xalloc_die never returns.
8124
8125 2002-02-20  Jim Meyering  <meyering@lucent.com>
8126
8127         * getdate.c: Regenerate using bison-1.33.
8128
8129 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8130
8131         * posixver.c, posixver.h: New files.
8132         * Makefile.am (libfetish_a_SOURCES): Add them.
8133
8134 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8135             Bruno Haible  <bruno@clisp.org>
8136
8137         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8138         (fwrite_success_callback): New declaration.
8139         * unicodeio.c (unicode_to_mb): New function, extracted from
8140         print_unicode_char. Call failure callback instead of error.
8141         (fwrite_success_callback): New function.
8142         (exit_failure_callback): New function.
8143         (fallback_failure_callback): New function.
8144         (print_unicode_char): Call unicode_to_mb.
8145
8146 2002-01-26  Jim Meyering  <meyering@lucent.com>
8147
8148         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8149
8150 2002-01-22  Jim Meyering  <meyering@lucent.com>
8151
8152         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8153         Otherwise, some versions of automake would omit the rule that makes
8154         Makefile from Makefile.in.
8155
8156 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8157
8158         * xmemcoll.h, xmemcoll.c: New files.
8159         * Makefile.am (libfetish_a_SOURCES): Add them.
8160         * memcoll.c: Include errno.h, and declare errno if not defined.
8161         (memcoll): Set errno to zero if there is no error.
8162
8163         * quotearg.c (quotearg_buffer_restyled):
8164         Fix bug with quoting buffers containing NUL when backslashing escapes.
8165         This bug was exposed by the other changes in this patch.
8166         (quotearg_n_options): New arg ARGSIZE.
8167         All callers changed.
8168         (quoting_options_from_style): New function.
8169         (quotearg_n_style): Use it.
8170         (quotearg_n_style_mem): New function.
8171
8172         * quotearg.h (quotearg_n_style_mem): New function.
8173
8174 2002-01-16  Jim Meyering  <meyering@lucent.com>
8175
8176         * getdate.y: Add three semicolons, each just before a closing brace.
8177         Bison (as of version 1.31) no longer papers over that mistake.
8178
8179 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8180
8181         * backupfile.c (ISDIGIT): Comment fix.
8182         * getdate.y (ISDIGIT): Likewise.
8183         * posixtm.c (ISDIGIT, year): Likewise.
8184         * strverscmp.c (ISDIGIT): Likewise.
8185         * userspec.c (ISDIGIT): Likewise.
8186
8187 2002-01-05  Jim Meyering  <meyering@lucent.com>
8188
8189         * version-etc.c (version_etc_copyright): Update copyright year.
8190
8191 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8192
8193         * closeout.c (close_stdout_status): If ferror (stdout), do
8194         not silently exit merely because the output buffer happens to
8195         have nothing pending.
8196
8197 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8198
8199         See the big note in ../ChangeLog.
8200         * human.c (suffixes): Prefer K to k for 1024.
8201         (generate_suffix_backwards): New function.
8202         (human_readable_inexact): Use it.
8203         * xstrtol.c (__xstrtol): If there is no number but there
8204         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8205         Accept 'K' as well as 'k'.
8206
8207 2001-12-15  Jim Meyering  <meyering@lucent.com>
8208
8209         * regex.h (__restrict_arr): Update from libc.
8210
8211         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8212         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8213         (STREQ): Define.
8214
8215 2001-12-10  Jim Meyering  <meyering@lucent.com>
8216
8217         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8218         Instead, include "xalloc.h".
8219         (initbuffer): Don't cast xmalloc return value to char*.
8220         (readline): Reword comment.
8221         Don't cast xrealloc return value to char*
8222         Return NULL, not 0.
8223
8224 2001-12-09  Jim Meyering  <meyering@lucent.com>
8225
8226         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8227         `signed and unsigned type in conditional expression'.
8228         * posixtm.c (posix_time_parse): Likewise.
8229
8230         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8231
8232         * readtokens.c (readtoken): Declare an index to be of type unsigned
8233         to avoid a pedantic warning.
8234
8235         * getstr.c: Don't include assert.h.
8236         (getstr): Remove warning-evoking assertions.
8237         Return -1 if offset parameter is out of bounds.
8238         Change the type of a local from int to size_t.
8239
8240         * strftime.c (my_strftime_localtime_r): Include this function
8241         definition in the `#if ! HAVE_TM_GMTOFF' block.
8242
8243         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8244         Include xalloc.h instead.
8245
8246 2001-12-02  Jim Meyering  <meyering@lucent.com>
8247
8248         * tempname.c: Don't declare getenv, thus reverting the change of
8249         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8250         included.
8251
8252         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8253         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8254
8255 2001-11-30  Akim Demaille  <akim@epita.fr>
8256
8257         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8258         before being defined.
8259
8260 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8261
8262         * quotearg.h (quotearg_n, quotearg_n_style):
8263         First arg is int, not unsigned.
8264         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8265         (SIZE_MAX, UINT_MAX): New macros.
8266         (quotearg_n_options): Abort if N is negative.
8267         Avoid overflow check on hosts where size_t is 64 bits and int
8268         is 32 bits, as overflow is impossible there.
8269         Fix off-by-one typo that caused unnecessary reallocation.
8270
8271 2001-11-27  Jim Meyering  <meyering@lucent.com>
8272
8273         * tempname.c: Merge with version from libc.
8274         * regex.c: Likewise.
8275
8276         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8277         for which STDC_HEADERS is 0, it was not included, resulting in a
8278         warning about an integer-to-pointer conversion problem with getenv.
8279         Reported by Volker Borchert.
8280
8281 2001-11-26  Jim Meyering  <meyering@lucent.com>
8282
8283         * gtod.h: Remove file.
8284         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8285         * gettimeofday.c: Don't include gtod.h.
8286         (GTOD_init): Remove function.
8287         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8288         Suggestion from Volker Borchert.
8289
8290 2001-11-23  Jim Meyering  <meyering@lucent.com>
8291
8292         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8293         * hash.c (struct hash_table): Define it here instead.
8294
8295 2001-11-22  Jim Meyering  <meyering@lucent.com>
8296
8297         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8298
8299 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8300
8301         * tempname.c (TMP_MAX): Remove; no longer needed.
8302         (TEMPORARIES): New macro.
8303         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8304         removes an artificial limitation (e.g. HP-UX 10.20, where
8305         TMP_MAX is 17576).
8306
8307 2001-11-18  Jim Meyering  <meyering@lucent.com>
8308
8309         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8310         on SunOS 4.
8311
8312         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8313         files will be created before anything else.
8314
8315 2001-11-17  Jim Meyering  <meyering@lucent.com>
8316
8317         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8318         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8319         rather than group writable.  Patch by Juan F. Codagnone.
8320
8321         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8322         Instead, include "xalloc.h".
8323
8324         * mountlist.c: Include unlocked-io.h after all system headers.
8325         Remove explicit declarations of xmalloc, xrealloc,
8326         and xstrdup.  Instead, include "xalloc.h".
8327
8328         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8329         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8330         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8331
8332         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8333         Reported by Padraig Brady.
8334
8335         * mkstemp.c: #undef mkstemp.
8336         Include config.h.
8337         (rpl_mkstemp): Rename from mkstemp.
8338         Protoize.
8339
8340 2001-11-16  Jim Meyering  <meyering@lucent.com>
8341
8342         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8343         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8344         determine the amount of total physical memory, use pstat_getstatic.
8345         HPUX-11 doesn't define _SC_PHYS_PAGES.
8346         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8347         If sysconf couldn't be used to determine the amount of available
8348         physical memory, use both pstat_getstatic and pstat_getdynamic.
8349         Based on a patch from Bob Proulx.
8350
8351 2001-11-05  Jim Meyering  <meyering@lucent.com>
8352
8353         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8354
8355 2001-11-03  Jim Meyering  <meyering@lucent.com>
8356
8357         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8358         in argmatch_to_argument call.
8359
8360         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8361         argument.
8362
8363         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8364         e.g., a fault due to an attempt to free a NULL pointer.
8365
8366 2001-11-01  Jim Meyering  <meyering@lucent.com>
8367
8368         * dirfd.c, dirfd.h: New files.
8369         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8370
8371         * hash.c (hash_print) [TESTING]: Clean up.
8372
8373 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8374
8375         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8376         to avoid a warning if -Wall.
8377
8378 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8379
8380         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8381
8382 2001-10-21  Jim Meyering  <meyering@lucent.com>
8383
8384         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8385         this code would end up calling gettext even in packages built
8386         with --disable-nls.
8387         * getopt.c (_): Likewise.
8388         * regex.c (_): Likewise.
8389
8390 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8391
8392         * error.c (strerror_r): Do not declare unless !_LIBC.
8393         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8394         Use strerror_r that is only a macro, even if it is not a function.
8395         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8396         (private_strerror): Use prototypes, not old-style function definition.
8397         (print_errno_message): New function.
8398         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8399         char*-flavored one.
8400         (error_tail, error, error_at_line): Use it.
8401
8402 2001-10-11  Jim Meyering  <meyering@lucent.com>
8403
8404         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8405         and quote_n (1, ... to avoid clobbering a buffer.
8406
8407 2001-10-05  Jim Meyering  <meyering@lucent.com>
8408
8409         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8410         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8411         * hash-pjw.h: New file.
8412
8413 2001-09-30  Jim Meyering  <meyering@lucent.com>
8414
8415         * mountlist.c [MOUNTED_GETFSSTAT]:
8416         Include <sys/ucred.h>, for Apple Darwin.
8417         Include sys/mount.h and sys/fs_types.h only if available.
8418         (FS_TYPE): Define.
8419         (read_filesystem_list): Use FS_TYPE.
8420
8421 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8422
8423         * exclude.c (excluded_filename): 0 -> false, since it's
8424         a boolean context.
8425
8426 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8427
8428         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8429         #defines strtoimax.  Also treat the other strto* functions
8430         like strtoimax.
8431
8432         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8433         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8434         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8435
8436 2001-09-26  Jim Meyering  <meyering@lucent.com>
8437
8438         Most macros in unlocked-io.h had the wrong number of arguments.
8439         * gen-uio: New script.
8440         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8441         * unlocked-io.hin: Remove file.
8442         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8443         rather than trying to embed it here.
8444         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8445         Reported by Padraig Brady.
8446
8447 2001-09-25  Volker Borchert  <bt@teknon.de>
8448
8449         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8450
8451 2001-09-23  Jim Meyering  <meyering@lucent.com>
8452
8453         * mountlist.c: Remove useless parentheses in #if directives.
8454         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8455         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8456
8457 2001-09-22  Jim Meyering  <meyering@lucent.com>
8458
8459         * localcharset.c: Update from latest gettext.
8460         * config.charset: Likewise.
8461
8462 2001-09-20  Jim Meyering  <meyering@lucent.com>
8463
8464         * xstrtol.c (strtoimax): Guard declaration with
8465         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8466         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8467         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8468         (strtoumax): Likewise, for completeness (it wasn't necessary).
8469
8470 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8471
8472         * strtoimax.c (HAVE_LONG_LONG):
8473         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8474         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8475         to work around bug in IBM C compiler.
8476
8477 2001-09-16  Jim Meyering  <meyering@lucent.com>
8478
8479         * mkdir.c: New file.
8480
8481 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8482
8483         * xgetcwd.c: Revert some of the previous change; intead,
8484         fix the HAVE_GETCWD_NULL code to behave more like the
8485         !HAVE_GETCWD_NULL code used to.
8486
8487         Include "xalloc.h".
8488         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8489         invoke xalloc_die.
8490
8491 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8492
8493         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8494         Use ssize_t, not int, to store result of readlink.
8495         Check for ssize_t overflow as well as size_t overflow,
8496         as POSIX says the result of readlink is implementation-defined
8497         when ssize_t overflows.
8498         Remove unnecessary cast to char*.
8499         Use free+malloc instead of realloc, as the storage doesn't need
8500         to be preserved and it's clearer and can be more efficient that way.
8501         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8502         * xreadlink.h (xreadlink): Update prototype.
8503
8504 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8505
8506         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8507         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8508         spotted by Jim Meyering.
8509
8510 2001-09-03  Jim Meyering  <meyering@lucent.com>
8511
8512         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8513
8514 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8515
8516         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8517         like the HAVE_GETCWD_NULL code.
8518         Include pathmax.h if not HAVE_GETCWD.
8519         Do not include xalloc.h.
8520         (INITIAL_BUFFER_SIZE): New symbol.
8521         Do not use xmalloc / xrealloc, since the caller is responsible for
8522         handling errors.  Preserve errno around `free' during failure.
8523         Do not overrun buffer when using getwd.
8524
8525 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8526
8527         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8528         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8529
8530 2001-09-02  Jim Meyering  <meyering@lucent.com>
8531
8532         * error.c: Update from GNU libc.
8533
8534 2001-09-01  Jim Meyering  <meyering@lucent.com>
8535
8536         * xreadlink.c: New file.
8537         * xreadlink.h: New file.
8538         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8539
8540         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8541         doesn't conflict with sparc Solaris 7's definition in
8542         /usr/include/sys/int_types.h.
8543
8544         * exclude.c: Use `""', not `<>' to #include non-system header files.
8545         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8546         and strncasecmp as r-values.  Unixware didn't have declarations.
8547
8548 2001-08-31  Jim Meyering  <meyering@lucent.com>
8549
8550         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8551         Use an initial, malloc'd, buffer of length 128 rather than
8552         a statically allocated one of length 1024.
8553
8554 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8555
8556         * xgetcwd.c: Don't include pathmax.h.
8557         Include stdlib.h and unistd.h if available.
8558         Include xalloc.h.
8559         (xmalloc, xstrdup, free): Remove decls.
8560         (xgetcwd): Don't assume sizes fit in unsigned.
8561         Check for overflow when computing sizes.
8562         Simplify reallocation code.
8563
8564 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8565
8566         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8567
8568         * strtoimax.c: Renamed from strtoxmax.c, removing the
8569         old strtoimax.c.
8570
8571         Also, make the following further changes to make this file's
8572         configuration more similar to that of strtol.c:
8573         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8574         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8575         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8576         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8577         changed to signed values.
8578
8579         And make the following changes as well:
8580         Fix copyright notice, as 1999 was missing.
8581         (verify): New macro.
8582         (strtoimax): Check sizes at compile-time, not run-time.
8583         Prefer strtol to strtoll if both work.
8584         (main): Remove; it was not that useful and was a pain to maintain.
8585
8586         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8587
8588 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8589
8590         * savedir.c (savedir): Remove size parameter, as POSIX says that
8591         a directory's st_size can have an arbitrary value, so the old
8592         usage could waste an arbitrary amount of memory.  All uses
8593         changed.
8594         * savedir.h: Update prototype.
8595
8596 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8597
8598         * xstrtol.c (strtoimax): New decl.
8599
8600 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8601
8602         * xstrtol.h: Add copyright notice.
8603         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8604         LONGINT_INVALID_SUFFIX_CHAR.
8605
8606 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8607
8608         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8609         tm to be declared.
8610
8611 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8612
8613         * hash.c: Remove '2001' from copyright notice.
8614
8615 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8616
8617         * full-write.h: New file.
8618         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8619         * full-write.c: Correct credits, as cccp.c no longer
8620         exists and anyway it was so heavily changed from the old cccp
8621         code as to be unrecognizable.  Include full-write.h.
8622         (full_write) Return size_t, with short writes meaning failure.
8623         All callers changed.  This fixes a bug with large buffers
8624         on 64-bit hosts.
8625         * utime.c: Include full-write.h.
8626
8627 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8628
8629         Merge 'exclude' changes from tar 1.13.22.
8630         This fixes one or two unlikely storage allocation overflow bugs,
8631         but doesn't change user-visible behavior otherwise.
8632
8633 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8634
8635         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8636         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8637         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8638         Include if available.
8639         (<xalloc.h>): Include
8640         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8641         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8642         collide with FNM macros.
8643         (struct patopts): New struct.
8644         (struct exclude): Use it, as exclude patterns now come with options.
8645         (new_exclude): Support above changes.
8646         (new_exclude, add_exclude_file):
8647         Initial size must now be a power of two to simplify overflow checking.
8648         (free_exclude, fnmatch_no_wildcards): New function.
8649         (excluded_filename): No longer requires options arg, as the options
8650         are determined by add_exclude.  Now returns bool, not int.
8651         (excluded_filename, add_exclude):
8652         Add support for the fancy new exclusion options.
8653         (add_exclude, add_exclude_file): Now takes int options arg.
8654         Check for arithmetic overflow when computing sizes.
8655         (add_exclude_file): xrealloc might modify errno, so don't
8656         realloc until after errno might be used.
8657
8658         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8659         New macros.
8660         (free_exclude): New decl.
8661         (add_exclude, add_exclude_file): Now takes int options arg.
8662         (excluded_filename): No longer requires options arg, as the options
8663         are determined by add_exclude.  Now returns bool, not int.
8664
8665 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8666
8667         * alloca.c (alloca): Arg is of type size_t, not unsigned.
8668
8669 2001-08-27  Jim Meyering  <meyering@lucent.com>
8670
8671         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8672
8673         * version-etc.c (N_): Remove definition.
8674         Revert most of last change.
8675         Instead, simply don't mark the `Copyright...' string for translation.
8676         Based on advice from Paul Eggert.
8677
8678         * strtoxmax.c: Tweak comment.
8679
8680 2001-08-26  Jim Meyering  <meyering@lucent.com>
8681
8682         * version-etc.c (version_etc_copyright_fmt): Replace literal year
8683         of copyright with `%s' so translators don't get an untranslated
8684         message in 2002.
8685         (COPYRIGHT_YEAR): Define.
8686         (version_etc): Use fprintf rather than fputs.
8687         Suggestion from Ulrich Drepper.
8688
8689         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8690
8691         * strtoll.c: New file, from GNU libc.
8692         * xstrtoimax.c: New file.
8693
8694         * xstrtol.h: Add xstrtoimax.
8695         * strtoumax.c: New file.  Simply include "strtoumax.c".
8696         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
8697
8698         * strtoumax.c: Factor to work both for unsigned and signed types, ...
8699         * strtoxmax.c: ... then renamed to this.
8700
8701 2001-08-13  Paul Eggert  <eggert@twinsun.com>
8702
8703         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
8704         Port to Solaris 8, where 'sed' requires a space after the 'r'
8705         command, and where sh dislikes "$/".  Clean up the spacing a bit.
8706         Redirect output to $tmp just once.
8707
8708 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
8709
8710         * addext.c (<errno.h>): Include.
8711         (errno): Declare if not defined.
8712         (addext): Work correctly when pathconf returns -1 and leaves
8713         errno alone because there is no limit.  Also, work even if
8714         pathconf returns a value greater than SIZE_MAX.
8715
8716 2001-08-12  Jim Meyering  <meyering@lucent.com>
8717
8718         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
8719         Simply `return getcwd (NULL, 0);'.
8720         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
8721         Use 1300 as initial value for length, not PATH_MAX.
8722
8723         * pathmax.h: Clean up cpp syntax.
8724
8725 2001-08-12  Jim Meyering  <meyering@lucent.com>
8726
8727         * gettimeofday.c: New file.
8728         * gtod.h: New file.
8729         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
8730
8731 2001-08-04  Jim Meyering  <meyering@lucent.com>
8732
8733         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
8734         to get in sync with glibc.
8735
8736 2001-08-03  Paul Eggert  <eggert@twinsun.com>
8737
8738         The following changes are from gettext 0.10.39 as maintained by
8739         Bruno Haible.
8740
8741         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
8742         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
8743         with inverted sense.  All uses changed.
8744
8745         * mbswidth.c: Don't include <limits.h>.
8746         Include <stdlib.h> and <string.h> unconditionally.
8747         (iswcntrl, mbsinit, ISCNTRL): New macros.
8748         (mbsnwidth): Use K&R style function declarations.
8749         Don't bother checking for MB_LEN_MAX == 1, since the compiler
8750         can optimize it when MB_CUR_MAX == 1.
8751         The width of control characters is zero, not 1.
8752
8753 2001-07-15  Jim Meyering  <meyering@lucent.com>
8754
8755         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
8756         (BUILT_SOURCES): Add unlocked-io.h.
8757         (io_functions): Define.
8758         (unlocked-io.h): New rule.
8759         (DISTCLEANFILES): Add unlocked-io.h.
8760         (all-local): Depend on unlocked-io.h, to ensure it is created.
8761
8762         * unlocked-io.hin: New file
8763
8764         * regex.c: Update from glibc.
8765
8766 2001-07-05  Jim Meyering  <meyering@lucent.com>
8767
8768         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
8769         recommendation.
8770         (libfetish_a_SOURCES): Put all .h files here instead.
8771         Remove a thus-exposed (better checks in automake) duplicate and
8772         two unnecessary .h files.
8773
8774 2001-06-11  Jim Meyering  <meyering@lucent.com>
8775
8776         * regex.c: Update from GNU libc.
8777
8778 2001-05-27  Jim Meyering  <meyering@lucent.com>
8779
8780         * readutmp.h (UT_TYPE): Define.
8781
8782 2001-05-24  Jim Meyering  <meyering@lucent.com>
8783
8784         * argmatch.c: Include "quote.h".
8785         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
8786         quote function.  Reported by Göran Uddeborg.
8787
8788 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
8789
8790         * dirname.c (dir_name): Compute append_dot using path, not newpath
8791         which is not yet declared.
8792
8793 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8794
8795         * Makefile.am (libfetish_a_SOURCES):
8796         Add strftime.c, since we now compile it on all hosts.
8797
8798         * strftime.c (my_strftime):
8799         Define to nstrftime if emacs, but only if my_strftime is not defined.
8800         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
8801         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
8802         Add one more extra argument: a nanoseconds value.
8803         All uses changed.
8804         (ns): New macro.
8805         (my_strftime function): Add %N format.
8806         (emacs_strftimeu): Renamed from emacs_strftime,
8807         with extra ut argument.
8808
8809 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8810
8811         dirname code cleanup.  base_name now behaves more compatibly
8812         with POSIX basename when given file names that have trailing
8813         slashes, and similarly for dir_name.  Add new primitives
8814         base_len and dir_len.  Put the directory-name-related decls
8815         into dirname.h.
8816
8817         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
8818         * backupfile.c (base_name): Likewise.
8819         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
8820         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
8821         * makepath.c (strip_trailing_slashes): Likewise.
8822         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
8823         Likewise.
8824         * rename.c (strip_trailing_slashes): Likewise.
8825         * same.c (base_name): Likewise.
8826         * stripslash.c (ISSLASH): Likewise.
8827
8828         * addext.c: Include <dirname.h> after size_t is defined.
8829         * backupfile.c: Likewise.
8830
8831         * addext.c (addext): Use base_len to trim redundant
8832         trailing slashes instead of doing it ourselves.
8833         But do not trim the last slash if it is not redundant.
8834
8835         * backupfile.c (find_backup_file_name,
8836         max_backup_version): Use base_len instead of rolling it ourselves.
8837         Handle the case of "" and (on DOS) "C:" correctly.
8838
8839         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
8840         Include <string.h>, <dirname.h>.
8841         (base_name): Allow file names ending in slashes, other than names
8842         that are all slashes.  In this case, return the basename followed
8843         by the slashes.  This is more general, and can be used in places
8844         where the original base_name purposely had an assertion failure.
8845         (base_len): New function.
8846
8847         * dirname.c: Include <string.h> instead of <stdlib.h>.
8848         Do not include <assert.h>; no longer needed.
8849         Include xalloc.h.
8850         (memrchr): Remove decl.
8851         (dir_name_r): Remove.
8852         (dir_len): Renamed from dirlen.  All callers changed.
8853         Rewrite in terms of base_name, for simplicity and consistency.
8854         (dir_name): Never return NULL.  All callers changed.
8855         Do not include <stdlib.h> in test program; no longer needed.
8856         return 0; is fine for test program.
8857
8858         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
8859         New macros.
8860         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
8861
8862         * path-concat.c (path_concat): Use base_len to compute
8863         base length, not strlen; this means we cannot rely on memcpy
8864         to null-terminate.
8865
8866         * same.c (STREQ): Remove.
8867         (same_name): Handle the case where the basename ends in trailing '/'.
8868
8869         * stripslash.c (strip_trailing_slashes): Return nonzero if
8870         a slash was stripped.  Do not strip the last slash after a
8871         file system prefix.
8872
8873 2001-04-08  Jim Meyering  <meyering@lucent.com>
8874
8875         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
8876         recomputed; that's necessary when the offset spans a DST transition.
8877         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
8878
8879 2001-04-02  Jim Meyering  <meyering@lucent.com>
8880
8881         * regex.h, regex.c: Update from GNU libc.
8882
8883 2001-03-19  Paul Eggert  <eggert@twinsun.com>
8884
8885         * version-etc.c (version_etc_copyright): Update to 2001.
8886
8887 2001-03-16  Paul Eggert  <eggert@twinsun.com>
8888
8889         * tempname.c (uint64_t): Define to uintmax_t if
8890         not defined, and if UINT64_MAX is not defined.
8891         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
8892         Reported by John David Anglin.
8893
8894 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
8895
8896         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
8897         alias if codeset is empty.
8898         * config.charset (BeOS): Use wildcard syntax.
8899
8900 2001-03-13  Jim Meyering  <meyering@lucent.com>
8901
8902         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
8903         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
8904         From Bruno Haible.
8905
8906 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
8907
8908         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
8909         Don't return NULL.
8910         * unicodeio.c (print_unicode_char): Simplify accordingly.
8911
8912 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
8913
8914         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
8915         support for DOS/DJGPP.
8916
8917 2001-02-28  Paul Eggert  <eggert@twinsun.com>
8918
8919         * Makefile.am (libfetish_a_SOURCES):
8920         Add dup-safer.c, fopen-safer.c.
8921         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
8922
8923         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
8924
8925 2001-02-25  Paul Eggert  <eggert@twinsun.com>
8926
8927         The mkstemp replacement is taken from glibc 2.2.2, with some
8928         portability fixes for use outside glibc, as follows:
8929
8930         * tempname.c (struct_stat64): New macro.
8931         (direxists, __gen_tempname): Use it.
8932         This avoids a portability problem with Solaris 8.
8933
8934         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
8935         (<stddef.h>, <stdint.h>, <string.h>):
8936         Include only if STDC_HEADERS || _LIBC.
8937         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
8938         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
8939         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
8940         (__set_errno): Define this macro if <errno.h> doesn't.
8941         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
8942         Define these macros if <stdio.h> doesn't.
8943         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
8944         Define these macros if <sys/stat.h>
8945         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
8946         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
8947         __xstat64): Define if not _LIBC.
8948         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
8949         (__gen_tempname): Invoke gettimeofday only if
8950         HAVE_GETTIMEOFDAY || _LIBC;
8951         otherwise, fall back on plain "time".
8952         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
8953
8954         * mkstemp.c (__GT_FILE): Define to zero if not defined.
8955
8956         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
8957
8958 2001-02-17  Jim Meyering  <meyering@lucent.com>
8959
8960         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
8961         around included file name.
8962
8963         * strnlen.c (__strnlen): Merge in a change from GNU libc.
8964
8965         * strftime.c: Update from GNU libc (the only changes were to comments).
8966
8967 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
8968
8969         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
8970
8971 2001-02-17  Paul Eggert  <eggert@twinsun.com>
8972
8973         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
8974         Remove workaround macros for hosts that have mbrtowc but not
8975         mbstate_t, as we now insist on proper declarations for both
8976         before using mbrtowc.
8977
8978 2001-02-17  Jim Meyering  <meyering@lucent.com>
8979
8980         * regex.c: Update from libc.
8981
8982 2001-02-16  Paul Eggert  <eggert@twinsun.com>
8983
8984         * alloca.c (malloc): Undef before defining, since stdlib.h
8985         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
8986         Reported by Mark Hounschell via Paul Eggert.
8987
8988 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
8989
8990         * config.charset: Update for FreeBSD 4.2.
8991
8992 2001-01-26  Jim Meyering  <meyering@lucent.com>
8993
8994         * quotearg.c: Include stddef.h.
8995         * quote.c: Include stddef.h.
8996         Reported by Axel Kittenberger.
8997
8998         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
8999         line in double quotes so that it evokes a better diagnostic.
9000         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9001         Reported by Axel Kittenberger.
9002
9003 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9004
9005         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9006         to avoid a warning.  Add back 'const' to inptr.
9007
9008 2001-01-16  Jim Meyering  <meyering@lucent.com>
9009
9010         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9011         From Bruno Haible.
9012
9013 2001-01-14  Jim Meyering  <meyering@lucent.com>
9014
9015         * rename.c: New file.  From Volker Borchert.
9016         Include stdlib.h, string.h or strings.h, and xalloc.h.
9017         Use strip_trailing_slashes rather than open-coding it.
9018
9019 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9020
9021         * strftime.c: Sync with glibc time/strftime.c 1.81.
9022
9023 2001-01-03  Jim Meyering  <meyering@lucent.com>
9024
9025         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9026         local `inptr' to avoid warning with some system declarations of iconv.
9027
9028 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9029
9030         * modechange.c: Do not assume that mode_t uses the
9031         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9032         the other-execute bit of FOO even if S_IXOTH != 1.
9033
9034         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9035         WOTH, XOTH, ALLM): New macros.
9036         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9037          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9038         Use them.
9039         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9040         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9041         (mode_compile):
9042         No need to use uintmax_t; unsigned long is long enough.
9043         Don't bother to get suffix since we don't use it.
9044
9045 2000-12-24  Jim Meyering  <meyering@lucent.com>
9046
9047         * hash.c (is_prime): Return explicit boolean values.
9048         (hash_get_first): Return NULL to appease Irix5.6's 89.
9049         Reported by Nelson Beebe.
9050
9051 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9052
9053         * localcharset.c (locale_charset): Add support for Win32.
9054
9055 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9056
9057         * physmem.h, physmem.c: New files.
9058
9059         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9060         (noinst_HEADERS): Add physmem.h.
9061
9062         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9063         't' for compatibility with Solaris 8 sort.
9064
9065 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9066
9067         * config.charset: Add support for BeOS.
9068
9069 2000-12-16  Jim Meyering  <meyering@lucent.com>
9070
9071         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9072         SHELLS_FILE to a file name that's useful on djgpp systems.
9073         Include stdlib.h.
9074         (ADDITIONAL_DEFAULT_SHELLS): Define.
9075         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9076         Based mostly on a patch from Prashant TR.
9077
9078 2000-12-16  Jim Meyering  <meyering@lucent.com>
9079
9080         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9081         N and M) would have treated it like `chown N:N FILE'.
9082
9083         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9084
9085 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9086
9087         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9088         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9089         to the list of canonical encodings. Rename EUC-CN to GB2312.
9090
9091 2000-12-08  Andreas Schwab  <schwab@suse.de>
9092
9093         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9094         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9095
9096 2000-12-07  Jim Meyering  <meyering@lucent.com>
9097
9098         * stripslash.c (ISSLASH): Define.
9099         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9100         From Prashant TR.
9101
9102         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9103         (dir_name_r): Declare this function as static.
9104         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9105         manifest itself on a name containing a mix of slashes and
9106         backslashes.
9107         Make this function work with names starting with a DOS-style
9108         drive letter and colon prefix.
9109         (dir_name): Append `.' if necessary.
9110         Based mostly on patches from Prashant TR and Eli Zaretskii.
9111
9112         * dirname.h (dir_name_r): Remove prototype.
9113
9114 2000-12-05  Jim Meyering  <meyering@lucent.com>
9115
9116         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9117
9118 2000-12-04  Jim Meyering  <meyering@lucent.com>
9119
9120         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9121         Also include memory.h, stdlib.h, unistd.h if appropriate.
9122         Reported by Andreas Jaeger (conflicting declaration of malloc).
9123
9124 2000-12-02  Jim Meyering  <meyering@lucent.com>
9125
9126         * closeout.h: Make idempotent, to avoid some obscure warnings.
9127
9128 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9129
9130         * memrchr.c: Include <config.h> before any system include file.
9131
9132 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9133
9134         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9135
9136 2000-11-26  Jim Meyering  <meyering@lucent.com>
9137
9138         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9139
9140 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9141
9142         * strftime.c (my_strftime): Do not invoke mbrlen with a
9143         size of (size_t) -1; it's not portable.
9144
9145 2000-11-17  Akim Demaille  <akim@epita.fr>
9146
9147         * obstack.h: Formatting changes.
9148         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9149         prevent type checking.
9150         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9151         cast the value to (void *): assigning a `foo *' to a `void *'
9152         variable is valid.
9153         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9154
9155 2000-11-17  Jim Meyering  <meyering@lucent.com>
9156
9157         * strstr.c: Update from GNU libc.
9158
9159 2000-11-16  Jim Meyering  <meyering@lucent.com>
9160
9161         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9162
9163 2000-11-11  Jim Meyering  <meyering@lucent.com>
9164
9165         * error.c: Add a couple #includes, merging from GNU libc version.
9166
9167 2000-11-10  Jim Meyering  <meyering@lucent.com>
9168
9169         * obstack.h: Update from GNU libc.
9170         * obstack.c: Likewise.
9171
9172 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9173
9174         * getusershell.c (setusershell): Use rewind rather than
9175         fseek/fseeko, to avoid configuration hassles with fseeko.
9176         Don't bother opening SHELLS_FILE if shellstream is NULL;
9177         it's not necessary.
9178
9179 2000-11-05  Jim Meyering  <meyering@lucent.com>
9180
9181         * makepath.h (make_dir): Declare.
9182         * makepath.c (make_dir): Remove `static' attribute.
9183         Tweak a comment.
9184
9185 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9186
9187         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9188         last one in a bucket, advance to the next bucket.
9189
9190 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9191
9192         * fnmatch.c: Do not comment out all the code if we are using
9193         the GNU C library, because in some cases we are replacing buggy
9194         code in the GNU C library itself.
9195
9196 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9197
9198         * error.h, getline.h, modechange.h:
9199         Remove "2000" from Copyright line, as the file hasn't been
9200         changed this year other than in the copyright notice.
9201
9202         * xalloc.h: Add "2000" to Copyright line, as this file
9203         was changed this year.
9204
9205 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9206
9207         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9208         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9209         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9210
9211 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9212
9213         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9214         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9215         doesn't define __restrict_arr.
9216
9217 2000-10-29  Jim Meyering  <meyering@lucent.com>
9218
9219         * xstat.in: Fix grammar in comment.
9220
9221 2000-10-28  Jim Meyering  <meyering@lucent.com>
9222
9223         * memchr.c: Update from libc.
9224         Adjust for portability:
9225         [HAVE_STDLIB_H]: Include stdlib.h.
9226         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9227         Undef __memchr, too.
9228         [!weak_alias]: Define __memchr to memchr.
9229
9230         * regex.c: Update from libc.
9231         * regex.h: Likewise.
9232         * getopt1.c: Likewise.
9233         * memcmp.c: Likewise.
9234
9235         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9236         Avoid using fseek, when possible -- it's broken by design.
9237         Patch by Ulrich Drepper.
9238
9239 2000-10-26  Jim Meyering  <meyering@lucent.com>
9240
9241         * strftime.c: Update from libc.
9242
9243 2000-10-25  Jim Meyering  <meyering@lucent.com>
9244
9245         * obstack.c: Update from libc.
9246
9247 2000-10-23  Jim Meyering  <meyering@lucent.com>
9248
9249         * hard-locale.c (hard_locale): Revert last change -- it was simply
9250         wrong.  That set_locale call must not have any side effects.
9251         From Paul Eggert.
9252
9253 2000-10-22  Jim Meyering  <meyering@lucent.com>
9254
9255         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9256         [CYCLIC]: Remove now-unused definition.
9257
9258         * save-cwd.c (O_DIRECTORY): Define, if needed.
9259         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9260         Suggestion from Ulrich Drepper.
9261
9262 2000-10-21  Jim Meyering  <meyering@lucent.com>
9263
9264         * dirname.c (dir_name_r): New function, factored out of dir_name.
9265         (dir_name): Use dir_name_r.
9266         * dirname.h (dir_name_r): Declare it.
9267
9268 2000-10-21  Jim Meyering  <meyering@lucent.com>
9269
9270         * dirname.c (memrchr): Declare if necessary.
9271         (dir_name): Remove the restriction that there be no
9272         trailing slashes.  Now, this code skips past them, effectively
9273         ignoring them.
9274         [TEST_DIRNAME] (main): New unit tests.
9275
9276         * memrchr.c: New file from GNU libc.
9277         Undef __memrchr, too.
9278         [!weak_alias]: Define __memrchr to memrchr.
9279         Guard weak_alias use with `#ifdef weak_alias'.
9280
9281 2000-10-17  Jim Meyering  <meyering@lucent.com>
9282
9283         * quote.h (PARAMS): Define and use.
9284         Reported by Akim Demaille.
9285
9286         * getopt.c: Update from libc.
9287
9288 2000-10-16  Jim Meyering  <meyering@lucent.com>
9289
9290         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9291         From Jan Fedak.
9292
9293 2000-09-25  Jim Meyering  <meyering@lucent.com>
9294
9295         * md5.h (rol): Define (from GnuPG).
9296
9297         * sha.c: Give credit (GnuPG) where due.
9298         (M): Use rol rather than open-coding it.
9299         Add a FIXME comment.
9300
9301 2000-09-21  Jim Meyering  <meyering@lucent.com>
9302
9303         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9304         Reported by Michael Stone.
9305
9306 2000-09-20  Jim Meyering  <meyering@lucent.com>
9307
9308         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9309         (noinst_HEADERS): Add sha.h.
9310         Based on code from Scott G. Miller and from GnuPG.
9311
9312 2000-09-15  Jim Meyering  <meyering@lucent.com>
9313
9314         * regex.c: Update from libc.
9315
9316 2000-09-10  Jim Meyering  <meyering@lucent.com>
9317
9318         * getopt.c (_getopt_internal): Update from glibc.
9319
9320 2000-09-09  Jim Meyering  <meyering@lucent.com>
9321
9322         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9323         think it should be used as a general replacement for isascii.
9324         * fnmatch.c: Likewise.
9325         * mbswidth.c: Likewise
9326         * regex.c: Likewise.
9327
9328         Don't use atoi.
9329         * userspec.c: Include sys/param.h and limits.h.
9330         Include xstrtol.h.
9331         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9332         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9333         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9334         UID, GID.  Check range.
9335
9336 2000-09-06  Jim Meyering  <meyering@lucent.com>
9337
9338         * getopt.c (_getopt_internal): Update from glibc.
9339
9340 2000-08-30  Jim Meyering  <meyering@lucent.com>
9341
9342         * strftime.c: Merge in changes from GNU libc.
9343
9344 2000-08-26  Jim Meyering  <meyering@lucent.com>
9345
9346         * closeout.c: Include "__fpending.h".
9347         (close_stdout_status): Return right away if there's nothing to flush.
9348
9349         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9350         * __fpending.c: New file.
9351         * __fpending.h: New file.
9352
9353 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9354
9355         Standardize on "memory exhausted" instead of "Memory exhausted"
9356         or "virtual memory exhausted".
9357         * obstack.c (print_and_abort): Use "memory exhausted", not
9358         "virtual memory exhausted".
9359         * same.c (same_name): Invoke xalloc_die instead of printing
9360         our own message.
9361         * userspec.c (parse_user_spec): Likewise.
9362         * bumpalloc.h: comment fix
9363         * same.c, userspec.c: Include xalloc.h.
9364
9365         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9366         not char *const and pointing to a constant array.
9367         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9368         (xrealloc): Comment fix.
9369
9370         * userspec.c (parse_user_spec):
9371         Don't translate a message until just before returning,
9372         to avoid unnecessary translation.
9373
9374 2000-08-07  Jim Meyering  <meyering@lucent.com>
9375
9376         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9377         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9378         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9379         getgroups.c, gethostname.c, getopt.h, group-member.c,
9380         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9381         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9382         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9383         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9384         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9385         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9386         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9387         yesno.c: Back out Copyright date changes for each file with no change
9388         this year.  This eases coordination with other programs using the same
9389         source code modules.  From Paul Eggert.
9390
9391 2000-08-03  Greg McGary  <greg@mcgary.org>
9392
9393         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9394         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9395         (EXTEND_BUFFER): Use them.
9396
9397 2000-08-01  Jim Meyering  <meyering@lucent.com>
9398
9399         * dirname.c (ISSLASH): Define.
9400         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9401         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9402         both `\' and `/' may be use as path separators.
9403         Based on a patch from Prashant TR.
9404
9405 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9406
9407         * quotearg.c (quotearg_n_options): Don't make the initial
9408         slot vector a constant, since it might get modified.
9409
9410 2000-07-31  Jim Meyering  <meyering@lucent.com>
9411
9412         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9413         * obstack.c (print_and_abort): Likewise.
9414
9415 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9416
9417         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9418         buffer, so that the caller can always quote one small
9419         component of a "memory exhausted" message in slot 0.
9420         From a suggestion by Jim Meyering.
9421
9422 2000-07-30  Jim Meyering  <meyering@lucent.com>
9423
9424         * makepath.c (make_path): Quote the other instance, too.
9425
9426         * quotearg.c (N_STATIC_SLOTVECS): Define.
9427         (STATIC_BUF_SIZE): Define.
9428         (quotearg_n_options): Use only statically allocated storage when
9429         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9430         than STATIC_BUF_SIZE.
9431
9432 2000-07-29  Jim Meyering  <meyering@lucent.com>
9433
9434         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9435         * dirname.c (dir_name): Likewise.
9436
9437         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9438
9439         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9440         (dir_name): Assert that there are no trailing slashes.
9441
9442 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9443
9444         * mbswidth.h (mbswidth): Add a flags argument.
9445         (mbswidth): New declaration.
9446         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9447         * mbswidth.c (mbswidth): Add a flags argument.
9448         (mbsnwidth): New function.
9449
9450 2000-07-24  Jim Meyering  <meyering@lucent.com>
9451
9452         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9453
9454 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9455
9456         * mbswidth.c (_XOPEN_SOURCE):
9457         Don't define; this causes problems on Solaris 7.
9458         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9459
9460 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9461
9462         * quotearg.c:
9463         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9464         so that mbstate_t is always defined.
9465
9466         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9467         be 1 in at least one GCC installation, and this configuration
9468         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9469         performance on hosts that have mbrtowc but have only unibyte
9470         locales, but I assume these hosts are rare.
9471
9472 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9473
9474         * quotearg.c: Streamline by invoking multibyte code only if needed.
9475         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9476         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9477         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9478         invoke multibyte primitives.
9479
9480 2000-07-23  Jim Meyering  <meyering@lucent.com>
9481
9482         * basename.c (base_name): Add an assertion.
9483
9484 2000-07-15  Bruno Haible  <clisp.cons.org>
9485
9486         * quotearg.c: When the system forces us to redefine mbstate_t,
9487         shadow its mbsinit function.
9488
9489 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9490
9491         * mbswidth.h: New file.
9492         * mbswidth.c: New file.
9493         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9494         (noinst_HEADERS): Add mbswidth.h.
9495
9496 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9497
9498         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9499         and IRIX 6.
9500
9501 2000-07-15  Jim Meyering  <meyering@lucent.com>
9502
9503         * makepath.c: Include quote.h.
9504         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9505         corresponding argument in a `quote (...)' call.
9506         Give better diagnostics.
9507
9508         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9509         (noinst_HEADERS): Add quote.h.
9510
9511         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9512         from tar's src/misc.c.
9513         * quote.h: New file.  Prototypes for same.
9514
9515 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9516
9517         From a suggestion by Bruno Haible.
9518         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9519         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9520         to decide whether to define the BeOS workaround macro;
9521         this adjusts to the change to AC_MBSTATE_T.
9522
9523 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9524
9525         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9526
9527         * quotearg.c (quoting_style_args, quoting_style_vals,
9528         quotearg_buffer_restyled): Add support for
9529         clocale_quoting_style.  Undo previous change to
9530         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9531         and "{RIGHT QUOTATION MARK}" msgids.
9532
9533 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9534
9535         The old behavior of quoting `like this' doesn't look good with
9536         newer, ISO-style fonts.  See:
9537         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9538
9539         Instead, quote "like this" by default.  Let the translator
9540         tailor the locale-specific quoting behavior by providing
9541         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9542
9543         * quotearg.c (N_): New macro.
9544         (gettext_default): New function.
9545         (quotearg_buffer_restyled): Use
9546         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9547         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9548
9549 2000-07-09  Jim Meyering  <meyering@lucent.com>
9550
9551         * Most files: Update copyright dates to include 2000.
9552
9553 2000-07-08  Jim Meyering  <meyering@lucent.com>
9554
9555         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9556         if not defined.
9557         (xgethostname): Remove now-unnecessary #ifdef.
9558         Move declaration of `err' into loop where it's used.
9559
9560 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9561
9562         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9563         by allocating a larger buffer. Test the gethostname return value for
9564         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9565         returns an error and ENAMETOOLONG isn't defined.
9566
9567 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9568         and Bruno Haible  <haible@clisp.cons.org>
9569
9570         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9571
9572 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9573
9574         * quotearg.c (struct quoting_options): Simplify quote_these_too
9575         dimension.
9576
9577 2000-07-03  Jim Meyering  <meyering@lucent.com>
9578
9579         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9580         Reported by Bruno Haible.
9581
9582 2000-07-04  Jim Meyering  <meyering@lucent.com>
9583
9584         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9585         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9586         lacks mbrtowc.
9587
9588 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9589         and Bruno Haible  <haible@clisp.cons.org>
9590
9591         * quotearg.c (mbrtowc):
9592         Assign to *pwc, and return 1 only if result is nonzero.
9593         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9594
9595 2000-07-03  Jim Meyering  <meyering@lucent.com>
9596
9597         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9598         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9599         From Bob Proulx.
9600
9601 2000-07-02  Jim Meyering  <meyering@lucent.com>
9602
9603         * quotearg.c (mbstate_t): Don't define here.
9604
9605 2000-07-02  Jim Meyering  <meyering@lucent.com>
9606
9607         * nanosleep.c (SIGCONT): Define if not already defined.
9608
9609 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9610
9611         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9612         per change in ../m4/ls-mntd-fs.m4.
9613         (read_filesystem_list): Ignore symbolic links.
9614
9615 2000-06-29  Jim Meyering  <meyering@lucent.com>
9616
9617         * same.c: Include <string.h> or <strings.h>, as appropriate,
9618         for declaration of strcmp.
9619
9620         * long-options.c: Include <stdlib.h>, for declaration of exit.
9621
9622         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9623         Avoid warning by casting result to `char *' to remove `const'.
9624
9625 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9626
9627         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9628
9629 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9630
9631         savedir now sets errno on failure and invokes xmalloc to get memory.
9632         Fix a couple of other minor bugs while we're at it.
9633
9634         * savedir.c (<unistd.h>): Do not include; there's no need.
9635         (NAMLEN): Remove macro.
9636         (malloc, realloc): Remove decls.
9637         (stpcpy): Likewise.
9638         ("xalloc.h"): Include.
9639         (NAME_SIZE_DEFAULT): New macro.
9640         (savedir): Use xmalloc / xrealloc to allocate memory.
9641         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9642         Skip "" directory entries.
9643         Use strlen to calculate directory entry length, since the old method
9644         is rarely used these days and isn't worth supporting.
9645         Don't use a pointer after freeing it.
9646         Check for integer overflow when calculating allocation size.
9647         Use memcpy to copy entries, instead of stpcpy.
9648         Set errno properly when returning NULL.
9649         Check for readdir error.
9650
9651 2000-06-26  Jim Meyering  <meyering@lucent.com>
9652
9653         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9654
9655 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9656
9657         * getusershell.c (xmalloc, xrealloc): Remove functions.
9658         Include xalloc.h.
9659         Don't include <stdlib.h>.  Don't declare malloc, realloc.
9660
9661 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
9662
9663         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9664
9665 2000-06-24  Jim Meyering  <meyering@lucent.com>
9666
9667         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9668
9669 2000-06-21  Jim Meyering  <meyering@lucent.com>
9670
9671         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
9672
9673 2000-06-19  Paul Eggert  <eggert@twinsun.com>
9674
9675         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9676         (mbrtowc, mbstate_t): Define substitutes if
9677         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9678         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9679         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9680
9681 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9682
9683         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9684         than 1024, return a memory chunk of least possible size, instead
9685         of size PATH_MAX + 2. In the loop, increment the size proportionally.
9686         Use free/xmalloc instead of xrealloc to avoid copying for very long
9687         paths.
9688
9689 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9690
9691         * canon-host.c (canon_host): Use malloc and memcpy to copy an
9692         address, not strdup.  Include <stdlib.h> and don't declare free().
9693
9694 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9695
9696         * path-concat.c (path_concat): Don't access dir[-1] if dir is
9697         the empty string.
9698
9699 2000-06-21  Jim Meyering  <meyering@lucent.com>
9700
9701         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
9702         (noinst_HEADERS): Add getstr.h.
9703
9704         * getline.c (getstr): Move into a separate file.
9705         * getstr.c (getstr): New file, extracted from getline.c, with
9706         the following changes: new parameter, delim2; both delim[12]
9707         parameters have type `int', not `char'.  The latter would lose
9708         with 8-bit delimiters.
9709         * getstr.h: New file.
9710
9711 2000-06-19  Jim Meyering  <meyering@lucent.com>
9712
9713         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
9714
9715 2000-06-18  Jim Meyering  <meyering@lucent.com>
9716
9717         * mkdir.c: Remove file, due mainly to copyright incompatibility.
9718         Besides, these days every porting target provides a mkdir function.
9719
9720         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
9721         (this snippet comes from src/system.h).
9722
9723 2000-06-15  Paul Eggert  <eggert@twinsun.com>
9724
9725         * human.c (adjust_value): New function.
9726         (human_readable_inexact): Apply rounding style even when
9727         printing approximate values.
9728
9729 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9730
9731         * human.c (human_readable_inexact): Allow an input block
9732         size that is not a multiple of the output block size, and vice versa.
9733         Reported by Piergiorgio Sartor.
9734
9735 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9736
9737         * getdate.y (get_date): Apply relative times after time
9738         zone indicator, not before.  Reported by Todd A. Jacobs.
9739
9740 2000-06-13  Jim Meyering  <meyering@lucent.com>
9741
9742         * Makefile.am (all-local): Depend on lstat.c and stat.c.
9743
9744         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
9745
9746 2000-06-12  Paul Eggert  <eggert@twinsun.com>
9747
9748         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
9749
9750 2000-06-04  Paul Eggert  <eggert@twinsun.com>
9751
9752         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
9753
9754 2000-06-04  Jim Meyering  <meyering@lucent.com>
9755
9756         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
9757         SunOS 4.1.4 for which gid_t is an unsigned type.
9758
9759 2000-06-03  Jim Meyering  <meyering@lucent.com>
9760
9761         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
9762
9763 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
9764
9765         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
9766         newer, don't install charset.alias.
9767         * config.charset: Change the Linux/glibc rules so they become empty
9768         on glibc-2.1 or newer.
9769
9770 2000-06-02  Jim Meyering  <meyering@lucent.com>
9771
9772         * mountlist.c: Back out last change.  Instead, do this...
9773         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
9774         member using the same `ignore'-testing code.
9775         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
9776         fs_type strings.
9777         From Mark D. Roth.
9778
9779 2000-05-29  Jim Meyering  <meyering@lucent.com>
9780
9781         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
9782         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
9783
9784 2000-05-22  Jim Meyering  <meyering@lucent.com>
9785
9786         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
9787
9788 2000-05-18  Jim Meyering  <meyering@lucent.com>
9789
9790         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
9791         back, too, since it may have been modified by allocate_entry.
9792         (hash_delete): Rewrite to use neither the assignment operator
9793         nor the comma operator in an if-expression.
9794
9795 2000-05-15  Paul Eggert  <eggert@twinsun.com>
9796
9797         * closeout.c:
9798         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
9799         Remove; no longer needed.
9800         "quotearg.h": Add include.
9801         (file_name): Do not bother to explicitly initialize to NULL; it's less
9802         efficient on some hosts.
9803         (close_stdout_status): Remove test as to whether stdout was already
9804         closed; it breaks for the case "echo x | sort >&-".
9805         Quote file name colons.
9806         Do not assume that _("write error") lacks format strings.
9807
9808 2000-05-15  Jim Meyering  <meyering@lucent.com>
9809
9810         * version-etc.c (version_etc_copyright): Update the copyright string
9811         used in all --version output.
9812
9813 2000-05-14  Jim Meyering  <meyering@lucent.com>
9814
9815         * closeout.c (close_stdout_set_file_name): New function.
9816         (close_stdout_status): Use new file-scoped global.
9817         Return right away if fstat says the stdout file descriptor is invalid.
9818         * closeout.h (close_stdout_set_file_name): Declare.
9819
9820 2000-05-10  Jim Meyering  <meyering@lucent.com>
9821
9822         * closeout.c [default_exit_status]: New file-scoped variable.
9823         (close_stdout_set_status): New function.
9824         * closeout.h (close_stdout_set_status): Declare.
9825
9826 2000-05-08  Jim Meyering  <meyering@lucent.com>
9827
9828         * long-options.c: Don't include closeout.h.
9829         (parse_long_options): Don't call close_stdout for --version.
9830
9831 2000-05-06  Jim Meyering  <meyering@lucent.com>
9832
9833         * strnlen.c: Undefine __strnlen and strnlen.
9834         [!weak_alias]: Define __strnlen to strnlen.
9835
9836         * atexit.c: New file, from libiberty.
9837
9838 2000-05-06  Jim Meyering  <meyering@lucent.com>
9839
9840         * closeout.c (close_stdout_status): Also check for errors on the
9841         stderr stream.
9842
9843 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
9844
9845         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
9846         instead of xmalloc, xrealloc, path_concat.
9847         (locale_charset): Treat empty environment variables as absent.
9848         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
9849
9850 2000-05-04  Jim Meyering  <meyering@lucent.com>
9851
9852         * getopt.c: Update from glibc.
9853         * obstack.c: Likewise.
9854         * obstack.h: Likewise.
9855         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
9856
9857         * regex.h: Likewise.
9858         * strndup.c: Likewise.
9859         * strnlen.c: New file, from glibc.
9860
9861 2000-05-01  Jim Meyering  <meyering@lucent.com>
9862
9863         * full-write.c (full_write): Remove `FIXME' part of comment.
9864
9865 2000-04-29  Jim Meyering  <meyering@lucent.com>
9866
9867         * path-concat.c: Declare strdup only if it's not defined.
9868         * canon-host.c: Likewise.
9869
9870 2000-04-28  Jim Meyering  <meyering@lucent.com>
9871
9872         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
9873         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
9874         included first, then limits.h is included by locale.h by libintl.h.
9875         From John David Anglin.
9876
9877 2000-04-25  Jim Meyering  <meyering@lucent.com>
9878
9879         * makepath.c (S_IRWXUGO): Define.
9880         (make_path): Always perform explicit chmod if MODE specifies any
9881         of the `special' permission bits.  Prompted by a bug report against
9882         install from Mate Wierdl and Joost van Baal.
9883
9884 2000-04-18  Jim Meyering  <meyering@lucent.com>
9885
9886         * README: New file.
9887
9888         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
9889         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
9890
9891 2000-04-17  Jim Meyering  <meyering@lucent.com>
9892
9893         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
9894         the definition of it to rpl_strftime also defined-away the system's
9895         declaration.
9896
9897 2000-04-15  Jim Meyering  <meyering@lucent.com>
9898
9899         Use `C' to denote so-called `contiguous' files, the same way
9900         that tar does.
9901         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
9902         (ftypelet): Use S_ISCTG.
9903         From Michael Deutschmann.
9904
9905 2000-04-14  Jim Meyering  <meyering@lucent.com>
9906
9907         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
9908
9909 2000-04-08  Jim Meyering  <meyering@lucent.com>
9910
9911         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
9912         names don't conflict.  Reported by Eli Zaretskii.
9913
9914 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
9915
9916         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
9917         bug.  Deal with the different error behavior of Irix iconv.
9918
9919 2000-04-07  Jim Meyering  <meyering@lucent.com>
9920
9921         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
9922         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
9923
9924 2000-04-05  Jim Meyering  <meyering@lucent.com>
9925
9926         Portability tweaks required for ultrix4.3.
9927         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
9928         * readutmp.c: Include sys/types.h before sys/stat.h.
9929         * canon-host.c: Declare strdup.
9930         * path-concat.c: Likewise.
9931         From John David Anglin.
9932
9933 2000-04-04  Jim Meyering  <meyering@lucent.com>
9934
9935         Be more DOS 8.3-friendly.
9936         * ref-add.sin: Renamed from ref-add.sed.in.
9937         * ref-del.sin: Renamed from ref-del.sed.in.
9938         * Makefile.am: Reflect renaming.
9939         Reported by Eli Zaretskii.
9940
9941         Use a temporary file name that won't clash with `charset.alias'
9942         in the DOS 8.3 name space.
9943         * Makefile.am (charset_tmp): Define.
9944         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
9945         (uninstall-local): Likewise.
9946         Reported by Eli Zaretskii.
9947
9948 2000-03-29  Paul Eggert  <eggert@twinsun.com>
9949
9950         * time/strftime.c (my_strftime): Make sure we call the system
9951         strftime, not ourselves, when invoking the underlying strftime.
9952
9953 2000-03-24  Jim Meyering  <meyering@lucent.com>
9954
9955         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
9956         (charset_alias): Define.
9957         (install-exec-local): Factor out common code.
9958         (uninstall-local): Split lines longer than 80.
9959         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
9960         (SUFFIXES): Define.
9961         (.sed.in.sed): New rule.  Don't redirect directly to $@.
9962         (CLEANFILES): Add ref-add.sed and ref-del.sed.
9963
9964 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
9965
9966         * config.charset: Output a line containing "Packages using this file".
9967         * ref-add.sed.in, ref-del.sed.in: New files.
9968         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
9969         ref-del.sed): New rules.
9970
9971 2000-03-17  Jim Meyering  <meyering@lucent.com>
9972
9973         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
9974         Otherwise, include <strings.h>
9975
9976 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
9977
9978         * unicodeio.c (utf8_wctomb): New function.
9979         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
9980         format instead of in UCS-4 with platform dependent endianness.
9981
9982 2000-03-07  Paul Eggert  <eggert@twinsun.com>
9983
9984         * savedir.c (savedir): Work even if directory size is
9985         negative; this can happen with some screwy NFS configurations.
9986
9987 2000-03-06  Jim Meyering  <meyering@lucent.com>
9988
9989         * localcharset.c (get_charset_aliases): Don't try to free file_name
9990         if it's NULL (because we ran out of memory).  From Bruno Haible.
9991
9992 2000-03-05  Jim Meyering  <meyering@lucent.com>
9993
9994         * localcharset.c ("path-concat.h"): Include.
9995         (get_charset_aliases): Use path_concat instead of ANSI string
9996         concatenation.
9997
9998         * unicodeio.h (PARAMS): Define.
9999         Use it to guard prototype.
10000
10001 2000-03-04  Jim Meyering  <meyering@lucent.com>
10002
10003         * Makefile.am (install-exec-local): Create $(libdir) before installing
10004         into it.
10005         (uninstall-local): Uncomment this rule so `make distcheck' works
10006         once again.
10007
10008         * unicodeio.c (<errno.h>): Include it.
10009         (errno): Declare if not defined.
10010
10011         * localcharset.c: Add Bruno's comment justifying use of volatile.
10012
10013         * config.charset: New version, incorporating remarks from a linux
10014         i18n mailing list.  From Bruno Haible.
10015
10016 2000-03-02  Jim Meyering  <meyering@lucent.com>
10017
10018         * Makefile.am (EXTRA_DIST): Add config.charset.
10019
10020 2000-03-01  Jim Meyering  <meyering@lucent.com>
10021
10022         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10023         * unicodeio.c: Likewise.
10024
10025 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10026
10027         * config.charset: New file.
10028         * localcharset.c: New file.
10029         * unicodeio.h, unicodeio.c: New files.
10030         * Makefile.am (DEFS): Add -DLIBDIR=...
10031         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10032         (noinst_HEADERS): Add unicodeio.h.
10033         (all-local, install-exec-local, charset.alias): New targets.
10034
10035 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10036
10037         * quotearg.c (ALERT_CHAR): New macro.
10038         (quotearg_buffer_restyled): Use it.
10039
10040 2000-02-27  Jim Meyering  <meyering@lucent.com>
10041
10042         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10043         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10044
10045         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10046         not `#if STDC_HEADERS'.
10047         Declare malloc if needed.
10048
10049         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10050         now that autoconf always defines the HAVE_DECL_ symbols.
10051         * human.c: Likewise.
10052         * same.c: Likewise.
10053         * strtoumax.c: Likewise.
10054
10055         * backupfile.c: Arrange for cpp to fail if the configure-time
10056         declaration check was not run.
10057         * hash.c: Likewise.
10058         * human.c: Likewise.
10059         * same.c: Likewise.
10060         * strtoumax.c: Likewise.
10061
10062         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10063         then first look up the entire `.'-containing string as a login name.
10064
10065 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10066
10067         * getdate.y: Handle two-digit years with leading zeros correctly.
10068         (textint): New typedef.
10069         (parser_control): Member year changed from int to textint.
10070         All uses changed.
10071         (YYSTYPE): Removed; replaced by %union with int and textint members.
10072         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10073         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10074         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10075         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10076         (date, number, to_year): Use width of number in digits, not its value,
10077         to determine whether it's a 2-digit year, or a 2-digit time.
10078         (yylex): Store number of digits of numeric tokens.
10079         Reported by John Kendall.
10080
10081         (parser_control): Changed from struct parser_control to typedef (for
10082         consistency).  All uses changed.
10083
10084         (tID): Removed; not used.
10085         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10086
10087 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10088
10089         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10090         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10091
10092 2000-02-12  Jim Meyering  <meyering@lucent.com>
10093
10094         * userspec.c (ISDIGIT): Define it.
10095         (isdigit): Remove definition.
10096         (is_number): Use ISDIGIT, not isdigit.
10097         <libintl.h>: Include.
10098         (_ and N_): Define.
10099         (parse_user_spec): Mark translatable strings.
10100
10101 2000-02-10  Jim Meyering  <meyering@lucent.com>
10102
10103         With these changes, nanosleep.[ch] are finally enough like the other
10104         lib/* replacement files to compile on a few more losing systems.
10105
10106         * nanosleep.h: Don't include config.h.
10107         Remove prototype from declaration of nanosleep.
10108         (PARAMS): Remove now-unneeded definition.
10109         * nanosleep.c: #undef nanosleep.
10110         (rpl_nanosleep): Rename from nanosleep.
10111
10112 2000-02-03  Jim Meyering  <meyering@lucent.com>
10113
10114         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10115         rather than with `#if HAVE_UTMPNAME'.
10116
10117 2000-02-01  Jim Meyering  <meyering@lucent.com>
10118
10119         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10120
10121 2000-01-31  Jim Meyering  <meyering@lucent.com>
10122
10123         * nanosleep.h (nanosleep): Guard declaration with
10124         `#if ! HAVE_DECL_NANOSLEEP'.
10125         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10126         the declaration in that vendor's sys/timers.h.
10127         Reported by Christian Krackowizer.
10128
10129         * quotearg.c (ISASCII): Add #undef and move definition to follow
10130         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10131         (ISPRINT): Likewise.
10132         Reported by Tom Tromey.
10133
10134 2000-01-30  Jim Meyering  <meyering@lucent.com>
10135
10136         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10137         uses of ->ut_name.  The latter doesn't work with new Linux header files
10138         where only utmpx.ut_user is declared.
10139
10140         * readutmp.h (UT_USER): Define.
10141
10142 2000-01-23  Jim Meyering  <meyering@lucent.com>
10143
10144         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10145         obstack.c.
10146
10147 2000-01-22  Jim Meyering  <meyering@lucent.com>
10148
10149         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10150         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10151         Required for some AIX systems.  Reported by Christian Krackowizer.
10152         [TESTING] (main): New function.
10153
10154         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10155         * dirname.c (dir_name): Support for DOS-style file names with drive
10156         letters.
10157
10158         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10159
10160         * strverscmp.c (ISDIGIT): Define.
10161         (strverscmp): Use ISDIGIT, not isdigit.
10162
10163 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10164
10165         * nanosleep.c (nanosleep):
10166         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10167         POSIX.1 doesn't require SA_INTERRUPT and some systems
10168         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10169         it's been part of POSIX.1 since day 1 (in 1988).
10170
10171 2000-01-17  Jim Meyering  <meyering@lucent.com>
10172
10173         * interlock: Remove unused file.  Reported by François Pinard.
10174
10175 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10176
10177         * quotearg.c (quotearg_buffer_restyled): Do not quote
10178         alert, backslash, formfeed, and vertical tab unnecessarily in
10179         shell quoting style.
10180
10181
10182 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10183 Free Software Foundation, Inc.
10184 Copying and distribution of this file, with or without modification,
10185 are permitted provided the copyright notice and this notice are preserved.