* regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
[pspp] / lib / ChangeLog
1 2006-07-28  Eric Blake  <ebb9@byu.net>
2
3         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
4         macro expansion.
5
6 2006-07-28  Simon Josefsson  <jas@extundo.com>
7
8         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
9         #include's.
10
11 2006-07-28  Simon Josefsson  <jas@extundo.com>
12
13         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
14         #include's.
15
16 2006-07-28  Bruno Haible <bruno@clisp.org>
17
18         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
19
20 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
21
22         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
23         arpa/inet.h.
24
25 2006-07-28  Bruno Haible  <bruno@clisp.org>
26
27         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
28         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
29         fallbacks.
30         Avoids link error on FreeBSD 4.x.
31         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
32
33         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
34         encoding.
35         * mbswidth.c (iswcntrl): Likewise.
36
37 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
38
39         * modechange.c (mode_compile): Numeric modes now affect setuid and
40         setgid on directories only if they set these bits.
41         * modechange.h: Remove obsolete comment about masks.
42
43 2006-07-27  Bruno Haible  <bruno@clisp.org>
44
45         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
46         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
47         defined.
48
49 2006-07-26  Eric Blake  <ebb9@byu.net>
50
51         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
52         like mingw that lack mkstemp.
53         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
54         avoid compilation warning on mingw.
55
56 2006-07-25  Bruno Haible  <bruno@clisp.org>
57
58         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
59         <stdarg.h> or config.h.
60
61 2006-07-24  Bruno Haible  <bruno@clisp.org>
62
63         * clean-temp.h: New file, from GNU gettext.
64         * clean-temp.c: New file, from GNU gettext.
65
66 2006-07-24  Bruno Haible  <bruno@clisp.org>
67
68         * tmpdir.h: New file, from GNU gettext.
69         * tmpdir.c: New file, from GNU gettext.
70
71 2006-07-23  Bruno Haible  <bruno@clisp.org>
72
73         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
74         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
75         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
76         gl_linked_remove_at): Use it.
77
78 2006-07-23  Eric Blake  <ebb9@byu.net>
79
80         * tmpfile-safer.c: New file.
81         * stdio-safer.h (fopen_safer): Add prototype.
82         * stdio--.h (tmpfile): Make safer.
83
84 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
85
86         * close-stream.c, close-stream.h: New files.
87
88 2006-07-22  Bruno Haible  <bruno@clisp.org>
89
90         Merge from GNU gettext 0.15.
91
92         2005-07-05  Bruno Haible  <bruno@clisp.org>
93
94                 * printf-args.c (printf_fetchargs): Work around broken
95                 definition of wint_t on mingw.
96
97         2005-02-12  Bruno Haible  <bruno@clisp.org>
98
99                 * xallocsa.h: Add extern "C" for C++.
100
101         2006-05-17  Bruno Haible  <bruno@clisp.org>
102
103                 Cygwin portability.
104                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
105
106         2006-04-30  Bruno Haible  <bruno@clisp.org>
107
108                 * progreloc.c: Include <mach-o/dyld.h> if available.
109                 (find_executable): Use _NSGetExecutablePath when possible.
110
111         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
112
113                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
114                 function.
115
116         2005-12-29  Bruno Haible  <bruno@clisp.org>
117
118                 * progreloc.c (set_program_name_and_installdir): Fix
119                 compilation error.
120
121         2005-12-04  Bruno Haible  <bruno@clisp.org>
122
123                 Cygwin portability.
124                 * progreloc.c: Include <windows.h> also on Cygwin.
125                 (find_executable): Add support for Cygwin.
126                 (set_program_name_and_installdir): Handle also platforms with
127                 nonempty EXEEXT.
128
129         2006-07-11  Bruno Haible  <bruno@clisp.org>
130
131                 * javacomp.c: Fix a comment.
132                 Reported by Jim Meyering.
133
134         2006-04-30  Bruno Haible  <bruno@clisp.org>
135
136                 * javacomp.h (compile_java_class): Add source_version,
137                 target_version arguments.
138                 * javacomp.c: Rewritten to choose only a compiler that
139                 respects the specified source_version and target_version.
140
141         2006-06-27  Bruno Haible  <bruno@clisp.org>
142
143                 Assume correct S_ISDIR macro.
144                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
145
146         2006-07-22  Bruno Haible  <bruno@clisp.org>
147
148                 * javaversion.h: New file, from GNU gettext.
149                 * javaversion.c: New file, from GNU gettext.
150                 * javaversion.java: New file, from GNU gettext.
151                 * javaversion.class: New file, from GNU gettext.
152
153         2006-05-17  Bruno Haible  <bruno@clisp.org>
154
155                 Cygwin portability.
156                 * javaexec.c (execute_java_class): Test for jview program
157                 also on Cygwin.
158
159         2006-04-09  Bruno Haible  <bruno@clisp.org>
160
161                 * fatal-signal.c: Don't include string.h.
162                 (at_fatal_signal): Use a copying loop instead of memcpy.
163
164         2005-12-04  Bruno Haible  <bruno@clisp.org>
165
166                 * csharpexec.c: Add support for 'clix' launcher (untested).
167                 (execute_csharp_using_sscli): New function.
168                 (execute_csharp_program): Call it.
169
170         2006-06-21  Bruno Haible  <bruno@clisp.org>
171
172                 Avoid warnings from recent versions of mcs.
173                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
174                 -o, -L, -r any more. Use options documented since mcs-1.0
175                 instead. Similarly for -g.
176
177         2005-07-09  Bruno Haible  <bruno@clisp.org>
178
179                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
180                 add a .dll suffix.
181                 Reported by Mark Junker <mjscod@gmx.de>.
182
183         2006-06-17  Bruno Haible  <bruno@clisp.org>
184
185                 * config.charset: Update for NetBSD 3.0.
186
187         2006-05-17  Bruno Haible  <bruno@clisp.org>
188
189                 Cygwin portability.
190                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
191
192         2006-05-16  Bruno Haible  <bruno@clisp.org>
193
194                 * localcharset.c [CYGWIN]: Include <windows.h>.
195                 (get_charset_aliases): For Cygwin, return the same CPxxx
196                 aliases list as under WIN32.
197                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
198                 the environment variables. Fall back to GetACP().
199
200         2006-04-05  Bruno Haible  <bruno@clisp.org>
201
202                 * config.charset: Update Juan Manuel Guerrero's address.
203
204         2005-02-12  Bruno Haible  <bruno@clisp.org>
205
206                 * allocsa.h: Add extern "C" for C++.
207
208         2005-02-10  Bruno Haible  <bruno@clisp.org>
209
210                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
211                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
212
213         2006-07-22  Bruno Haible  <bruno@clisp.org>
214
215                 * gettext.h: Update to GNU gettext-0.15.
216
217 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
218         and Simon Josefsson <jas@extundo.com>
219
220         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
221
222         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
223
224 2006-07-21  Eric Blake  <ebb9@byu.net>
225
226         * stdlib-safer.h: New file from coreutils, required by
227         stdlib--.h.
228
229 2006-07-19  Derek R. Price  <derek@ximbiot.com>
230
231         * getaddrinfo.h: Don't define unimplemented AI_* flags.
232         Reindent and repaginate.
233
234 2006-07-17  Bruno Haible  <bruno@clisp.org>
235
236         * gl_list.h: New file.
237         * gl_list.c: New file.
238         * gl_array_list.h: New file.
239         * gl_array_list.c: New file.
240         * gl_carray_list.h: New file.
241         * gl_carray_list.c: New file.
242         * gl_linked_list.h: New file.
243         * gl_linked_list.c: New file.
244         * gl_anylinked_list1.h: New file.
245         * gl_anylinked_list2.h: New file.
246         * gl_avltree_list.h: New file.
247         * gl_avltree_list.c: New file.
248         * gl_anyavltree_list1.h: New file.
249         * gl_anyavltree_list2.h: New file.
250         * gl_rbtree_list.h: New file.
251         * gl_rbtree_list.c: New file.
252         * gl_anyrbtree_list1.h: New file.
253         * gl_anyrbtree_list2.h: New file.
254         * gl_anytree_list1.h: New file.
255         * gl_anytree_list2.h: New file.
256         * gl_linkedhash_list.h: New file.
257         * gl_linkedhash_list.c: New file.
258         * gl_anyhash_list1.h: New file.
259         * gl_anyhash_list2.h: New file.
260         * gl_avltreehash_list.h: New file.
261         * gl_avltreehash_list.c: New file.
262         * gl_rbtreehash_list.h: New file.
263         * gl_rbtreehash_list.c: New file.
264         * gl_anytreehash_list1.h: New file.
265         * gl_anytreehash_list2.h: New file.
266
267         * gl_oset.h: New file.
268         * gl_oset.c: New file.
269         * gl_array_oset.h: New file.
270         * gl_array_oset.c: New file.
271         * gl_avltree_oset.h: New file.
272         * gl_avltree_oset.c: New file.
273         * gl_rbtree_oset.h: New file.
274         * gl_rbtree_oset.c: New file.
275         * gl_anytree_oset.h: New file.
276
277 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
278
279         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
280         New files.
281         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
282         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
283         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
284         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
285         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
286         callers changed.  Revamp internals significantly, by not
287         attempting to create directories that are temporarily more
288         permissive than the final results.  Do not attempt to use
289         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
290         This removes some race conditions, fixes some bugs, and simplifies
291         things.  Use new dirchownmod function to do owner and mode changes.
292         * mkdir-p.h: Likewise.
293         * modechange.c (octal_to_mode): New function.
294         (struct mode_change): New member mentioned.
295         (make_node_op_equals): New arg mentioned.  All callers changed.
296         (mode_compile): Keep track of which mode bits the user has explicitly
297         mentioned.
298         (mode_adjust): New arg DIR, so that we implement the X op correctly.
299         New arg PMODE_BITS, to keep track of which mode bits the user
300         mentioned; it treats S_ISUID and S_ISGID speciall.
301         All callers changed.
302         * modechange.h: Likewise.
303
304 2006-07-11  Derek R. Price  <derek@ximbiot.com>
305
306         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
307
308 2006-07-10  Derek R. Price  <derek@ximbiot.com>
309
310         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
311         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
312         macros into the GNU _D_EXACT_NAMLEN.
313         * savedir.c:  Likewise.
314         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
315
316 2006-07-09  Jim Meyering  <jim@meyering.net>
317
318         * argp-pv.c: Remove a doubled word in a comment.
319         * check-version.c (check_version): Likewise.
320         * javacomp.c (compile_java_class): Likewise.
321
322 2006-07-08  Jim Meyering  <jim@meyering.net>
323
324         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
325
326 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
327
328         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
329         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
330         brackets.  Other minor changes to suppress some compiler
331         warnings.
332
333 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
334
335         * getloadavg.c: Use __VMS, not VMS.
336         * getopt.c: Likewise.
337         * getpagesize.h: Likewise.
338         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
339         probably does not work.
340
341 2006-07-06  Derek R. Price  <derek@ximbiot.com>
342         and Paul Eggert  <eggert@cs.ucla.edu>
343
344         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
345         Don't worry about this obsolete case any more.
346         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
347         directories.
348         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
349         worry about this obsolete case any more.
350         * fts.c: Likewise.
351         * getcwd.c: Likewise.
352         * glob.h: Likewise.
353         * savedir.c: Likewise.
354
355 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
356
357         * .cppi-disable: Add wcwidth.
358         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
359         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
360         (ISGRAPH): Remove.  All uses changed to isgraph.
361         (FOLD) [!defined _LIBC]: Remove special case.
362         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
363         * regext_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
364         HAVE_ISBLANK.
365         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
366
367 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
368
369         * strtod.c (strtod): cast the argument of tolower to unsigned char.
370
371 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
372
373         * memcasecmp.c: Include <limits.h>.
374         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
375         * strtod.c (strtod): Don't assume isspace works on negative chars.
376         Don't assume isdigit succeeds only on '0' through '9'.
377
378 2006-07-05  Derek R. Price  <derek@ximbiot.com>
379
380         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
381         All uses of is_space replaced by isspace.
382         * exit.h: Don't talk about STDC_HEADERS.
383         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
384         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
385         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
386         replaced by isprint etc.
387         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
388         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
389         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
390         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
391         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
392         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
393
394 2006-07-05  Eric Blake  <ebb9@byu.net>
395
396         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
397         missing from netdb.h.
398         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
399
400 2006-06-27  Bruno Haible  <bruno@clisp.org>
401
402         Assume ANSI C header files and <ctype.h> functions.
403         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
404         (mbsnwidth): Use isprint, iscntrl instead.
405
406 2006-07-03  Jim Meyering  <jim@meyering.net>
407
408         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
409         macro is used before the first cycle_check call.
410
411 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
412
413         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
414         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
415         reported by Mark D. Baushke, one in
416         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
417
418         Merge from coreutils.
419
420         * .cppi-disable: Add stdint_.h.
421         * .cvsignore: Add stdint.h.
422
423         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
424
425         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
426         both double and long double versions.
427         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
428         * xstrtold.c: New file.
429         * xstrtod.h (xstrtold): New decl.
430
431         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
432
433         * filemode.c (setst): Remove.
434         (strmode): Rewrite to avoid setst.  This makes the code shorter,
435         (arguably) clearer, and the generated code is a bit smaller on my
436         Debian GNU/Linux stable x86 host.
437
438         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
439
440         * filemode.c: Include "filemode.h" first, to test the interface.
441         Assume that filemode.h includes sys/types.h and sys/stat.h.
442         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
443         (ftypelet): Reorder to put common cases first, for efficiency.
444         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
445         to do 'M'.
446         (strmode): Renamed from mode_string, and now stores 12 bytes instead
447         of 10, for compatibility with FreeBSD.  All callers changed.
448         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
449         that can't be deduced solely from st_mode.  First arg is now a const
450         pointer.
451         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
452         (strmode): Renamed from mode_string.
453         (filemodestring): New decl.
454         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
455         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
456         (S_ISPORT, S_ISWHT): New macros, if not already defined.
457
458         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
459
460         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
461         fsusage.h now does that.  Include fsusage.h first, to test interface.
462         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
463         at most one method (the old code could have generated decls that
464         didn't conform to C89, not that this was ever exercised).
465         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
466
467         2006-03-19  Jim Meyering  <jim@meyering.net>
468
469         Work even in a chroot where d_ino values for entries in "/"
470         don't match the stat.st_ino values for the same names.
471         * getcwd.c (__getcwd): When no d_ino value matches the target inode
472         number, iterate through all entries again, using lstat instead.
473         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
474         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
475
476         * getcwd.c (__getcwd): Clarify a comment.
477         Use memcpy in place of a call to strcpy.
478
479         2006-03-12  Jim Meyering  <jim@meyering.net>
480
481         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
482         that of the current directory (which we're about to chdir ".." out of),
483         then save the dev-ino of the parent, instead.
484
485         * same-inode.h (SAME_INODE): New file/macro.
486         * chdir-safer.c (SAME_INODE): Remove definition.
487         Include "same-inode.h", instead.
488         * same.c: Likewise.
489         * cycle-check.h: Include "same-inode.h".
490         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
491         * cycle-check.c (SAME_INODE): Remove definition.
492         * root-dev-ino.h: Include "same-inode.h".
493
494         2006-03-11  Eric Blake  <ebb9@byu.net>
495
496         * same.c (same_name): s/base_name/last_component/
497         * backupfile.c (check_extension, numbered_backup): Likewise.
498         * filenamecat.c (file_name_concat): Likewise.
499
500         2006-03-11  Eric Blake  <ebb9@byu.net>,
501                     Paul Eggert  <eggert@cs.ucla.edu>
502
503         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
504         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
505         drive prefix.
506         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
507         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
508         (last_component): New method.
509         * dirname.c (dir_len): Determine when drive letters need a
510         subsequent slash.  Preserve // when it is special.
511         (dir_name): Don't append dot when drive letter is absolute.
512         [TEST_DIRNAME]: Move into a full-blown gnulib test.
513         * basename.c (base_name): New semantics - malloc the result.
514         Preserve // when it is special.  Preserve relative files that look
515         like drive letters.
516         (base_len): Preserve // when it is special.
517         (last_component): New method, similar to old base_name semantics.
518         * stripslash.c (strip_trailing_slashes): Use last_component, not
519         base_name.  Strip redundant slashes from ///.
520
521 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
522
523         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
524         both are 64 bits, since this seems to be the tradition, and this
525         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
526         we ever run into a host that prefers long long to long in this
527         case, we'll need another configure-time test.  Problem reported by
528         Jim Meyering.
529
530 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
531
532         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
533         possible collision with system files.
534         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
535         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
536         WCHAR_MIN and WCHAR_MAX in this case.
537         (<stddef.h>): Do not include; no longer needed.
538         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
539         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
540         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
541         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
542         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
543         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
544         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
545         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
546         !defined(__c99))]: Include in this case too, since it's harmless
547         now.
548         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
549         dangerous to do so.
550         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
551         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
552         (_STDINT_MIN, _STDINT_MAX): New macros.
553         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
554         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
555         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
556         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
557         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
558         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
559         macros, not typedefs; this simplifies things quite a bit.
560         Use long int for all types narrower than int64_t.
561         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
562         Define in terms of long long int or int64_t or long int,
563         not int64_t or int32_t.  This saves some compile-time testing.
564         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
565         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
566         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
567         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
568         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
569         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
570         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
571         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
572         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
573         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
574         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
575         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
576         undef any previous version and define our own version, for
577         simplicity and consistency with the new macros for types.
578         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
579         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
580         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
581         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
582         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
583         @WINT_T_SUFFIX@ to keep things simple here.
584         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
585         Simplify by assuming typical 8/16/32/64 host, since we're
586         already doing that elsewhere anyway.
587         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
588         and assume long long int is 64 bits if available.  This
589         speeds up 'configure'.
590
591 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
592
593         * getaddrinfo.c: fixed typo
594
595 2006-06-29  Eric Blake  <ebb9@byu.net>
596
597         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
598         unused static function.
599
600 2006-06-29  Eric Blake  <ebb9@byu.net>
601
602         * stat_.h: New file.
603
604 2006-06-29  Derek R. Price  <derek@ximbiot.com>
605
606         * strftime.c: Assume strftime() exists.
607
608 2006-06-28  Bruno Haible  <bruno@clisp.org>
609
610         * getaddrinfo.h: Fix POSIX URL.
611         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
612         (use_win32_p): Make static.
613         (getaddrinfo): Reject service name if it is empty or does not consist
614         solely of decimal digits, or if its value is > 65535.
615         (getnameinfo): Remove useless casts.
616
617 2006-06-28  Derek R. Price  <derek@ximbiot.com>
618
619         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
620         Autoconf 2.60 says this stuff was obsolete.
621
622 2006-05-12  Bruno Haible  <bruno@clisp.org>
623
624         * mkdtemp.c [MINGW]: Include <io.h>.
625         (mkdir): Define using _mkdir.
626
627 2006-06-28  Bruno Haible  <bruno@clisp.org>
628
629         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
630         declaration for wcwidth.
631         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
632
633 2006-06-28  Eric Blake  <ebb9@byu.net>
634
635         * xvasprintf.h: Fix comments.
636
637 2006-06-28  Eric Blake  <ebb9@byu.net>
638
639         * mbchar.h (wcwidth): Include wcwidth.h.
640         * mbswidth.c (wcwidth): Move from here...
641         * wcwidth.h: ...to this new file.
642
643 2006-06-28  Simon Josefsson  <jas@extundo.com>
644
645         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
646         functions there.  It will succeed on Windows XP, but on Windows
647         2000 and (presumably) earlier, it will fail, and use the internal
648         re-implementation.
649         (use_win32_p): New function.
650         (getaddrinfo): Use strtoul on servname, to support numeric ports.
651         Support AI_NUMERICSERV to disable getservbyname.
652         (getnameinfo): New function, only supports
653         NI_NUMERICHOST|NI_NUMERICSERV for now.
654
655         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
656         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
657         getnameinfo.
658
659 2006-06-27  Bruno Haible  <bruno@clisp.org>
660
661         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
662
663 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
664
665         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
666         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
667         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
668
669 2006-06-26  Bruno Haible  <bruno@clisp.org>
670
671         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
672         WCHAR_MAX.
673         Reported by Mark D. Baushke and Larry Jones.
674
675 2006-06-26  Bruno Haible  <bruno@clisp.org>
676
677         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
678         in pre-C99 mode.
679         Suggested by Mark D. Baushke and Larry Jones.
680
681 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
682
683         * stdint_.h: Treat BSD/OS like OpenBSD.
684
685 2006-06-23  Bruno Haible  <bruno@clisp.org>
686
687         * stdint_.h: Treat IRIX like OpenBSD.
688
689 2006-06-23  Bruno Haible  <bruno@clisp.org>
690
691         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
692         ISO C 99 Technical Corrigendum 1.
693
694 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
695
696         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
697         Some compiler complained about some of them.  Problem reported by
698         Larry Jones in
699         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
700
701 2006-06-21  Simon Josefsson  <jas@extundo.com>
702
703         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
704         variable.
705
706         * socket_.h: Don't define WINVER.
707
708         * inet_pton.h, inet_pton.c: New file, taken from glibc but
709         slightly modified to work in gnulib.
710
711 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
712
713         * read-file.c (fread_file): Start with buffer allocation of
714         0 bytes rather than 1 byte; this simplifies the code.
715         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
716         code to free buffer and save/restore errno.
717         (internal_read_file): Remove unused local.
718
719 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
720
721         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
722         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
723         Problem reported by Denis Excoffier in
724         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
725
726 2006-06-19  Simon Josefsson  <jas@extundo.com>
727
728         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
729
730 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
731
732         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
733
734 2006-06-17  Bruno Haible  <bruno@clisp.org>
735
736         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
737
738 2006-06-17  Bruno Haible  <bruno@clisp.org>
739
740         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
741         problem on Solaris 2.5.1.
742
743 2006-06-16  Eric Blake  <ebb9@byu.net>
744
745         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
746         * unicodeio.c [!defined errno]: Likewise.
747         * strtol.c [!defined errno]: Likewise.
748         * strtod.c [!defined errno]: Likewise.
749
750 2006-06-15  Bruno Haible  <bruno@clisp.org>
751
752         * stdint_.h: Rewritten to be fully auto-configured.
753         Fixes bug on HP-UX/IA64.
754
755 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
756
757         * getdate.y (__attribute__): Don't define if already defined.
758         Problem reported by Larry Jones.
759         * utimens.c (__attribute__): Likewise.
760
761 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
762
763         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
764         reported by Andreas Schwab.
765
766 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
767             Bruno Haible  <bruno@clisp.org>
768
769         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
770
771 2006-05-26  Martin Lambers  <marlam@marlam.de>
772
773         * getpass.c: Updates the test for the native W32 API, and adds
774         missing includes, thus fixing compilation warnings.
775
776 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
777
778         * tempname.c (small_open, large_open): New macros.
779         (__open, __open64) [!_LIBC]: Remove.
780         (__gen_tempname): Use small_open and large_open instead of __open
781         and __open64.  This fixes a portability bug on HP-UX 11.11i
782         reported by Simon Wing-Tang in
783         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
784
785 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
786
787         * exclude.c (exclude_fnmatch): New function.
788         (excluded_file_name): Call exclude_fnmatch.
789         * exclude.h (excluded_file_name): New prototype
790
791 2006-05-24  Bruno Haible  <bruno@clisp.org>
792
793         * printf-args.c (printf_fetchargs): Turn NULL pointers for
794         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
795         Reported by Thorsten Maerz <torte@netztorte.de> via
796         Aaron Stone <aaron@serendipity.cx>.
797
798 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
799
800         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
801         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
802         (my_usleep): Don't mishandle maximum value.
803
804 2006-05-19  Jim Meyering  <jim@meyering.net>
805
806         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
807
808 2006-05-17  Bruno Haible  <bruno@clisp.org>
809
810         Cygwin portability.
811         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
812
813 2006-05-17  Bruno Haible  <bruno@clisp.org>
814
815         * stdint_.h: Fix recognition of Cygwin.
816
817 2006-05-11  Jim Meyering  <jim@meyering.net>
818
819         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
820
821 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
822
823         * crc.c (crc32_update): Remove unnecessary L suffix.
824         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
825         unwanted sign propagation, e.g., on hosts with 64-bit int.
826         There still are some problems with reeelly weird theoretical hosts
827         (e.g., 33-bit int) but it's not worth worrying about now.
828         * sha1.c (rol): Likewise.
829         (K1, K2, K3, K4): Remove unnecessary L suffix.
830
831 2006-05-10  Bruno Haible  <bruno@clisp.org>
832
833         * des.c: Cast to avoid warnings.
834
835 2006-05-10  Simon Josefsson  <jas@extundo.com>
836
837         * md4.c: Typo fix, update copyright years.
838         (K1, K2): Don't use L because it turn computations into 64-bit on
839         64-bit platforms.
840
841 2006-05-09  Bruno Haible  <bruno@clisp.org>
842
843         * xvasprintf.c: Include limits.h, string.h, xsize.h.
844         (EOVERFLOW): Define fallback value.
845         (xstrcat): New function.
846         (xvasprintf): Recognize the special case of a string concatenation.
847
848 2006-05-01  Bruno Haible  <bruno@clisp.org>
849
850         * stdint_.h: Shorter URL.
851         * inttypes.h: Likewise.
852
853 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
854
855         * verify.h: Document the internals better.  Most of this change
856         was written by Bruno Haible.
857
858 2006-04-29  Bruno Haible  <bruno@clisp.org>
859
860         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
861         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
862
863 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
864
865         * getdate.y (get_date): When adding relative date, start with the
866         initial time, not with the result of the first mktime call.
867
868 2006-04-23  Bruno Haible  <bruno@clisp.org>
869
870         * copy-file.c: Include <unistd.h> unconditionally.
871         * execute.c: Likewise.
872         * fatal-signal.c: Likewise.
873         * findprog.c: Likewise.
874         * mkdtemp.c: Likewise.
875         * pipe.h: Likewise.
876         * pipe.c: Likewise.
877         * wait-process.h: Likewise.
878
879 2006-04-23  Bruno Haible  <bruno@clisp.org>
880
881         * fwriteerror.c (fwriteerror): Call fclose also when an error
882         condition was already detected.
883         Reported by Ben Pfaff <blp@cs.stanford.edu>.
884
885 2006-04-19  Derek Price  <derek@ximbiot.com>
886             Eric Blake  <ebb9@byu.net>
887
888         * inttypes.h: Correct grammar in comment.
889
890 2006-04-18  Derek Price  <derek@ximbiot.com>
891             Paul Eggert  <eggert@cs.ucla.edu>
892
893         * inttypes.h: New file.
894         * strtoimax.c: Assume <inttypes.h>.
895
896 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
897
898         * utimens.c (futimens): glibc futimesat messes up if /proc
899         isn't mounted.  Problem reported by Kir Kolyshkin.
900
901 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
902
903         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
904         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
905         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
906
907 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
908
909         Merge regex changes from libc, removing some of our
910         POSIX-conformance changes that were rejected and redoing them in a
911         less-intrusive way.
912
913         * regcomp.c (re_compile_internal, init_dfa):
914         Length arg is now size_t, not Idx.  All uses changed.
915         (peek_token): Forward decl now says internal_function.
916         (__re_error_msgid, __re_error_msgid_idx):
917         Now static rather than extern with attribute_hidden.
918         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
919         For some reason libc prefers K&R style defns for external functions.
920         (regerror) [!defined _LIBC]: Likewise.
921         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
922         (seek_collating_symbol_entry, lookup_collation_sequence_value):
923         (build_range_exp, build_collating_symbol):
924         Use K&R-style defn.
925         (re_compile_fastmap): Use '\0' to memset, not 0.
926         (utf8_sb_map): Make the calculations more obvious.
927         (init_dfa, parse_bracket_exp, build_charclass_op):
928         Call calloc and cast result, as glibc does.
929         (init_word_char, fetch_token, peek_token, peek_token_bracket):
930         (build_range_exp, build_collating_symbol):
931         Now internal functions.
932
933         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
934
935         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
936         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
937         Don't depend on VMS; depend on __VMS instead, for POSIX
938         namespace cleanness.
939         (regoff_t): Define to ssize_t, not long int.
940
941         Remove the REG_ macros named below.  Instead, make the old names
942         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
943         __USE_GNU_REGEX.
944         (REG_BACKSLASH_ESCAPE_IN_LISTS):
945         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
946         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
947         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
948         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
949         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
950         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
951         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
952         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
953         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
954         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
955         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
956         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
957         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
958         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
959         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
960         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
961         (REG_NREGS):
962         Remove.  All uses replaced by the old RE_* names.
963         (RE_BACKSLASH_ESCAPE_IN_LISTS):
964         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
965         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
966         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
967         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
968         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
969         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
970         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
971         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
972         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
973         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
974         Don't bother having these macros be independent of each others'
975         values, since they no longer exist in the POSIX name space.
976
977         Rename the following member names back to their old names,
978         unless !__USE_GNU_REGEX.  All uses changed back.
979         (buffer): Renamed from re_buffer.
980         (allocated): Renamed from re_allocated.
981         (used): Renamed from re_used.
982         (syntax): Renamed from re_syntax.
983         (fastmap): Renamed from re_fastmap.
984         (translate): Renamed from re_translate.
985         (can_be_null): Renamed from re_can_be_null.
986         (regs_allocated): Renamed from re_regs_allocated.
987         (fastmap_accurate): Renamed from re_fastmap_accurate.
988         (no_sub): Renamed from re_no_sub.
989         (not_bol): Renamed from re_not_bol.
990         (not_eol): Renamed from re_not_eol.
991         (newline_anchor): Renamed from re_newline_anchor.
992         (num_regs): Renamed from rm_num_regs.
993         (start): Renamed from rm_start.
994         (end): Renamed from rm_end.
995
996         (free_state): Move up a bit.
997
998         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
999         #define to be empty.
1000         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1001         when that is what is intended.
1002         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1003         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1004         (MAX): New macro.
1005         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1006         All uses changed back to re_malloc, etc.  It's now the caller's
1007         responsibility to check for overflow; all callers changed.
1008         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1009         (re_x2nrealloc): Remove.
1010         (free_state): Remove decl.
1011
1012         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1013         (re_set_registers, re_exec):
1014         Use K&R-style defn.
1015
1016         2006-01-31  Roland McGrath  <roland@redhat.com>
1017
1018         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1019         Reported by Mike Frysinger <vapier@gentoo.org>.
1020
1021         2006-01-15  Andreas Jaeger  <aj@suse.de>
1022
1023         [BZ #1950]
1024         * regex_internal.c (re_string_reconstruct): Adjust for
1025         build_wcs_upper_buffer change.
1026         (build_wcs_upper_buffer): Change return type.
1027
1028         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1029
1030         * regex_internal.h: Include <stdint.h> if available.
1031
1032         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1033
1034         * regex_internal.h (SIZE_MAX): Provide a default definition.
1035
1036         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1037
1038         * regcomp.c: Adjust for changed secondary hash function.
1039
1040         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1041
1042         * regex.h: Pretty printing.
1043         Clean up namespace a bit.
1044
1045         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1046
1047         * regexec.c (update_cur_sifted_state, check_arrival,
1048         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1049
1050         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1051                     Ulrich Drepper  <drepper@redhat.com>
1052
1053         [BZ #1302]
1054         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1055         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1056
1057         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1058
1059         [BZ #281]
1060         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1061         * regcomp.c: Remove unnecessary uses of
1062         unsigned RE_TRANSLATE_TYPE.
1063         * regex_internal.h: Likewise.
1064         * regex_internal.c: Likewise.
1065         * regexec.c: Likewise.
1066         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1067
1068         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1069
1070         * regexec.c (find_recover_state): Remove unnecessary
1071         initialization.
1072         (transit_state_bkref): Make DFA a const pointer.
1073         (get_subexp): Likewise.
1074         (check_arrival): Likewise.
1075         (update_cur_sifted_state): Likewise.
1076         (re_search_internal): Likewise.
1077         (prune_impossible_nodes): Likewise.
1078         (acquire_init_state_context): Likewise.
1079         (proceed_next_node): Likewise.
1080         (set_regs): Likewise.
1081         (free_fail_stack_return): Likewise.
1082         (check_arrival_expand_ecl): Mark DFA parameter as const.
1083         (check_arrival_expand_ecl_sub): Likewise.
1084         (check_subexp_limits): Likewise.
1085         (sub_epsilon_src_nodes):  Likewise.
1086         (add_epsilon_src_nodes):  Likewise.
1087         (merge_state_array): Likewise.
1088         (update_regs): Likewise.
1089         (build_trtable): Likewise.
1090         (sift_states_backward): Mark MCTX parameter as const.
1091         (build_sifted_states): Likewise.
1092         (update_cur_sifted_state): Likewise.
1093         (sift_states_mkref): Likewise.
1094         (check_arrival_expand_ecl): Mark eclosure as const.
1095         (check_dst_limits_calc_pos_1): Likewise.
1096         * regex_internal.h (re_match_context_t): Make dfa a const
1097         pointer.
1098
1099         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1100
1101         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1102         (transit_state_sb): Likewise.
1103         (transit_state_mb): Likewise.
1104         (sift_states_iter_mb): Likewise.
1105         (check_arrival_add_next_nodes): Likewise.
1106         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1107         [_LIBC] (re_search_2_stub): Use mempcpy.
1108
1109         * regex_internal.c (re_string_reconstruct): Avoid calling
1110         mbrtowc for very simple UTF-8 case.
1111
1112         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1113         a pointer-to-const.
1114         (re_acquire_state_context): Likewise.
1115         * regex_internal.h: Adjust prototypes.
1116
1117         * regex.c: Prevent using C++ compilers.
1118
1119         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1120         (re_acquire_state_context): Likewise.
1121
1122 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1123             Bruno Haible  <bruno@clisp.org>
1124
1125         * stdint_.h: On OpenBSD, don't redefine types already included in
1126         <sys/types.h> and <inttypes.h>.
1127
1128 2006-03-24  Eric Blake  <ebb9@byu.net>
1129
1130         * time_r.c (copy_string_result): Remove, as it is no longer used.
1131
1132 2006-03-24  Simon Josefsson  <jas@extundo.com>
1133
1134         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1135         including some doc fixes.
1136         (base64_encode_alloc): Fix +1 bug on allocation failures.
1137
1138 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1139
1140         * base64.c (base64_encode): Do not read past end of array with
1141         unsanitized input on systems with CHAR_BIT > 8.
1142
1143 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1144
1145         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1146         Typedef to long int, not to off_, as POSIX will likely change
1147         in that direction.
1148
1149 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1150
1151         * argp-help.c (validate_uparams): Fix typo
1152         * argp-parse.c (argp_default_options): Consistently begin help
1153         messages with a lowercase letter.
1154
1155 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1156
1157         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1158         overrun buffers and shouldn't be used (much as gets shouldn't be
1159         used).
1160         * time_r.c (asctime_r, ctime_r): Likewise.
1161
1162 2006-03-08  Simon Josefsson  <jas@extundo.com>
1163
1164         * gc-gnulib.c (randomize): Don't open files called 'no', they
1165         signal that configure disabled the device.
1166
1167 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1168
1169         * c-stack.c: Include unistd.h unconditionally, since we now assume
1170         the unistd module.
1171         * getlogin_r.c: Likewise.
1172         * getlogin_r.h: Likewise.
1173         * glob.c: Likewise.
1174         * pagealign_alloc.c: Likewise.
1175         * unistd_.h: Remove; no longer needed.
1176
1177 2006-03-07  Simon Josefsson  <jas@extundo.com>
1178
1179         * unistd_.h: New file.
1180
1181 2006-03-07  Simon Josefsson  <jas@extundo.com>
1182
1183         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1184
1185 2006-03-01  Simon Josefsson  <jas@extundo.com>
1186
1187         * readline.c: Fix typo, tiny patch from Stepan Kasal
1188         <kasal@ucw.cz>.
1189
1190 2006-02-28  Simon Josefsson  <jas@extundo.com>
1191
1192         * getopt.c: Protect #include of unistd.h, for MSVS.
1193
1194 2006-02-27  Simon Josefsson  <jas@extundo.com>
1195
1196         * base64.h: Indent #define's.  From Jim Meyering
1197         <jim@meyering.net>.
1198
1199 2006-02-27  Jim Meyering  <jim@meyering.net>
1200
1201         Revert the change of 2006-02-24, so these files can continue
1202         to be sync'd from gettext.
1203         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1204         of `config.h'.
1205
1206 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1207
1208         * glob.c: Say "invalid" rather than "illegal" in comments.
1209
1210 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1211
1212         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1213
1214 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1215
1216         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1217         AT_FDCWD exceeds INT_MAX.
1218         * openat.h (AT_FDCWD): Likewise.
1219
1220 2006-02-14  Jim Meyering  <jim@meyering.net>
1221
1222         Sync from coreutils.
1223
1224         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1225         failure on deficient systems, and simplify gnulib lgpl dependencies.
1226         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1227         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1228
1229         * xalloc-die.c: Remove unused definition of N_.
1230
1231 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1232
1233         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1234
1235 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1236
1237         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1238         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1239
1240 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1241
1242         * argp-namefrob.h: Restore changes accidentally lost during the
1243         "autoupdate" on 2005-12-12.
1244
1245 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1246
1247         * fnmatch.c (L_): Renamed from L, to work around a bug in
1248         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1249         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1250         All uses changed.
1251
1252 2006-01-26  Simon Josefsson  <jas@extundo.com>
1253
1254         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1255         prototype is visible on mingw32.
1256
1257         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1258         for mingw32.
1259
1260         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1261         mingw32).
1262
1263 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1264
1265         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1266         attempt to open for write; this always fails, at least on POSIX
1267         hosts.  This reinstates the 2006-01-09 change, which was
1268         inadvertently removed.
1269
1270 2006-01-26  Bruno Haible  <bruno@clisp.org>
1271             Paul Eggert  <eggert@cs.ucla.edu>
1272
1273         * stdbool_.h (_Bool)
1274         [(! (defined __cplusplus || defined __BEOS__)
1275           && !defined __GNUC__
1276           && !(defined __HP_cc || defined __xlc__
1277                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1278                || defined __sgi))]:
1279         #define to signed char in these cases too; this simplifies
1280         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1281         etc., separately) and makes it more conservative.
1282
1283 2006-01-21  Jim Meyering  <jim@meyering.net>
1284
1285         Sync from the stable (b5) branch of coreutils:
1286
1287         * fts.c (fts_children): Don't let close() clobber errno from
1288         failed fchdir().
1289
1290         * fts.c (fts_stat): When following a symlink-to-directory,
1291         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1292         a dangling symlink.  That can also happen at least for ELOOP.
1293         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1294         FYI, this bug predates the inclusion of fts.c in coreutils.
1295
1296         * fts.c (fts_open): Put new maxarglen declaration and uses
1297         in their own block, so pre-c99 compilers don't object.
1298
1299         Avoid the double-free (first in fts_read, second in fts_close) that
1300         would occur when an `active' directory is made inaccessible (e.g.,
1301         via chmod a-x) during a traversal.
1302         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1303         before returning.  Reproduce this failure by
1304         mkdir -p a/b; cd a; chmod a-x . b
1305         Reported by Stavros Passas.
1306
1307 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1308
1309         * argp-namefrob.h: Bugfix. Remove stray #
1310
1311 2006-01-25  Bruno Haible  <bruno@clisp.org>
1312
1313         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1314         warnings.
1315         Reported by Paul Eggert.
1316
1317 2006-01-25  Jim Meyering  <jim@meyering.net>
1318
1319         * fileblocks.c: Remove more useless parentheses.
1320         * readutmp.h: Likewise.
1321
1322 2006-01-24  Bruno Haible  <bruno@clisp.org>
1323
1324         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1325         has it.
1326         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1327         2005-11-26.
1328
1329         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1330         to avoid problems with the built-in _Bool type.
1331         Reported by Paul Eggert on 2005-11-26.
1332
1333 2006-01-24  Jim Meyering  <jim@meyering.net>
1334
1335         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1336
1337 2006-01-24  Simon Josefsson  <jas@extundo.com>
1338
1339         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1340         Bruno.
1341
1342 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1343
1344         Work around porting bugs reported by Dieter in
1345         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1346         * getopt.c (_NOPROTO): Remove; no longer needed.
1347         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1348         Include "getopt.h" first, to check interface.
1349         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1350         !HAVE_DECL_GETENV.
1351         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1352         (__strndup): Revert to K&R-style function dfns, the glibc style.
1353         * strnlen.c: Don't claim it's taken from glibc; it's not.
1354         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1355         Include strnlen.h first, to get prototype properly.
1356         (strnlen): Renamed from __strnlen.
1357         Remove weak alias.
1358
1359 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1360
1361         These changes imported from libc.
1362         * getopt.c: Use __fxprintf instead of inline stream orientation
1363         test and two separate function calls.
1364         * strndup.c (__strndup): Add libc_hidden_def.
1365
1366 2006-01-22  Bruno Haible  <bruno@clisp.org>
1367
1368         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1369         temporary buffer for sprintf, take into account the precision also
1370         for 'd', 'i', 'u', 'o', 'x', 'X'.
1371
1372 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1373
1374         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1375         to pacify gcc -Wswitch-default.
1376
1377 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1378
1379         * argp-help.c (usage_long_opt): Do not print DOC options.
1380         (__argp_base_name): Removed
1381         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1382         typo.
1383         (__argp_base_name): Provide macro definition or extern declaration
1384         depending on the configuration
1385
1386 2006-01-20  Simon Josefsson  <jas@extundo.com>
1387
1388         * inet_ntop.h: Unconditionally include sys/socket.h.
1389
1390 2006-01-19  Simon Josefsson  <jas@extundo.com>
1391
1392         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1393
1394 2006-01-12  Simon Josefsson  <jas@extundo.com>
1395
1396         * base64.c: Fix warning, reported by Bruno Haible
1397         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1398
1399 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1400
1401         Sync from coreutils.
1402         * md5.c: Fix commentary typos.
1403         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1404         * md5.h (__attribute__): Remove; unused.
1405         * sha1.c: Fix commentary to match md5 better.
1406         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1407         so that we don't need to worry about alignment.  All uses changed.
1408         This merges the 2005-10-28 md5 change into sha1.
1409
1410 2006-01-11  Jim Meyering  <jim@meyering.net>
1411
1412         Sync from coreutils.
1413         * md5.c (OP): Fix spacing.
1414
1415 2006-01-11  Simon Josefsson  <jas@extundo.com>
1416
1417         * stdint_.h (SIZE_MAX): Add missing (.
1418
1419 2006-01-10  Bruno Haible  <bruno@clisp.org>
1420
1421         * argp.h (__const): Remove macro. Use const instead.
1422         * argp-fmtstream.h (__const): Likewise.
1423         * glob_.h (__const): Remove macro.
1424         * glob-libc.h: Use const instead of __const.
1425
1426 2006-01-10  Jim Meyering  <jim@meyering.net>
1427
1428         Avoid the double-free (first in fts_read, second in fts_close) that
1429         would occur when an `active' directory is made inaccessible (e.g.,
1430         via chmod a-x) during a traversal.
1431         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1432         before returning.  Reproduce this failure by
1433         mkdir -p a/b; cd a; chmod a-x . b
1434         Reported by Stavros Passas.
1435
1436         Sync from coreutils.
1437         * sha1.c: Tweak grammar in a comment.
1438
1439 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1440
1441         * regex_internal.h (BITSET_WORD_BITS):
1442         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1443         preprocessor mishandles large unsigned values as if they were signed.
1444         Problem reported by Claudio Fontana in
1445         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1446
1447 2006-01-10  Simon Josefsson  <jas@extundo.com>
1448
1449         * socket_.h: New file.
1450
1451 2006-01-10  Bruno Haible  <bruno@clisp.org>
1452
1453         * localcharset.c: Update from GNU gettext.
1454
1455 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1456
1457         Sync from coreutils.
1458         * chdir-long.c (cdb_free): Don't bother trying to open directory
1459         for write access: POSIX says that must fail.
1460         * fts.c (diropen): Likewise.
1461         * save-cwd.c (save_cwd): Likewise.
1462         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1463         well, for minor improvements on hosts that lack O_DIRECTORY.
1464         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1465         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1466         Fall back on chown if open failed with EACCES.
1467
1468         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1469         Report an error at compile-time if only a 1-second nominal clock
1470         resolution is found.
1471
1472         * lchmod.h: New file.
1473         * mkdir-p.c: Include lchmod.h, lchown.h.
1474         (make_dir_parents): Use lchown rather than chown, and
1475         lchmod rather than chmod.
1476
1477         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1478         too.  Problem with "none" reported by Bob Proulx.  Problem with
1479         "proc" reported by n0dalus.
1480
1481         * mountlist.c: Include <limits.h>.
1482         (dev_from_mount_options)
1483         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1484         New function.  It no longer assumes "dev=" has the System V meaning
1485         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1486         (read_file_system_list)
1487         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1488         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1489         dev= in that case.
1490
1491         * posixtm.h (PDS_PRE_2000): New macro.
1492         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1493         All usages changed.  Reject dates outside the range 1969-1999 if
1494         PDS_PRE_2000 is used.
1495
1496 2006-01-09  Jim Meyering  <jim@meyering.net>
1497
1498         Sync from coreutils.
1499
1500         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1501
1502         * chdir-safer.h, chdir-safer.c: New files.
1503
1504         * modechange.c (mode_compile): Reject an invalid mode string
1505         that starts with an octal digit.  From Andreas Gruenbacher.
1506
1507         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1508         and dup to open_safer and dup_safer, respectively.
1509         (openat_permissive): Fix typo in comment.
1510
1511         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1512         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1513         (_): Remove; no longer needed.
1514         (openat): Renamed from rpl_openat; no need for rpl_openat
1515         since openat.h renames openat for us.
1516         Replace most of the body with a call to openat_permissive,
1517         to avoid duplicate code.
1518         Port to (probably hypothetical) environments were mode_t is
1519         wider than int.
1520         (openat_permissive): Require mode arg, so that we can check
1521         types better.  Put it just after flags.  Change cwd failure
1522         indicator from pointer-to-bool to pointer-to-errno-value.
1523         All callers changed.
1524         Invoke openat_save_fail and/or openat_restore_fail if
1525         cwd_errno is null, so that openat can call us.
1526         (openat_permissive, fdopendir, fstatat, unlinkat):
1527         Simplify errno handling to avoid some duplicate code,
1528         as it's OK to set errno on success.
1529         * openat.h: Revamp code so that function macros depend on
1530         __OPENAT_PREFIX only, not also on AT_FDCWD.
1531         (openat_ro): Remove.  Caller changed to use openat_permissive.
1532         (openat_permissive): Now a macro, if not a function.
1533         (openat_restore_fail, openat_save_fail): Now always functions,
1534         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1535
1536         * openat-priv.h: New file, defining macros used by mkdirat.c
1537         and openat.c.
1538         * mkdirat.c: Include openat-priv.h.
1539         Remove definitions of macros defined therein.
1540         * openat.c: Likewise.
1541
1542         * mkdirat.c (mkdirat): New file and function.
1543         * openat.h (mkdirat): Declare.
1544
1545         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1546
1547         * openat.h (openat_permissive): Declare.
1548         (openat_ro): Define.
1549
1550         * openat.c (EXPECTED_ERRNO): New macro.
1551         (openat_permissive): New function -- used in remove.c rewrite.
1552         (all functions): Set errno just before returning, only if there
1553         was an actual failure.
1554         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1555
1556         Emulate openat-family functions using Linux's procfs, if possible.
1557         Idea and some code based on Ulrich Drepper's glibc changes.
1558
1559         * openat.c: (BUILD_PROC_NAME): New macro.
1560         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1561         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1562         before falling back on save_cwd and restore_cwd.
1563         (fdopendir, fstatat, unlinkat): Likewise.
1564
1565         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1566         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1567
1568         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1569         as second argument to va_arg.  Otherwise, some versions of gcc
1570         warn that `if this code is reached, the program will abort'.
1571
1572 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1573
1574         Sync from coreutils.
1575
1576         Add POSIX ACL support
1577         * acl.h (copy_acl, set_acl): Add declarations.
1578         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1579         systems other than Linux.
1580         (chmod_or_fchmod): New function: use fchmod when possible,
1581         and chmod otherwise.
1582         (file_has_acl): Add a POSIX ACL implementation, with a
1583         Linux-specific subcase.
1584         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1585         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1586         acls are unsupported.
1587         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1588         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1589         are unsupported.
1590
1591 2006-01-09  Bruno Haible  <bruno@clisp.org>
1592
1593         * sysexit_.h (EX_OK): New macro.
1594         Suggested by Martin Lambers <marlam@marlam.de>.
1595
1596 2006-01-09  Bruno Haible  <bruno@clisp.org>
1597
1598         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1599         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1600         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1601         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1602
1603 2006-01-09  Bruno Haible  <bruno@clisp.org>
1604
1605         * stdint_.h (SIZE_MAX): Write the value without involving negative
1606         numbers.
1607
1608 2005-10-16  Bruno Haible  <bruno@clisp.org>
1609
1610         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1611         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1612
1613 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1614
1615         * strftime.c (tzname): Don't declare if it is already #defined.
1616         Problem reported for Mingw by Mark Junker.
1617
1618 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1619
1620         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1621         long int, not int, for nanosecond counts, so that people who are
1622         used to POSIX struct timespec won't be surprised.  Reported by Jim
1623         Meyering.
1624
1625 2005-12-16  Jim Meyering  <jim@meyering.net>
1626
1627         * fprintftime.c, fprintftime.h: New files.
1628
1629 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1630
1631         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1632         * argp-help.c (fill_in_uparams): Check if the constructed
1633         struct uparams is valid. Fall back to the default values if it is
1634         not.
1635
1636 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1637
1638         * argp-help.c (__argp_base_name): New function
1639         (__argp_short_program_name): Rewrite using __argp_base_name
1640         * argp-namefrob.h: Define program_invocation_name and
1641         program_invocation_short_name if requested
1642         (__argp_base_name): Add prototype
1643         * argp-parse.c (argp_def): Use gettext wrappers
1644         (argp_default_parser): Use __argp_base_name
1645         * argp-pin.c: New file. Defines program_invocation_name and
1646         program_invocation_short_name on systems that lack them.
1647
1648 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1649
1650         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1651         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1652         porting problem reported by Georg Schwarz in
1653         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1654
1655 2005-07-09  Bruno Haible  <bruno@clisp.org>
1656
1657         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1658         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1659         Reported by Mark Junker <mjscod@gmx.de>.
1660
1661 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1662
1663         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1664         (uintmax_t) [defined uintmax_t]: Do not declare.
1665         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1666         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1667         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
1668         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1669         sake of portability to weird hosts that C allows (though we don't
1670         know of any practical examples).
1671
1672         * savedir.h (fdsavedir): New decl.
1673         * savedir.c (fdsavedir, savedirstream): New functions; the latter
1674         contains most of the former guts of savedir.
1675         (savedir): Use savedirstream.
1676         Include "openat.h".
1677
1678 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1679
1680         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1681         coreutils no longer futzes with rounding modes.
1682
1683 2005-11-14  Jim Meyering  <jim@meyering.net>
1684
1685         * mkstemp-safer.c: Include <config.h>, required for possible
1686         replacement of mkstemp.
1687
1688 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1689
1690         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1691         business.
1692         (gethrxtime) [! (HAVE_NANOUPTIME
1693         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1694         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1695         our own approximation.
1696
1697 2005-11-10  Simon Josefsson  <jas@extundo.com>
1698
1699         * readline.c: Remove EOL.
1700
1701 2005-11-08  Eric Blake  <ebb9@byu.net>
1702
1703         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1704
1705 2005-11-08  Eric Blake  <ebb9@byu.net>
1706
1707         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1708
1709 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
1710
1711         Fix porting problem reported by Theodoros V. Kalamatianos.
1712         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1713         Don't assume that futimes failing means we must fail.
1714
1715 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
1716
1717         * getcwd.c (__getcwd): Don't assume that system calls after readdir
1718         leave errno alone.  Problem reported by Dmitry V. Levin.
1719
1720 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1721
1722         * savedir.c (savedir): Don't assume that xrealloc etc. leave
1723         errno alone.  Problem reported by Frederic Jolliton.
1724
1725 2005-10-28  Simon Josefsson  <jas@extundo.com>
1726
1727         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
1728         "restrict" keywords, as per POSIX.  Protect the function
1729         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
1730         Don't use K&R prototypes.  Check the sprintf return values.
1731         Re-define EAFNOSUPPORT if not present.  Indent.
1732
1733         * md5.h, md5.c: Simplify buffer handling visavi alignment,
1734         suggested by Bruno Haible <bruno@clisp.org>.
1735
1736         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
1737
1738         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
1739
1740         * gc-libgcrypt.c: Add MD2 (which is not available through
1741         libgcrypt).
1742
1743         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
1744
1745         * md2.h, md2.c: New files.
1746
1747 2005-10-24  Simon Josefsson  <jas@extundo.com>
1748
1749         * md4.h: Shrink buffer size, now that we changed the type.
1750
1751 2005-10-22  Simon Josefsson  <jas@extundo.com>
1752
1753         * arcfour.h, arcfour.c: Use fixed size indices in the
1754         arcfour_context struct (simplify test vector testing in GNU
1755         Shishi).
1756
1757 2005-10-22  Simon Josefsson  <jas@extundo.com>
1758
1759         * md4.h, md4.c: Simplify buffer handling visavi alignment,
1760         suggested by Bruno Haible <bruno@clisp.org>.
1761
1762 2005-10-22  Simon Josefsson  <jas@extundo.com>
1763
1764         * crc.h: Include stddef.h, for size_t.
1765
1766 2005-10-21  Simon Josefsson  <jas@extundo.com>
1767
1768         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
1769         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
1770
1771 2005-10-21  Simon Josefsson  <jas@extundo.com>
1772
1773         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
1774         block.
1775
1776 2005-10-21  Simon Josefsson  <jas@extundo.com>
1777
1778         * gc-gnulib.c: Support ARCTWO in CBC mode.
1779
1780 2005-10-21  Simon Josefsson  <jas@extundo.com>
1781
1782         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
1783         <bruno@clisp.org>.
1784
1785         * hmac-sha1.c (hmac_sha1): Likewise.
1786
1787         * crc.c (crc32_update): Actually use crc parameter, suggested by
1788         Bruno Haible <bruno@clisp.org>.
1789
1790         * crc.h: Include stdint.h directly, suggested by Bruno Haible
1791         <bruno@clisp.org>.
1792
1793 2005-10-21  Simon Josefsson  <jas@extundo.com>
1794
1795         * des.h, des.c: New files.
1796
1797         * gc-gnulib.c: Support DES.c
1798
1799 2005-10-21  Simon Josefsson  <jas@extundo.com>
1800
1801         * arctwo.h, arctwo.c: New files.
1802
1803         * gc-gnulib.c: Support ARCTWO.
1804
1805 2005-10-21  Simon Josefsson  <jas@extundo.com>
1806
1807         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
1808
1809 2005-10-19  Simon Josefsson  <jas@extundo.com>
1810
1811         * gc-gnulib.c: Support ARCFOUR.
1812
1813 2005-10-19  Simon Josefsson  <jas@extundo.com>
1814
1815         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
1816         support.
1817
1818         * gc.h: Add ECB enum type.
1819
1820         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
1821
1822 2005-10-19  Simon Josefsson  <jas@extundo.com>
1823
1824         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
1825
1826 2005-10-18  Simon Josefsson  <jas@extundo.com>
1827
1828         * md4.h, md4.c: New files, based on md5.?.
1829
1830 2005-10-17  Simon Josefsson  <jas@extundo.com>
1831
1832         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
1833
1834         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
1835
1836 2005-10-17  Simon Josefsson  <jas@extundo.com>
1837
1838         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
1839
1840 2005-10-17  Simon Josefsson  <jas@extundo.com>
1841
1842         * gc.h, gc-libgcrypt.c: Add ciphers.
1843
1844 2005-10-17  Simon Josefsson  <jas@extundo.com>
1845
1846         * sha1.c: Use uint32_t instead of md5_uint32.t
1847
1848         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
1849         md5.h.
1850
1851         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
1852
1853         * md5.h: Use stdint.h and uint32_t.  Doc fix.
1854
1855 2005-10-15  Simon Josefsson  <jas@extundo.com>
1856
1857         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
1858
1859         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
1860
1861 2005-10-14  Simon Josefsson  <jas@extundo.com>
1862
1863         * arcfour.h, arcfour.c: New files.
1864
1865 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
1866
1867         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
1868         include <wchar.h>; no longer needed.
1869
1870 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
1871         and  Ulrich Drepper  <drepper@redhat.com>
1872
1873         Import from libc.
1874         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
1875         instead of inline stream orientation test and two separate
1876         function calls.  Pay no attention to USE_IN_LIBIO.
1877
1878 2005-10-14  Roland McGrath  <roland@redhat.com>
1879
1880         Import from libc.  [BZ #1331]
1881         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
1882         macro argument.
1883         Reported by Matej Vela <vela@debian.org>.
1884
1885 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
1886
1887         * mkdir-p.c (make_dir_parents): Don't report an error if an
1888         intermediate directory is in a read-only file system.  Problem
1889         reported by Eric Blake.
1890
1891 2005-10-13  Simon Josefsson  <jas@extundo.com>
1892
1893         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
1894         Move memory allocation outside of loop.
1895
1896 2005-10-12  Simon Josefsson  <jas@extundo.com>
1897
1898         * gc-pbkdf2-sha1.c: New file.
1899
1900         * gc.h: Add gc_pbkdf2_sha1 prototype.
1901
1902 2005-10-12  Simon Josefsson  <jas@extundo.com>
1903
1904         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
1905         suggested by Bruno Haible <bruno@clisp.org>.
1906
1907 2005-10-12  Simon Josefsson  <jas@extundo.com>
1908
1909         * gc-libgcrypt.c (gc_hmac_sha1): New function.
1910
1911         * gc-gnulib.c (gc_hmac_sha1): New function.
1912
1913 2005-10-12  Simon Josefsson  <jas@extundo.com>
1914
1915         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
1916
1917 2005-10-12  Simon Josefsson  <jas@extundo.com>
1918
1919         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
1920         GC_USE_HMAC_MD5, respectively.
1921
1922         * gc-libgcrypt.c (gc_md5): Fix assert call.
1923         (gc_md5): Fix typo.
1924
1925         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
1926
1927         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
1928
1929         * gc-gnulib.c (gc_hash_buffer): Ditto.
1930
1931 2005-10-11  Bruno Haible  <bruno@clisp.org>
1932
1933         * c-strcasestr.h: New file, from GNU gettext.
1934         * c-strcasestr.c: New file, from GNU gettext.
1935
1936 2005-10-11  Bruno Haible  <bruno@clisp.org>
1937
1938         * c-strcase.h: New file, from GNU gettext.
1939         * c-strcasecmp.c: New file, from GNU gettext.
1940         * c-strncasecmp.c: New file, from GNU gettext.
1941
1942 2005-10-11  Simon Josefsson  <jas@extundo.com>
1943
1944         * crc.h, crc.c: New files.
1945
1946         * gc.h (gc_hash_buffer): Add doc.
1947
1948 2005-10-08  Simon Josefsson  <jas@extundo.com>
1949
1950         * gc.h: Add gc_hash and gc_hash_buffer.
1951
1952         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
1953
1954         * gc-libgcrypt.c (gc_hash_buffer): Add.
1955
1956 2005-10-11  Bruno Haible  <bruno@clisp.org>
1957
1958         * strcasecmp.c: Include limits.h.
1959         (strcasecmp): Avoid integer overflow on exotic platforms.
1960         * strncasecmp.c: Include limits.h.
1961         (strncasecmp): Avoid integer overflow on exotic platforms.
1962         Reported by Paul Eggert.
1963
1964 2005-10-06  Simon Josefsson  <jas@extundo.com>
1965
1966         * hmac-md5.c: New file.
1967
1968         * hmac.h: New file.
1969
1970 2005-10-06  Simon Josefsson  <jas@extundo.com>
1971
1972         * memxor.c (memxor): Avoid casts and warnings.
1973
1974 2005-10-05  Derek Price  <derek@ximbiot.com>
1975
1976         * getdelim.c (SIZE_MAX): New macro, if not already defined.
1977
1978 2005-10-05  Simon Josefsson  <jas@extundo.com>
1979
1980         * memxor.c (memxor): Fix compiler error.
1981
1982         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
1983         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
1984
1985         * memxor.h, memxor.c: New files.
1986
1987         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
1988         we assume all systems have it, suggested by Jim Meyering
1989         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
1990         any systems lack sys/socket.h; mingw32 is known to lack it, but we
1991         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
1992         same reasons.
1993
1994 2005-10-04  Bruno Haible  <bruno@clisp.org>
1995
1996         * verify.h (verify_true): Provide alternative definition for C++.
1997
1998 2005-10-04  Simon Josefsson  <jas@extundo.com>
1999
2000         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2001         D. Baushke" <mdb@gnu.org>.
2002
2003 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2004
2005         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2006         (SSIZE_MAX): New macro, if not already defined.
2007         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2008         than 2 GiB.
2009
2010 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2011
2012         * exclude.c: Include verify.h.
2013         (verify): Remove.  All callers changed to use verify.h's version.
2014         * strtoimax.c: Likewise.
2015         * utimecmp.c: Likewis.e
2016
2017         Sync from coreutils.
2018         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2019         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2020         * .cvsignore: Add fts.h, search.h, t-fpending.
2021         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2022         bother returning ENOSYS if settimeofday or stime fails; just let
2023         them return whatever errno they want to return.
2024         * utimens.c: Include unistd.h, for dup2.
2025         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2026         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2027
2028 2005-10-02  Jim Meyering  <jim@meyering.net>
2029
2030         Sync from coreutils.
2031         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2032         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2033         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2034         Remove AT_FDCWD test.
2035         Do not consume the fd unless successful.
2036         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2037         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2038         block, so that we don't even try to compile it if settimeofday is
2039         available.  This works around a compilation failure on OSF1 V5.1,
2040         due to stime requiring a `long int*' while tv_sec is `int'.
2041
2042 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2043
2044         * getdelim.c (getdelim): Remove unused variables.
2045
2046 2005-10-01  Simon Josefsson  <jas@extundo.com>
2047
2048         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2049         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2050         AI_* and EAI_* definitions.  Protect function declarations.
2051
2052 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2053
2054         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2055         so that the code works even with ancient cpp.  Portability problem
2056         with GCC 2.7.2.1 reported by Thomas M.Ott.
2057
2058 2005-09-27  Jim Meyering  <jim@meyering.net>
2059
2060         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2061
2062         * intprops.h (signed_type_or_expr__): Define.
2063         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2064         for unsigned types.
2065
2066 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2067
2068         * verify.h (verify_expr): Remove, replacing with:
2069         (verify_true): New macro that returns true instead of void.
2070         (verify_type__): Remove.
2071         (verify): Use verify_true rather than verify_type__.
2072
2073 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2074
2075         * utimens.c (ENOSYS): Define if not already defined.
2076         (futimens): Support having a null PATH if the file descriptor
2077         is nonnegative.
2078
2079         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2080         Remove.
2081         (__attribute): Define to empty unless GCC 3.1 or later.
2082         This works around a core dump on OpenBSD 3.4, which has GCC
2083         2.95.3, which dumps core when given __attribute__(()).  It also
2084         simplifies other tests, since we really don't want to bother with
2085         worrying about which ancient version of GCC supported what.
2086         Original problem reported by Yoann Vandoorselaere, with part of
2087         the fix suggested by Derek Price.
2088
2089 2005-09-24  Jim Meyering  <jim@meyering.net>
2090
2091         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2092         so we can once again use a positive bitfield width of 1 -- now we
2093         don't have to explain why we were using a bitfield width of 2.
2094
2095 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2096
2097         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2098         Problem reported by Eric Blake.
2099         (getaddrinfo): Initialize se so that it's not garbage.
2100         Redo internal storage allocation so that it doesn't make unportable
2101         assumptions about alignment.
2102         Fix a memory leak.
2103
2104         * utimens.c (futimens): Use futimesat if available.
2105         Prefer it to futimes since it doesn't have the futimes bug.
2106
2107         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2108         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2109         Instead, declare a function that returns a pointer to an array,
2110         and use verify_type__ to declare the size of the array.
2111         Problem and germ of a solution reported by Bruno Haible.
2112         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2113         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2114
2115 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2116
2117         Sync from coreutils.
2118
2119         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2120         stat-time.h.
2121         * argmatch.h: Include verify.h
2122         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2123         (ARGMATCH_ASSERT): Remove; unused.
2124         * canonicalize.c: Assume STDC_HEADERS.
2125         * exclude.c: Include "strcase.h".
2126         * regex_internal.h [!defined _LIBC]: Likewise.
2127         * getusershell.c: Include stdio--.h rather than stdio.h
2128         and stdio-safer.h.
2129         (getusershell): Call fopen, not fopen_safer.
2130         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2131         Do not include unistd-safer.h.
2132         (save_cwd): Don't call fd_safer; no longer needed
2133         now that we include fcntl--.h.
2134
2135         * getdate.y (relative_time): New type.
2136         (RELATIVE_TIME_0): New constant.
2137         (parser_control): Use relative_time instead of doing it ourselves.
2138         (%union): Add new relative_time rel member.
2139         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2140         Now typeless.
2141         (relunit, relunit_snumber): Now of type rel.
2142         (zone, rel, relunit, get_date): Adjust to above changes.
2143
2144         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2145         Do not include unistd-safer.h.
2146         (getloadavg): Don't call fd_safer; no longer needed
2147         now that we include fcntl--.h.
2148
2149         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2150         (make_dir_parents): Treat ENOSYS like EEXIST.
2151
2152         Improve quality of diagnostics on restore_cwd failure.
2153         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2154         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2155         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2156         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2157         each time through the loop.  Do not diagnose restore_cwd failure;
2158         that is the caller's job (and perhaps the caller does not care).
2159
2160         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2161         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2162         If the file already exists but is not a directory, don't bother
2163         to try to make its parents.
2164         Close potential file descriptor leak if we can't chdir("/") (!).
2165         Don't always return true if chdir($PWD) fails; return true only
2166         if the requested action was done successfully (except for the
2167         chdir($PWD)).
2168         Don't log final directory unless we actually made it.
2169         Refactor to avoid duplicate code to fix up permissions.
2170         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2171
2172         * strftime.c (my_strftime): Rewrite the previous change slightly,
2173         to make it a bit faster and (I hope) clearer.
2174         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2175         Fix bug in formats like %2N.
2176
2177         * verify.h: New file.
2178
2179 2005-09-22  Jim Meyering  <jim@meyering.net>
2180
2181         Sync from coreutils.
2182
2183         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2184
2185         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2186         the .tm_year member, since otherwise gcc-4.0 would now warn about
2187         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2188
2189         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2190         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2191
2192         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2193         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2194         when run in a time zone for which daylight savings time is in effect
2195         for the starting date.
2196
2197         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2198         stop us from restricting permissions of just-created absolute-named
2199         directories.
2200         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2201         to restore initial working directory.
2202         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2203         to tell caller if/when we change the working directory and are
2204         unable to return to the initial one.
2205         * mkdir-p.h (make_dir_parents): Update prototype.
2206         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2207         `return false'.  This fixes a bug introduced on 2004-07-30.
2208
2209         * openat.c (fdopendir): Be sure to close the supplied
2210         file descriptor before returning.  This makes our replacement
2211         implementation a little closer to Solaris's, where fdopendir
2212         ties the file descriptor to the returned DIR* pointer.
2213         * openat.c (unlinkat): New function.
2214         * openat.h (unlinkat): Add prototype.
2215         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2216         (openat_restore_fail): Rename from openat_restore_die.
2217         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2218
2219         Provide an alternative to exiting immediately upon save_cwd or
2220         restore_cwd failure.  Now, an application can arrange e.g.,
2221         to perform a longjump in that case.
2222         * openat.c: Include dirname.h.
2223         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2224         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2225         and openat_restore_die rather than calling error directly.
2226         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2227
2228         * openat-die.c (openat_save_die, openat_restore_die): New file.
2229         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2230
2231         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2232         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2233                             int utc, int nanoseconds);
2234         Background:
2235         date should not have to allocate a megabyte of virtual memory to
2236         handle a format argument like +%1048575T.  When implemented with
2237         strftime, it must allocate such a buffer, use strftime to fill it
2238         in, print it, then free it.
2239         With fprintftime, it simply prints everything and exits.
2240         With no need for memory allocation, that's one fewer way to fail.
2241         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2242         optional field width, not before, so we accept %9:z, not %:9z.
2243         (my_strftime): Be sure to use L_('x') for literals.
2244
2245         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2246         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2247         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2248         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2249         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2250         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2251         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2252         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2253         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2254
2255         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2256         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2257         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2258         and don't include <sys/file.h>).
2259
2260 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2261
2262         Sync from coreutils.
2263
2264         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2265         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2266         [!LDAV_DONE]: Avoid unused variable warning.
2267
2268 2005-09-21  Bruno Haible  <bruno@clisp.org>
2269
2270         * unicodeio.h (unicode_to_mb): New declaration.
2271
2272 2005-09-20  Derek Price  <derek@ximbiot.com>
2273
2274         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2275
2276 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2277
2278         Use a consistent style for including <config.h>.
2279         * __fpending.c, acl.c, argmatch.c,
2280         argp-help.c, argp-parse.c,
2281         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2282         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2283         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2284         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2285         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2286         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2287         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2288         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2289         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2290         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2291         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2292         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2293         modechange.c, mountlist.c, open-safer.c, physmem.c,
2294         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2295         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2296         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2297         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2298         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2299         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2300         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2301         userspec.c, utimecmp.c, version-etc-fsf.c,
2302         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2303         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2304         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2305         Standardize inclusion of config.h.
2306         * __fpending.h, dirfd.h, getdate.h, human.h,
2307         inttostr.h:  Removed inclusion of config.h from header files.
2308         * inttostr.c:  Adjusted in-tree users.
2309         * timespec.h: Remove superfluous warning to include config.h.
2310         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2311         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2312         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2313         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2314
2315 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2316
2317         * stat-time.h: New file.
2318         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2319         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2320         in a different way.
2321         (timespec_cmp): New function.
2322         * utimecmp.c: Include stat-time.h.
2323         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2324         members exist, not on the obsolescent ST_MTIM_NSEC.
2325         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2326
2327 2005-09-15  Derek Price  <derek@ximbiot.com>
2328             Paul Eggert  <eggert@cs.ucla.edu>
2329
2330         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2331         changes, consolidating in...
2332         * regex_internal.h: ...this file.
2333
2334 2005-09-15  Derek Price  <derek@ximbiot.com>
2335
2336         * regex_internal.h: Blank `pure' for GNUC < 3.
2337         * regex_internal.c: Ditto, using this...
2338         (__GNUC_PREREQ): ...new macro.
2339         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2340         (__GNUC_PREREQ): ...this new macro.
2341
2342         * strstr.h: Include string.h. Define strstr as a macro here.
2343
2344 2005-09-13  Derek Price  <derek@ximbiot.com>
2345
2346         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2347         failure.
2348         Reported by Jim Meyering  <jim@meyering.net>.
2349
2350 2005-09-13  Jim Meyering  <jim@meyering.net>
2351
2352         * canon-host.c: Filter through gnu indent and reword comments slightly.
2353         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2354
2355 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2356
2357         * lib/base64.c: Typo.
2358         (base64_encode): Put b64str in initialized data section.
2359
2360 2005-09-12  Derek Price  <derek@ximbiot.com>
2361
2362         Return usable errors from canon-host.
2363         * canon-host.h: New file.
2364         * canon-host.c (canon_host): Wrap...
2365         (canon_host_r): ...this new function, which now relies exclusively on
2366         getaddrinfo.
2367         (ch_strerror): New function.
2368         (last_cherror): New global.
2369         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2370         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2371         void *.
2372         (freeaddrinfo): Free ai->ai_canonname when set.
2373
2374 2005-09-12  Derek Price  <derek@ximbiot.com>
2375             Paul Eggert  <eggert@cs.ucla.edu>
2376
2377         * glob-libc.h: Renamed from glob_.h.  The new version is
2378         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2379         protecting things that should be done only in gnulib contexts.
2380         * glob_.h: New file, containing only the glob things needed for
2381         gnulib.
2382         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2383         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2384         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2385         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2386         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2387         and to respect the namespace rules better.
2388
2389 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2390
2391         Merge glibc and coreutils changes into gnulib, plus a few
2392         extra fixes.
2393         * md5.c: Use #error rather than a string.
2394         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2395         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2396         (__attribute__): Define to empty for non recent-GCC.
2397         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2398         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2399         Renamed from their non-__ counterparts, with new macros replacing
2400         them if not _LIBC.  Add __THROW attribute.
2401         (rol): Remove.
2402         (struct md5_ctx): Align buffer if using GCC.
2403         * sha1.h (struct sha1_ctx): Likewise.
2404         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2405         The old name was backwards.
2406         (NOTSWAP): Remove; not used.
2407         (rol): New macro, moved here from md5.h.
2408         (sha1_process_block): Remove a FIXME that doesn't make sense.
2409
2410 2005-09-12  Derek Price  <derek@ximbiot.com>
2411
2412         * gai_strerror.c: Include config.h when available.  Include
2413         getaddrinfo.h before other headers to test interface.
2414         Reported by Larry Jones <lawrence.jones@ugs.com>.
2415
2416 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2417
2418         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2419         definitions, since that's the preferred style in glibc.
2420         Fix a minor spacing issue, and update copyright notice to match glibc's.
2421
2422 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2423
2424         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2425
2426 2005-09-06  Simon Josefsson  <jas@extundo.com>
2427
2428         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2429         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2430
2431 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2432
2433         Change bitset word type from unsigned int to unsigned long int,
2434         as this has better performance on typical 64-bit hosts.
2435         Port bitset code to hosts with unusual word sizes.
2436         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2437         (build_collating_symbol):
2438         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2439         argument is a bitset.  This is merely a style issue, but it makes
2440         it clearer that an entire array is expected.
2441         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2442         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2443         Port to the case where bitset_word is not the same as unsigned int.
2444         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2445         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2446         Likewise.
2447         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2448         (build_trtable, group_nodes_into_DFAstates):
2449         Likewise.
2450         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2451         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2452         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2453         * regexec.c (group_nodes_into_DFAstates): Likewise.
2454         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2455         * regcomp.c (optimize_subexps, lower_subexp):
2456         Work even if bitset_word has holes in its bitwise representation.
2457         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2458         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2459         Likewise.
2460         * regex_internal.c (re_string_reconstruct):
2461         Don't assume UCHAR_MAX == 255.
2462         * regex_internal.h (bitset_set_all): Likewise.
2463         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2464         All uses changed.
2465         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2466         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2467         All uses changed.
2468         (BITSET_WORD_MAX): New macro.
2469         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2470         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2471         (bitset_empty, bitset_copy):
2472         Prefer sizeof (bitset) to multiplying it out ourselves.
2473         (bitset_not_merge): Remove; unused.
2474         (bitset_contain): Return bool, not unsigned int with one bit on.
2475         All callers changed.
2476         * regexec.c (build_trtable): Don't assume bitset has no stricter
2477         alignment than re_node_set; do this by defining a new internal
2478         type struct dests_alloc and using it to allocate memory.
2479
2480 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2481
2482         Check for arithmetic overflow when calculating sizes, to prevent
2483         some buffer-overflow issues.  These patches are conservative, in the
2484         sense that when I couldn't determine whether an overflow was possible,
2485         I inserted a run-time check.
2486         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2487         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2488         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2489         (re_xnrealloc, re_x2nrealloc): New inline functions.
2490         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2491         (build_equiv_class, build_charclass): Check for arithmetic overflow
2492         in size expression calculations.
2493         * lib/regex_internal.c (re_string_realloc_buffers):
2494         (build_wcs_upper_buffer, re_node_set_add_intersect):
2495         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2496         (re_dfa_add_node, register_state): Likewise.
2497         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2498         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2499         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2500         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2501
2502 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2503
2504         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2505         to avoid a collision with bits/local_lim.h in glibc.
2506         All uses changed.  Problem reported by Dmitry V. Levin in
2507         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2508
2509         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2510         bugs in int versus size_t comparisons.
2511         (re_string_context_at): Fix bug where the code assumed that
2512         Idx is signed.
2513
2514         Use bool where appropriate.
2515         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2516         All callers changed.
2517         (calc_eclosure_iter): Likewise, for ROOT arg.
2518         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2519         (build_charclass_op): Likewise, for NON_MATCH arg.
2520         * regex_internal.c (re_string_allocate, re_string_construct):
2521         (re_string_construct_common): Likewise, for ICASE arg.
2522         * regexec.c (re_search_2_stub, re_search_stub):
2523         Likewise, for RET_LEN arg.
2524         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2525         (set_regs): Likewise, for FL_BACKTRACK arg.
2526         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2527         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2528         (calc_eclosure_iter, parse_bracket_exp):
2529         Use bool for internal variables that are booleans.
2530         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2531         (set_regs, build_sifted_states, sift_states_bkref):
2532         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2533         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2534         (find_collation_sequence_value):
2535         Likewise.
2536         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2537         (re_node_set_compare):
2538         Return bool, not int. All callers changed.
2539         * regexec.c (check_halt_node_context, check_dst_limits):
2540         (build_trtable, check_node_accept): Likewise.
2541         * regex_internal.h: Include stdbool.h.
2542
2543         Fix bugs uncovered when converting to bool.
2544         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2545         failure instead of charging ahead blindly.
2546         * regex_internal.c (register_state): Likewise.
2547         * regexec.c (re_search_2_stub): Use simpler method than boolean
2548         for freeing internal storage.
2549         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2550         bitset pieces used as boolean, to avoid undefined behavior
2551         on hosts that do int overflow checking.
2552
2553 2005-08-31  Derek Price  <derek@ximbiot.com>
2554
2555         * getdelim.c (getdelim): Return EOF on EOF.
2556         Reported by Larry Jones <lawrence.jones@ugs.com>.
2557
2558 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2559
2560         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2561         lengths fit in regoff_t; this isn't true if regoff_t is the same
2562         width as size_t.
2563         * regex.c (re_search_internal): 5th arg is LAST_START
2564         (= START + RANGE) instead of RANGE.  This avoids overflow
2565         problems when regoff_t is the same width as size_t.
2566         All callers changed.
2567         (re_search_2_stub): Check for overflow when adding the
2568         sizes of the two strings.
2569         (re_search_stub): Check for overflow when adding START
2570         to RANGE; if it occurs, substitute the extreme value.
2571
2572 2005-08-31  Jim Meyering  <jim@meyering.net>
2573
2574         * regcomp.c (search_duplicated_node): Make first pointer arg
2575         a pointer-to-const.
2576         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2577         (register_state): Likewise.
2578         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2579         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2580         (group_nodes_into_DFAstates): Likewise.
2581
2582 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2583
2584         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2585         old glibc regex code mishandles strings longer than 2**31 bytes.
2586         This patch fixes this when the regex code is used in gnulib
2587         (i.e., outside glibc).
2588
2589         This patch should not affect the use of the regex code inside
2590         glibc.  No doubt this problem also needs to be handled for glibc
2591         as well, but the result will be an incompatible change to the
2592         glibc ABI, and the old ABI will have to be supported too.  That
2593         can be the the subject for another patch.
2594
2595         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2596         governing whether the rest of this patch is active.  By default,
2597         the macro is disabled and the patch has no effect.
2598         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2599         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2600         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2601         (re_match_2, re_set_registers): Use the new types.
2602         * regex_internal.h (Idx, re_hashval_t): New types.
2603         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2604         New macros.
2605         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2606         (re_string_context_at, bin_tree_t, re_dfastate_t):
2607         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2608         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2609         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2610         (re_string_char_size_at, re_string_wchar_at):
2611         (re_string_elem_size_at):
2612         Use the new types and macros to port to 64-bit hosts.
2613         Use unsigned types for internal values, so that the code
2614         mostly works even for arrays larger than SSIZE_MAX.
2615         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2616         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2617         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2618         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2619         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2620         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2621         (calc_inveclosure, parse_dup_op, build_range_exp):
2622         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2623         (fetch_number, create_token_tree, mark_opt_subexp):
2624         Likewise.
2625         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2626         (create_cd_newstate, re_string_allocate, re_string_construct):
2627         (re_string_realloc_buffers, build_wcs_upper_buffer):
2628         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2629         (re_string_reconstruct, re_string_peek_byte_case):
2630         (re_string_fetch_byte_case, re_string_context_at):
2631         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2632         (re_node_set_init_copy, re_node_set_add_intersect):
2633         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2634         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2635         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2636         (re_acquire_state, re_acquire_state_context, register_state):
2637         Likewise.
2638         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2639         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2640         (re_search_internal, re_search_2_stub, re_search_stub)
2641         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2642         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2643         (update_cur_sifted_state, check_dst_limits):
2644         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2645         (check_subexp_limits, sift_states_bkref, merge_state_array):
2646         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2647         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2648         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2649         (expand_bkref_cache, check_node_accept_bytes):
2650         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2651         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2652         (acquire_init_state_context, check_halt_node_context):
2653         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2654         (sift_states_backward, clean_state_log_if_needed):
2655         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2656         (find_recover_state, transit_state_sb, transit_state_mb):
2657         (transit_state_bkref, build_trtable, match_ctx_clean):
2658         Likewise.
2659         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2660         to work around an assumption that REG_MISSING is negative.
2661
2662         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2663         (seek_collating_symbol_entry) [defined _LIBC]:
2664         (lookup_collation_sequence_value) [defined _LIBC]:
2665         (build_range_exp, build_collating_symbol) [defined _LIBC]:
2666         Use prototypes rather than old-style function definitions.
2667         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2668         (transit_state_sb) [0]:
2669         (find_collation_sequence_value) [defined _LIBC]: Likewise.
2670
2671         * regexec.c (re_search_internal): Simplify update of rm_so and
2672         rm_eo.
2673
2674         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2675         (optimize_subexps, lower_subexp):
2676         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2677         since the signed shift might overflow.  Use 1u<<31 instead.
2678         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2679         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2680         Likewise.
2681
2682         * regcomp.c (optimize_subexps, lower_subexp):
2683         Use CHAR_BIT rather than 8, for clarity.
2684         * regexec.c (check_dst_limits_calc_pos_1):
2685         (check_subexp_matching_top): Likewise.
2686         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2687         have to worry about portability issues when shifting it left.
2688         Remove no-longer-needed test for table_size > 0.
2689         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2690         in a word, as the resulting behavior is undefined.
2691         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2692         in one case, a <= should have been an <, and in another case the
2693         whole test was missing.
2694         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
2695         the standard name CHAR_BIT.
2696         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2697         this is not true on one's complement and signed-magnitude hosts.
2698
2699         * regex_internal.h (re_sub_match_top_t): Remove unused member
2700         next_last_offset.
2701         (struct re_dfa_t): Remove unused member states_alloc.
2702         * regcomp.c (init_dfa): Don't initialize unused members.
2703
2704 2005-08-31  Bruno Haible  <bruno@clisp.org>
2705
2706         * strstr.c: Include <stddef.h>, for NULL.
2707         * strcasestr.c: Likewise.
2708         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2709
2710 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
2711
2712         * iconvme.h: Add prototype for iconv_alloc.
2713
2714 2005-08-29  Simon Josefsson  <jas@extundo.com>
2715
2716         * iconvme.c: Fix errno.
2717
2718 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
2719
2720         * iconvme.c: Split iconv_string into iconv_alloc.
2721
2722 2005-08-27  Jim Meyering  <jim@meyering.net>
2723
2724         * fopen-safer.c: Merge minor changes from coreutils.
2725         * dup-safer.c: Likewise.
2726         * fd-safer.c: Likewise.
2727
2728         Merge from coreutils.
2729         * stdio--.h: New file.
2730         * stdlib--.h: New file.
2731         * mkstemp-safer.c: New file.
2732
2733         GNU tar needs these.
2734         * pipe-safer.c: New file.
2735         * creat-safer.c: New file.
2736         * fcntl--.h (creat): Define to creat_safer.
2737         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
2738         * unistd--.h (pipe): Define to pipe_safer.
2739         * unistd-safer.h: Declare pipe_safer.
2740
2741 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
2742
2743         * regex_internal.h: Remove all references to
2744         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
2745         or better.
2746         (bitset_not, bitset_merge, bitset_not_merge):
2747         (bitset_mask, re_string_allocate, re_string_construct):
2748         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
2749         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
2750         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
2751         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
2752         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2753         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2754         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
2755         (re_acquire_state_context):
2756         Remove unnecessary forward decls.
2757         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
2758         Put __attribute at function definition,
2759         now that the function decl has been removed.
2760         * lib/regex_internal.c (re_string_peek_byte_case):
2761         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
2762         Likewise.
2763
2764 2005-08-26  Simon Josefsson  <jas@extundo.com>
2765
2766         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
2767         Haible <bruno@clisp.org>.
2768
2769 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2770
2771         * regexec.c (set_regs): Don't alloca with an unbounded size.
2772
2773         alloca modernization/simplification for regex.
2774         * regex.c: Remove portability cruft for alloca.  This no longer
2775         needs to be at the start of the file, and can be moved into
2776         regex_internal.h and simplified.
2777         * regex_internal.h: Include <alloca.h>.
2778         (__libc_use_alloca) [!defined _LIBC]: New macro.
2779         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
2780         now works outside glibc.
2781
2782 2005-08-24  Simon Josefsson  <jas@extundo.com>
2783
2784         * getpass.c: Add WIN32 implementation.  Conditionalize use of
2785         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
2786         GLIBC specific code.
2787
2788 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2789
2790         Make regex safe for g++.  This fixes one real bug (an "err"
2791         that should have been "*err").  g++ problem reported by
2792         Sam Steingold.
2793         * regex_internal.h (re_calloc): New macro, consistent with
2794         re_malloc etc.  All callers of calloc changed to use re_calloc.
2795         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
2796         not int.  All callers changed.
2797         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
2798         just use an array of size MB_LEN_MAX.
2799         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
2800         (find_recover_state): Change "err" to "*err"; this fixes what
2801         appears to be a real bug.
2802         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
2803         versus int.
2804
2805 2005-08-25  Jim Meyering  <jim@meyering.net>
2806
2807         * open-safer.c: Include <config.h>.
2808         Otherwise, we'd lose LARGEFILE support in any file using
2809         e.g. "fcntl--.h"
2810
2811 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2812
2813         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
2814         * regex.h (regerror): Likewise.
2815
2816         * regex.c: Do not include <sys/types.h>, as POSIX no longer
2817         requires this.  (The code never needed it.)
2818
2819         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
2820         All uses of recently-renamed identifiers changed to use the new,
2821         POSIX-compliant names.  The code will build and run just fine
2822         without these changes, but it's better to eat our own dog food
2823         and use the standard-conforming names.
2824
2825         * regex.h: Fix a multitude of POSIX name space violations.
2826         These changes have an effect only for programs that define
2827         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
2828         do not change anything for programs compiled in the normal way.
2829         Also, there is no effect on the ABI.
2830
2831         (_REGEX_SOURCE): New macro.
2832         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
2833         defined and _GNU_SOURCE is not; this fixes a name space violation.
2834
2835         Rename the following macros to obey POSIX requirements.
2836         The old names are still visible as macros if _REGEX_SOURCE is defined.
2837         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
2838         RE_BACKSLASH_ESCAPE_IN_LISTS.
2839         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
2840         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
2841         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
2842         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
2843         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
2844         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
2845         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
2846         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
2847         (REG_INTERVALS): renamed from RE_INTERVALS.
2848         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
2849         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
2850         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
2851         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
2852         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
2853         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
2854         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
2855         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
2856         RE_UNMATCHED_RIGHT_PAREN_ORD.
2857         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
2858         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
2859         (REG_DEBUG): renamed from RE_DEBUG.
2860         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
2861         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
2862         unusual, since we can't clash with the POSIX REG_ICASE.
2863         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
2864         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
2865         (REG_NO_SUB): renamed from RE_NO_SUB.
2866         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
2867         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
2868         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
2869         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
2870         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
2871         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
2872         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
2873         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
2874         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
2875         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
2876         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
2877         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
2878         RE_SYNTAX_POSIX_MINIMAL_BASIC.
2879         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
2880         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
2881         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
2882         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
2883         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
2884         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
2885         (REG_FIXED): Renamed from REGS_FIXED.
2886         (REG_NREGS): Renamed from RE_NREGS.
2887
2888         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
2889         of other REG_* macros, since POSIX says the user is allowed to
2890         #undef these macros selectively.
2891
2892         (reg_errcode_t): Update comment stating what other tables need
2893         to be consistent.
2894
2895         Rename the following enum values to obey POSIX requirements.
2896         The old names are still visible as macros.
2897         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
2898         is not defined, since GNU is supposed to be a superset of POSIX as
2899         much as possible, and since we want reg_errcode_t to be a signed
2900         type for implementation consistency.
2901         (_REG_NOERROR): Renamed from REG_NOERROR.
2902         (_REG_NOMATCH): Renamed from REG_NOMATCH.
2903         (_REG_BADPAT): Renamed from REG_BADPAT.
2904         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
2905         (_REG_ECTYPE): Renamed from REG_ECTYPE.
2906         (_REG_EESCAPE): Renamed from REG_EESCAPE.
2907         (_REG_ESUBREG): Renamed from REG_ESUBREG.
2908         (_REG_EBRACK): Renamed from REG_EBRACK.
2909         (_REG_EPAREN): Renamed from REG_EPAREN.
2910         (_REG_EBRACE): Renamed from REG_EBRACE.
2911         (_REG_BADBR): Renamed from REG_BADBR.
2912         (_REG_ERANGE): Renamed from REG_ERANGE.
2913         (_REG_ESPACE): Renamed from REG_ESPACE.
2914         (_REG_BADRPT): Renamed from REG_BADRPT.
2915         (_REG_EEND): Renamed from REG_EEND.
2916         (_REG_ESIZE): Renamed from REG_ESIZE.
2917         (_REG_ERPAREN): Renamed from REG_ERPAREN.
2918         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
2919         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
2920         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
2921         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
2922
2923         (_REG_RE_NAME, _REG_RM_NAME): New macros.
2924         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
2925         changed.  But support the old name if the new one is not defined
2926         and if _REGEX_SOURCE.
2927
2928         Change the following member names in struct re_pattern_buffer.
2929         The old names are still supported if !_REGEX_SOURCE.
2930         The new names are always supported, regardless of _REGEX_SOURCE.
2931         (re_buffer): Renamed from buffer.
2932         (re_allocated): Renamed from allocated.
2933         (re_used): Renamed from used.
2934         (re_syntax): Renamed from syntax.
2935         (re_fastmap): Renamed from fastmap.
2936         (re_translate): Renamed from translate.
2937         (re_can_be_null): Renamed from can_be_null.
2938         (re_regs_allocated): Renamed from regs_allocated.
2939         (re_fastmap_accurate): Renamed from fastmap_accurate.
2940         (re_no_sub): Renamed from no_sub.
2941         (re_not_bol): Renamed from not_bol.
2942         (re_not_eol): Renamed from not_eol.
2943         (re_newline_anchor): Renamed from newline_anchor.
2944
2945         Change the following member names in struct re_registers.
2946         The old names are still supported if !_REGEX_SOURCE.
2947         The new names are always supported, regardless of _REGEX_SOURCE.
2948         (rm_num_regs): Renamed from num_regs.
2949         (rm_start): Renamed from start.
2950         (rm_end): Renamed from end.
2951
2952         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
2953         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
2954         Prepend __ to parameter names.
2955
2956         Undo yesterday's changes.
2957
2958 2005-08-24  Jim Meyering  <jim@meyering.net>
2959
2960         Sync from coreutils.
2961         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
2962
2963 2005-08-21  Bruno Haible  <bruno@clisp.org>
2964
2965         * lock.h: Add multiple inclusion guard.
2966         * tls.h: Add multiple inclusion guard.
2967
2968 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2969
2970         * regex.h (REG_NOSYS)
2971         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
2972         Define, since POSIX requires it as of 2001.
2973         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
2974         New private symbol, used to keep the enum signed in all cases.
2975         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
2976         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
2977
2978         * regex_internal.c (re_string_skip_chars, register_state):
2979         (calc_state_hash):
2980         Remove forward decls; no longer needed now that we use prototypes.
2981         * regexec.c (acquire_init_state_context, check_halt_node_context):
2982         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
2983         (clean_state_log_if_needed): Likewise.
2984
2985 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2986
2987         Fix problems reported by Sam Steingold in
2988         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
2989         * regexec.c (sift_states_bkref): Fix portability bug: the code
2990         assumed that reg_errcode_t is a signed type, which is not
2991         necessarily true if _XOPEN_SOURCE is not defined.
2992         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
2993         some compilers warn about it otherwise.
2994
2995 2005-08-20  Jim Meyering  <jim@meyering.net>
2996
2997         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
2998         of unused local, dfa.
2999
3000 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3001
3002         * regcomp.c (create_initial_state): Remove duplicate decl.
3003         (init_word_char, create_initial_state, duplicate_node_closure):
3004         (fetch_token, peek_token_bracket, build_range_exp):
3005         (build_collating_symbol): Remove forward decls; no longer needed
3006         now that we use prototypes.
3007
3008         * regcomp.c:
3009         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3010         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3011         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3012         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3013         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3014         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3015         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3016         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3017         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3018         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3019         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3020         (build_charclass, build_charclass_op, fetch_number, create_tree):
3021         (create_token_tree, mark_opt_subexp, duplicate_tree):
3022         Use prototypes rather than old-style definitions.
3023
3024         * regex_internal.c:
3025         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3026         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3027         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3028         (re_string_reconstruct, re_string_peek_byte_case):
3029         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3030         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3031         (re_node_set_init_copy, re_node_set_add_intersect):
3032         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3033         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3034         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3035         (re_acquire_state, re_acquire_state_context, register_state):
3036         (create_ci_newstate, create_cd_newstate, free_state):
3037         Likewise.
3038         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3039         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3040         (re_search_internal, prune_impossible_nodes):
3041         (acquire_init_state_context, check_matching, static):
3042         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3043         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3044         (update_regs, sift_states_backward, build_sifted_states):
3045         (clean_state_log_if_needed, merge_state_array):
3046         (update_cur_sifted_state, add_epsilon_src_nodes):
3047         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3048         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3049         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3050         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3051         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3052         (check_arrival, check_arrival_add_next_nodes):
3053         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3054         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3055         (check_node_accept_bytes, check_node_accept, extend_buffers):
3056         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3057         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3058         (sift_ctx_init):
3059         Likewise.
3060
3061         * regex_internal.h:
3062         (re_string_allocate, re_string_construct, re_string_reconstruct):
3063         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3064         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3065         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3066         (re_string_context_at, re_string_peek_byte_case):
3067         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3068         is defined, since we now use prototypes always.
3069
3070         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3071         C89 or better.  All uses removed.
3072
3073 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3074
3075         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3076         [defined lint]: Suppress bogus uninitialized-variable warnings.
3077
3078         * regcomp.c (duplicate_node): Return new index, not an error code,
3079         and let the caller return REG_ESPACE if out of space.  This
3080         removes an uninitialied-variable warning with GCC 4.0.1, and also
3081         avoids taking the address of a local variable.  All callers
3082         changed.
3083
3084 2005-08-19  Jim Meyering  <jim@meyering.net>
3085
3086         * regexec.c (proceed_next_node): Redo local variables to
3087         avoid GCC shadowing warnings.
3088
3089 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3090
3091         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3092         (re_node_set_insert_last, re_dfa_add_node):
3093         Rename local variables to avoid GCC shadowing warnings.
3094
3095 2005-08-18  Bruno Haible  <bruno@clisp.org>
3096
3097         * strstr.c (strstr): Fix return value in multibyte case.
3098         * strcasestr.c (strcasestr): Likewise.
3099
3100 2005-08-17  Jim Meyering  <jim@meyering.net>
3101
3102         Make the %s format (seconds since the epoch) work for a negative
3103         number and when used with a zero-padded field width, e.g. %015s.
3104
3105         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3106         label so that it precedes the code to set `digits'.  Otherwise,
3107         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3108         print `00-22'.  Now, it prints `-0022', as it should.
3109
3110 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3111
3112         * regex.h: Remove useless space-before-tab.  From coreutils.
3113
3114 2005-08-17  Bruno Haible  <bruno@clisp.org>
3115
3116         * strcasestr.h: New file.
3117         * strcasestr.c: New file.
3118
3119 2005-08-17  Bruno Haible  <bruno@clisp.org>
3120
3121         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3122         * strstr.c: Completely rewritten, with multibyte locale support.
3123
3124 2005-08-17  Bruno Haible  <bruno@clisp.org>
3125
3126         * strcasecmp.c: Use mbuiter.h.
3127
3128 2005-08-17  Bruno Haible  <bruno@clisp.org>
3129
3130         * mbuiter.h: New file.
3131
3132 2005-08-16  Bruno Haible  <bruno@clisp.org>
3133
3134         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3135         (mbi_init): Update.
3136         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3137         NUL byte, not after it.
3138
3139 2005-08-16  Bruno Haible  <bruno@clisp.org>
3140
3141         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3142         the valid ones. Makes the comparison operations transitive:
3143         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3144         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3145
3146 2005-08-16  Bruno Haible  <bruno@clisp.org>
3147
3148         * strcase.h (strcasecmp): Add note in comments.
3149         * strncasecmp.c: Use code from strcasecmp.c.
3150         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3151         (strcasecmp): Work correctly in multibyte locales.
3152
3153 2005-08-16  Bruno Haible  <bruno@clisp.org>
3154
3155         * strnlen1.h: New file.
3156         * strnlen1.c: New file.
3157
3158 2005-08-16  Bruno Haible  <bruno@clisp.org>
3159
3160         * mbfile.h: New file.
3161
3162 2005-08-16  Bruno Haible  <bruno@clisp.org>
3163
3164         * mbiter.h: New file.
3165
3166 2005-08-16  Bruno Haible  <bruno@clisp.org>
3167
3168         * mbchar.h: New file.
3169         * mbchar.c: New file.
3170
3171 2005-08-16  Bruno Haible  <bruno@clisp.org>
3172
3173         * tls.h: New file, from GNU gettext.
3174         * tls.c: New file, from GNU gettext.
3175
3176 2005-08-15  Bruno Haible  <bruno@clisp.org>
3177
3178         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3179         is defined.
3180
3181 2005-08-14  Jim Meyering  <jim@meyering.net>
3182
3183         Sync from coreutils.
3184
3185         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3186         Use the hash-table-based cycle-detection code not just when
3187         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3188         Reported by James Youngman in
3189         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3190         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3191         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3192         This lets us compile with -DFTS_DEBUG, once again.
3193         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3194         * fts.c (fd_safer): Remove decl.
3195         Include fcntl--.h rather than unistd-safer.h
3196         (fts_safe_changedir): Don't call fd_safer; no longer needed
3197         now that we include fcntl--.h.
3198
3199 2005-08-11  Simon Josefsson  <jas@extundo.com>
3200
3201         * readline.h, readline.c: New file.
3202
3203 2005-08-11  Bruno Haible  <bruno@clisp.org>
3204
3205         * strnlen.h (strnlen): Change parameter name to match comment.
3206
3207 2005-08-10  Simon Josefsson  <jas@extundo.com>
3208
3209         * strndup.c: Use strnlen.h.
3210
3211         * strnlen.h: New file.
3212
3213 2005-08-02  Simon Josefsson  <jas@extundo.com>
3214
3215         * getline.h, getline.c: Rewrite.
3216
3217         * getdelim.h, getdelim.c: New files, ported from glibc.
3218
3219 2005-07-31  Bruno Haible  <bruno@clisp.org>
3220
3221         * lock.h (gl_lock_initializer): New macro.
3222         (gl_lock_define_initialized): Use it.
3223         (gl_rwlock_initializer): New macro.
3224         (gl_rwlock_define_initialized): Use it.
3225         (gl_recursive_lock_initializer): New macro.
3226         (gl_recursive_lock_define_initialized): Use it.
3227
3228 2005-07-26  Bruno Haible  <bruno@clisp.org>
3229
3230         * lock.h: Update from GNU gettext.
3231         * lock.c: Update from GNU gettext.
3232
3233 2005-07-18  Bruno Haible  <bruno@clisp.org>
3234
3235         * lock.h (gl_once_t): New type.
3236         (gl_once_define, gl_once): New macros.
3237         * lock.c (fresh_once): New variable.
3238         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3239         functions.
3240
3241 2005-07-18  Simon Josefsson  <jas@extundo.com>
3242
3243         * check-version.c (check_version): Accept identical versions too.
3244
3245 2005-07-18  Bruno Haible  <bruno@clisp.org>
3246
3247         * lock.h: New file, from GNU gettext.
3248         * lock.c: New file, from GNU gettext.
3249
3250 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3251
3252         * quotearg.c: Add translator comment suggested by Bruno Haible,
3253         with a minor change.
3254
3255 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3256
3257         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3258         copyright symbol and the year.
3259         * version-etc.c (COPYRIGHT_YEAR): New constant.
3260         (version_etc_va): Use parameterized copyright notice.
3261         Reword to conform to the current GNU coding standards.
3262
3263 2005-07-11  Simon Josefsson  <jas@extundo.com>
3264
3265         * size_max.h: New file.
3266
3267 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3268
3269         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3270         block of defines.
3271
3272 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3273        and  Paul Eggert  <eggert@cs.ucla.edu>
3274
3275         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3276         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3277
3278 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3279
3280         * regex.c, regex.h: Sync from libc.
3281         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3282         New files, synced from libc, except that regex_internal.h
3283         currently has a small porting fix.
3284
3285 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3286
3287         Remove the dependency of the strftime module on the tzset module.
3288         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3289         Copy the input structure, to work around some of the bug with
3290         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3291         Solaris releases, you should also use the tzset module, but we won't
3292         require it as a dependency any more since we don't want LGPLed code
3293         to depend on GPLed code.
3294
3295 2005-07-02  Jim Meyering  <jim@meyering.net>
3296
3297         * backupfile.c (backup_args): Change a `0' to NULL.
3298
3299 2005-07-01  Jim Meyering  <jim@meyering.net>
3300
3301         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3302         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3303         * save-cwd.c, tempname.c:
3304         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3305         and don't include <sys/file.h>).
3306
3307 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3308
3309         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3310         declares only 'struct timespec;' (!).
3311
3312 2005-06-29  Jim Meyering  <jim@meyering.net>
3313
3314         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3315         type name.  Use the variable name instead.
3316         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3317
3318 2005-06-28  Simon Josefsson  <jas@extundo.com>
3319
3320         * check-version.h, check-version.c: New files.
3321
3322 2005-06-28  Simon Josefsson  <jas@extundo.com>
3323
3324         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3325         collision with global variable.  Better indentation.  Don't
3326         increment buffer pointer beyond buffer end.  Based on comments
3327         from Paul Eggert <eggert@cs.ucla.edu>.
3328
3329         * base64.h: Indent.
3330
3331 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3332
3333         * canon-host.c (canon-host): Append trailing "," to 0 in
3334         initializer of struct addrinfo, as an indication that we don't
3335         care how many members the structure has.
3336
3337 2005-06-24  Derek Price  <derek@ximbiot.com>
3338         and Bruno Haible  <bruno@clisp.org>
3339
3340         Remove stat module & update lstat.
3341         * stat.c: Remove this file...
3342         (slash_aware_lstat): ...moving this content and its support...
3343         * lstat.c (rpl_lstat): ...into here.
3344         * lstat.h: New file.
3345
3346 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3347
3348         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3349         (ranged_convert): Don't save conversion in a temporary struct.
3350         This causes a warning with GCC 4.0.0, and anyway in the typical
3351         case it's not worth the extra 100 bytes or so of code.
3352         (ranged_convert, __mktime_internal): When calling a function via a
3353         pointer P, use P () rather than (*P) (), as we now assume C89 or
3354         better.
3355
3356 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3357
3358         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3359         "who -r" failed to give output.  Problem reported by Tim Waugh.
3360
3361         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3362         (xcalloc): Use it to avoid needless tests.
3363         Problem reported by Jim Meyering.
3364
3365 2005-06-16  Jim Meyering  <jim@meyering.net>
3366
3367         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3368         when either N or S is zero.
3369
3370 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3371
3372         * argp.h (__option_is_short): Check upper limit of
3373         __key. Isprint() requires its argument to have the value
3374         of an unsigned char or EOF.
3375
3376 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3377
3378         * fnmatch.c (fnmatch): If there is an encoding error in a
3379         multibyte string or pattern, fall back on unibyte matching.
3380         Problem reported by James Youngman.
3381
3382 2005-06-08  Bruno Haible  <bruno@clisp.org>
3383
3384         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3385         warning on mingw.
3386
3387 2005-06-08  Bruno Haible  <bruno@clisp.org>
3388
3389         * csharpcomp.h: New file, from GNU gettext.
3390         * csharpcomp.c: New file, from GNU gettext.
3391         * csharpcomp.sh.in: New file, from GNU gettext.
3392
3393 2005-06-07  Derek Price  <derek@ximbiot.com>
3394
3395         Sync from CVS.
3396         * glob_.h: Indent nested #ifdef.
3397
3398 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3399
3400         Sync from coreutils.
3401         Use "file name" when talking about file names, instead of "filename"
3402         or "path", as per the GNU coding standards.
3403         * mkdir-p.c: Renamed from makepath.c.
3404         (make_dir_parents): Renamed from make_path.  All callers changed.
3405         * mkdir-p.h: Likewise.  All includers changed.
3406         * filenamecat.c: Renamed from path-concat.c.
3407         (file_name_concat): Renamed from path_concat.  All callers changed.
3408         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3409         * filenamecat.h: Likewise.  All includers changed.
3410         * acl.c: Don't use "path" or "filename" to mean "file name"
3411         in comments or local variable names.
3412         * basename.c: Likewise.
3413         * canonicalize.c, canonicalize.h: Likewise.
3414         * dirname.c, dirname.h: Likewise.
3415         * euidaccess.c: Likewise.
3416         * exclude.c: Likewise
3417         * fnmatch_.h, fnmatch_loop.c: Likewise.
3418         * fsusage.c, fsuage.h: Likewise.
3419         * fts.c, fts_.h: Likewise.
3420         * getcwd.c: Likewise.
3421         * getloadavg.c: Likewise.
3422         * mkstemp.c: Likewise.
3423         * mountlist.c, mountlist.h: Likewise.
3424         * openat.c, openat.h: Likewise.
3425         * readlink-stub.c: Likewise.
3426         * readutmp.c, readutmp.h: Likewise.
3427         * rename.c: Likewise.
3428         * rmdir.c: Likewise.
3429         * same.c: Likewise.
3430         * savedir.c: Likewise.
3431         * stripslash.c: Likewise.
3432         * tempname.c: Likewise.
3433         * xreadlink.c: Likewise.
3434         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3435         All uses changed.
3436         * exclude.h: Likewise.
3437
3438         * euidaccess.c (getuid, getgid, getuid, getegid)
3439         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3440         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3441         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3442         * pathmax.h: Include <limits.h> unconditionally, since other
3443         files have been getting away with it for years (MORE/BSD 4.3
3444         is extinct now).
3445         * userspec.c (getpwnam, getgrnam, getgrgid)
3446         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3447
3448         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3449         Define to 256, not 255, as per modern POSIX.
3450
3451 2005-06-01  Bruno Haible  <bruno@clisp.org>
3452
3453         * csharpexec.h: New file, from GNU gettext.
3454         * csharpexec.c: New file, from GNU gettext.
3455         * csharpexec.sh.in: New file, from GNU gettext.
3456
3457 2005-05-31  Derek Price  <derek@ximbiot.com>
3458             Paul Eggert  <eggert@cs.ucla.edu>
3459
3460         Sync from cvs.
3461         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3462
3463 2005-05-29  Derek Price  <derek@ximbiot.com>
3464             Paul Eggert  <eggert@cs.ucla.edu>
3465
3466         * glob_.h, glob.c: New files.
3467
3468 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3469
3470         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3471
3472         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3473         the configuration hassle isn't worth it.
3474         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3475         (LONGEST_MODIFIER, PRIuMAX): Remove.
3476
3477 2005-05-27  Bruno Haible  <bruno@clisp.org>
3478
3479         * getlogin_r.h: Remove second include of <stddef.h>.
3480
3481 2005-05-25  Bruno Haible  <bruno@clisp.org>
3482             Derek Price  <derek@ximbiot.com>
3483
3484         * getlogin_r.h: Simplify API documentation.
3485
3486 2005-05-25  Derek Price  <derek@ximbiot.com>
3487             Paul Eggert  <eggert@cs.ucla.edu>
3488
3489         * getlogin_r.c, getlogin_r.h: New files.
3490
3491 2005-05-22  Bruno Haible  <bruno@clisp.org>
3492
3493         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3494         Also include <sys/param.h> if it defines MIN, MAX.
3495         Based on a patch by Derek Price <derek@ximbiot.com>.
3496
3497 2005-05-22  Bruno Haible  <bruno@clisp.org>
3498
3499         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3500         (INT64_MIN): Fix definition.
3501         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3502
3503         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3504         NEED_SIGNED_INT_TYPES.
3505
3506         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3507         HAVE_SYSTEM_INTTYPES.
3508
3509 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3510
3511         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3512         so that unistd-safer.h (GPL'ed code) need not be included.
3513
3514 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3515
3516         New fts module.
3517         * fts.c: Don't include "cycle-check.h" or "hash.h".
3518         (setup_dir, free_dir): New functions.
3519         (enter_dir, leave_dir): Define trivial
3520         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3521         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3522         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3523         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3524         Move to fts-cycle.c.
3525         (fts_open): Use setup_dir.
3526         (fts_close): Use free_dir.
3527         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3528         This adds a label and some gotos, but the alternatives were messier.
3529         Check for memory allocation failure when entering a dir.
3530         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3531         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3532         (FTS): New member fts_cycle, that is a union that contains the
3533         old active_dir_ht and cycle_state.  All uses changed to mention
3534         fts_cycle.ht and fts_cycle.state.
3535         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3536         fts.c, with the following changes:
3537         (setup_dir, free_dir): New functions.
3538         (enter_dir): Now returns bool.  Return true if successful, false
3539         if memory exhausted.  All callers changed.
3540         Do not bother partly cleaning up on
3541         memory allocation failure; that is free_dir's job.
3542         However, free ad if hash_insert fails, to avoid memory leak.
3543         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3544         fts->fts_options to see which union member to use.
3545
3546 2005-05-20  Jim Meyering  <jim@meyering.net>
3547
3548         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3549         Now a macro, to pacify GCC.
3550
3551 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3552
3553         * chown.c (rpl_chown): Return -1 on failure.
3554
3555 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3556
3557         * canonicalize.c: Include canonicalize.h first, to test interface.
3558         Include <stddef.h> unconditionally, since we assume C89 now.
3559         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3560         * fts.c: Include fts_.h first, to check interface.
3561         Do not include intprops.h; no longer needed.
3562         Include cycle-check.h and hash.h, since fts_.h no longer does.
3563         Remove unnecessary casts of closedir to void.
3564         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3565         decide whether to decrement nlinks.
3566         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3567         (FTS): Use struct hash_table * instead of Hash_table, so that
3568         we no longer need to include hash.h here.
3569
3570 2005-05-17  Jim Meyering  <jim@meyering.net>
3571
3572         * fts.c, fts_.h: New files, from coreutils.
3573
3574 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3575
3576         Sync from coreutils.
3577         * unlinkdir.c, unlinkdir.h: New files.
3578         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3579         regex.h, unlocked-io.h, xtime.h:
3580         White space changes only.
3581         * makepath.c (make_path): Port to hosts where leading "//" is special.
3582         * yesno.c: Include getline.h, not ctype.h.
3583         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3584         Use getline to remove arbitrary restriction on response length.
3585
3586 2005-05-13  Bruno Haible  <bruno@clisp.org>
3587
3588         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3589         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3590         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3591         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3592         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3593         Add support for 64-bit integers in the MSVC compiler.
3594
3595 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3596
3597         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3598         Change the initial comment to refer to GPL, not LGPL.
3599         gnulib-tool will change it to LGPL as needed.
3600
3601         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3602         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3603         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3604         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3605         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3606         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3607         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3608         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3609         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3610         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3611         concatpath.c, config.charset, copy-file.c, copy-file.h,
3612         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3613         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3614         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3615         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3616         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3617         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3618         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3619         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3620         full-read.c, full-read.h, full-write.c, full-write.h,
3621         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3622         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3623         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3624         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3625         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3626         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3627         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3628         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3629         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3630         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3631         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3632         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3633         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3634         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3635         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3636         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3637         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3638         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3639         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3640         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3641         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3642         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3643         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3644         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3645         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3646         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3647         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3648         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3649         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3650         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3651         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3652         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3653         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3654         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3655         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3656         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3657         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3658         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3659         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3660         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3661         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3662         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3663         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3664         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3665         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3666         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3667         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3668         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3669         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3670         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3671         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3672         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3673         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3674         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3675         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3676         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3677         Update FSF postal mail address.
3678
3679 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3680
3681         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3682         specified in ai_socktype. Fix invalid ai_protocol
3683         check. ai_protocol is usually set to 0 or depending on
3684         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
3685         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
3686         ai_socktype / ai_protocol in the returned addrinfo structure.
3687
3688 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3689             Bruno Haible  <bruno@clisp.org>
3690
3691         * inet_ntop.h: New file.
3692         * inet_ntop.c: New file, from glibc with modifications.
3693
3694 2005-05-08  Jim Meyering  <jim@meyering.net>
3695
3696         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3697
3698 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
3699
3700         Merge from coreutils.  Among other things,
3701         add bulletproofing for cases where stdin, stdout, or stderr are closed.
3702         * fd-safer.c: New file.
3703         * fcntl-safer.h, open-safer.c: Remove.
3704         * chdir-long.c: Fix comment "fetish" -> "coreutils".
3705         * dup-safer.c: Include unistd-safer.h first.
3706         Don't include errno.h.
3707         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3708         * file-type.h: Don't assume invoker included sys/stat.h first.
3709         * file-type.c: Rely on file-type.h change.
3710         * getloadavg.c: Include unistd-safer.h.
3711         (getloadavg): Use safer open.
3712         * getusershell.c: Include "stdio-safer.h".
3713         (getusershell): Use safer fopen.
3714         * long-options.c (long_options): Use NULL rather than 0.
3715         * modechange.h (mode_free): Remove; all callers changed to invoke
3716         'free'.
3717         * modechange.c: Likewise.
3718         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
3719         (MODE_DONE): New constant.
3720         (struct mode_change): Remove 'next' member.
3721         (make_node_op_equals): New function; like the old one of the
3722         same name, except it allocates an array.
3723         (mode_compile, mode_create_from_ref): Use it.
3724         (mode_compile): Allocate result as an array, not a linked list.
3725         Parse octal string ourself, so that we catch mistakes like "+0".
3726         (mode_adjust): Arg is an array, not a linked list.
3727         * modechange.c: Include stat-macros.h, xalloc.h.
3728         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
3729         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
3730         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
3731         Remove.  This is now stat-macros.h's job.
3732         (talloc): Remove.  All callers replaced by xalloc, so that
3733         our invokers don't have to worry about reporting memory failures.
3734         (make_node_op_equals): Remove.
3735         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3736         New constants.
3737         (struct mode_change): Moved here from modechange.h.
3738         (mode_append_entry): Remove.
3739         (mode_compile): Remove MASKED_OPS arg, since it encouraged
3740         apps to have incorrect behavior.  Use simpler algorithm for head
3741         and tail.  Don't futz with umask; that's now the job of mode_adjust.
3742         Detect more invalid usages rather than having somewhat-random behavior.
3743         Don't insert an "a=" action, as that leads to incorrect behavior.
3744         (mode_compile, mode_create_from_ref): Return NULL on error instead
3745         of an enum, since now there's only one way to have an error.  All
3746         callers changed.
3747         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
3748         at the correct time.  Simplify calculation of "+u" and its ilk.
3749         Don't mishandle "+X".
3750         (mode_free): Remove "register" and localize decls.
3751         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3752         (struct mode_change): Move to modechange.c; callers don't
3753         need to see this stuff.
3754         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
3755         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
3756         (mode_change, mode_adjust): Reflect the new signatures noted above.
3757         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
3758         that might redefine system include files.
3759         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
3760         (my_usleep): Use NULL rather than (void *) 0.
3761         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
3762         Use siginterrupt to specify that system calls should be interrupted.
3763         (rpl_nanosleep): Move initialization of suspended closer to call of
3764         my_usleep.
3765         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
3766         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
3767         (desirable_utmp_entry): New function.
3768         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
3769         using x2nrealloc, to simplify logic.
3770         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
3771         size calculation.  Do not assume utmp file is a regular file.
3772         * readutmp.h (UT_PID): Moved here from ../src/who.c.
3773         (READ_UTMP_CHECK_PIDS): New constant.
3774         * save-cwd.c: Include unistd-safer.h.
3775         (save_cwd): Use fd_safer.
3776         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
3777         [!_LIBC] Include "stat-macros.h" instead.
3778         * unistd-safer.h (fd_safer): New decl.
3779
3780 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
3781
3782         * byteswap_.h: New file.
3783
3784 2005-04-25  Albert Chin  <china@thewrittenword.com>
3785
3786         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
3787         Toolkit C bug.
3788
3789 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
3790
3791         * getdate.y (zone): Allow relunit_snumber after tZONE, so
3792         that "UTC +1 second" continues to work.  Problem reported
3793         by Dmitry V. Levin.
3794         (relunit_snumber): New rule.
3795         (relunit): Use it.
3796
3797 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
3798
3799         * getdate.y (universal_time_zone_table): New constant.
3800         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
3801         universal_time_zone_table.
3802         (lookup_zone): Prefer universal_time_zone_table to
3803         local_time_zone_table, so that "GMT" time stamps are allowed in
3804         London during the summer.  Problem reported by Ian Abbott.
3805
3806 2005-04-12  Jim Meyering  <jim@meyering.net>
3807
3808         * human.c (humblock): Set *options even when returning due to
3809         xstrtoumax conversion failure.  Thanks to a used-uninitialized
3810         warning from gcc-4.
3811
3812 2005-04-09  Jim Meyering  <jim@meyering.net>
3813
3814         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
3815         -Wuninitialized: initialize tm0.tm_year.
3816
3817 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
3818
3819         * getdate.y (parser_control): rels_seen is now a boolean, not a
3820         count, since there's no maximum.  All uses changed.
3821         Add member dsts_seen.
3822         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
3823         not being INT_MAX.
3824         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
3825         Use pc_rels_seen to decide whther a date is absolute.
3826
3827         * getdate.y (number): Don't overwrite year.
3828         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
3829         check.
3830
3831 2005-04-02  Simon Josefsson  <jas@extundo.com>
3832
3833         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
3834         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
3835
3836 2005-03-27  Jim Meyering  <jim@meyering.net>
3837
3838         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
3839
3840 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
3841
3842         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
3843         "one's complement" -> "ones' complement" in comment, as per Knuth.
3844         "value of type" -> "type or expression" in comment.
3845         * mktime.c, strftime.c: Propagate intprops.h comment nits.
3846
3847 2005-03-26  Jim Meyering  <jim@meyering.net>
3848
3849         Comment nits.
3850         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
3851         Correct typos: s/or/of/.
3852
3853 2005-03-23  Jim Meyering  <jim@meyering.net>
3854
3855         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
3856
3857 2005-03-21  Jim Meyering  <jim@meyering.net>
3858
3859         Changes imported from coreutils.
3860
3861         * cycle-check.c: Don't include xalloc.h.
3862
3863         * path-concat.c: Don't include assert.h.
3864         (path_concat): Remove assertion that would have triggered
3865         for ABASE starting with more than one slash.
3866         Reported by Andreas Schwab.
3867
3868         * path-concat.c (path_concat): Set *BASE_IN_RESULT
3869         properly when ABASE is an absolute file name.
3870         Correct the description of this function.
3871         Include <assert.h>.
3872         Add an assertion and a test driver.
3873         This fixes a bug introduced on 2004-07-02.
3874         Andreas Schwab reported the resulting failure of cp --parents:
3875         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
3876
3877 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
3878
3879         * strftime.c (my_strftime): If the underlying strftime returns 0
3880         (which shouldn't happen), generate nothing instead of returning 0
3881         immediately, so that nstrftime (NULL, ...) doesn't return 0.
3882
3883 2005-03-16  Bruno Haible  <bruno@clisp.org>
3884
3885         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
3886
3887 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
3888
3889         * strftime.c (my_strftime): Prepend space to format so that we can
3890         reliably distinguish strftime failure from empty output on POSIX
3891         hosts.
3892
3893 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
3894
3895         * iconvme.c (SIZE_MAX): New macro, if not already defined.
3896         (iconv_string): Don't guess a size-zero buffer, as that might cause
3897         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
3898         result would be 'too large', where 'too large' is (heuristically)
3899         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
3900         overflow concerns.  This will prevent some unwanted malloc failures
3901         when the inputs are very large.
3902
3903 2005-03-15  Bruno Haible  <bruno@clisp.org>
3904
3905         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
3906         'negate'.
3907
3908         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
3909         variable.
3910
3911         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
3912
3913 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
3914
3915         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
3916         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
3917         intprops.h.
3918         * strtol.c: Likewise.
3919
3920 2005-03-14  Simon Josefsson  <jas@extundo.com>
3921
3922         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
3923         <fx@gnu.org>.
3924
3925 2005-03-14  Jim Meyering  <jim@meyering.net>
3926
3927         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
3928         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
3929         to be nonzero so that we (and caller) can detect the difference
3930         between a valid zero-length expansion and an error return, even
3931         when the underlying strftime fails before writing anything into
3932         that location.
3933
3934 2005-03-10  Jim Meyering  <jim@meyering.net>
3935
3936         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
3937         so that this module works on systems without fchdir.
3938
3939 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
3940
3941         Factor int-properties macros into a single file, except for
3942         glibc-related files.
3943         * intprops.h: New file.
3944         * getloadavg.c: Include it instead of limits.h.
3945         (INT_STRLEN_BOUND): Remove.
3946         * human.c: Include intprops.h.
3947         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
3948         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
3949         * inttostr.h: Include intprops.h instead of limits.h.
3950         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
3951         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
3952         for consistency with intprops.h.
3953         (time_t_is_integer, twos_complement_arithmetic): Use them.
3954         * sig2str.h: Include <signal.h>, intprops.h.
3955         (INT_STRLEN_BOUND): Remove.
3956         * strftime.c (TYPE_SIGNED): Remove.
3957         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
3958         * strtol.c: Adjust comments to match intprops.h.
3959         * userspec.c: Include intprops.h.
3960         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
3961         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
3962         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
3963         instead of rolling our own expressions.
3964         * xstrtol.c: Include xstrtol.h first, to test interface.
3965
3966         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
3967         instead of int.
3968         (my_strftime): Do not mishandle years close to INT_MAX, by doing
3969         the right thing even if adding 1900 would overflow.  Similarly
3970         for tm_mon + 1 and tm_yday + 1.
3971         Make %Y always equivalent to %C%y, and similarly for %G and %g.
3972         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
3973         (DO_SIGNED_NUMBER): New macro.
3974         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
3975
3976 2005-03-07  Bruno Haible  <bruno@clisp.org>
3977
3978         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
3979
3980 2005-03-03  Derek R. Price  <derek@ximbiot.com>
3981             Bruno Haible  <bruno@clisp.org>
3982
3983         * pagealign_alloc.h: New file.
3984         * pagealign_alloc.c: New file.
3985
3986 2005-01-28  Bruno Haible  <bruno@clisp.org>
3987
3988         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
3989         stpncpy.c uses it.
3990
3991 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
3992
3993         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
3994         The workaround isn't strictly needed for POSIX conformance, and
3995         it's too much of a pain to configure and maintain.  We'll ask
3996         people to fix their kernels instead.
3997         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
3998         (NANOSLEEP_BUG_WORKAROUND): Remove.
3999         (xnanosleep): Remove the workaround.
4000
4001 2005-02-12  Bruno Haible  <bruno@clisp.org>
4002
4003         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4004
4005 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4006
4007         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4008         * timespec.h (gettime): Return void, since it always
4009         succeeds now.  All uses changed.
4010         * gettime.c (gettime) Likewise.
4011         [HAVE_NANOTIME]: Prefer nanotime.
4012         Assume gettimeofday succeeds, as POSIX requires.
4013         Assime time () succeeds, since other code already does.
4014         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4015         (timespec_subtract): Remove.
4016         (NANOSLEEP_BUG_WORKAROUND): New constant.
4017         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4018         things considerably.  Use it only on GNU/Linux hosts, since the
4019         workaround shouldn't be needed elsewhere.
4020
4021 2005-02-24  Bruno Haible  <bruno@clisp.org>
4022
4023         * gettext.h: Update from GNU gettext 0.14.2.
4024
4025 2005-02-24  Bruno Haible  <bruno@clisp.org>
4026
4027         * localcharset.c: Update from GNU gettext 0.14.2.
4028         * config.charset: Update from GNU gettext 0.14.2.
4029
4030 2005-02-22  Simon Josefsson  <jas@extundo.com>
4031
4032         * iconvme.h, iconvme.c: New files, from libc.
4033
4034 2005-02-20  Neil Conway  <neilc@samurai.com>
4035
4036         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4037         returned by OSX/Darwin if the specified buffer is not large
4038         enough for the hostname.
4039
4040 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4041
4042         * memrchr.h: New file.
4043         * chdir-long.c: Include it.
4044         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4045         Don't bother including stddef.h.
4046
4047 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4048
4049         * argp-help.c (__argp_help): Create a fake struct argp_state and
4050         pass it to _help, otherwise the latter coredumps trying to
4051         dereference state.root_argp.
4052
4053 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4054
4055         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4056         inclusion.
4057         Include <sys/types.h>, for dev_t.
4058         (ME_DUMMY, ME_REMOTE): Move from here....
4059         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4060         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4061         Dmitry V. Levin.
4062         Include mountlist.h first, to test the interface.
4063
4064 2005-01-29  Bruno Haible  <bruno@clisp.org>
4065
4066         * progname.c (program_name): Initialize.
4067         Needed when linking statically on MacOS X.
4068
4069 2005-01-28  Bruno Haible  <bruno@clisp.org>
4070
4071         * javacomp.sh.in: New file, from GNU gettext.
4072         * javacomp.h: New file, from GNU gettext.
4073         * javacomp.c: New file, from GNU gettext.
4074
4075 2005-01-26  Bruno Haible  <bruno@clisp.org>
4076
4077         * javaexec.sh.in: New file, from GNU gettext.
4078         * javaexec.h: New file, from GNU gettext.
4079         * javaexec.c: New file, from GNU gettext.
4080
4081 2005-01-26  Simon Josefsson  <jas@extundo.com>
4082
4083         * gai_strerror.c: Use GPL in header.
4084
4085 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4086
4087         * argp-help.c (hol_entry_help): Avoid using non-constant
4088         initializers for struct pentry_state.
4089         (__argp_error): Check return value of __asprintf
4090         (__argp_failure): Translate error message
4091
4092         * argp-parse.c: Removed braces around the expansion of N_()
4093
4094 2005-01-21  Jim Meyering  <jim@meyering.net>
4095
4096         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4097         same value as for Solaris 9.
4098
4099         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4100         component length.  This included changing the parameter to be
4101         of type `char *' rather than `char const *'.
4102         * chdir-long.h (chdir_long): Update prototype.
4103
4104         * openat.c (fdopendir, fstatat): New functions.
4105         * openat.h: Include headers required for use of DIR and struct stat.
4106         [AT_SYMLINK_NOFOLLOW]: Define.
4107         (fdopendir, fstatat): Add prototypes.
4108
4109 2005-01-21  Bruno Haible  <bruno@clisp.org>
4110
4111         * classpath.h: New file, from GNU gettext.
4112         * classpath.c: New file, from GNU gettext.
4113
4114 2005-01-20  Simon Josefsson  <jas@extundo.com>
4115
4116         * version-etc-fsf.c: New file, with version_etc_copyright.
4117         * version-etc.c: Remove version_etc_copyright.
4118         * version-etc.h (version_etc_copyright): Use [] instead of * in
4119         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4120
4121 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4122
4123         * save-cwd.c (save_cwd): Remove code to support the case
4124         where fchdir is missing or flaky.
4125
4126 2005-01-20  Simon Josefsson  <jas@extundo.com>
4127
4128         * base64.h (isbase64): Add.
4129
4130         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4131         using a unsigned prototype, don't inline.
4132         (base64_decode): Use it.
4133
4134 2005-01-19  Bruno Haible  <bruno@clisp.org>
4135
4136         * sh-quote.h: New file, from GNU gettext.
4137         * sh-quote.c: New file, from GNU gettext.
4138
4139 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4140
4141         Merge changes from coreutils, as described below in several
4142         changelogs dated today.
4143
4144         * save-cwd.c: Include "save-cwd.h" before other include files.
4145         (O_DIRECTORY): Remove; not needed here, since "." must be
4146         a directory.  All uses removed.
4147         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4148         universal on Suns, and we also need to test for IRIX.
4149         Revamp code to use 'if' rather than '#if'.
4150         Avoid unnecessary comparison of cwd->desc to 0.
4151
4152         * utimens.c (futimens): Robustify the previous patch, by checking
4153         for known valid error numbers rather than observed invalid ones.
4154
4155 2005-01-18  Jim Meyering  <jim@meyering.net>
4156
4157         * version-etc.c (version_etc_copyright): Update copyright date.
4158
4159         * utimens.c (futimens): Account for the fact that futimes
4160         can also fail with errno == ENOSYS or errno == ENOENT.
4161         Patch from Dmitry V. Levin.
4162
4163         Change the name of the robust chdir function from chdir to chdir_long.
4164         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4165         (restore_cwd): Use chdir_long, not chdir.
4166         * chdir-long.c: Renamed from chdir.c.
4167         * chdir-long.h: Renamed from chdir.h.
4168         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4169         Hurd.
4170
4171 2005-01-18  Bob Proulx  <bob@proulx.com>
4172
4173         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4174         offsetof() macro construct to avoid compile failure with native HP-UX
4175         11.0 ANSI C compiler.
4176
4177 2005-01-06  Bruno Haible  <bruno@clisp.org>
4178
4179         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4180         because stpncpy.m4 takes care of it.
4181
4182 2004-01-24  Bruno Haible  <bruno@clisp.org>
4183
4184         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4185
4186 2003-10-09  Bruno Haible  <bruno@clisp.org>
4187
4188         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4189
4190 2005-01-06  Bruno Haible  <bruno@clisp.org>
4191
4192         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4193         * fwriteerror.c: Include <stdbool.h>.
4194         (fwriteerror): At the end, close the file stream. Record whether
4195         stdout was already closed.
4196
4197 2004-05-27  Bruno Haible  <bruno@clisp.org>
4198
4199         * execute.c (environ): Declare if needed.
4200         * pipe.c (environ): Likewise.
4201         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4202
4203 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4204
4205         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4206         definitions to be after all include files, to avoid collisions.
4207         Problem reported by Bob Proulx.
4208
4209 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4210
4211         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4212         not needed.  This removes a dependency on the gettext module.
4213         [defined _LIBC]: Do not include <libintl.h>; not needed.
4214
4215 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4216
4217         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4218         HAVE_DECL_STRTOLD.
4219
4220 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4221
4222         * argp-parse.c: Include <stddef.h>.
4223         (alignof, alignto): New macros.
4224         (parser_init): Don't assume that void * is aligned sufficiently
4225         for struct option.
4226
4227         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4228         need to extend the stack.
4229         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4230         large.
4231
4232 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4233
4234         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4235
4236 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4237
4238         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4239         Remove now-obsolete comment about AIX.
4240         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4241         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4242         (YYMAXDEPTH): New macro.
4243
4244 2004-12-18  Bruno Haible  <bruno@clisp.org>
4245
4246         * fatal-signal.c (fatal_signals): Make non-const.
4247         (init_fatal_signals): New function.
4248         (uninstall_handlers, install_handlers): Ignore signals that were set to
4249         SIG_IGN.
4250         (at_fatal_signal): Call init_fatal_signals.
4251         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4252         SIG_IGN.
4253         Reported by Paul Eggert.
4254
4255 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4256
4257         * getdate.y (textint): New member "negative".
4258         (time_zone_hhmm): New function.
4259         Expect 14 shift-reduce conflicts, not 13.
4260         (o_colon_minutes): New rule.
4261         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4262         (yylex): Set the "negative" member of signed numbers.
4263
4264 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4265
4266         Changes imported from coreutils.
4267         * hard-locale.c: Assume <locale.h> exists.
4268         Include "strdup.h".
4269         (GLIBC_VERSION): New macro.
4270         (hard_locale): Assume setlocale exists.
4271         Rewrite to avoid #ifdef.
4272         Use strdup rather than malloc + strcpy.
4273         * human.c: Assume <locale.h> exists.
4274         (human_readable): Assume localeconv exists.
4275
4276 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4277
4278         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4279         convert T2, not T.  (Imported from libc.)
4280
4281 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4282
4283         * getcwd.c (is_ENAMETOOLONG): New macro.
4284         (__getcwd.c): Don't restore errno; glibc doesn't.
4285         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4286         first, falling back to our code only if its results look suspicious.
4287         Ensure that the resulting buffer is only as large as necessary.
4288
4289         * readutmp.c: Include readutmp.h first.
4290         Include <errno.h>, since readutmp.h no longer does that.
4291         * readutmp.h: Don't include <errno.h>,
4292         <sys/param.h>, <time.h>; not needed to establish interface.
4293         (errno): Remove decl.
4294         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4295         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4296         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4297
4298 2004-11-28  Simon Josefsson  <jas@extundo.com>
4299
4300         * base64.h, base64.c: New file.
4301
4302 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4303
4304         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4305
4306 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4307
4308         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4309         HP's ANSI C compiler.
4310         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4311         Declaring int functions causes warnings on some modern systems and
4312         shouldn't be needed to compile on ancient ones.
4313         * same.c (MIN) [defined MIN]: Don't define, since it's already
4314         defined.
4315
4316         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4317         with the following changes.
4318         (__set_errno): Parenthesize properly.
4319         Include <stdbool.h>.
4320         (MIN, MAX, MATCHING_INO): New macros.
4321         (__getcwd): Define with prototype, not K&R form.
4322         Use heuristics to allocate default buffer on stack if possible.
4323         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4324         behavior, and to avoid the PATH_MAX limit when computing
4325         ../../../../...
4326         Use MATCHING_INO to compare inode number to file.
4327         Check for arithmetic overflow in size calculations.
4328         Fix bug in reallocation of dot array that caused getcwd to fail
4329         on directories nested deeper than 75.
4330         Be more careful about saving errno on error.
4331         Do not use realloc; use only free+malloc, as this is a bit
4332         more flexible and avoids a needless copy operation.
4333         Do not inspect st_dev and st_ino for symbolic links; POSIX
4334         doesn't specify the latter.
4335         Check for closedir errors.
4336         Avoid needless casts.
4337         Use "#ifdef weak_alias" around weak_alias, to be like other
4338         glibc code.
4339         The following changes to getcwd.c have effect only when used in
4340         gnulib; they have no effect inside glibc proper.
4341         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4342         as alloca isn't used.
4343         (alloca, __alloca): Likewise.
4344         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4345         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4346         unconditionally, as gnulib assumes C89 or better.
4347         Do not include <sys/param.h>.
4348         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4349         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4350         better.
4351         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4352         Include <dirent.h> in a way that is compatible with modern Autoconf.
4353         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4354         New macros, if not already defined.
4355         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4356         Use "_LIBC", not "defined _LIBC", for consistency.
4357         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4358         a mempcpy module.
4359         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4360         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4361         * xgetcwd.c: David MacKenzie's old code was removed, so give
4362         credit only to Jim Meyering and adjust the copyright dates.
4363         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4364         <stdlib.h>, <unistd.h>, "pathmax.h".
4365         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4366         (INITIAL_BUFFER_SIZE): Remove.
4367         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4368
4369 2004-11-23  Jim Meyering  <jim@meyering.net>
4370
4371         * getopt_.h: Remove trailing blanks.
4372
4373 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4374
4375         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4376         (futimens): New function, which uses futimes if available.
4377         (futimens, utimens): Support timespec==NULL, with same semantics
4378         as utime and utimens.
4379         * utimens.h (futimens): New decl.
4380
4381 2004-11-23  Jim Meyering  <jim@meyering.net>
4382
4383         * __fpending.c: Add comment.
4384
4385 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4386
4387         * getopt_.h: Re-addition of __getopt_argv_const caused
4388         redefinition warnings. To avoid them, include the defines
4389         in `#if !defined __need_getopt ... #endif'. The only place
4390         where __getopt_argv_const is used is in definitions
4391         of getopt_long and getopt_long_only below, which are as well
4392         protected by `#ifndef __need_getopt'.
4393         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4394         __need_getopt after including <stdio.h> and <unistd.h> These
4395         headers might have defined it.
4396
4397 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4398
4399         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4400         New macros.
4401         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4402         optopt): Use them instead of invoking ## directly; otherwise, the
4403         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4404
4405 2004-11-19  Bruno Haible  <bruno@clisp.org>
4406
4407         * strtok_r.c: Move comments from here...
4408         * strtok_r.h: ... to here.
4409
4410 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4411
4412         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4413         might fail.  Problem reported by Yoann Vandoorselaere.
4414         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4415         that mishandle size_t overflow.
4416
4417 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4418
4419         * canon-host.c: Include "strdup.h".
4420         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4421         Use strdup instead of malloc/strcpy to duplicate strings.
4422
4423         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4424         (human_space_before_unit): New constant.
4425         * human.c (human_readable): Support it.
4426
4427         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4428         (xgetcwd): Set errno correctly when failing.
4429         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4430         the failure is actually due to a PATH_MAX problem.
4431
4432         Further getopt changes to make it more likely that glibc will
4433         buy the changes back.
4434         * getopt.c (POSIXLY_CORRECT): New constant.
4435         (getopt): Use it, so to preserve glibc semantic
4436         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4437         when compiling for libc.
4438         * getopt_.h (__getopt_argv_const): Bring it back.
4439         (getopt_long, getopt_long_only): Use it.
4440
4441         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4442         New arg POSIXLY_CORRECT.  All callers changed.
4443         (getopt): Argv is now char * const *, as per standard.
4444         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4445         not char *__getopt_argv_const *.
4446         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4447         _getopt_long_only_r): Likewise.
4448         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4449         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4450         _getopt_long_r, _getopt_long_only_r): Likewise.
4451         * getopt_.h (__getopt_argv_const): Remove.
4452         (getopt): Argv is now char * const *, as per standard.
4453
4454         * getdate.y (tORDINAL): New token.
4455         (day, relunit): Allow it for relative times.
4456         (relative_time_table): Use tORDINAL for ordinals.
4457
4458 2004-11-15  Jim Meyering  <jim@meyering.net>
4459
4460         * closeout.c: Include "__fpending.h" once again.
4461         Include <stdbool.h>.
4462         (close_stdout): Don't fail just because stdout was closed initially,
4463         since some programs don't write to stdout in the normal course of
4464         operation (other than --version and --help), and we don't want this
4465         function to make e.g. `touch file >&-' fail.
4466         But do fail if it was closed and someone has tried to write to it.
4467         E.g., `printf foo >&-' must fail.
4468
4469 2004-11-11  Simon Josefsson  <jas@extundo.com>
4470
4471         * strtok_r.h, strtok_r.c: New file.
4472
4473 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4474
4475         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4476         we can stop lying to compilers about the constness of argv when we
4477         are compiled outside glibc.
4478         (getopt, getopt_long, getopt_long_only): Use it.
4479         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4480         getopt): Likewise.
4481         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4482         _getopt_long_only_r): Likewise.
4483         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4484         _getopt_long_only_r): Likewise.
4485
4486         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4487         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4488         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4489         the other external symbols.
4490         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4491         declaration, since the above renaming now works around collisions.
4492
4493 2004-11-11  Jim Meyering  <jim@meyering.net>
4494
4495         * linebreak.c: Remove trailing blanks.
4496         * alloca_.h: Likewise.
4497         * acosl.c: Likewise.
4498         * euidaccess.c: Likewise.
4499         * allocsa.h: Likewise.
4500
4501 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4502
4503         * mktime.c (SHR): New macro, which is a portable
4504         substitute for >> that should work even on Crays.
4505         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4506         Problem reported by Mark D. Baushke in
4507         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4508         * getdate.y (SHR): Likewise.
4509         (tm_diff): Use it.
4510         * strftime.c (SHR): Likewise.
4511         (tm_diff): Use it.
4512         * quotearg.c (struct quoting_options): Use unsigned int for
4513         quote_these_too, so that right shifts are well defined.  All uses
4514         changed.
4515
4516 2004-11-10  Simon Josefsson  <jas@extundo.com>
4517
4518         * getaddrinfo.h, getaddrinfo.c: New files.
4519
4520 2004-11-10  Jim Meyering  <jim@meyering.net>
4521
4522         Ensure that no close failure goes unreported.
4523         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4524         return early when it seems there's nothing to flush.
4525         Don't include __fpending.h.
4526
4527 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4528
4529         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4530
4531 2004-11-05  Bruno Haible  <bruno@clisp.org>
4532
4533         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4534         Reported by Mark D. Baushke <mdb@cvshome.org>.
4535
4536 2004-11-04  Bruno Haible  <bruno@clisp.org>
4537
4538         2004-09-11  Bruno Haible  <bruno@clisp.org>
4539                 * allocsa.valgrind: New file.
4540         2004-02-06  Bruno Haible  <bruno@clisp.org>
4541                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4542                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4543                 Reported by Christopher Seip <chris.seip@hp.com>.
4544
4545 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4546
4547         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4548         with errno == ERANGE if the buffer is too small.
4549         Problem reported by Mark D. Baushke.
4550
4551 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4552
4553         * xreadlink.c (MAXSIZE): New macro.
4554         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4555         size does not exceed MAXSIZE.  Avoid cast.
4556         As suggested by Mark D. Baushke in
4557         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4558         if readlink fails with buffer size just under MAXSIZE, try again
4559         with MAXSIZE.
4560
4561 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4562         and  Paul Eggert  <eggert@cs.ucla.edu>
4563
4564         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4565         (get_date): Overparenthesize to avoid GCC warning.
4566
4567 2004-11-02  Bruno Haible  <bruno@clisp.org>
4568
4569         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4570         function returns void.
4571
4572 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4573
4574         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4575         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4576         already declared.
4577
4578 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4579
4580         * getdate.y: Add support for TZ="foo" within a date string.
4581         Fix some bugs near time_t boundaries.  Reject dates with
4582         out-of-range components, e.g., "Sept 31".
4583         Include <stdlib.h>, "setenv.h", "xalloc.h".
4584         (ISDIGIT_LOCALE): Remove; unused.
4585         Note that the TZ and time functions used here are not reentrant.
4586         (mktime_ok, get_tz): New functions.
4587         (TZBUFSIZE): New constant.
4588         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4589         This requires that we sometimes generate our own TZ="XXX..." setting.
4590
4591 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4592
4593         * mktime.c (not_equal_tm): Remove redundant check.
4594
4595 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4596
4597         * getdate.y: Use Bison 1.875 features, and some minor
4598         code cleanups.  This change does not affect semantics.
4599         Don't include <stdlib.h>; no longer needed.
4600         Don't include unlocked-io.h; only the "#if TEST" code uses
4601         stdio, and performance isn't crucial there.
4602         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4603         Bison 1.875 features as described below.
4604         All uses of "PC." replaced by "pc->".
4605         (YYSTYPE): Add a forward declaration.
4606         (yylex, yyerror): Use full prototypes in forward decls.
4607         Use "%pure-parser" rather than obsolescent "%pure_parser".
4608         Use %parse-param and %lex-param instead of obsolescent
4609         YYPARSE_PARAM and YYLEX_PARAM.
4610         (meridian_table, month_and_day_table, time_units_table,
4611         relative_time_table, time_zone_table, military_table,
4612         lookup_zone, lookup_word, get_date):
4613         Use NULL instead of 0 where appropriate.
4614         (to_hour): Avoid abort (), to avoid a dependency on
4615         stdlib.h.
4616         (yyerror, yylex): Now accepts parser_control * arg.
4617         (main) [TEST]: Use '\0' rather than 0 for char.
4618
4619 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4620
4621         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4622         It's now the caller's responsibility to handle the case where
4623         !HAVE_GETPAGESIZE && !defined getpagesize.
4624
4625         * mktime.c (leapyear): Arg is long int, not int.
4626
4627 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4628
4629         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4630
4631 2004-10-12  Simon Josefsson  <jas@extundo.com>
4632
4633         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4634         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4635         to real functions.
4636
4637 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4638
4639         * vsnprintf.h: New file.
4640         * vsnprintf.c: New file.
4641
4642 2004-10-07  Bruno Haible  <bruno@clisp.org>
4643
4644         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4645         into the provided buffer.
4646
4647 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4648
4649         * diacrit.c, diacrit.h: Add GPL notice.
4650
4651         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4652         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4653         * logl.c (logl): Keep the code as similar to glibc as possible.
4654         This avoids a potential constant-folding bug.
4655
4656 2004-10-05  Bruno Haible  <bruno@clisp.org>
4657
4658         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4659
4660 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4661
4662         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
4663         * xmalloc.c (xmemdup): Likewise.
4664         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4665         XFREE): Remove these long-obsolescent macros.
4666         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4667         * xstrdup.c: Remove.
4668
4669         * regex.c (re_comp): Cast gettext return value to char *,
4670         Problem reported by Martin Neitzel via Mark D. Baushke.
4671
4672 2004-10-04  Simon Josefsson  <jas@extundo.com>
4673
4674         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4675         '#ifdef USE_UNLOCKED_IO'.
4676
4677 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4678
4679         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4680         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4681         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4682         regex.c, sha1.c, version-etc.c, yesno.c:
4683         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4684         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4685         the includer's responsibility.
4686
4687         Sync from coreutils.
4688
4689         * modechange.c (mode_compile): Don't decrement a pointer that
4690         points to the start of a string, as the C Standard says the
4691         resulting behavior is undefined.
4692
4693         * backupfile.h (enum backuptype): Rename none -> no_backups,
4694         simple -> simple_backups, numbered_existing ->
4695         numbered_existing_backups, numbered -> numbered_backups
4696         to avoid shadowing problems.  All uses changed.
4697         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4698         * backupfile.c (check_extension, numbered_backup):
4699         Rename locals to avoid shadowing 'basename'.
4700         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4701         once.
4702
4703         * .cppi-disable: Add getopt_.h, getopt_int.h.
4704         * .cvsignore: Add getopt.h.
4705
4706 2004-10-04  Simon Josefsson  <jas@extundo.com>
4707
4708         * memmem.h: New file.
4709         * memmem.c: New file, taken from glibc.
4710
4711 2004-10-02  Jim Meyering  <jim@meyering.net>
4712
4713         * dirfd.h, getpagesize.h: Add copyright notice.
4714
4715 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
4716
4717         * snprintf.c: Remove comments as to why each header is needed.
4718
4719 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
4720
4721         * strsep.h: New file.
4722         * strsep.c: New file.
4723
4724 2004-10-01  Simon Josefsson  <jas@extundo.com>
4725
4726         * snprintf.c (snprintf): Handle size==0.
4727
4728 2004-10-01  Simon Josefsson  <jas@extundo.com>
4729             Bruno Haible  <bruno@clisp.org>
4730
4731         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
4732         (snprintf): Declare 'args'.
4733
4734 2004-09-30  Simon Josefsson  <jas@extundo.com>
4735
4736         * snprintf.h, snprintf.c: New files.
4737
4738 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4739
4740         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
4741         (hol_entry_help): Never translate an empty string.
4742         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
4743         * argp.h (OPTION_NO_TRANS): New option.
4744
4745 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
4746
4747         * xvasprintf.c: Include xalloc.h.
4748         (xvasprintf): Use xalloc_die, not xmalloc_die.
4749
4750 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
4751
4752         * dummy.c: Change copyright notice to FSF, and license to GPL.
4753
4754 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
4755
4756         * argp-pvh.c (argp_program_version_hook): Provide initial value.
4757         Problem reported by Bruno Haible in:
4758         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
4759
4760 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
4761
4762         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
4763         in case some system header has #define'd it.  Problem reported by
4764         Soeren D. Schulze in
4765         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
4766
4767 2004-09-08  Bruno Haible  <bruno@clisp.org>
4768
4769         * stdint_.h: New file, taken from GNU clisp.
4770
4771 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
4772
4773         * xvasprintf.h: New file.
4774         * xvasprintf.c: New file.
4775         * xasprintf.c: New file.
4776
4777 2004-09-08  Bruno Haible  <bruno@clisp.org>
4778
4779         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
4780         is > INT_MAX.
4781         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
4782
4783 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
4784
4785         Import from coreutils.
4786         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
4787         strings on unbounded length.  alloca's performance benefits aren't
4788         that important here.
4789         (V_STRDUP): Remove.
4790         (parse_with_separator): New function, with most of the internals
4791         of the old parse_user_spec.  Allow user to omit both user and group,
4792         for compatibility with FreeBSD.
4793         Clone only the user name, not the entire spec.
4794         Do not set *uid, *gid unless entirely successful.
4795         Avoid memory leak in some failing cases.
4796         Fix regression for USER.GROUP reported by Dmitry V. Levin in
4797         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
4798         (parse_user_spec): Rewrite to use parse_with_separator.
4799
4800 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
4801
4802         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
4803         its complicated substitute.
4804         * argp-help.c: Include <errno.h>, for program_invocation_short_name
4805         and program_invocation_name.
4806         (__argp_basename) [!_LIBC]: Remove; the only use was
4807         replaced by its body.
4808         (__argp_short_program_name): Change condition from
4809         !defined __argp_short_program_name to
4810         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
4811         to match argp-namefrob.h.
4812         (__argp_failure): Don't assume strerror_r returns char *.
4813         * argp-parse.c (N_): Define unconditionally.
4814         (argp_default_options): Fill out initializers with 0 to avoid
4815         gcc warnings.
4816
4817 2004-08-12  Simon Josefsson  <jas@extundo.com>
4818
4819         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
4820         * getopt_.h: Renamed from getopt.h.
4821
4822 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
4823
4824         Merge from coreutils.
4825
4826         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
4827         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
4828         for Reliant Unix 5.43.
4829
4830         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
4831         (union fooround): Use uintmax_t, not long int.
4832         The rest is a merge from libc:
4833         [defined _LIBC]: Include <shlib-compat.h>.
4834         (_obstack) [defined _LIBC]: Remove after 2.3.4.
4835
4836         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
4837
4838         * strverscmp.c: Convert to UTF-8.
4839
4840 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
4841
4842         * obstack.h (obstack_empty_p):
4843         Don't assume that chunk->contents is suitably aligned.
4844         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
4845         Likewise. Problem reported by Benno in
4846         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
4847
4848         * chown.c (rpl_chown): Work even if the file is writeable but not
4849         readable.  This could be improved further but it'd take some work.
4850
4851 2004-08-08  Simon Josefsson  <jas@extundo.com>
4852
4853         * xgethostname.c: Don't include error.h (not used).
4854
4855         * getpass.h: Add.
4856         * getpass.c: Include getpass.h first.
4857
4858 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
4859
4860         * xalloc-die.c: New files.
4861         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
4862         All uses removed.
4863         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
4864         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
4865         (_, N_, xalloc_die): Move to xalloc-die.c.
4866         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
4867         so that we needn't mess with xalloc_msg_memory_exhausted.
4868
4869         * sha1.h: Renamed from sha.h.
4870         (SHA1_H): Renamed from _SHA_H.
4871         (sha1_ctx): Renamed from sha_ctx.
4872         (sha1_init_ctx): Renamed from sha_init_ctx.
4873         (sha1_process_block): Renamed from sha_process_block.
4874         (sha1_process_bytes): Renamed from sha_process_bytes.
4875         (sha1_finish_ctx): Renamed from sha_finish_ctx.
4876         (sha1_read_ctx): Renamed from sha_read_ctx.
4877         (sha1_stream): Renamed from sha_stream.
4878         (sha1_buffer): Renamed from sha_buffer.
4879         * sha1.c: Likewise; renamed from sha.c.
4880         Do not include <sys/types.h>.
4881         Include <stddef.h> rather than <stdlib.h>.
4882
4883 2004-08-08  Bruno Haible  <bruno@clisp.org>
4884
4885         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
4886         FILESYSTEM_PREFIX_LEN.
4887         * progreloc.c: Likewise.
4888         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
4889
4890 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
4891
4892         Merge from tar.
4893         * argp-help.c (make_hol, hol_append): Don't assume that
4894         SIZE_MAX is a valid preprocessor constant.
4895         (__argp_basename): Change from "#ifndef _LIBC"
4896         to "#ifndef __argp_short_program_name", so that
4897         we don't compile these functions for tar.
4898
4899         More merges from coreutils.
4900         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
4901         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
4902         yesno.h: New files.
4903         * addext.c: Remove; no longer needed.
4904         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
4905         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
4906         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
4907         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
4908         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
4909         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
4910         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
4911         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
4912         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
4913         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
4914         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
4915         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
4916         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
4917         Import changes from coreutils.
4918
4919 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
4920
4921         Merge from coreutils.
4922
4923         * .gdb-history: Remove; this doesn't belong here.
4924
4925         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
4926         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
4927         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
4928
4929         * dirname.h: Include <stdbool.h>.
4930         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
4931         for consistency with POSIX terminology.  All uses changed.
4932         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
4933         (strip_trailing_slashes): Use bool for booleans.
4934         * stripslash.c (strip_trailing_slashes): Likewise.
4935
4936         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
4937         sometimes returns a positive errno value even when it succeeds.
4938         (print_errno_message) [!LIBC]: Fall back on strerror if
4939         __strerror_r fails.
4940
4941         * path-concat.c (mempcpy): Don't define if a system header defines it.
4942         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
4943         (longest_relative_suffix): New function.
4944         (path_concat): Use it.  Assume first argument is not NULL.
4945         Port to DOS.  Omit redundant separators.
4946         Report an error instead of returning NULL.
4947         Use mempcpy instead of memcpy.
4948         (xpath_concat): Remove: not declared or used.
4949
4950         * same.h: Include <stdbool.h>
4951         (same_name): Return bool, not int.
4952         * same.c (same_name): Likewise.
4953         (errno): Don't declare; we assume C89 or better now.
4954
4955         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
4956         if not already defined.
4957
4958         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
4959         * dup-safer.c (errno): Likewise.
4960
4961 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
4962
4963         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
4964         working.
4965
4966 2004-08-03  Simon Josefsson  <jas@extundo.com>
4967
4968         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
4969         * progname.h: Don't include stdbool.h.
4970
4971 2004-08-02  Simon Josefsson  <jas@extundo.com>
4972
4973         * getsubopt.h: New file, with comments from Bruno Haible.
4974         * getsubopt.c: New file, from glibc, but slightly modified based on
4975         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
4976
4977 2004-08-01  Simon Josefsson  <jas@extundo.com>
4978
4979         * xgetdomainname.c: Include stdlib.h, for free().
4980
4981 2004-07-16  Simon Josefsson  <jas@extundo.com>
4982
4983         * dummy.c: New file.
4984
4985 2004-07-16  Bruno Haible  <bruno@clisp.org>
4986
4987         * backupfile.h: Add extern "C" for C++.
4988         * closeout.h: Likewise.
4989         * copy-file.h: Likewise.
4990         * findprog.h: Likewise.
4991         * full-write.h: Likewise.
4992         * pathname.h: Likewise.
4993         * progname.h: Likewise.
4994         * stpcpy.h: Likewise.
4995         * stpncpy.h: Likewise.
4996         * strcase.h: Likewise.
4997         * strstr.h: Likewise.
4998         * xalloc.h: Likewise.
4999
5000         * mbswidth.h: Add extern "C" for C++.
5001         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5002
5003 2004-07-09  Simon Josefsson  <jas@extundo.com>
5004
5005         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5006         failed without this.)
5007
5008 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5009
5010         * fchown-stub.c: New file.
5011
5012 2004-06-24  Jim Meyering  <jim@meyering.net>
5013
5014         * obstack.h (obstack_base): Cast to (void *), per documentation.
5015
5016 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5017
5018         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5019
5020 2004-06-01  Jim Meyering  <jim@meyering.net>
5021
5022         * calloc.c: New file.
5023
5024 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5025
5026         * getdate.y (yylex): Allow space between sign and number.
5027         Problem reported by Dan Jacobson.
5028
5029 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5030         and  Jim Meyering  <jim@meyering.net>
5031
5032         Merge from coreutils CVS.
5033
5034         * stat-macros.h: New file, with contents from file-type.h
5035         and coreutils' system.h.
5036         * file-type.c: Include "stat-macros.h".
5037         * file-type.h (file_type): Move all macro definitions to new file,
5038         stat-macros.h.
5039
5040         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5041         Wrap old code with this conditional.
5042         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5043         function that does not dereference symlinks.
5044         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5045
5046         * xreadlink.c: Include xreadlink.h first, to catch .h file
5047         dependency problems.
5048         (xreadlink): Accept new arg SIZE, for efficiency.
5049         All decls and uses changed.
5050         * xreadlink.h: Include <stddef.h>, for size_t.
5051
5052         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5053         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5054
5055         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5056
5057 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5058
5059         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5060         macros to be defined.
5061         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5062         the allocator returns NULL because the requested size is zero.
5063
5064 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5065
5066         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5067         var.  Add comment explaining why libc still defines it.  This
5068         merges the following patch from glibc:
5069         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5070
5071 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5072
5073         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5074         present in glibc since revision 1.1 of this file.
5075         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5076         obstack_alignment_mask, obstack_alloc, obstack_base,
5077         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5078         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5079         obstack_grow0, obstack_init, obstack_int_grow,
5080         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5081         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5082         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5083         nonexistent functions.
5084
5085 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5086             Paul Eggert  <eggert@cs.ucla.edu>
5087
5088         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5089
5090 2004-05-14  Bruno Haible  <bruno@clisp.org>
5091
5092         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5093         that consists of a '.' followed by an empty digit string.
5094         Patch by Tor Lillqvist <tml@iki.fi>.
5095
5096 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5097
5098         Port obstack to the AS/400, where pointers are 16 bytes wide and
5099         you cannot cast an integer to a valid pointer.  This patch is
5100         currently waiting to be integrated into glibc; see
5101         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5102
5103         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5104         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5105         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5106         (struct obstack): temp member is now a union of a pointer and
5107         an integer, instead of an integer.  All integer uses changed.
5108         This does not affect the physical layout of struct obstack,
5109         except on hosts (like the AS/400) where the size or alignment of
5110         void * is greater than that of ptrdiff_t.
5111         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5112         __STDC__)]: Store temporary in pointer member of union, not
5113         integer member.
5114         * obstack.c: Include <stddef.h>, for offsetof.
5115         (struct fooalign): Remove; it doesn't need a name.
5116         (union fooround): Change double to long double, and add void *.
5117         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5118         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5119         not a macro.  Hence the values are always int; so remove all
5120         casts-to-int in uses.
5121
5122 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5123             Derek Price  <derek@ximbiot.com>
5124
5125         * alloca.c: Include <alloca.h>, to get our interface.
5126         * alloca_.h: Use __alloca on AIX, so that we don't have to
5127         include <alloca.h> first.  Use C89 prototype for alloca; this
5128         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5129         Use #elif for simplicity, since we can assume C89 now.
5130         Don't try to source the system alloca.h since it will not be found
5131         and to prevent recursively including its replacement.
5132         * fnmatch.c: Include <alloca.h> instead of opencoding.
5133         * regex.c: Likewise.
5134
5135 2004-05-16  Derek Price  <derek@ximbiot.com>
5136             Paul Eggert  <eggert@cs.ucla.edu>
5137
5138         getline cleanup.  This changes the getndelim2 API: both order of
5139         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5140         no delimiter).
5141
5142         * getline.c: Don't include stddef.h or stdio.h, since our
5143         interface does that.
5144         (getline): Always use getdelim, so that we don't have two
5145         copies of this code.
5146         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5147         if available.
5148         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5149         (GETNDELIM2_MAXIMUM): New macro.
5150         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5151         instead of the old practice of delim2==0.  All callers changed.
5152         Return -1 on overflow, instead of returning junk.
5153         Do not set *linesize unless allocation succeeds.
5154         * getndelim2.h: Do not include stddef.h; no longer needed, now
5155         that we include sys/types.h.
5156         * getnline.h: Likewise.
5157         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5158         (getndelim2): Reorder arguments.
5159         * getnline.c (getnline, getndelim):
5160         Don't discard the NMAX argument.
5161         (getnline): Invoke getndelim, to avoid code duplication.
5162         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5163         of (size_t) -1 by callers of the getnline family.
5164
5165 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5166
5167         * nanosleep.c (suspended): Change its type from int to
5168         sig_atomic_t volatile.
5169         (first_call): Make it private to rpl_nanosleep, and have it
5170         be zero initially as that's a bit faster.
5171         (my_usleep): Round up fractional times instead of truncating them,
5172         as this is the usual meaning for 'sleep'.
5173
5174         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5175         doesn't work.
5176         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5177         (ENOSYS): Define if not defined.
5178         (settime): Fall back on stime if it exists and settimeofday fails.
5179         But don't bother with fallbacks if a method fails with errno == EPERM.
5180
5181 2004-05-11  Jim Meyering  <jim@meyering.net>
5182
5183         Prior to this change, the save_cwd caller required read access to the
5184         current directory on most systems (ones with the fchdir function).
5185
5186         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5187         fails, try write-only, and finally, resort to using xgetcwd.
5188
5189 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5190
5191         * obstack.c, obstack.h: Import changes from libc.
5192
5193 2004-04-28  Bruno Haible  <bruno@clisp.org>
5194
5195         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5196         implicitly appends .exe to executables.
5197         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5198         accepts Windows pathnames.
5199         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5200         Cygwin like Windows, since it now accepts Windows pathnames.
5201         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5202         Cygwin like Windows, since it now accepts Windows pathnames.
5203         Reported by Derek Robert Price <derek@ximbiot.com>.
5204
5205 2004-04-20  Jim Meyering  <jim@meyering.net>
5206
5207         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5208
5209 2004-04-20  Jim Meyering  <jim@meyering.net>
5210             Bruno Haible  <bruno@clisp.org>
5211
5212         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5213         memory when realloc fails.
5214
5215 2004-04-18  Jim Meyering  <jim@meyering.net>
5216
5217         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5218         don't leak memory and do call END_UTMP_ENT.
5219
5220 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5221
5222         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5223         (CHAR_BIT): Remove, since we assume C89.
5224         Include <stdint.h> if available, as per current Autoconf CVS advice.
5225
5226 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5227
5228         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5229         not bool, to be more consistent with Unix conventions.
5230         Suggested by Bruno Haible.
5231
5232         Merge from coreutils.
5233
5234         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5235         New files.
5236
5237         * getdate.h: Include stdbool.h, and timespec.h instead of
5238         the usual <time.h> dance.
5239         (get_date): Change signature to support fractional time stamps.
5240         All callers changed.
5241         * getdate.y: Include "getdate.h" first, as we can now
5242         assume C89 and don't need to worry about 'const'.
5243         Similarly, include "unlocked-io.h" near start, not in middle.
5244         Include <limits.h>.
5245         (textint.value): Use long int rather than int.
5246         (textint.digits): Use size_t rather than int.
5247         (BILLION, LOG10_BILLION): New constants.
5248         (parser_control): New member rel_ns.  Members day_ordinal,
5249         time_zone, month, day, hour, minutes, rel_year, rel_month,
5250         rel_day, rel_hour, rel_minutes, rel_seconds
5251         are now long int, not int.  Member seconds is now struct timespec,
5252         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5253         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5254         not int.
5255         (%union.intval): Now long int, not int.
5256         New member timespec.
5257         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5258         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5259         (spec): Now is a timespec or an item list.
5260         (timespec, items): New nonterminals.
5261         (time, rel, relunit, number, get_date):
5262         Add support for fractional seconds.
5263         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5264         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5265         (to_hour): First arg is now long int, not int.
5266         (to_year): Returns long int, not int.
5267         Don't treat year -70 like 70.
5268         (tm_diff): Returns long int, not int.
5269         (lookup_word): Use bool instead of int when appropriate.
5270         (yylex): Use size_t for count, not int.
5271         Detect overflow when parsing large integer constants.
5272         Add support for fractions.
5273         (get_date): Make pointers 'const' if possible.
5274         Use more-portable code to detect integer overflow.
5275         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5276         Don't use ctime; it's not reliable if the year has >4 digits.
5277
5278         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5279         This is for compatibility with BSD.
5280
5281         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5282         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5283         From coreutils' system.h.
5284
5285         * userspec.c: Don't include "posixver.h".
5286         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5287         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5288         compatible extension.  Simplify code by removing a boolean int
5289         that was always nonzero if a string was nonnull.
5290
5291 2004-03-30  Jim Meyering  <jim@meyering.net>
5292
5293         Merge from coreutils.
5294
5295         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5296
5297         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5298         an empty input stream.
5299
5300         * readtokens.c: Include <stdbool.h>.
5301         (readtoken): Use `size_t' rather than int/long.
5302         All callers adjusted.
5303         Use `bool' rather than `int' where appropriate.
5304         Use memset rather than an explicit loop.
5305         Use x2nrealloc rather than xrealloc.
5306         Allow the use of `\0' as a delimiter.
5307         (readtokens): Likewise.
5308         * readtokens.h (readtoken, readtokens): Update prototypes.
5309
5310 2004-03-30  Bruno Haible  <bruno@clisp.org>
5311
5312         * getloadavg.c (getloadavg): Don't assume setlocale returns
5313         nonnull.
5314
5315 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5316
5317         Merge changes to getloadavg.c from coreutils and Emacs.
5318
5319         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5320         Define to an expression, not to the empty string.
5321         Include cloexec.h and xalloc.h.
5322         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5323         Use set_cloexec_flag rather than rolling our own.
5324         * cloexec.c, cloexec.h: New files.
5325
5326 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5327
5328         * getopt.h: Sync with libc CVS.
5329
5330 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5331             Bruno Haible  <bruno@clisp.org>
5332
5333         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5334         not on all platforms that have <wchar.h>.
5335         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5336
5337 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5338
5339         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5340         Sync with libc CVS.
5341         * getopt_int.h: New file, also synced from libc.
5342
5343 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5344
5345         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5346         '#if' expressions.  Unlike the code it replaces, it does not
5347         depend on (defined _SC_PAGESIZE).  However, it does depend on
5348         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5349         first reported by Jason Andrade in
5350         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5351
5352 2004-01-18  Simon Josefsson  <jas@extundo.com>
5353
5354         * strdup.h: New file.
5355         * strdup.c: Include it.
5356         * path-concat.c: Include strdup.h. Drop strdup declaration.
5357         * userspec.c: Include strdup.h. Drop strdup declaration.
5358
5359 2004-02-06  Karl Berry  <karl@gnu.org>
5360
5361         * config.charset: update from gettext 0.14.1.
5362
5363 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5364
5365         Add comments and code, prompted by suggestions from Bruno Haible
5366         for sh-quote.
5367         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5368         describing the enum quoting_style values.
5369         * quotearg.c (quotearg_alloc): New function.
5370         (quotearg_buffer_restyled): Treat lone { and } as special.
5371         Treat = as special.  Work around bug with older shells
5372         that "see" a '\' that is really the 2nd byte of a multibyte char.
5373         Quote empty string with shell_quoting_style.
5374
5375 2004-02-03  Bruno Haible  <bruno@clisp.org>
5376
5377         * pipe.h: New file, from GNU gettext.
5378         * pipe.c: New file, from GNU gettext.
5379
5380 2004-01-27  Bruno Haible  <bruno@clisp.org>
5381
5382         * execute.h: New file, from GNU gettext.
5383         * execute.c: New file, from GNU gettext.
5384         * w32spawn.h: New file, from GNU gettext.
5385
5386 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5387
5388         Exit-status fix from coreutils.
5389
5390         Use exit_failure consistently in place of EXIT_FAILURE,
5391         so that program exit statuses are consistent on failure.
5392
5393         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5394         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5395         * argmatch.h: Comment fix to match the above.
5396         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5397         Now a macro referring to exit_failure, instead of a separate
5398         variable.  Include "exitfail.h" to get it.
5399         * xstrtol.h: Include "exitfail.h".
5400         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5401
5402         * long-options.c (parse_long_options): Use prototype
5403         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5404         for clarity.
5405
5406 2004-01-21  Jim Meyering  <jim@meyering.net>
5407
5408         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5409         so as not to conflict with a different-sized __mktime_internal
5410         function in GNU libc.
5411         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5412         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5413
5414 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5415
5416         Merge from diffutils.
5417
5418         * file-type.c (file_type): Add typed memory objects.
5419         * file-type.h (S_TYPEISTMO): New macro.
5420
5421         * c-stack.h (c_stack_action): Remove argv argument.
5422         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5423         (die): Don't calculate message unless segv_action returns.
5424         (get_stack_location, min_address_from_argv, max_address_from_argv,
5425         volatile stack_base, volatile_stack_size): Remove.
5426         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5427         that every segmentation violation is a stack overflow.  (Ouch!)
5428         See Debian bug 136249 (still outstanding) for more info about why
5429         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5430
5431 2003-11-30  Bruno Haible  <bruno@clisp.org>
5432
5433         Safer stack allocation.
5434         * setenv.c: Include allocsa.h.
5435         (alloca): Remove fallback definition.
5436         (freea): Remove macro.
5437         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5438         instead of freea.
5439
5440 2003-10-17  Bruno Haible  <bruno@clisp.org>
5441
5442         * binary-io.h: Avoid warnings on Cygwin.
5443
5444 2003-12-28  Bruno Haible  <bruno@clisp.org>
5445
5446         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5447         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5448
5449 2003-11-28  Bruno Haible  <bruno@clisp.org>
5450
5451         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5452
5453 2003-11-27  Bruno Haible  <bruno@clisp.org>
5454
5455         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5456
5457 2003-11-17  Bruno Haible  <bruno@clisp.org>
5458
5459         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5460
5461 2003-11-24  Bruno Haible  <bruno@clisp.org>
5462
5463         * xallocsa.h: New file, from GNU gettext.
5464         * xallocsa.c: New file, from GNU gettext.
5465
5466 2003-11-24  Bruno Haible  <bruno@clisp.org>
5467
5468         * allocsa.h: New file, from GNU gettext.
5469         * allocsa.c: New file, from GNU gettext.
5470
5471 2003-11-24  Bruno Haible  <bruno@clisp.org>
5472
5473         * eealloc.h: New file.
5474
5475 2004-01-15  Jim Meyering  <jim@meyering.net>
5476
5477         Merge from coreutils.
5478
5479         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5480         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5481         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5482
5483         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5484         optional configure-time default.
5485
5486         * version-etc.c (version_etc_copyright): Update copyright date.
5487
5488         * xreadlink.c (xreadlink): Correct outdated comment.
5489
5490 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5491
5492         Merge from coreutils.
5493
5494         * posixver.c: Include posixver.h.
5495
5496         * same.c: Include <stdbool.h>, <limits.h>.
5497         (_POSIX_NAME_MAX): Define if not defined.
5498         (MIN): New macro.
5499         (same_name): If file names are silently truncated, report
5500         that the file names are the same if they are the same after
5501         the silent truncation.
5502
5503         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5504         conversion function.
5505         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5506         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5507         longer needed.
5508
5509 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5510
5511         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5512         with like-named macro in fnmatch.c.
5513         (EXT): Use an internal constant instead.
5514
5515         Merge fnmatch patches from glibc.
5516         * fnmatch.c (mbsinit): Remove define.
5517         Add libc_hidden_ver (__fnmatch, fnmatch).
5518         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5519         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5520
5521 2003-12-14  Karl Berry  <karl@gnu.org>
5522
5523         * config.charset: update from gettext-runtime.
5524
5525 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5526
5527         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5528         Bug reported by Alfred M. Szmidt.
5529
5530 2003-11-29  Karl Berry  <karl@gnu.org>
5531
5532         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5533
5534 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5535             Bruno Haible  <bruno@clisp.org>
5536
5537         * printf-parse.h: Don't include sys/types.h.
5538         (ARG_NONE): New macro.
5539         (char_directive): Change type of *arg_index fields to size_t.
5540         * printf-parse.c: Don't include sys/types.h.
5541         (SSIZE_MAX): Remove macro.
5542         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5543         Remove unnecessary overflow check.
5544         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5545         fields.
5546
5547 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5548
5549         * alloca.c: Remove dependency on xalloc module.
5550         (xalloc_die): Remove.
5551         (memory_full) [!defined emacs]: New macro.
5552         [!defined emacs]: Don't include xalloc.h.
5553         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5554         address arithmetic overflows.  Change datatypes a bit to avoid
5555         unnecessary casts.
5556
5557 2003-11-22  Jim Meyering  <jim@meyering.net>
5558
5559         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5560
5561 2003-11-17  Bruno Haible  <bruno@clisp.org>
5562
5563         * vasnprintf.c (alloca): Remove fallback definition.
5564         (freea): Remove definition.
5565         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5566         Reported by Paul Eggert.
5567
5568 2003-11-17  Jim Meyering  <jim@meyering.net>
5569
5570         On systems without utime and without a utimes function capable of
5571         dealing with a NULL struct utimbuf* argument, this utime replacement
5572         could -- in unusual circumstances -- leak a file descriptor.
5573         * utime.c: Include <unistd.h> and <errno.h>.
5574         (utime_null): Be sure to close `fd' and to preserve errno.
5575         Reported by Geoff Collyer via Arnold Robbins.
5576
5577 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5578             Bruno Haible  <bruno@clisp.org>
5579
5580         Protect against address arithmetic overflow.
5581         * printf-args.h: Include stddef.h.
5582         (arguments): Change type of field 'count' to size_t.
5583         * printf-args.c (printf_fetchargs): Use size_t instead of
5584         'unsigned int' where appropriate.
5585         * printf-parse.h: Include sys/types.h.
5586         (char_directive): Change type of *arg_index fields to ssize_t.
5587         (char_directives): Change type of fields 'count', max_*_length to
5588         size_t.
5589         * printf-parse.c: Include sys/types.h and xsize.h.
5590         (SSIZE_MAX): Define fallback value.
5591         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5592         instead of 'int' where appropriate. Check a_allocated, d_allocated
5593         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5594         * vasnprintf.c: Include xsize.h.
5595         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5596         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5597         overflow. Avoid wraparound when converting a width or precision from
5598         decimal to binary.
5599
5600 2003-11-16  Bruno Haible  <bruno@clisp.org>
5601
5602         Update from GNU gettext.
5603         * printf-parse.c: Generalize to it can be compiled for wide strings.
5604         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5605         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5606         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5607         SNPRINTF): New macros.
5608         Don't include <alloca.h> if the file is used inside libintl.
5609         (local_wcslen): New function, for Solaris 2.5.1.
5610         (VASNPRINTF): Use it instead of wcslen.
5611
5612 2003-11-16  Bruno Haible  <bruno@clisp.org>
5613
5614         * xsize.h (xmax): New function.
5615         (xsum, xsum3, xsum4): Declare as "pure" functions.
5616
5617 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5618
5619         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5620         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5621         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5622         heuristic is just as accurate as far as we know, and it removes a
5623         dependency on size_max.m4 and ptrdiff_max.m4.
5624
5625 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5626
5627         * xstrtol.c (__xstrtol): Remove "break" immediately after
5628         "return", to pacify some unknown compiler.  Problem reported
5629         by Joerg Schilling.
5630
5631 2003-11-11  Bruno Haible  <bruno@clisp.org>
5632
5633         * xsize.h (SIZE_MAX): Remove fallback definition.
5634         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5635         defined.
5636
5637 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5638
5639         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5640         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5641         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5642         From Bruno Haible.
5643         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5644         not (size_t) -1, since it's defined here.
5645
5646 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5647
5648         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5649         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5650         Reject sizes of exactly SIZE_MAX bytes.
5651         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5652         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5653
5654 2003-11-05  Bruno Haible  <bruno@clisp.org>
5655
5656         * xsize.h: Include limits.h, to avoid a possible collision with
5657         SIZE_MAX defined in <limits.h> on Solaris.
5658
5659 2003-11-04  Bruno Haible  <bruno@clisp.org>
5660
5661         * xsize.h: New file.
5662         * linebreak.c: Include xsize.h.
5663         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5664         argument for overflow.
5665         Suggested by Paul Eggert.
5666
5667 2003-10-31  Bruno Haible  <bruno@clisp.org>
5668
5669         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5670         to avoid (extremely rare) race condition.
5671         Suggested by Paul Eggert.
5672
5673 2003-11-03  Jim Meyering  <jim@meyering.net>
5674
5675         * userspec.c: Include "userspec.h".
5676         * userspec.h: New file.
5677
5678 2003-10-31  Paul Eggert  <eggert@twinsun.com>
5679
5680         * mountlist.h (struct mount_entry.me_type_malloced): New member.
5681         * mountlist.c (SIZE_MAX): Define if not defined already.
5682         (read_filesystem_list): Set and use me_type_malloced.
5683         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5684         whatever the type happens to be), for brevity and consistency.
5685         Check for size calculation overflow on Alphas running OSF/1.
5686
5687 2003-10-31  Jim Meyering  <jim@meyering.net>
5688
5689         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5690
5691         * linebuffer.c: Include <string.h> for declaration of memset.
5692
5693 2003-10-30  Paul Eggert  <eggert@twinsun.com>
5694             Bruno Haible  <bruno@clisp.org>
5695
5696         * vasprintf.c: Include <limits.h>, <stdlib.h>.
5697         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5698
5699 2003-10-29  Paul Eggert  <eggert@twinsun.com>
5700
5701         * xalloc.h (xalloc_oversized): Now a macro, not a function,
5702         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
5703         no longer needed.
5704         * quotearg.c (quotearg_n_options): Use it.
5705         * group-member.c: Include <stdbool.h>.
5706         (free_group_info): Arg is now const *; don't free arg.
5707         (get_group_info): Now returns bool and accepts struct group_info *,
5708         rather than returning a malloc'ed struct group_info *.
5709         All uses changed.  Check for overflow in internal size calculation.
5710
5711         * getusershell.c (readname): Simplify the code by using x2nrealloc
5712         rather than xmalloc/xrealloc.
5713         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
5714         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
5715         conformance bug: the old code used a pointer after freeing the
5716         storage that it addressed.
5717         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
5718         rather than doing it by hand.
5719         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
5720         the buffer preserved.  Use free and xmalloc instead.
5721         * quotearg.c (quotearg_n_options): Likewise.
5722         Use a simpler test for size overflow.  Don't use xalloc_oversized
5723         because unsigned int might be wider than size_t (!); this suggests
5724         that we should switch from unsigned int to size_t for slot numbers.
5725
5726 2003-10-27  Bruno Haible  <bruno@clisp.org>
5727
5728         * stdbool_.h: Better support for BeOS.
5729
5730 2003-10-27  Paul Eggert  <eggert@twinsun.com>
5731
5732         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
5733         to allocate the returned structure.  Do not allocate a subarray,
5734         as x2nrealloc will do that.
5735         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
5736         instead of xnrealloc.
5737         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
5738
5739 2003-10-26  Paul Eggert  <eggert@twinsun.com>
5740
5741         * xalloc.h (xalloc_oversized): New static inline function, for
5742         callers that want to do their own size-overflow checking.  Include
5743         <stdbool.h>, since xalloc_oversized returns bool.
5744         * xalloc.c (array_size_overflow): Remove.  All callers changed
5745         to use xalloc_oversized.
5746
5747         Add two functions x2realloc, x2nrealloc, for programs that grow
5748         arrays dynamically by doubling their sizes.
5749         * xalloc.h (x2realloc, x2nrealloc): New decls.
5750         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
5751         New functions.
5752
5753         Port to C99 semantics for 'inline' of external functions.
5754         Bug reported by Bruno Haible.
5755         * xmalloc.c (xnmalloc_inline): New static inline function,
5756         with the old contents of xnmalloc.
5757         (xnmalloc, xmalloc): Use it.
5758         (xnrealloc_inline): New static inline function,
5759         with the old contents of xnrealloc.
5760         (xnrealloc, xrealloc): Use it.
5761
5762         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
5763
5764 2003-10-25  Paul Eggert  <eggert@twinsun.com>
5765
5766         Fix several address-calculation bugs in the hash modules,
5767         plus some minor code cleanup.
5768
5769         * hash.h: Include <stdbool.h>, for bool.
5770         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
5771         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
5772         hash_get_n_entries, hash_get_max_bucket_length,
5773         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
5774         hash_rehash): Use size_t rather than unsigned.
5775         * hash.c (struct hash_table, hash_get_n_buckets,
5776         hash_get_n_buckets_used, hash_get_n_entries,
5777         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
5778         hash_get_entries, hash_do_for_each, hash_string, is_prime,
5779         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
5780         Likewise.
5781         (SIZE_MAX): Define if not defined.
5782         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
5783         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
5784         hash_print):
5785         Use const * when possible.
5786         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
5787         (check_tuning): Fix bug: if tuning parameters were very close to
5788         0 or 1, rounding errors could have caused subscript violations.
5789         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
5790         (hash_initialize): Add 'fail:' label
5791         to free table and return NULL, and use it to simplify code.
5792         Use calloc rather than clearing the storage ourself.
5793         (hash_initialize, hash_rehash): Check for arithmetic overflow in
5794         buffer size calculations.
5795         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
5796         Include <stddef.h>, for size_t.
5797         * hash-pjw.c (hash_pjw): Likewise.
5798         Switch to method described by Bruno Haible.
5799         Include <limits.h>, for CHAR_BIT.
5800         (SIZE_BITS): New macro.
5801
5802 2003-10-21  Paul Eggert  <eggert@twinsun.com>
5803
5804         * getndelim2.c (getndelim2): When size calculation overflows,
5805         ceiling the allocation at NMAX bytes rather than silently
5806         discarding input bytes before NMAX is reached.  This makes
5807         a difference only if NMAX exceeds SIZE_MAX / 2.
5808
5809         * obstack.c: Merge from glibc.
5810         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
5811         Add libc_hidden_def (_obstack_newchunk).
5812         (_obstack_free) [! defined _LIBC]: Remove.
5813         [defined _LIBC]: Make a strong alias from obstack_free, rather than
5814         a clone of the function body.
5815         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
5816         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
5817
5818         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
5819         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
5820         arg to memcpy.
5821
5822         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
5823         (obstack_ptr_grow_fast, obstack_int_grow_fast):
5824         Don't use lvalue casts, as GCC plans to remove support for them
5825         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
5826         was also present in the non-GCC version, indicating that this
5827         code had always been buggy and had never been widely used.
5828         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
5829         Use the fast variant of each macro, rather than copying the
5830         definiens of the fast variant; that way, we'll be more likely to
5831         catch future bugs in the fast variants.
5832
5833 2003-10-20  Bruno Haible  <bruno@clisp.org>
5834
5835         * wait-process.h: New file, from GNU gettext.
5836         * wait-process.c: New file, from GNU gettext.
5837
5838 2003-10-19  Jim Meyering  <jim@meyering.net>
5839
5840         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
5841
5842 2003-10-16  Paul Eggert  <eggert@twinsun.com>
5843
5844         * getgroups.c: Include <errno.h>, <stdlib.h>.
5845         (getgroups): First arg is int, not size_t.
5846         Don't let 'free' mangle errno.
5847
5848 2003-10-16  Jim Meyering  <jim@meyering.net>
5849
5850         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
5851
5852 2003-10-15  Paul Eggert  <eggert@twinsun.com>
5853
5854         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
5855         (SIZE_MAX): Remove.
5856         (new_exclude, add_exclude_file): Initial size no longer needs to
5857         be a power of 2.
5858         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
5859         our own address arithmetic overflow checking.
5860
5861         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
5862         (fnmatch): Do not alloca more than 2000 wide characters;
5863         instead, use malloc for large buffers.
5864         Check for address arithmetic overflow, and return -1
5865         with errno set to ENOMEM in that case.
5866         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
5867         (NEW_PATTERN): Do not alloca more than 8000 bytes;
5868         instead, return -1.  Check for address arithmetic overflow.
5869
5870 2003-10-14  Paul Eggert  <eggert@twinsun.com>
5871
5872         Handle invalid suffixes and overflow independently, so that
5873         callers can treat them independently as needed.  Fix some bugs in
5874         suffix handling, e.g., "100k@" was not diagnosed as an invalid
5875         suffix for a human-readable blocksize.  The major caller-visible
5876         change is the addition of a new
5877         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
5878         that both overflow and suffix chars were found.
5879
5880         * human.c (humblock): Don't check separately for invalid suffix
5881         char; that is xstrtoumax's job (now that its bug is fixed).
5882         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
5883         INTMAX_MAX]: New macros.
5884         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
5885         TYPE_MAXIMUM): New macros.
5886         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
5887         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
5888         if overflow occurs, as it's what __strtol does and it's more useful
5889         in practice.
5890         (__xstrtol): If __strtol reports some error other than ERANGE,
5891         reflect it to the caller as LONGINT_INVALID.  If it reports
5892         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
5893         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
5894         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
5895         value.
5896         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
5897         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
5898         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
5899         [defined UINTMAX_MAX]: New macros.
5900
5901 2003-10-14  Bruno Haible  <bruno@clisp.org>
5902
5903         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
5904         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
5905         Also use volatile where needed.
5906
5907 2003-10-12  Paul Eggert  <eggert@twinsun.com>
5908
5909         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
5910         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
5911         and define in terms of the other primitives.
5912         * xmalloc.c: Include stdbool.h; do not include exit.h.
5913         (SIZE_MAX): Define if not already defined.
5914         (array_size_overflow): New function.
5915         (xalloc_die): Abort instead of exiting if 'error' returns.
5916         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
5917         (xmalloc, xrealloc): Use them.
5918         (xcalloc): Check for address arithmetic overflow.
5919         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
5920         a bit faster than strcpy.
5921
5922 2003-10-08  Paul Eggert  <eggert@twinsun.com>
5923
5924         Merge getpass from libc, plus a few fixes.
5925
5926         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
5927         Include <stdbool.h>.
5928         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
5929         __fsetlocking to empty.
5930         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
5931         do include <bits/libc-lock.h>.
5932         Do not include <fcntl.h>; not needed.
5933         [_LIBC]: Include <wchar.h>.
5934         (NOTCANCEL_MODE): New macro.
5935         (flockfile, funlockfile) [_LIBC]: New macros.
5936         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
5937         [!_LIBC]: New macros.
5938         (call_fclose): New function.
5939         (getpass): Use it.  Save tty stream separately; this simplifies the
5940         code and makes it more reliable if stdin happens to equal stdout.
5941         Invoke __fsetlocking on tty.
5942         Handle thread cancellation if needed.
5943         Namespace cleanup (use __tcgetattr, __getline).
5944         Use bool for Booleans.
5945         [USE_IN_LIBIO]: Handle wide streams.
5946         [!_LIBC]: Unconditionally do the fseek, since we don't know what
5947         stream might go where.
5948
5949         * unlocked-io.h: Include <stdio.h>, so that the caller
5950         doesn't have to include <stdio.h> before us.
5951         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
5952         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
5953         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
5954         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
5955         if not declared, so that we can use getpass.c code from libc without
5956         rewriting it.
5957         (flockfile, ftrylockfile, funlockfile): New macros.
5958
5959 2003-10-06  Bruno Haible  <bruno@clisp.org>
5960
5961         * version-etc-2.h: Remove file.
5962         * version-etc-2.c: Remove file.
5963
5964 2003-09-25  Jim Meyering  <jim@meyering.net>
5965             Bruno Haible  <bruno@clisp.org>
5966
5967         This lets translators provide better translations for the
5968         "Written by ..." part of --version output.
5969         * version-etc.h: Include stdarg.h.
5970         (version_etc_copyright): Declare as readonly.
5971         (version_etc): Make this function variadic with a NULL-terminated list
5972         of author name strings.
5973         (version_etc_va): New declaration.
5974         * version-etc.c: Include stdarg.h, stdlib.h.
5975         (version_etc_copyright): Declare as readonly.
5976         (version_etc_va): New function. Provide a different translatable string
5977         for each possible number of authors < 10. Abbreviate when there are 10
5978         authors or more.
5979         (version_etc): Make this function variadic. Call version_etc_va.
5980         Suggestion from Gary V. Vaughan.
5981
5982         * long-options.h (parse_long_options): Change prototype: the authors
5983         string is moved to the end and becomes variadic.
5984         * long-options.c: Include stdarg.h.
5985         (parse_long_options): Make this function variadic, too.
5986         Call version_etc_va, not version_etc.
5987
5988 2003-10-06  Bruno Haible  <bruno@clisp.org>
5989
5990         * fatal-signal.h: New file, from GNU gettext.
5991         * fatal-signal.c: New file, from GNU gettext.
5992
5993 2003-10-04  Karl Berry  <karl@gnu.org>
5994
5995         * argp*: update from libc.
5996
5997 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
5998
5999         * getpass.c (getpass): Use a no-op fseek when switching from input to
6000         output mode on the same stream.
6001
6002 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6003
6004         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6005         Fix arg typo in previous patch.
6006
6007 2003-09-28  Jim Meyering  <jim@meyering.net>
6008
6009         * error.c: Correct cpp indentation.
6010
6011 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6012
6013         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6014         Omit the special code that used __typeof__, since we worry that
6015         it could be more trouble than it's worth.  See:
6016         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6017         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6018
6019         * free.c: New file.
6020
6021 2003-09-26  Jim Meyering  <jim@meyering.net>
6022
6023         * error.c (error_tail): Move some declarations
6024         into inner scope where the local variables are used.
6025
6026 2003-09-26  Bruno Haible  <bruno@clisp.org>
6027
6028         * stpncpy.h (gnu_stpncpy): New declaration.
6029         (stpncpy): Define as alias for gnu_stpncpy.
6030         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6031
6032 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6033
6034         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6035         (error_tail): Do not loop, reallocating temporary buffer, since
6036         the output cannot contain more wide characters than the input
6037         contains bytes, the size must be big enough already.  This avoids
6038         one potential size overflow calculation.  Check for size overflow
6039         when calculating temporary buffer size.  Free temporary buffer
6040         when done, if it was allocated with malloc; this plugs a memory
6041         leak.  Remove casts from void * to pointers, that are no longer
6042         needed now that we're assuming C89 or better.
6043
6044         Merge error changes from glibc.
6045
6046         * error.c, error.h: Update copyright notice header to match glibc.
6047         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6048         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6049         Disable cancellation while printing error.
6050         * error.h: Prepend __ to parameter names.
6051
6052 2003-09-25  Karl Berry  <karl@gnu.org>
6053
6054         * argp-fmtstream.c, argp-help.c: update from libc.
6055
6056 2003-09-25  Bruno Haible  <bruno@clisp.org>
6057
6058         * version-etc-2.h: New file, from version-etc.h with modifications.
6059         * version-etc-2.c: New file, from version-etc.c with modifications.
6060
6061 2003-09-25  Simon Josefsson  <jas@extundo.com>
6062
6063         * xgetdomainname.h: New file.
6064         * xgetdomainname.c: New file.
6065
6066 2003-09-25  Simon Josefsson  <jas@extundo.com>
6067             Bruno Haible  <bruno@clisp.org>
6068
6069         * getdomainname.h: New file.
6070         * getdomainname.c: New file.
6071
6072 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6073
6074         * linebuffer.c (freebuffer): Don't free the argument, just
6075         the buffer associated with the argument.  Bug reported by
6076         Simon Josefsson.
6077
6078 2003-09-19  Karl Berry  <karl@gnu.org>
6079
6080         * argp.h: update from libc.
6081
6082 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6083
6084         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6085         input error, instead of returning NULL the next time we are called
6086         (and therefore losing track of errno).
6087
6088 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6089
6090         * getndelim2.c (getndelim2): Don't trash errno when a read
6091         fails, so that the caller gets the proper errno.
6092
6093         * readutmp.c (read_utmp): Likewise.
6094         Check for fstat error.  Close stream and free storage
6095         when failing.
6096
6097 2003-09-14  Bruno Haible  <bruno@clisp.org>
6098
6099         * fwriteerror.h: New file.
6100         * fwriteerror.c: New file.
6101
6102 2003-09-14  Jim Meyering  <jim@meyering.net>
6103
6104         * getloadavg.c: Correct cpp indentation.
6105         * strdup.c: Likewise.
6106         * vasnprintf.c: Likewise.
6107
6108 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6109
6110         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6111         * obstack.c [!defined _LIBC]: Likewise.
6112         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6113         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6114         * exitfail.c: Don't include stdlib.h; no longer needed.
6115
6116         More changes to assume C89 or better.
6117
6118         * error.c (error_tail): Assume vprintf.
6119
6120         * argmatch.c (getenv): Remove decl.
6121         * progreloc.c (get_full_program_name): Define via prototype.
6122         * setenv.c (clearenv): Likewise.
6123         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6124         needed.
6125         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6126         (malloc, memcpy): Remove decls.
6127         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6128         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6129         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6130         (memcpy): Remove macro.
6131         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6132         (__P): Remove.  All uses removed.
6133         (PTR): Remove.  All uses changed to void *.
6134         (CHAR_BIT, NULL): Remove.
6135         (spaces, zeros, memset_space, memset_zero)
6136         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6137         Remove.
6138         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6139         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6140         Define with prototype.
6141         Remove now-unnecessary prototype decl.
6142         (extra_args_spec): Assume ANSI C.  All uses changed.
6143         (extra_args_spec_iso): Remove.
6144         (my_strftime, emacs_strftimeu): Define via prototype.
6145         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6146         unconditionally.
6147         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6148         * strtoimax.c: Include <stdlib.h> unconditionally.
6149         (strtoul, strtol): Remove decls.
6150         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6151         LONG_MAX): Remove.
6152         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6153         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6154         (LOCALE_PARAM_PROTO): New macro.
6155         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6156         (INTERNAL (strtol), strtol): Define with a prototype.
6157         (PARAMS): Remove.  All uses removed.
6158         * tempname.c: Include <string.h> unconditionally.
6159         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6160         * xgethostname.c (main): Define with a prototype.
6161         * xmalloc.c: Include "xalloc.h" first, to check interface.
6162         Include <stdlib.h> unconditionally.
6163         (calloc, malloc, realloc, free): Remove decls.
6164         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6165         Include <stdlib.h> unconditionally.  Sort include file names.
6166         (strtod): Remove.
6167         (xstrtod): Define with a prototype.
6168         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6169         (strtol, strtoul): Remove decls.
6170
6171 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6172
6173         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6174         Include <stdlib.h>, <string.h> unconditionally.
6175         Remove now-unnecessary cast to char *.
6176         * strnlen.c: Include <string.h> unconditionally.
6177         * yesno.c (yesno): Define with a prototype.
6178
6179 2003-09-10  Bruno Haible  <bruno@clisp.org>
6180
6181         * strcspn.c: Include <string.h> unconditionally.
6182         * strpbrk.c: Include <string.h> unconditionally.
6183         * strstr.c: Include <string.h> unconditionally.
6184         * unicodeio.c: Include <string.h> unconditionally.
6185         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6186         * unsetenv.c: Likewise.
6187         * xreadlink.c: Include <stdlib.h> unconditionally.
6188         * yesno.c: Include <stdlib.h> unconditionally.
6189         (rpmatch): Add prototype.
6190
6191 2003-09-10  Jim Meyering  <jim@meyering.net>
6192
6193         * error.c: Correct indentation of cpp directives.
6194
6195 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6196
6197         More K&R removal.
6198
6199         * acosl.c (main): Use a prototype.
6200         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6201         tanl.c: Likewise.
6202
6203         * getloadavg.c (getloadavg, main): Define via prototypes.
6204
6205         * getopt.h (struct option.name): Assume C89, and use 'const'.
6206         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6207         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6208         with a prototype.
6209         * getopt.c (const): Remove macro.
6210         Include <string.h> unconditionally.
6211         (my_index): Remove; all uses changed to strchr.
6212         (strlen): Remove decl.
6213         (exchange): Remove forward decl; no longer needed.
6214         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6215         Define with prototype.
6216         * getopt1.c (const): Remove macro.
6217         (getopt_long, getopt_long_only, main): Define with prototype.
6218
6219         * getugroups.c: Include <string.h> unconditionally.
6220
6221         * getusershell.c: Include <stdlib.h> unconditionally.
6222         (getusershell, setusershell, endusershell, readname, main):
6223         Define with prototypes.
6224
6225         * group-member.c: Include group-member.h first.
6226         Include <stdlib.h> unconditionally.
6227
6228         * hard-locale.c: Include hard-locale.h first.
6229         Include <stdlib.h>, <string.h> unconditionally.
6230
6231         * hash.c (free, malloc): Remove decls.
6232         Include <stdlib.h> unconditionally.
6233
6234         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6235         (getenv): Do not declare.
6236
6237         * idcache.c: Include <string.h> unconditionally.
6238
6239         * long-options.c: Include long-options.h first, to test interface.
6240         Include <stdlib.h> unconditionally.
6241
6242         * makepath.c: Include makepath.h first, to test interface.
6243         Include <stdlib.h> and <string.h> unconditionally.
6244
6245         * linebuffer.c: Include <stdlib.h>.
6246         (free): Remove decl.
6247
6248         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6249         rpl_malloc returns void *, not char *.
6250         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6251
6252         * md5.h: Include <limits.h> unconditionally.
6253         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6254         (__P): Remove; all uses removed.
6255         * md5.c: Include "md5.h" first.
6256         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6257         md5_buffer, md5_process_bytes, md5_process_block):
6258         Define with prototypes.
6259         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6260         * sha.c: Include "sha.h" first.
6261         Include <stdlib.h>, <string.h> unconditionally.
6262
6263         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6264         * memcmp.c (__ptr_t): Likewise.
6265         * memrchr.c (__ptr_t): Likewise.
6266         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6267         Include <string.h> unconditionally.
6268         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6269         * memchr.c: Include <stdlib.h> unconditionally.
6270         * memchr.c (LONG_MAX): Remove.
6271         * memrchr.c (LONG_MAX): Likewise.
6272         * memchr.c (__memchr): Define via a prototype.
6273         * memrchr.c (__memrchr): Likewise.
6274         * memcmp.c (__P): Remove, and remove all uses.
6275         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6276         Remove forward decls; no longer needed.
6277         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6278         Use types required by C89 in prototype.
6279
6280         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6281         * savedir.c: Likewise.
6282         * mkdir.c (free): Remove decl.
6283         * rmdir.c (rmdir): Define with a prototype.
6284         * savedir.c: Include savedir.h first, to test interface.
6285
6286         * mktime.c (STDC_HEADERS): Remove.
6287         Include <stdlib.h>, <string.h> unconditionally.
6288
6289         * modechange.c: Include <stdlib.h> unconditionally.
6290         (malloc): Remove decl.
6291
6292         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6293         (free): Remove decl.
6294
6295         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6296         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6297         (This type really should be intptr_t, but that's a C99ism.)
6298         (_obstack_memcpy): Remove: all uses changed to memcpy.
6299         Include <string.h> unconditionally.
6300         (struct obstack): Assume __STDC__ for types of members
6301         chunkfun, freefun, extra_arg.
6302         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6303         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6304         obstack_begin, obstack_specify_allocation,
6305         obstack_specify_allocation_with_arg, obstack_chunkfun,
6306         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6307         Remove unprototyped decls and the macros that use them.
6308         * obstack.c (POINTER): Remove.  All uses changed to void *.
6309         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6310         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6311         (defined __STDC__ && __STDC__)]:
6312         Remove nonprototyped code.
6313         Include <stdlib.h> unconditionally.
6314         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6315         _obstack_allocated_p, _obstack_free, obstack_free,
6316         _obstack_memory_used, print_and_abort):
6317         Define using prototypes.
6318         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6319         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6320         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6321         obstack_next_free, obstack_object_size, obstack_room) [0]:
6322         Remove unused, unprototyped code.
6323
6324         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6325
6326         * physmem.c (physmem_total, physmem_available, main): Define
6327         with prototypes.
6328
6329         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6330         (main): Define with a prototype.
6331
6332         * posixver.c (getenv): Remove decl.
6333
6334         * putenv.c (malloc): Returns void *, not char *.
6335         Include <string.h> unconditionally.
6336         (strchr, memcpy, NULL): Do not define.
6337
6338         * readtokens.c: Include readtokens.h first, to test interface.
6339         Include <stdlib.h>, <string.h> unconditionally.
6340         (init_tokenbuffer): Define with a prototype.
6341
6342         * regex.c (PARAMS): Remove.  All uses removed.
6343         All uses of _RE_ARGS removed, too.
6344         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6345         unconditionally.
6346         (bzero): Assume memset exists.
6347         (memcmp, memcpy, NULL): Remove.
6348         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6349         char, or assignments to local vars of type signed char.
6350         (init_syntax_once, PREFIX(extract_number_and_incr),
6351         PREFIX(print_partial_compiled_pattern),
6352         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6353         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6354         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6355         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6356         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6357         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6358         wcs_compile_range, byte_compile_range, truncate_wchar,
6359         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6360         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6361         count_mbs_length, wcs_re_match_2_internal,
6362         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6363         PREFIX(alt_match_null_string_p),
6364         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6365         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6366         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6367         now-unnecessary declaration, if any.
6368         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6369         regcomp, regexec):
6370         Remove now-unnecessary casts among pointer types.
6371         * regex.h (_RE_ARGS): Remove.  All uses removed.
6372
6373         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6374         (free): Remove decl.
6375
6376         * rpmatch.c: Include <stdlib.h> unconditionally.
6377
6378         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6379         (free): Remove decl.
6380
6381         * save-cwd.c: Include <stdlib.h> unconditionally.
6382         * xgetcwd.c: Likewise.
6383
6384         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6385         (free): Remove decl.
6386
6387         * strchrnul.c (strchrnul): Define with a prototype.
6388         Fix bug: c_in was not converted to char before searching.
6389
6390         The following changes are not K&R related:
6391
6392         * group-member.h: Include <sys/types.h>, so that this file is
6393         self-contained.
6394         * makepath.h: Likewise.
6395
6396         * getusershell.c (readname, default_index, line_size, readname):
6397         Use size_t, not int, for sizes.
6398         (readname): If the size overflows, report an error instead of
6399         looping forever.
6400
6401 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6402
6403         * getndelim2.c: Assume stdlib.h per the C89 spec.
6404
6405 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6406
6407         Assume C89 or better; remove K&R cruft.
6408         A few of these changes were first proposed by Derek Robert Price
6409         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6410
6411         * addext.c: Include <string.h> unconditionally.
6412         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6413         Don't declare getenv or malloc.
6414
6415         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6416         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6417         (NULL): Remove.
6418         (find_stack_direction, alloca): Use prototypes.
6419
6420         * atexit.c (atexit): Define using a prototype.
6421
6422         * basename.c, dirname.c, stripslash.c:
6423         Include <string.h> unconditionally.
6424
6425         * bcopy.c: Include <stddef.h>.
6426         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6427
6428         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6429
6430         * error.h (error, error_at_line, error_print_progname)
6431         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6432         * error.c: Include error.h first, to check interface.
6433         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6434         (VA_START): Remove; all uses changeed to va_start.
6435         (exit, strerror): Remove decls.
6436         (error_print_progname): Prototype uncondionally.
6437         Don't include <errno.h>; no longer needed.
6438         (private_strerror): Remove.
6439         (error_tail): Always define.
6440         (error, error_at_line): Assume C89 or better; always use prototypes.
6441         * fatal.c: Include "fatal.h" first, to test interface.
6442         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6443         (VA_START): Remove; all uses changed to va_start.
6444         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6445         this case.
6446         (exit): Remove decl.
6447         (fatal): Prototype unconditionally.  Assume va_start works.
6448         Abort at end, to pacify gcc.
6449
6450         * euidaccess.c (main): Define with a prototype.
6451
6452         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6453
6454         * exitfail.c: Include <stdlib.h> unconditionally.
6455
6456         * fnmatch_.h (__P): Remove.  All uses changed to assume
6457         prototypes.
6458         * fnmatch.c: Include fnmatch.h first, to test interface.
6459         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6460         (getenv): Remove decl.
6461         (fnmatch): Define using a prototype.
6462         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6463         (FCT): Define using a prototype.
6464
6465         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6466
6467         * gethostname.c: Include <stddef.h>.
6468         (gethostname): Define with prototype.  Length is size_t, not int.
6469
6470 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6471
6472         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6473         getversion.c should have been removed then, but was accidentally
6474         preserved.
6475
6476         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6477         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6478
6479 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6480
6481         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6482         copy_tm_result.  Bug reported by Simon Josefsson in
6483         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6484
6485 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6486
6487         * time_r.c, time_r.h: New files.
6488
6489         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6490         __localtime_r.
6491         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6492         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6493
6494         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6495         __gmtime_r.
6496         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6497         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6498         Include <time_r.h>.
6499
6500         * timegm.c: Switch to glibc implementation, with the following changes:
6501         [defined HAVE_CONFIG_H]: Include <config.h>.
6502         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6503         (__mktime_internal) [!defined _LIBC]: New decl.
6504         (__gmtime_r) [!defined _LIBC]: New macro and function.
6505         (timegm): Use a prototype, since gnulib assumes C89.
6506         Do not bother declaring tmp to be const, as it's not really usefu.
6507         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6508         (timegm): Declare only if HAVE_DECL_TIMEGM.
6509
6510 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6511
6512         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6513         Bug reported by Lute Kamstra in
6514         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6515
6516         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6517         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6518         course with correspondingly smaller numbers for tomorrow and
6519         yesterday.  From Tadayoshi Funaba.  Originally installed into
6520         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6521         coreutils merge?).
6522
6523 2003-08-31  Simon Josefsson  <jas@extundo.com>
6524
6525         * timegm.h: New file.
6526         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6527
6528 2003-08-31  Karl Berry  <karl@gnu.org>
6529
6530         * argp.h: update from libc.
6531
6532 2003-08-28  Bruno Haible  <bruno@clisp.org>
6533
6534         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6535         warning on QNX, which defines O_BINARY to 000000.
6536
6537 2003-08-24  Bruno Haible  <bruno@clisp.org>
6538
6539         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6540         MSVC7 <stdio.h> is included later.
6541
6542 2003-08-20  Bruno Haible  <bruno@clisp.org>
6543
6544         * progname.h: New file, from GNU gettext.
6545         * progname.c: New file, from GNU gettext.
6546         * progreloc.c: New file, from GNU gettext.
6547
6548 2003-08-19  Bruno Haible  <bruno@clisp.org>
6549
6550         * xstrdup.c: Assume <string.h> exists.
6551
6552 2003-08-18  Jim Meyering  <jim@meyering.net>
6553
6554         * setenv.h: Indent nested cpp directive.
6555         * vasnprintf.c: Remove trailing blanks.
6556
6557 2003-08-17  Simon Josefsson  <jas@extundo.com>
6558             Bruno Haible  <bruno@clisp.org>
6559
6560         * xstrndup.h: New file.
6561         * xstrndup.c: New file.
6562
6563 2003-08-17  Bruno Haible  <bruno@clisp.org>
6564
6565         * strndup.h: New file.
6566
6567 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6568
6569         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6570         space, undoing this 2003-08-12 change:
6571         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6572
6573 2003-08-16  Jim Meyering  <jim@meyering.net>
6574
6575         Merge from coreutils.
6576         * xstrtoimax.c: #else #if -> #elif.
6577         * xstrtoumax.c: Likewise.
6578
6579 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6580
6581         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6582         rather than tab, after '#' in shell-script copyright notices.
6583         Suggested by Bruno Haible.
6584
6585 2003-08-15  Jim Meyering  <jim@meyering.net>
6586         and Paul Eggert  <eggert@twinsun.com>
6587
6588         Merge from coreutils.
6589         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6590         member but strut utmpx does not.  Needed for AIX 4.3.3.
6591         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6592
6593 2003-08-15  Jim Meyering  <jim@meyering.net>
6594
6595         Merge from coreutils.
6596         * xgethostname.c: Include <stdlib.h>.
6597         (xghostname): Don't exit for anything other than memory-related
6598         failure; just return NULL.
6599         * userspec.c: Include "posixver.h".
6600         (parse_user_spec): Accept `.' as a separator only
6601         in pre-POSIX-200112 mode.
6602         * strtoimax.c: Use #elif rather than #else #if.
6603         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6604         Remove function, now that we can rely on a working tzset function.
6605         [!_LIBC]: Ensure that the required autoconf test has been run.
6606         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6607         Use underlying_strftime for %r.
6608         * sha.c: Merge in some clean-up and optimization changes from glibc.
6609         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6610         Ensure that it is a multiple of 64.
6611         Rearrange loop exit tests so as to avoid performing an
6612         additional fread after encountering an error or EOF.
6613         * realloc.c: Update copyright date.
6614
6615 2003-08-14  Jim Meyering  <jim@meyering.net>
6616
6617         Merge from coreutils.
6618         * obstack.h: Whitespace changes.
6619         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6620         and xcalloc return values.
6621         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6622         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6623         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6624         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6625         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6626         error from mntctl.
6627         Use mntctl's return value to drive the entry-processing loop, since
6628         we can't rely on the value of the vmt_length member in the last
6629         entry.  On some systems doing so could result in exhausting
6630         virtual memory.  Based in part on a patch from Mike Jetzer.
6631
6632 2003-08-14  Jim Meyering  <jim@meyering.net>
6633         and Paul Eggert  <eggert@twinsun.com>
6634
6635         Merges from coreutils, plus other fixes.
6636         * physmem.c: Merge in portability changes from gcc/libiberty
6637         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6638         for credits and details.  Thanks to Kaveh Ghazi for helping
6639         to keep these files in sync.
6640         (ARRAY_SIZE): Define it.
6641         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6642         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6643         (memcasecmp): Don't assume size_t fits in unsigned int.
6644         Remove casts and duplicate code.
6645         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6646         (memcpy): Remove definition.
6647         Merge in some clean-up and optimization changes from glibc.
6648         [BLOCKSIZE]: Move definition to top of file.
6649         Ensure that it is a multiple of 64.
6650         Rearrange loop exit tests so as to avoid performing an
6651         additional fread after encountering an error or EOF.
6652         * md5.h (md5_uintptr): Define.
6653         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6654         return to the initial working directory.  Preserve errno
6655         for caller.
6656         * idcache.c: Include "xalloc.h".
6657         (xmalloc, xrealloc): Remove decls.
6658         (getuser): Remove casts no longer required in C89.
6659         * human.c: Include stdio.h, for sprintf.
6660         * group-member.c: Include "xalloc.h".
6661         (xmalloc, xrealloc): Remove decls.
6662         (get_group_info): Remove casts no longer required in C89.
6663         * getusershell.c (readname): Remove casts no longer required in C89.
6664         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6665         * getline.c: Whitespace fix, from coreutils.
6666
6667 2003-08-13  Paul Eggert  <eggert@twinsun.com>
6668
6669         * exclude.c: Include <ctype.h>
6670         (IN_CTYPE_DOMAIN): New macro.
6671         (is_space): New fn.
6672         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6673         and empty lines.
6674
6675         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6676         Undo previous (whitespace-only) change.
6677
6678 2003-08-12  Paul Eggert  <eggert@twinsun.com>
6679
6680         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6681         Normalize leading white space and remove trailing white space.
6682         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6683         notice, as per ../config/srclist-update.
6684
6685         Merge from coreutils.
6686         * euidaccess.h: New file.
6687         * euidaccess.c: Include it.
6688         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6689         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
6690         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6691
6692 2003-08-11  Bruno Haible  <bruno@clisp.org>
6693
6694         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6695         (vasnprintf): Use it instead of wcslen.
6696
6697 2003-08-11  Bruno Haible  <bruno@clisp.org>
6698
6699         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6700         value to ensure that _Bool promotes to int. Use #define for _Bool when
6701         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6702
6703 2003-08-10  Karl Berry  <karl@gnu.org>
6704
6705         * regex.h: update from libc (whitespace fix).
6706
6707 2003-08-09  Paul Eggert  <eggert@twinsun.com>
6708
6709         Merge some files from coreutils.  These changes were
6710         originally made by Jim Meyering.
6711         * acl.c: Include <sys/types.h> before <sys/stat.h>;
6712         many older Unixes require this.
6713         * alloca.c (alloca): Remove cast to argument of free;
6714         no longer needed in C89.
6715         * alloca_.h, regex.h: Fix white space to match
6716         what GNU indent does.
6717
6718 2003-08-05  Paul Eggert  <eggert@twinsun.com>
6719
6720         * bumpalloc.h: Remove.
6721
6722 2003-08-04  Paul Eggert  <eggert@twinsun.com>
6723
6724         * getloadavg.c: Change copyright notice and spacing to conform to
6725         GNU coding style.
6726
6727         Merge from coreutils.
6728         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
6729         From glibc.
6730         * getdate.y (date): Also accept dates like May-23-2003; suggestion
6731         from Karl Berry, implemented by Jim Meyering.
6732         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
6733         from Dmitry V. Levin.
6734         Remove anachronistic cast of xrealloc.
6735         * fnmatch_.h (__const): Remove.  Use 'const'.
6736         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
6737         type. Otherwise, it wouldn't compile with at least /bin/cc on
6738         ymp-cray-unicos9.0.2.X.
6739         Combine two mostly-identical uses of alloca into one.
6740         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
6741
6742 2003-08-04  Dave Love <d.love@dl.ac.uk>
6743
6744         [From Emacs.]
6745
6746         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
6747         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
6748         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
6749         obsolete NLIST_NAME_UNION.
6750         [__GNU__]: Undef BSD and FSCALE.
6751         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
6752
6753 2003-08-03  Paul Eggert  <eggert@twinsun.com>
6754
6755         * stdbool_.h (_Bool): Make it signed char, instead of
6756         an enum type, so that it's guaranteed to promote to int.  See:
6757         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
6758
6759 2003-07-31  Paul Eggert  <eggert@twinsun.com>
6760
6761         * strerror.c: Include config.h, limits.h.  Declare sprintf.
6762         (strerror): Don't assume that a printable int fits in 14 bytes.
6763
6764 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
6765             Bruno Haible  <bruno@clisp.org>
6766
6767         * getline.h (getline, getdelim): Change return type to ssize_t.
6768         * getline.c (getline, getdelim): Likewise.
6769         Remove _GNU_SOURCE define; now it's defined in config.h through
6770         m4/getline.m4.
6771
6772 2003-07-22  Paul Eggert  <eggert@twinsun.com>
6773
6774         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
6775         over-parenthesization in macros.
6776
6777         Sync with coreutils.
6778
6779         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
6780         required by C99.
6781
6782         Use `exit_failure' for xalloc and xmemcoll instead of their own
6783         private exit-failure variables.
6784         * xalloc.h (xalloc_exit_failure): Remove.
6785         * xmalloc.c: Likewise.  Include exitfail.h.
6786         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
6787         * xmemcoll.h (xmemcoll_exit_failure): Remove.
6788         * xmemcoll.c: Likewise.  Include exitfail.h.
6789         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
6790
6791 2003-07-18  Paul Eggert  <eggert@twinsun.com>
6792
6793         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
6794         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
6795         to test that it can stand by itself.  Include "exitfail.h".
6796         Clients should set exit_failure instead.
6797         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
6798
6799 2003-07-18  Andreas Schwab  <schwab@suse.de>
6800
6801         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
6802
6803 2003-07-18  Bruno Haible  <bruno@clisp.org>
6804
6805         * getndelim2.h: New file.
6806         * getndelim2.c: Make into a module of its own. Include config.h,
6807         getndelim2.h.
6808         (getndelim2): Make non-static. Change return type to ssize_t.
6809         * getline.h: Change argument names.
6810         * getline.c: Include getndelim2.h instead of getndelim2.c.
6811         * getnline.c: Include getndelim2.h.
6812
6813 2003-07-17  Bruno Haible  <bruno@clisp.org>
6814
6815         * Makefile.am: Remove file.
6816         * Makefile.in: Remove file.
6817
6818 2003-07-17  Bruno Haible  <bruno@clisp.org>
6819
6820         * getnline.h: New file.
6821         * getnline.c: New file.
6822         * getndelim2.c: New file, extracted from getline.c.
6823         (getndelim2): Renamed from getdelim2, with added nmax argument.
6824         * getline.c: Include getndelim2.c.
6825         (getdelim2): Moved out to getndelim2.c.
6826         (getline, getdelim): Update.
6827
6828 2003-07-15    <karl@gnu.org>
6829
6830         * vasnprintf.c: update from gettext.
6831
6832 2003-07-15  Jim Meyering  <jim@meyering.net>
6833
6834         * makepath.c (make_path): Enclose diagnostic in _(...).
6835
6836 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6837
6838         * asnprintf.c, asprintf.c, config.charset, gettext.h,
6839         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
6840         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
6841         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
6842         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
6843         updated automatically by ../config/srclist-update.  This changes
6844         their license from LPGL to GPL.
6845
6846 2003-07-14  Jim Meyering  <jim@meyering.net>
6847
6848         Don't emit diagnostics.  Let callers do that.
6849         * save-cwd.c: Don't include "error.h".
6850         (save_cwd): Don't call error.  Ensure that errno is valid
6851         when returning nonzero.
6852
6853         * save-cwd.h (restore_cwd): Update prototype.
6854         * save-cwd.c (restore_cwd): Remove two parameters.
6855         Simplify.  Don't call error upon failure.  Let callers do that.
6856         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
6857         when auditing is enabled.  But don't bother updating the #if.
6858
6859 2003-07-14  Simon Josefsson  <jas@extundo.com>
6860
6861         * mempcpy.h: New file.
6862         * mempcpy.c: New file.
6863
6864 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6865
6866         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
6867         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
6868         unicodeio.c, unicodeio.h, unlocked-io.h:
6869         Switch from LGPL to GPL.
6870
6871 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
6872
6873         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
6874         it breaks C++ compilation.
6875         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
6876
6877 2003-07-10  Jim Meyering  <jim@meyering.net>
6878
6879         * vasnprintf.c: Remove trailing blanks.
6880         Make cpp indentation consistent.
6881
6882 2003-07-09  Paul Eggert  <eggert@twinsun.com>
6883
6884         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
6885         posixver.c, strftime.c, strnlen.c, strverscmp.c:
6886         Switch from LGPL to GPL.
6887
6888 2003-07-07  Paul Eggert  <eggert@twinsun.com>
6889
6890         * mktime.c: Fix some boundary cases and remove need for floating point.
6891
6892         Issue a compile-time diagnostic if time_t is floating point, or if
6893         two's complement arithmetic is not in effect, or if arithmetic
6894         right shift does not propagate the sign.  These assumptions were
6895         all in the original code but they weren't checked.
6896
6897         (TIME_T_MIDPOINT, verify): New macros.
6898         (__isleap): Remove; it has integer overflow problems.
6899         (leapyear): New function, without those problems.
6900         (ydhms_tm_diff): Remove; splitting into two parts.
6901         (ydhms_diff): New function, containing the arithmetic part of
6902         the old ydhms_tm_diff function.  Issue a compile-time
6903         diagnostic if we are not using C99 integer division.
6904         Avoid casts when possible.
6905         (guess_time_tm): New function, containing the checking part of
6906         the old ydhms_tm_diff function.  Return the new value, rather than
6907         the difference between it and the old.  Accept a new argument T
6908         so that *T specifies the old value.  Check for overflow in the result.
6909
6910         (__mktime_internal): Use a time_t offset, not a long int offset.
6911         This undoes the 2003-06-04 change, which is no longer needed now
6912         that we have better overflow checking.
6913         (localtime_offset): Likewise.
6914
6915         (__mktime_internal): Avoid harmful overflow on hosts where time_t
6916         and long are 64-bit but int is only 32-bit.
6917         (ydhms_diff): Use long int to store year1 and yday1.
6918         Issue a compile-time diagnostic if long int is not wide enough.
6919
6920         (__mktime_internal): Use long int to store adjusted year and yday.
6921         Use plain C rather than preprocessor commands, if that doesn't
6922         affect efficiency.
6923         Check for overflow (and try to repair) after each probe
6924         rather than checking only at the very end.  This avoids some bugs
6925         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
6926         does not equal GMT offset at maximum time).
6927         Use integer to check for overflow rather than floating point; this
6928         is more portable to non-IEEE hosts, and is a tad faster.
6929         When we detect that we are oscillating between two values,
6930         don't check whether tm_isdst has the requested value, since
6931         we already know the answer.  When tm_isdst has the wrong value,
6932         use a different heuristic to find the right one, based on the
6933         extreme values actually observed in practice in tz2003a,
6934         rather than the (overly optimistic) "previous 3 calendar quarters".
6935
6936         (not_equal_tm, print_tm, check_result): Use "const T" rather than
6937         "T const" to accommodate glibc style.
6938         (check_result): Use less-confusing report format.  "long" -> "long int.
6939         (main): Likewise.
6940         Don't loop if the iteration overflows time_t.
6941         Allow a negative step in the iteration.
6942
6943 2003-07-01  Paul Eggert  <eggert@twinsun.com>
6944
6945         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
6946         having it depend on HAVE_SYS_TYPES_H.
6947
6948 2003-06-25  Bruno Haible  <bruno@clisp.org>
6949
6950         * readlink.c: New file.
6951
6952 2003-06-20  Bruno Haible  <bruno@clisp.org>
6953
6954         Assume C89, so PARAMS isn't needed.
6955         * unicodeio.h (PARAMS): Remove.
6956         * unicodeio.c: Don't use PARAMS.
6957
6958 2003-06-18  Jim Meyering  <jim@meyering.net>
6959
6960         Merge changes from coreutils.
6961         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
6962         Remove explicit declarations of xmalloc and realloc.
6963         Include xalloc.h.
6964         (read_utmp): Remove anachronistic cast of xmalloc.
6965
6966 2003-06-17  Paul Eggert  <eggert@twinsun.com>
6967
6968         Assume C89, so PARAMS isn't needed.
6969         * backupfile.h (PARAMS): Remove.  All uses removed.
6970         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
6971         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
6972         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
6973         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
6974         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
6975         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
6976         xstrtol.h: Likewise.
6977         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
6978         same.h, strverscmp.h: Do not include config.h; no longer needed.
6979         Anyway, config.h should always be included before any other file.
6980
6981 2003-06-11  Simon Josefsson  <jas@extundo.com>
6982
6983         * sysexit_.h: New file.
6984
6985 2003-05-20  Derek Price  <derek@ximbiot.com>
6986
6987         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
6988
6989 2003-06-10  Simon Josefsson  <jas@extundo.com>
6990
6991         * strchrnul.h: New file.
6992         * strchrnul.c: New file.
6993
6994 2003-06-10  Simon Josefsson <jas@extundo.com>
6995
6996         * argp.h: New file, from glibc.
6997         * argp-ba.c: New file, from glibc.
6998         * argp-eexst.c: New file, from glibc.
6999         * argp-fmtstream.c: New file, from glibc.
7000         * argp-fmtstream.h: New file, from glibc.
7001         * argp-fs-xinl.c: New file, from glibc.
7002         * argp-help.c: New file, from glibc.
7003         * argp-namefrob.h: New file, from glibc.
7004         * argp-parse.c: New file, from glibc.
7005         * argp-pv.c: New file, from glibc.
7006         * argp-pvh.c: New file, from glibc.
7007         * argp-xinl.c: New file, from glibc.
7008
7009 2003-06-07  Jim Meyering  <jim@meyering.net>
7010
7011         * readtokens.h: Put `Free Software Foundation, Inc.'
7012         in place of my name in the copyright comment.
7013         Remove definition and uses of __P.
7014
7015         From coreutils.
7016         * stat.c: Don't declare xmalloc explicitly.
7017         Instead, include "xalloc.h".
7018         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7019         xrealloc, and xcalloc return values.
7020         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7021         Improve comment.
7022         * xgetcwd.h: Remove definition/uses of PARAMS.
7023
7024 2003-06-06  Jim Meyering  <jim@meyering.net>
7025
7026         * stdbool_.h: Renamed from stdbool.h.in.
7027
7028 2003-06-06  Jim Meyering  <jim@meyering.net>
7029
7030         Merge from coreutils.
7031         * same.c: (same_name): Declare *_basename locals to be `const'.
7032         Consolidate declarations and initializations of *_base* locals.
7033
7034         Merge from coreutils.
7035         This avoids a core dump on systems without GNU putenv,
7036         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7037         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7038         (unsetenv): New static function, from GNU libc.
7039         (rpl_putenv): Use it.
7040
7041         * modechange.c: Remove trailing blanks.
7042
7043         Merge from coreutils.
7044         * fsusage.c: Remove declaration of statfs.
7045         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7046
7047         * posixtm.c: Include <stdbool.h> unconditionally.
7048
7049 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7050
7051         * mktime.c (__mktime_internal): When resolving a tm_isdst
7052         mismatch, look in future quarters as well as past.  This fixes a
7053         bug when processing fall-backwards gaps immediately after a long
7054         period of daylight-saving time.
7055
7056         * mktime.c: Assume freestanding C89 or better.
7057         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7058         (__P): Remove; not used.
7059         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7060         (mktime, not_equal_tm, print_tm, check_result,
7061         main): Use prototypes.  Use const * where appropriate.
7062         (main): Fix typo in testing code that uncovered by above changes.
7063         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7064
7065 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7066
7067         * mktime.c: Fix Debian bug 177940
7068         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7069         (localtime_offset): Now long int, not time_t, because we want it
7070         to be guaranteed to be signed.  All uses changed.
7071         (__mktime_internal): If overflow would occur when adding offset,
7072         don't add it.
7073
7074         Merge 'human' changes from coreutils.  Rewrite to support
7075         locale-specific notations like thousands separators.
7076         * human.c: Simplify authorship notice.
7077         Include human.h immediately after config.h.
7078         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7079         <limits.h>: Do not include, since human.h does.
7080         (SIZE_MAX, UINTMAX_MAX): New macros.
7081         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7082         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7083         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7084         (power_letter): Renamed from suffixes.
7085         (generate_suffix_backwards): Remove.
7086         (adjust_value): Now takes int style (because of human.h changes)
7087         and long double value (for greater precision on some platforms).
7088         (group_number): New function.
7089         (human_readable): Use it.  Use integer options, not enum.
7090         Put the options before the sizes in the arg list.
7091         Support all the new options.
7092         The old human_readable function has been removed;
7093         use inttostr.h instead.
7094         (human_readable, default_block_size, humblock):
7095         Use uintmax_t, not int, for block sizes.
7096         (human_readable_inexact, block_size_types): Remove.
7097         (block_size_opts): New constant.
7098         (human_options): Renamed from human_block_size, with new signature
7099         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7100         * human.h: Add copyright and authorship notice.
7101         Include <limits.h> and <stdbool.h> unconditionally.
7102         (PARAMS): Remove.  All uses removed.
7103         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7104         (enum human_inexact_style): Remove tag; now a nameless enum.
7105         (human_floor, human_ceiling, human_round_to_even): Now have
7106         values 2, 0, 1 rather than -1, 1, 0.
7107         (human_group_digits, human_suppress_point_zero, human_autoscale,
7108         human_base_1024, human_SI, human_B): New constants.
7109         (human_readable_inexact, human_block_size): Remove.
7110         (human_readable): Size args are now uintmax_t, not int.
7111         (human_options): New decl.
7112
7113         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7114         unnecessary now that we assume C89 or better.  This change
7115         imported from coreutils.
7116
7117         * mktime.c (__mktime_internal): Do not reject negative timestamps
7118         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7119         in the 2003-05-30 sync from glibc.
7120
7121         .h files should stand alone, but we shouldn't include <sys/types.h>
7122         if we can get away with just <stddef.h>.
7123
7124         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7125         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7126         rather than <sys/types.h>, as we merely need size_t.
7127         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7128         to get size_t.
7129         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7130         Include <stdio.h>, to get FILE.
7131         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7132         memcasecmp.h has included <stddef.h> and all we need is size_t.
7133         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7134         our interface, instead of including <sys/types.h>
7135
7136 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7137
7138         [from coreutils]
7139         Fix some minor time-related bugs with POSIX time arguments.
7140         Some valid time stamps were being rejected (notably -1, and
7141         time stamps before 1900 on 64-bit hosts).  And some invalid
7142         time stamps were being accepted, e.g. September 31.
7143
7144         * posixtm.h (posixtime): Return bool instead of time_t, so
7145         that we can return (time_t) -1 successfully.
7146         * posixtm.c: Likewise.
7147         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7148         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7149         (t): Remove static var.
7150         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7151         of static var.  All uses changed.
7152         (year): Do not reject years before 1900; they can occur with
7153         64-bit time_t.
7154         (posix_time_parse): Do not check for out-of-range components;
7155         that is now the caller's responsibility, since our checks were
7156         only approximations.
7157         (posixtime): Use mktime to check for out-of-range components,
7158         since it knows them exactly.
7159         If mktime returns (time_t) -1, check whether an error actually occurred
7160         by invoking localtime on -1.
7161         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7162         posixtime failures better.
7163         Improve the test data (in comments only).
7164
7165 2003-05-30    <karl@gnu.org>
7166
7167         * mktime.c: update from libc.
7168
7169 2003-05-30  Bruno Haible  <bruno@clisp.org>
7170
7171         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7172         * localcharset.h: Likewise.
7173         * localcharset.c: Likewise.
7174
7175 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7176
7177         Assume the headers required for C89 freestanding compilers.
7178         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7179         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7180         without checking for HAVE_LIMITS_H.
7181         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7182         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7183         to do that.
7184         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7185         * exclude.c: Include <stdbool.h> unconditionally.
7186         * tempname.c: Include <stddef.h> unconditionally.
7187         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7188         * modechange.c, rpmatch.c (NULL): Don't define, since
7189         <stddef.h> does that.
7190         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7191         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7192         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7193         * xstrtol.c: Likewise.
7194         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7195         * savedir.c: Include <stddef.h> instead of defining NULL.
7196
7197         * addext.c (addext): Use assignment rather than cast, to avoid
7198         warnings on some platforms.
7199
7200         * mktime.c (__mktime_internal): Do not reject negative timestamps
7201         arbitrarily.
7202
7203 2003-05-10  Bruno Haible  <bruno@clisp.org>
7204
7205         * linebreak.c (iconv_string_length): Don't return -1 just because the
7206         string is longer than 4 KB.
7207
7208 2003-05-12  Jim Meyering  <jim@meyering.net>
7209
7210         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7211         the space-padded-by-default conversion specifiers, %e, %k, %l.
7212
7213 2003-05-03  Bruno Haible  <bruno@clisp.org>
7214
7215         Upgrade to Unicode-4.0.
7216         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7217         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7218         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7219         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7220         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7221         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7222         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7223         Change width of U+E0100..U+E01EF from 1 to 0.
7224
7225 2003-04-25  Bruno Haible  <bruno@clisp.org>
7226
7227         * copy-file.c: Include <stddef.h>, for size_t.
7228
7229 2003-04-25  Jim Meyering  <jim@meyering.net>
7230
7231         * copy-file.c (copy_file_preserving): Declare buf_size to be
7232         of type size_t, not int.
7233
7234 2003-04-11  Jim Meyering  <jim@meyering.net>
7235
7236         Merge changes from Coreutils.
7237
7238         2003-03-22  Jim Meyering  <jim@meyering.net>
7239
7240         * strftime.c (widen): Cast alloca return value to proper type.
7241
7242         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7243
7244         From GNU libc.
7245         * strftime.c (my_strftime): Handle very large width
7246         specifications for numeric values correctly.  Improve checks for
7247         overflow.
7248
7249         2003-01-19  Jim Meyering  <jim@meyering.net>
7250
7251         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7252         (nl_get_alt_digit) [! defined my_strftime]: Define.
7253         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7254         _nl_get_alt_digit and _nl_get_walt_digit.
7255
7256         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7257         These changes have no effect outside of _LIBC.
7258
7259 2003-04-10  Bruno Haible  <bruno@clisp.org>
7260
7261         * findprog.h: New file, from GNU gettext.
7262         * findprog.c: New file, from GNU gettext.
7263
7264 2003-04-05  Jim Meyering  <jim@meyering.net>
7265
7266         Merge changes from Coreutils.
7267
7268         * exclude.h (PARAMS): Remove definition and uses.
7269         * exclude.c: Remove uses of `PARAMS'.
7270
7271         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7272         Add test-cases for DOS filenames. Declare program_name.
7273         (main): Set up program_name.  Patch by Rich Dawe.
7274
7275         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7276         error from mntctl.
7277         Use mntctl's return value to drive the entry-processing loop, since
7278         we can't rely on the value of the vmt_length member in the last
7279         entry.  On some systems doing so could result in exhausting
7280         virtual memory.  Based in part on a patch from Mike Jetzer.
7281
7282 2003-04-04  Bruno Haible  <bruno@clisp.org>
7283
7284         * linebreak.h: New file, from GNU gettext.
7285         * linebreak.c: New file, from GNU gettext with slight modifications.
7286         * lbrkprop.h: New file, from GNU gettext.
7287
7288 2003-04-03  Bruno Haible  <bruno@clisp.org>
7289
7290         * utf8-ucs4.h: New file, from GNU gettext.
7291         * utf16-ucs4.h: New file, from GNU gettext.
7292         * ucs4-utf8.h: New file, from GNU gettext.
7293         * ucs4-utf16.h: New file, from GNU gettext.
7294
7295 2003-04-02  Bruno Haible  <bruno@clisp.org>
7296
7297         * binary-io.h: New file, from GNU gettext.
7298
7299 2003-04-01  Bruno Haible  <bruno@clisp.org>
7300
7301         * pathname.h: New file, from GNU gettext.
7302         * concatpath.c: New file, from GNU gettext.
7303
7304 2003-03-30  Bruno Haible  <bruno@clisp.org>
7305
7306         * copy-file.c (copy_file_preserving): Don't set owner if the function
7307         chown() doesn't exist.
7308
7309 2003-03-28  Bruno Haible  <bruno@clisp.org>
7310
7311         * copy-file.h: New file, from GNU gettext.
7312         * copy-file.c: New file, from GNU gettext.
7313
7314 2003-03-18  Jim Meyering  <jim@meyering.net>
7315
7316         * quote.c (quote_n): Fix typo in comment.
7317
7318 2003-03-14  Jim Meyering  <jim@meyering.net>
7319
7320         Merge changes from Coreutils.
7321         * obstack.h (obstack_object_size): Declare temporary, __o,
7322         to be const, in order to avoid warnings.
7323         (obstack_room): Likewise.
7324         (obstack_empty_p): Likewise.
7325
7326 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7327
7328         Merge changes from Bison.
7329         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7330         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7331         when compiling Bison 1.875's `bitset bset = obstack_alloc
7332         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7333         * hash.c: Include <stdbool.h> unconditionally.
7334
7335 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7336
7337         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7338         Reported by Bruce Becker; see:
7339         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7340
7341 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7342             Bruno Haible  <bruno@clisp.org>
7343
7344         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7345         Reported by John Hughes, see
7346         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7347
7348 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7349
7350         * poll_.h: New file.
7351         * poll.c: New file.
7352
7353 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7354
7355         * mathl.h: New file.
7356         * acosl.c: New file.
7357         * asinl.c: New file.
7358         * atanl.c: New file.
7359         * ceill.c: New file.
7360         * cosl.c: New file.
7361         * expl.c: New file.
7362         * floorl.c: New file.
7363         * frexpl.c: New file.
7364         * ldexpl.c: New file.
7365         * logl.c: New file.
7366         * sincosl.c: New file.
7367         * sinl.c: New file.
7368         * sqrtl.c: New file.
7369         * tanl.c: New file.
7370         * trigl.c: New file.
7371         * trigl.h: New file.
7372
7373 2003-02-17  Bruno Haible  <bruno@clisp.org>
7374
7375         * mkdtemp.h: New file, from GNU gettext.
7376         * mkdtemp.c: New file, from GNU gettext.
7377
7378 2003-01-31  Bruno Haible  <bruno@clisp.org>
7379
7380         * rename.c: #undef rename before defining rpl_rename.
7381         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7382
7383 2003-01-30  Bruno Haible  <bruno@clisp.org>
7384
7385         * printf-args.h: New file, from GNU gettext.
7386         * printf-args.c: New file, from GNU gettext.
7387         * printf-parse.h: New file, from GNU gettext.
7388         * printf-parse.c: New file, from GNU gettext.
7389         * vasnprintf.h: New file, from GNU gettext.
7390         * vasnprintf.c: New file, from GNU gettext.
7391         * asnprintf.c: New file, from GNU gettext.
7392         * vasprintf.h: New file, from GNU gettext with modifications.
7393         * vasprintf.c: New file, from GNU gettext.
7394         * asprintf.c: New file, from GNU gettext.
7395
7396 2003-01-29  Bruno Haible  <bruno@clisp.org>
7397
7398         * stpncpy.h: New file, from GNU gettext with modifications.
7399         * stpncpy.c: New file, from GNU gettext with modifications.
7400
7401 2003-01-28  Bruno Haible  <bruno@clisp.org>
7402
7403         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7404         Paul Eggert.
7405         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7406         Paul Eggert.
7407
7408 2003-01-27  Bruno Haible  <bruno@clisp.org>
7409
7410         * xsetenv.h: New file, from GNU gettext.
7411         * xsetenv.c: New file, from GNU gettext.
7412
7413 2003-01-23  Bruno Haible  <bruno@clisp.org>
7414
7415         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7416
7417 2003-01-22  Bruno Haible  <bruno@clisp.org>
7418
7419         * exit.h: New file, from GNU gettext.
7420
7421 2003-01-11  Bruno Haible  <bruno@clisp.org>
7422
7423         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7424         * strcase.h (strcasecmp, strncasecmp): Likewise.
7425
7426 2003-01-14  Jim Meyering  <jim@meyering.net>
7427
7428         * same.c (same_name): Tweak a comment.
7429
7430 2003-01-11  Bruno Haible  <bruno@clisp.org>
7431
7432         * same.c (same_name): Reorder tests so as to avoid calling stat()
7433         when a string comparison is sufficient.
7434
7435 2003-01-11  Bruno Haible  <bruno@clisp.org>
7436
7437         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7438         'unsigned int'.
7439
7440 2003-01-11  Bruno Haible  <bruno@clisp.org>
7441
7442         * hash-pjw.c: Add comment about low quality of this function.
7443
7444 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7445
7446         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7447         to avoid collisions with libcurses and libreadline.
7448
7449         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7450         * getstr.h, getstr.c: Remove.
7451         * getline.c: Include "getline.h", to check interface.
7452         Move body of old getstr.c here: this defines MIN_CHUNK and
7453         declares getdelim2, which is renamed from getstr.
7454         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7455
7456         * linebuffer.c (readlinebuffer): Renamed from readline.
7457         All uses changed.
7458         * linebuffer.h: Likewise.
7459         (readline): Remove backward-compatibility macro.
7460
7461 2003-01-12  Jim Meyering  <jim@meyering.net>
7462
7463         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7464
7465 2003-01-10  Bruno Haible  <bruno@clisp.org>
7466
7467         * alloca_.h: New file.
7468         * getdate.y: Unconditionally include alloca.h.
7469         * makepath.c: Likewise.
7470         * setenv.c: Likewise.
7471         * userspec.c: Likewise.
7472
7473 2003-01-09  Bruno Haible  <bruno@clisp.org>
7474
7475         * stdbool.h.in: New file.
7476
7477 2003-01-08  Bruno Haible  <bruno@clisp.org>
7478
7479         * safe-read.c: Include specification header first, to ensure its
7480         selfcontainedness.
7481         * full-write.c: Likewise.
7482
7483 2003-01-08  Jim Meyering  <jim@meyering.net>
7484
7485         * full-write.c: Undefine and define-away `const' after inclusion
7486         of errno.h, not before.  Suggestion from Bruno Haible.
7487
7488 2003-01-07  Jim Meyering  <jim@meyering.net>
7489
7490         * full-write.c: Rework so that it may serve to define full_read, too.
7491         * full-read.c: Simply #define FULL_READ and include full-write.c.
7492
7493 2003-01-06  Jim Meyering  <jim@meyering.net>
7494
7495         * version-etc.c: Update year in translatable copyright string.
7496
7497 2002-12-25  Bruno Haible  <bruno@clisp.org>
7498
7499         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7500         * xstrtol.h: Likewise.
7501         * xstrtoimax.c: Likewise.
7502         * xstrtoumax.c: Likewise.
7503         * human.h: Likewise.
7504
7505         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7506         on systems that have <inttypes.h> but not <stdint.h>.
7507
7508 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7509
7510         * memcoll.c (memcoll): Fall back on a simple algorithm using
7511         memcmp if strcoll doesn't work.
7512
7513 2002-12-23  Bruno Haible  <bruno@clisp.org>
7514
7515         * localcharset.h: New file.
7516         * localcharset.c: Include it.
7517         * unicodeio.c: Likewise.
7518
7519 2002-12-22  Bruno Haible  <bruno@clisp.org>
7520
7521         * utime.c (utime_null): No need to call ftruncate if the file was
7522         nonempty.
7523
7524 2002-12-23  Bruno Haible  <bruno@clisp.org>
7525
7526         * memcoll.c (STRCOLL): New macro.
7527         (memcoll): Use it.
7528
7529 2002-12-22  Bruno Haible  <bruno@clisp.org>
7530
7531         * getstr.h (getstr): Define, to avoid clash with libcurses.
7532         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7533
7534 2002-12-22  Bruno Haible  <bruno@clisp.org>
7535
7536         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7537
7538 2002-12-23  Bruno Haible  <bruno@clisp.org>
7539
7540         * getline.h: Include <stddef.h>, for size_t.
7541
7542         * unicodeio.h: Include <stddef.h>, for size_t.
7543         * unicodeio.c: Don't include <stddef.h>.
7544
7545 2002-12-17  Bruno Haible  <bruno@clisp.org>
7546
7547         * canon-host.c (strdup): Remove unused declaration.
7548
7549         * fsusage.c: Include full_read.h.
7550         (get_fs_usage): Use full_read instead of safe_read.
7551
7552         * utime.c (utime_null): Use SAFE_READ_ERROR.
7553
7554 2002-12-11  Bruno Haible  <bruno@clisp.org>
7555
7556         * setenv.h: Rewritten to cope with systems that have setenv() but not
7557         unsetenv().
7558         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7559         modifications:
7560
7561         2002-12-11  Bruno Haible  <bruno@clisp.org>
7562
7563                 * setenv.c (alloca): Fall back to malloc.
7564                 (freea): New macro.
7565                 (setenv): Use freea() to free memory allocated with alloca().
7566
7567         2002-11-13  Bruno Haible  <bruno@clisp.org>
7568
7569                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7570                 function declarations.
7571                 * unsetenv.c (unsetenv): Likewise.
7572
7573         2002-03-04  Bruno Haible  <bruno@clisp.org>
7574
7575                 Portability to AIX 4.3.3.
7576                 * unsetenv.c: New file, extracted from setenv.c.
7577                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7578
7579         2001-12-20  Bruno Haible  <bruno@clisp.org>
7580
7581                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7582                 use malloc instead. For SunOS 4.
7583
7584         2001-12-11  Bruno Haible  <bruno@clisp.org>
7585
7586                 * setenv.c: Declare alloca.
7587                 (compar_fn_t): New typedef.
7588                 (KNOWN_VALUE, STORE_VALUE): Use it.
7589
7590         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7591         setenv.h.
7592
7593 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7594
7595         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7596         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7597         Choose values that are less likely to collide with system fnmatch
7598         options.
7599         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7600         defined (e.g., a pure POSIX system).
7601         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7602         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7603
7604 2002-12-06  Jim Meyering  <jim@meyering.net>
7605
7606         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7607
7608         Merge in changes from libc's misc/error.c, in preparation
7609         for the merge of gnulib's changes back into libc.
7610
7611         * error.c (_): Define only if not already defined.
7612         Move definition to follow all #include directives.
7613         Include unlocked-io.h only if !_LIBC.
7614         [_LIBC]: Include <libio/libioP.h>.
7615         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7616         (fflush): Tweak definition to use INTUSE.
7617         (putc): Define.
7618
7619 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7620
7621         * alloca.c [defined emacs]: Include "lisp.h".
7622         (xalloc_die) [defined emacs]: New macro.
7623         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7624         [! defined emacs]: Include <xalloc.h>.
7625         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7626         (pointer): Typedef to POINTER_TYPE *.
7627         (malloc): Remove decl; we now always use xmalloc.
7628         (alloca): Use old-style definition, since Emacs needs this.
7629         Check for arithmetic overflow when computing combined size.
7630
7631 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7632
7633         Do not generate unlocked-io.h automatically, since it's easier to
7634         maintain it by hand.
7635
7636         * unlocked-io.h: New file, from GNU diffutils,
7637         but with proper copyright notice and attribution.
7638         * gen-uio: Remove.
7639         * Makefile.am: Add copyright notice.
7640         (libfetish_a_SOURCES): Add unlocked-io.h.
7641         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7642         (DISTCLEANFILES, io_functions): Remove macros.
7643         (EXTRA_DIST): Remove gen_uio.
7644         (unlocked-io.h): Remove rule.
7645
7646 2002-12-04  Jim Meyering  <jim@meyering.net>
7647
7648         Reflect the fact that stat.c and lstat.c are no longer generated.
7649         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7650         (DISTCLEANFILES): Likewise.
7651         (EXTRA_DIST): Likewise.
7652         (all_local): Don't depend on stat.c or lstat.c.
7653         (stat.c, lstat.c): Remove rules.
7654         (EXTRA_DIST): Remove xstat.in.
7655
7656         * xstat.in: Remove file.  Contents moved into stat.c.
7657         * stat.c: New file.  Contents mostly from xstat.in.
7658         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7659         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7660
7661         * safe-read.c: Rework so that it may serve to define safe_write, too.
7662         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7663
7664 2002-12-03  Jim Meyering  <jim@meyering.net>
7665
7666         * safe-read.c, safe-write.c: Change variable names and comments, but
7667         not semantics, to minimize the differences between these two files.
7668         (safe_read): Change comment to mention SAFE_READ_ERROR.
7669
7670         * safe-read.c (IS_EINTR): Define.
7671         (safe_read): Use IS_EINTR in place of in-function cpp directives.
7672
7673 2002-12-02  Bruno Haible  <bruno@clisp.org>
7674
7675         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7676         Define, taken from safe-read.c.
7677         (INT_MAX): Provide fallback.
7678         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7679         * safe-write.h (SAFE_WRITE_ERROR): Define.
7680
7681         * safe-read.c (EINTR): Remove definition.
7682         (safe_read): Don't use EINTR if it is absent.
7683
7684 2002-12-02  Jim Meyering  <jim@meyering.net>
7685
7686         * safe-read.c (EINTR): Define.
7687         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7688         (INT_MAX): Provide fallback.
7689         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7690
7691         * safe-read.h (SAFE_READ_ERROR): Define.
7692
7693 2002-12-01  Jim Meyering  <jim@meyering.net>
7694
7695         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7696         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7697
7698 2002-11-27  Paul Eggert  <eggert@twinsun.com>
7699
7700         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7701         hash_rehash): Replace `if (limit <= value) abort ();' with
7702         `if (! (value < limit)) abort ();', for readability.
7703
7704 2002-11-26    <karl@gnu.org>
7705
7706         * strdup.c: copy from libc again, with jim's ok.
7707         * .cppi-disable: re-add strdup.c
7708
7709 2002-11-25    <karl@gnu.org>
7710
7711         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7712         instead of "strtol.c".
7713
7714 2002-11-25  Jim Meyering  <jim@meyering.net>
7715
7716         * mktime.c: Sync from libc, now that it has the latest fix.
7717
7718 2002-11-24    <karl@gnu.org>
7719
7720         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
7721         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
7722
7723 2002-11-24  Jim Meyering  <jim@meyering.net>
7724
7725         Update from coreutils:
7726
7727         * mktime.c: Merge in changes from libc.
7728
7729         Avoid a link-time failure on some Linux systems.
7730         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
7731         (__mon_yday): Declare with the STATIC attribute.
7732         (__mktime_internal): Likewise.
7733         Based on a report from Greg Schafer.
7734
7735 2002-11-23  Jim Meyering  <jim@meyering.net>
7736
7737         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
7738         Use `unsigned', not `int', as type of index.
7739
7740         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
7741
7742         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
7743
7744 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7745
7746         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
7747         hint that one should use `if (! x) abort ();' rather than `assert
7748         (x);', and anyway it's one less thing to worry about configuring.
7749         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7750         hash_rehash, hash_insert): Use abort rather than assert.
7751
7752 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7753
7754         * quotearg.h: Allow multiple inclusion by surrounding with
7755         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
7756         so that we can be included first.
7757         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
7758         * quotearg.c: Include quotearg.h immediately after config.h.
7759         No need to include stddef.h or sys/types.h any more.
7760         Surround local include files with "", not "<>".
7761         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
7762         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
7763         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
7764         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
7765         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
7766         (ISPRINT): Remove; no longer needed now that we assume C89.
7767
7768         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
7769         Preserve errno.
7770
7771         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
7772         quotearg_char): Use SIZE_MAX rather than
7773         (size_t) -1 when we are talking about "infinity".
7774
7775         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
7776
7777 2002-11-22  Bruno Haible  <bruno@clisp.org>
7778
7779         * safe-read.h: Assume C89. Add comments.
7780         (safe_read): Change return type to size_t.
7781         * safe-read.c (safe_read): Change return type to size_t. Handle byte
7782         counts > SSIZE_MAX correctly.
7783         * safe-write.h: New file.
7784         * safe-write.c: New file.
7785         * full-read.h: New file.
7786         * full-read.c: New file.
7787         * full-write.h: Assume C89. Add comments.
7788         * full-write.c: Include safe-write.h.
7789         (full_write): Rewritten to use safe_write.
7790         Suggested by Jim Meyering and Paul Eggert.
7791
7792 2002-11-21  Bruno Haible  <bruno@clisp.org>
7793
7794         Remove case insensitive option matching.
7795         * argmatch.h (argcasematch): Remove declaration.
7796         (ARGCASEMATCH): Remove macro.
7797         (__xargmatch_internal): Remove case_sensitive argument.
7798         (XARGMATCH): Update.
7799         (XARGCASEMATCH): Remove macro.
7800         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
7801         case_sensitive argument.
7802         (argcasematch): Remove function.
7803         (__xargmatch_internal): Remove case_sensitive argument.
7804         (main): Use XARGMATCH instead of XARGCASEMATCH.
7805
7806         * xmalloc.c: Change compile-time error message. Add comment about
7807         required autoconf version.
7808
7809 2002-11-21  Jim Meyering  <jim@meyering.net>
7810
7811         * strdup.c (strdup): Tweak comment and initial #if/#include.
7812
7813         Merge in changes from the coreutils.
7814
7815         2002-09-25  Paul Eggert  <eggert@twinsun.com>
7816         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
7817         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
7818         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
7819         int.  Work more efficiently if X is the same width as uintmax_t.
7820         Do not compare X to -1, to avoid bogus compiler warning.
7821         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
7822         Don't assume that f_frsize and f_bsize are the same type.
7823
7824         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
7825         on FreeBSD.
7826
7827         * makepath.c (make_path): Restore umask *before* creating the final
7828         component.
7829         (make_path): Minor reformatting.
7830
7831         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
7832         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
7833
7834         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
7835         ones.  At least on GNU/Linux systems, `auto' means something else.
7836         From Michael Stone.
7837
7838 2002-11-20  Paul Eggert  <eggert@twinsun.com>
7839
7840         Merge argmatch cleanups from Bison.  Assume C89.
7841
7842         * argmatch.c: Include config.h here, not in argmatch.h.
7843         Include stdlib.h, for EXIT_FAILURE.
7844         Always include <string.h>, since we assume C89.
7845         (EXIT_FAILURE): Remove pre-C89 bug workaround.
7846         * argmatch.h: Do not include <config.h> or <sys/types.h>.
7847         Include <stddef.h> instead, since it's all we need for size_t.
7848         (PARAMS): Remove.  All uses removed.
7849         (ARRAY_CARDINALITY): Do not bother to #undef.
7850         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
7851         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7852         Remove unnecessary parentheses.
7853         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7854         Insert necessary parentheses.
7855         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
7856         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
7857
7858 2002-11-19  Bruno Haible  <bruno@clisp.org>
7859
7860         * mbswidth.c: Include mbswidth.h right at the beginning.
7861         * mbswidth.h: Include <stddef.h>, for size_t.
7862
7863         * mbswidth.h (PARAMS): Remove macro.
7864         (mbswidth, mbsnwidth): Use ANSI C function declarations.
7865         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
7866
7867         * gcd.h (PARAMS): Remove macro.
7868         (gcd): Use ANSI C function declarations.
7869         * gcd.c (gcd): Likewise.
7870
7871 2002-11-15  Bruno Haible  <bruno@clisp.org>
7872
7873         * strcspn.c: Include <stddef.h>.
7874         (strcspn): Use ANSI C function declaration. Change return type to
7875         size_t. Use NULL.
7876         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
7877         (strpbrk): Use NULL.
7878         * strpbrk.h (PARAMS): Remove macro.
7879         (strpbrk): Use ANSI C function declaration.
7880         * strstr.c: Don't include <sys/types.h>.
7881         * strstr.h (PARAMS): Remove macro.
7882         (strstr): Use ANSI C function declarations.
7883
7884 2002-11-06  Bruno Haible  <bruno@clisp.org>
7885
7886         * gcd.h (gcd): Change argument type to 'unsigned long'.
7887         * gcd.c (gcd): Likewise.
7888
7889 2002-11-05  Bruno Haible  <bruno@clisp.org>
7890
7891         * gcd.h: New file, from gettext-0.11.5.
7892         * gcd.c: New file, from gettext-0.11.5.
7893
7894 2002-11-05  Bruno Haible  <bruno@clisp.org>
7895
7896         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7897         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7898         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7899         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7900
7901         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7902         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7903
7904         * closeout.c: Include gettext.h instead of <libintl.h>.
7905         * human.c: Include gettext.h instead of <libintl.h>.
7906         * quotearg.c: Include gettext.h instead of <libintl.h>.
7907         * rpmatch.c: Include gettext.h instead of <libintl.h>.
7908         * unicodeio.c: Include gettext.h instead of <libintl.h>.
7909         * userspec.c: Include gettext.h instead of <libintl.h>.
7910         * version-etc.c: Include gettext.h instead of <libintl.h>.
7911         * xmalloc.c: Include gettext.h instead of <libintl.h>.
7912         (textdomain): Remove definition.
7913         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
7914
7915         * long-options.c: Remove include of <libintl.h> and definition of _.
7916         * same.c: Remove include of <libintl.h> and definition of _.
7917
7918 2002-11-04  Bruno Haible  <bruno@clisp.org>
7919
7920         * stpcpy.h: New file, from GNU gettext-0.11.5.
7921         * strcase.h: New file, from GNU gettext-0.11.5.
7922         * strpbrk.h: New file, from GNU gettext-0.11.5.
7923         * strstr.h: New file, from GNU gettext-0.11.5.
7924         * xgetcwd.h: New file, from GNU gettext-0.11.5.
7925
7926 2002-05-09  Bruno Haible  <bruno@clisp.org>
7927
7928         * config.charset: Update for newest glibc. Add canonical names
7929         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
7930
7931 2002-05-09  Bruno Haible  <bruno@clisp.org>
7932
7933         * localcharset.c (get_charset_aliases): Add more Windows specific
7934         aliases.
7935
7936 2002-05-08  Owen Taylor  <otaylor@redhat.com>
7937
7938         * config.charset: A few additions for Solaris.
7939
7940 2001-12-05  Bruno Haible  <bruno@clisp.org>
7941
7942         * localcharset.c (locale_charset): Don't return an empty string.
7943
7944 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
7945
7946         * config.charset: msdos in uk_UA uses CP1125.
7947
7948 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
7949
7950         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
7951         * localcharset.c (locale_charset): Declare as extern "C".
7952
7953 2002-02-15  Bruno Haible  <bruno@clisp.org>
7954
7955         * config.charset [msdosdjgpp]: For Russian, use CP866.
7956
7957 2002-02-11  Bruno Haible  <bruno@clisp.org>
7958
7959         * config.charset: Add support for NetBSD.
7960
7961 2002-09-25    <karl@gnu.org>
7962
7963         * strdup.c: copy from libc/string (via ../config/srclist*).
7964         * getopt*: copy from libc/posix.
7965         * gettext.h: copy from gettext.
7966         * .cppi-disable: add strdup.c, gettext.h.
7967
7968 2002-07-01  Jim Meyering  <meyering@lucent.com>
7969
7970         * c-stack.c: Include sys/time.h.
7971         From Volker Borchert.
7972
7973 2002-06-11  Paul Eggert  <eggert@twinsun.com>
7974
7975         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
7976         New macro.  Use it uniformly instead of
7977         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
7978         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
7979         reported by Vin Shelton.
7980
7981 2002-06-22  Jim Meyering  <meyering@lucent.com>
7982
7983         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
7984         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
7985
7986 2002-06-22  Paul Eggert  <eggert@twinsun.com>
7987
7988         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
7989         Do not assume SA_SIGINFO behavior.
7990         Bug reported by Jim Meyering on NetBSD 1.5.2.
7991
7992 2002-06-22  Jim Meyering  <meyering@lucent.com>
7993
7994         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
7995
7996         * exitfail.c, exitfail.h: Likewise.
7997         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
7998
7999         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8000         of fnmatch.h.
8001         (EXTRA_DIST): Add fnmatch_loop.c.
8002         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8003
8004         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8005         * fnmatch.c: Update from diffutils-2.8.2.
8006         * fnmatch_.h: New file.  From diffutils-2.8.2.
8007         * fnmatch.h: Remove file.
8008
8009 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8010
8011         * file-type.h: Report an error if neither S_ISREG nor
8012         S_IFREG is defined, instead of using a test specific to glibc
8013         2.2.  This should be safe, since POSIX requires S_ISREG and
8014         Unix Version 7 had S_IFREG.  We don't need to check for
8015         <sys/types.h> since we don't use any symbols that it defines.
8016
8017 2002-06-15  Jim Meyering  <meyering@lucent.com>
8018
8019         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8020         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8021         have been included before this file.
8022
8023 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8024
8025         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8026         so that each temporary file name is unique and valid in the first
8027         8 characters, for operation under DOS.
8028
8029 2002-06-15  Jim Meyering  <meyering@lucent.com>
8030
8031         Work even with DJGPP 2.03, which lacks support for symlinks.
8032         From Richard Dawe.
8033         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8034         is defined.
8035         * lchown.c (S_ISLNK): Likewise.
8036
8037 2002-06-14  Jim Meyering  <meyering@lucent.com>
8038
8039         * file-type.h: Use the version from diffutils-2.8.2.
8040         * file-type.c: Likewise.
8041
8042 2002-05-27  Jim Meyering  <meyering@lucent.com>
8043
8044         Fix a problem seen only on nonconforming systems whereby ls.c's
8045         use of localtime, and then of gettimeofday would cause trouble:
8046         the localtime call used to initialize rpl_gettimeofday's save
8047         mechanism would clobber ls's current local time information so
8048         that in any long listing the first file would always be listed
8049         with date 1970-01-01.  Analysis by Volker Borchert.
8050
8051         * gettimeofday.c (localtime): Undefine.
8052         (rpl_localtime): New function.
8053
8054 2002-05-22  Jim Meyering  <meyering@lucent.com>
8055
8056         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8057         * file-type.h: New file.
8058         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8059
8060 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8061
8062         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8063
8064 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8065
8066         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8067         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8068         of 127, since 64 is the largest conceivable number for ancient
8069         nonstandard hosts.
8070         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8071
8072 2002-04-28  Jim Meyering  <meyering@lucent.com>
8073
8074         * sig2str.c (WTERMSIG): Remove definition (unused).
8075
8076 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8077
8078         * sig2str.h, sig2str.c: New files.
8079         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8080
8081 2002-04-24  Jim Meyering  <meyering@lucent.com>
8082
8083         * gettext.h: New file, from Gettext.
8084         * Makefile.am (INCLUDES): Remove -I../intl.
8085         (libfetish_a_SOURCES): Add gettext.h.
8086
8087 2002-04-16  Jim Meyering  <meyering@lucent.com>
8088
8089         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8090         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8091         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8092
8093 2002-04-12  Jim Meyering  <meyering@lucent.com>
8094
8095         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8096
8097 2002-03-10  Jim Meyering  <meyering@lucent.com>
8098
8099         * makepath.c (make_path): Remove a comma from a diagnostic.
8100         Suggestion from Santiago Vila.
8101
8102 2002-03-08  Jim Meyering  <meyering@lucent.com>
8103
8104         * rename.c: Mention that this wrapper is needed also on
8105         mips-dec-ultrix4.4 systems.
8106
8107 2002-03-02  Jim Meyering  <meyering@lucent.com>
8108
8109         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8110         not HAVE_CLOCK_SETTIME.
8111
8112 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8113
8114         * nanosleep.h: Rename to....
8115         * timespec.h: New name for nanosleep.h.  All uses changed.
8116
8117         * gettime.c: New file.
8118         * settime.c: New file.
8119         * stime.c: Remove.
8120
8121         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8122         timespec.h.  Remove nanosleep.h.
8123
8124 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8125
8126         * acl.c, acl.h: New files.
8127         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8128
8129 2002-02-24  Jim Meyering  <meyering@lucent.com>
8130
8131         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8132         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8133         cause trouble.  Reported by Nelson Beebe.
8134
8135 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8136
8137         * path-concat.c (xpath_concat): Reorder code to pacify
8138         compilers that don't know that xalloc_die never returns.
8139
8140 2002-02-20  Jim Meyering  <meyering@lucent.com>
8141
8142         * getdate.c: Regenerate using bison-1.33.
8143
8144 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8145
8146         * posixver.c, posixver.h: New files.
8147         * Makefile.am (libfetish_a_SOURCES): Add them.
8148
8149 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8150             Bruno Haible  <bruno@clisp.org>
8151
8152         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8153         (fwrite_success_callback): New declaration.
8154         * unicodeio.c (unicode_to_mb): New function, extracted from
8155         print_unicode_char. Call failure callback instead of error.
8156         (fwrite_success_callback): New function.
8157         (exit_failure_callback): New function.
8158         (fallback_failure_callback): New function.
8159         (print_unicode_char): Call unicode_to_mb.
8160
8161 2002-01-26  Jim Meyering  <meyering@lucent.com>
8162
8163         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8164
8165 2002-01-22  Jim Meyering  <meyering@lucent.com>
8166
8167         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8168         Otherwise, some versions of automake would omit the rule that makes
8169         Makefile from Makefile.in.
8170
8171 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8172
8173         * xmemcoll.h, xmemcoll.c: New files.
8174         * Makefile.am (libfetish_a_SOURCES): Add them.
8175         * memcoll.c: Include errno.h, and declare errno if not defined.
8176         (memcoll): Set errno to zero if there is no error.
8177
8178         * quotearg.c (quotearg_buffer_restyled):
8179         Fix bug with quoting buffers containing NUL when backslashing escapes.
8180         This bug was exposed by the other changes in this patch.
8181         (quotearg_n_options): New arg ARGSIZE.
8182         All callers changed.
8183         (quoting_options_from_style): New function.
8184         (quotearg_n_style): Use it.
8185         (quotearg_n_style_mem): New function.
8186
8187         * quotearg.h (quotearg_n_style_mem): New function.
8188
8189 2002-01-16  Jim Meyering  <meyering@lucent.com>
8190
8191         * getdate.y: Add three semicolons, each just before a closing brace.
8192         Bison (as of version 1.31) no longer papers over that mistake.
8193
8194 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8195
8196         * backupfile.c (ISDIGIT): Comment fix.
8197         * getdate.y (ISDIGIT): Likewise.
8198         * posixtm.c (ISDIGIT, year): Likewise.
8199         * strverscmp.c (ISDIGIT): Likewise.
8200         * userspec.c (ISDIGIT): Likewise.
8201
8202 2002-01-05  Jim Meyering  <meyering@lucent.com>
8203
8204         * version-etc.c (version_etc_copyright): Update copyright year.
8205
8206 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8207
8208         * closeout.c (close_stdout_status): If ferror (stdout), do
8209         not silently exit merely because the output buffer happens to
8210         have nothing pending.
8211
8212 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8213
8214         See the big note in ../ChangeLog.
8215         * human.c (suffixes): Prefer K to k for 1024.
8216         (generate_suffix_backwards): New function.
8217         (human_readable_inexact): Use it.
8218         * xstrtol.c (__xstrtol): If there is no number but there
8219         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8220         Accept 'K' as well as 'k'.
8221
8222 2001-12-15  Jim Meyering  <meyering@lucent.com>
8223
8224         * regex.h (__restrict_arr): Update from libc.
8225
8226         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8227         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8228         (STREQ): Define.
8229
8230 2001-12-10  Jim Meyering  <meyering@lucent.com>
8231
8232         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8233         Instead, include "xalloc.h".
8234         (initbuffer): Don't cast xmalloc return value to char*.
8235         (readline): Reword comment.
8236         Don't cast xrealloc return value to char*
8237         Return NULL, not 0.
8238
8239 2001-12-09  Jim Meyering  <meyering@lucent.com>
8240
8241         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8242         `signed and unsigned type in conditional expression'.
8243         * posixtm.c (posix_time_parse): Likewise.
8244
8245         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8246
8247         * readtokens.c (readtoken): Declare an index to be of type unsigned
8248         to avoid a pedantic warning.
8249
8250         * getstr.c: Don't include assert.h.
8251         (getstr): Remove warning-evoking assertions.
8252         Return -1 if offset parameter is out of bounds.
8253         Change the type of a local from int to size_t.
8254
8255         * strftime.c (my_strftime_localtime_r): Include this function
8256         definition in the `#if ! HAVE_TM_GMTOFF' block.
8257
8258         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8259         Include xalloc.h instead.
8260
8261 2001-12-02  Jim Meyering  <meyering@lucent.com>
8262
8263         * tempname.c: Don't declare getenv, thus reverting the change of
8264         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8265         included.
8266
8267         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8268         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8269
8270 2001-11-30  Akim Demaille  <akim@epita.fr>
8271
8272         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8273         before being defined.
8274
8275 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8276
8277         * quotearg.h (quotearg_n, quotearg_n_style):
8278         First arg is int, not unsigned.
8279         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8280         (SIZE_MAX, UINT_MAX): New macros.
8281         (quotearg_n_options): Abort if N is negative.
8282         Avoid overflow check on hosts where size_t is 64 bits and int
8283         is 32 bits, as overflow is impossible there.
8284         Fix off-by-one typo that caused unnecessary reallocation.
8285
8286 2001-11-27  Jim Meyering  <meyering@lucent.com>
8287
8288         * tempname.c: Merge with version from libc.
8289         * regex.c: Likewise.
8290
8291         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8292         for which STDC_HEADERS is 0, it was not included, resulting in a
8293         warning about an integer-to-pointer conversion problem with getenv.
8294         Reported by Volker Borchert.
8295
8296 2001-11-26  Jim Meyering  <meyering@lucent.com>
8297
8298         * gtod.h: Remove file.
8299         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8300         * gettimeofday.c: Don't include gtod.h.
8301         (GTOD_init): Remove function.
8302         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8303         Suggestion from Volker Borchert.
8304
8305 2001-11-23  Jim Meyering  <meyering@lucent.com>
8306
8307         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8308         * hash.c (struct hash_table): Define it here instead.
8309
8310 2001-11-22  Jim Meyering  <meyering@lucent.com>
8311
8312         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8313
8314 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8315
8316         * tempname.c (TMP_MAX): Remove; no longer needed.
8317         (TEMPORARIES): New macro.
8318         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8319         removes an artificial limitation (e.g. HP-UX 10.20, where
8320         TMP_MAX is 17576).
8321
8322 2001-11-18  Jim Meyering  <meyering@lucent.com>
8323
8324         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8325         on SunOS 4.
8326
8327         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8328         files will be created before anything else.
8329
8330 2001-11-17  Jim Meyering  <meyering@lucent.com>
8331
8332         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8333         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8334         rather than group writable.  Patch by Juan F. Codagnone.
8335
8336         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8337         Instead, include "xalloc.h".
8338
8339         * mountlist.c: Include unlocked-io.h after all system headers.
8340         Remove explicit declarations of xmalloc, xrealloc,
8341         and xstrdup.  Instead, include "xalloc.h".
8342
8343         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8344         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8345         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8346
8347         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8348         Reported by Padraig Brady.
8349
8350         * mkstemp.c: #undef mkstemp.
8351         Include config.h.
8352         (rpl_mkstemp): Rename from mkstemp.
8353         Protoize.
8354
8355 2001-11-16  Jim Meyering  <meyering@lucent.com>
8356
8357         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8358         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8359         determine the amount of total physical memory, use pstat_getstatic.
8360         HPUX-11 doesn't define _SC_PHYS_PAGES.
8361         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8362         If sysconf couldn't be used to determine the amount of available
8363         physical memory, use both pstat_getstatic and pstat_getdynamic.
8364         Based on a patch from Bob Proulx.
8365
8366 2001-11-05  Jim Meyering  <meyering@lucent.com>
8367
8368         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8369
8370 2001-11-03  Jim Meyering  <meyering@lucent.com>
8371
8372         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8373         in argmatch_to_argument call.
8374
8375         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8376         argument.
8377
8378         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8379         e.g., a fault due to an attempt to free a NULL pointer.
8380
8381 2001-11-01  Jim Meyering  <meyering@lucent.com>
8382
8383         * dirfd.c, dirfd.h: New files.
8384         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8385
8386         * hash.c (hash_print) [TESTING]: Clean up.
8387
8388 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8389
8390         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8391         to avoid a warning if -Wall.
8392
8393 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8394
8395         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8396
8397 2001-10-21  Jim Meyering  <meyering@lucent.com>
8398
8399         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8400         this code would end up calling gettext even in packages built
8401         with --disable-nls.
8402         * getopt.c (_): Likewise.
8403         * regex.c (_): Likewise.
8404
8405 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8406
8407         * error.c (strerror_r): Do not declare unless !_LIBC.
8408         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8409         Use strerror_r that is only a macro, even if it is not a function.
8410         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8411         (private_strerror): Use prototypes, not old-style function definition.
8412         (print_errno_message): New function.
8413         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8414         char*-flavored one.
8415         (error_tail, error, error_at_line): Use it.
8416
8417 2001-10-11  Jim Meyering  <meyering@lucent.com>
8418
8419         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8420         and quote_n (1, ... to avoid clobbering a buffer.
8421
8422 2001-10-05  Jim Meyering  <meyering@lucent.com>
8423
8424         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8425         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8426         * hash-pjw.h: New file.
8427
8428 2001-09-30  Jim Meyering  <meyering@lucent.com>
8429
8430         * mountlist.c [MOUNTED_GETFSSTAT]:
8431         Include <sys/ucred.h>, for Apple Darwin.
8432         Include sys/mount.h and sys/fs_types.h only if available.
8433         (FS_TYPE): Define.
8434         (read_filesystem_list): Use FS_TYPE.
8435
8436 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8437
8438         * exclude.c (excluded_filename): 0 -> false, since it's
8439         a boolean context.
8440
8441 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8442
8443         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8444         #defines strtoimax.  Also treat the other strto* functions
8445         like strtoimax.
8446
8447         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8448         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8449         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8450
8451 2001-09-26  Jim Meyering  <meyering@lucent.com>
8452
8453         Most macros in unlocked-io.h had the wrong number of arguments.
8454         * gen-uio: New script.
8455         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8456         * unlocked-io.hin: Remove file.
8457         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8458         rather than trying to embed it here.
8459         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8460         Reported by Padraig Brady.
8461
8462 2001-09-25  Volker Borchert  <bt@teknon.de>
8463
8464         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8465
8466 2001-09-23  Jim Meyering  <meyering@lucent.com>
8467
8468         * mountlist.c: Remove useless parentheses in #if directives.
8469         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8470         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8471
8472 2001-09-22  Jim Meyering  <meyering@lucent.com>
8473
8474         * localcharset.c: Update from latest gettext.
8475         * config.charset: Likewise.
8476
8477 2001-09-20  Jim Meyering  <meyering@lucent.com>
8478
8479         * xstrtol.c (strtoimax): Guard declaration with
8480         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8481         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8482         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8483         (strtoumax): Likewise, for completeness (it wasn't necessary).
8484
8485 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8486
8487         * strtoimax.c (HAVE_LONG_LONG):
8488         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8489         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8490         to work around bug in IBM C compiler.
8491
8492 2001-09-16  Jim Meyering  <meyering@lucent.com>
8493
8494         * mkdir.c: New file.
8495
8496 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8497
8498         * xgetcwd.c: Revert some of the previous change; intead,
8499         fix the HAVE_GETCWD_NULL code to behave more like the
8500         !HAVE_GETCWD_NULL code used to.
8501
8502         Include "xalloc.h".
8503         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8504         invoke xalloc_die.
8505
8506 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8507
8508         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8509         Use ssize_t, not int, to store result of readlink.
8510         Check for ssize_t overflow as well as size_t overflow,
8511         as POSIX says the result of readlink is implementation-defined
8512         when ssize_t overflows.
8513         Remove unnecessary cast to char*.
8514         Use free+malloc instead of realloc, as the storage doesn't need
8515         to be preserved and it's clearer and can be more efficient that way.
8516         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8517         * xreadlink.h (xreadlink): Update prototype.
8518
8519 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8520
8521         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8522         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8523         spotted by Jim Meyering.
8524
8525 2001-09-03  Jim Meyering  <meyering@lucent.com>
8526
8527         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8528
8529 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8530
8531         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8532         like the HAVE_GETCWD_NULL code.
8533         Include pathmax.h if not HAVE_GETCWD.
8534         Do not include xalloc.h.
8535         (INITIAL_BUFFER_SIZE): New symbol.
8536         Do not use xmalloc / xrealloc, since the caller is responsible for
8537         handling errors.  Preserve errno around `free' during failure.
8538         Do not overrun buffer when using getwd.
8539
8540 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8541
8542         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8543         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8544
8545 2001-09-02  Jim Meyering  <meyering@lucent.com>
8546
8547         * error.c: Update from GNU libc.
8548
8549 2001-09-01  Jim Meyering  <meyering@lucent.com>
8550
8551         * xreadlink.c: New file.
8552         * xreadlink.h: New file.
8553         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8554
8555         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8556         doesn't conflict with sparc Solaris 7's definition in
8557         /usr/include/sys/int_types.h.
8558
8559         * exclude.c: Use `""', not `<>' to #include non-system header files.
8560         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8561         and strncasecmp as r-values.  Unixware didn't have declarations.
8562
8563 2001-08-31  Jim Meyering  <meyering@lucent.com>
8564
8565         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8566         Use an initial, malloc'd, buffer of length 128 rather than
8567         a statically allocated one of length 1024.
8568
8569 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8570
8571         * xgetcwd.c: Don't include pathmax.h.
8572         Include stdlib.h and unistd.h if available.
8573         Include xalloc.h.
8574         (xmalloc, xstrdup, free): Remove decls.
8575         (xgetcwd): Don't assume sizes fit in unsigned.
8576         Check for overflow when computing sizes.
8577         Simplify reallocation code.
8578
8579 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8580
8581         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8582
8583         * strtoimax.c: Renamed from strtoxmax.c, removing the
8584         old strtoimax.c.
8585
8586         Also, make the following further changes to make this file's
8587         configuration more similar to that of strtol.c:
8588         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8589         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8590         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8591         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8592         changed to signed values.
8593
8594         And make the following changes as well:
8595         Fix copyright notice, as 1999 was missing.
8596         (verify): New macro.
8597         (strtoimax): Check sizes at compile-time, not run-time.
8598         Prefer strtol to strtoll if both work.
8599         (main): Remove; it was not that useful and was a pain to maintain.
8600
8601         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8602
8603 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8604
8605         * savedir.c (savedir): Remove size parameter, as POSIX says that
8606         a directory's st_size can have an arbitrary value, so the old
8607         usage could waste an arbitrary amount of memory.  All uses
8608         changed.
8609         * savedir.h: Update prototype.
8610
8611 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8612
8613         * xstrtol.c (strtoimax): New decl.
8614
8615 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8616
8617         * xstrtol.h: Add copyright notice.
8618         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8619         LONGINT_INVALID_SUFFIX_CHAR.
8620
8621 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8622
8623         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8624         tm to be declared.
8625
8626 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8627
8628         * hash.c: Remove '2001' from copyright notice.
8629
8630 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8631
8632         * full-write.h: New file.
8633         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8634         * full-write.c: Correct credits, as cccp.c no longer
8635         exists and anyway it was so heavily changed from the old cccp
8636         code as to be unrecognizable.  Include full-write.h.
8637         (full_write) Return size_t, with short writes meaning failure.
8638         All callers changed.  This fixes a bug with large buffers
8639         on 64-bit hosts.
8640         * utime.c: Include full-write.h.
8641
8642 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8643
8644         Merge 'exclude' changes from tar 1.13.22.
8645         This fixes one or two unlikely storage allocation overflow bugs,
8646         but doesn't change user-visible behavior otherwise.
8647
8648 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8649
8650         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8651         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8652         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8653         Include if available.
8654         (<xalloc.h>): Include
8655         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8656         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8657         collide with FNM macros.
8658         (struct patopts): New struct.
8659         (struct exclude): Use it, as exclude patterns now come with options.
8660         (new_exclude): Support above changes.
8661         (new_exclude, add_exclude_file):
8662         Initial size must now be a power of two to simplify overflow checking.
8663         (free_exclude, fnmatch_no_wildcards): New function.
8664         (excluded_filename): No longer requires options arg, as the options
8665         are determined by add_exclude.  Now returns bool, not int.
8666         (excluded_filename, add_exclude):
8667         Add support for the fancy new exclusion options.
8668         (add_exclude, add_exclude_file): Now takes int options arg.
8669         Check for arithmetic overflow when computing sizes.
8670         (add_exclude_file): xrealloc might modify errno, so don't
8671         realloc until after errno might be used.
8672
8673         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8674         New macros.
8675         (free_exclude): New decl.
8676         (add_exclude, add_exclude_file): Now takes int options arg.
8677         (excluded_filename): No longer requires options arg, as the options
8678         are determined by add_exclude.  Now returns bool, not int.
8679
8680 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8681
8682         * alloca.c (alloca): Arg is of type size_t, not unsigned.
8683
8684 2001-08-27  Jim Meyering  <meyering@lucent.com>
8685
8686         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8687
8688         * version-etc.c (N_): Remove definition.
8689         Revert most of last change.
8690         Instead, simply don't mark the `Copyright...' string for translation.
8691         Based on advice from Paul Eggert.
8692
8693         * strtoxmax.c: Tweak comment.
8694
8695 2001-08-26  Jim Meyering  <meyering@lucent.com>
8696
8697         * version-etc.c (version_etc_copyright_fmt): Replace literal year
8698         of copyright with `%s' so translators don't get an untranslated
8699         message in 2002.
8700         (COPYRIGHT_YEAR): Define.
8701         (version_etc): Use fprintf rather than fputs.
8702         Suggestion from Ulrich Drepper.
8703
8704         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8705
8706         * strtoll.c: New file, from GNU libc.
8707         * xstrtoimax.c: New file.
8708
8709         * xstrtol.h: Add xstrtoimax.
8710         * strtoumax.c: New file.  Simply include "strtoumax.c".
8711         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
8712
8713         * strtoumax.c: Factor to work both for unsigned and signed types, ...
8714         * strtoxmax.c: ... then renamed to this.
8715
8716 2001-08-13  Paul Eggert  <eggert@twinsun.com>
8717
8718         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
8719         Port to Solaris 8, where 'sed' requires a space after the 'r'
8720         command, and where sh dislikes "$/".  Clean up the spacing a bit.
8721         Redirect output to $tmp just once.
8722
8723 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
8724
8725         * addext.c (<errno.h>): Include.
8726         (errno): Declare if not defined.
8727         (addext): Work correctly when pathconf returns -1 and leaves
8728         errno alone because there is no limit.  Also, work even if
8729         pathconf returns a value greater than SIZE_MAX.
8730
8731 2001-08-12  Jim Meyering  <meyering@lucent.com>
8732
8733         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
8734         Simply `return getcwd (NULL, 0);'.
8735         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
8736         Use 1300 as initial value for length, not PATH_MAX.
8737
8738         * pathmax.h: Clean up cpp syntax.
8739
8740 2001-08-12  Jim Meyering  <meyering@lucent.com>
8741
8742         * gettimeofday.c: New file.
8743         * gtod.h: New file.
8744         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
8745
8746 2001-08-04  Jim Meyering  <meyering@lucent.com>
8747
8748         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
8749         to get in sync with glibc.
8750
8751 2001-08-03  Paul Eggert  <eggert@twinsun.com>
8752
8753         The following changes are from gettext 0.10.39 as maintained by
8754         Bruno Haible.
8755
8756         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
8757         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
8758         with inverted sense.  All uses changed.
8759
8760         * mbswidth.c: Don't include <limits.h>.
8761         Include <stdlib.h> and <string.h> unconditionally.
8762         (iswcntrl, mbsinit, ISCNTRL): New macros.
8763         (mbsnwidth): Use K&R style function declarations.
8764         Don't bother checking for MB_LEN_MAX == 1, since the compiler
8765         can optimize it when MB_CUR_MAX == 1.
8766         The width of control characters is zero, not 1.
8767
8768 2001-07-15  Jim Meyering  <meyering@lucent.com>
8769
8770         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
8771         (BUILT_SOURCES): Add unlocked-io.h.
8772         (io_functions): Define.
8773         (unlocked-io.h): New rule.
8774         (DISTCLEANFILES): Add unlocked-io.h.
8775         (all-local): Depend on unlocked-io.h, to ensure it is created.
8776
8777         * unlocked-io.hin: New file
8778
8779         * regex.c: Update from glibc.
8780
8781 2001-07-05  Jim Meyering  <meyering@lucent.com>
8782
8783         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
8784         recommendation.
8785         (libfetish_a_SOURCES): Put all .h files here instead.
8786         Remove a thus-exposed (better checks in automake) duplicate and
8787         two unnecessary .h files.
8788
8789 2001-06-11  Jim Meyering  <meyering@lucent.com>
8790
8791         * regex.c: Update from GNU libc.
8792
8793 2001-05-27  Jim Meyering  <meyering@lucent.com>
8794
8795         * readutmp.h (UT_TYPE): Define.
8796
8797 2001-05-24  Jim Meyering  <meyering@lucent.com>
8798
8799         * argmatch.c: Include "quote.h".
8800         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
8801         quote function.  Reported by Göran Uddeborg.
8802
8803 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
8804
8805         * dirname.c (dir_name): Compute append_dot using path, not newpath
8806         which is not yet declared.
8807
8808 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8809
8810         * Makefile.am (libfetish_a_SOURCES):
8811         Add strftime.c, since we now compile it on all hosts.
8812
8813         * strftime.c (my_strftime):
8814         Define to nstrftime if emacs, but only if my_strftime is not defined.
8815         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
8816         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
8817         Add one more extra argument: a nanoseconds value.
8818         All uses changed.
8819         (ns): New macro.
8820         (my_strftime function): Add %N format.
8821         (emacs_strftimeu): Renamed from emacs_strftime,
8822         with extra ut argument.
8823
8824 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8825
8826         dirname code cleanup.  base_name now behaves more compatibly
8827         with POSIX basename when given file names that have trailing
8828         slashes, and similarly for dir_name.  Add new primitives
8829         base_len and dir_len.  Put the directory-name-related decls
8830         into dirname.h.
8831
8832         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
8833         * backupfile.c (base_name): Likewise.
8834         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
8835         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
8836         * makepath.c (strip_trailing_slashes): Likewise.
8837         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
8838         Likewise.
8839         * rename.c (strip_trailing_slashes): Likewise.
8840         * same.c (base_name): Likewise.
8841         * stripslash.c (ISSLASH): Likewise.
8842
8843         * addext.c: Include <dirname.h> after size_t is defined.
8844         * backupfile.c: Likewise.
8845
8846         * addext.c (addext): Use base_len to trim redundant
8847         trailing slashes instead of doing it ourselves.
8848         But do not trim the last slash if it is not redundant.
8849
8850         * backupfile.c (find_backup_file_name,
8851         max_backup_version): Use base_len instead of rolling it ourselves.
8852         Handle the case of "" and (on DOS) "C:" correctly.
8853
8854         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
8855         Include <string.h>, <dirname.h>.
8856         (base_name): Allow file names ending in slashes, other than names
8857         that are all slashes.  In this case, return the basename followed
8858         by the slashes.  This is more general, and can be used in places
8859         where the original base_name purposely had an assertion failure.
8860         (base_len): New function.
8861
8862         * dirname.c: Include <string.h> instead of <stdlib.h>.
8863         Do not include <assert.h>; no longer needed.
8864         Include xalloc.h.
8865         (memrchr): Remove decl.
8866         (dir_name_r): Remove.
8867         (dir_len): Renamed from dirlen.  All callers changed.
8868         Rewrite in terms of base_name, for simplicity and consistency.
8869         (dir_name): Never return NULL.  All callers changed.
8870         Do not include <stdlib.h> in test program; no longer needed.
8871         return 0; is fine for test program.
8872
8873         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
8874         New macros.
8875         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
8876
8877         * path-concat.c (path_concat): Use base_len to compute
8878         base length, not strlen; this means we cannot rely on memcpy
8879         to null-terminate.
8880
8881         * same.c (STREQ): Remove.
8882         (same_name): Handle the case where the basename ends in trailing '/'.
8883
8884         * stripslash.c (strip_trailing_slashes): Return nonzero if
8885         a slash was stripped.  Do not strip the last slash after a
8886         file system prefix.
8887
8888 2001-04-08  Jim Meyering  <meyering@lucent.com>
8889
8890         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
8891         recomputed; that's necessary when the offset spans a DST transition.
8892         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
8893
8894 2001-04-02  Jim Meyering  <meyering@lucent.com>
8895
8896         * regex.h, regex.c: Update from GNU libc.
8897
8898 2001-03-19  Paul Eggert  <eggert@twinsun.com>
8899
8900         * version-etc.c (version_etc_copyright): Update to 2001.
8901
8902 2001-03-16  Paul Eggert  <eggert@twinsun.com>
8903
8904         * tempname.c (uint64_t): Define to uintmax_t if
8905         not defined, and if UINT64_MAX is not defined.
8906         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
8907         Reported by John David Anglin.
8908
8909 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
8910
8911         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
8912         alias if codeset is empty.
8913         * config.charset (BeOS): Use wildcard syntax.
8914
8915 2001-03-13  Jim Meyering  <meyering@lucent.com>
8916
8917         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
8918         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
8919         From Bruno Haible.
8920
8921 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
8922
8923         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
8924         Don't return NULL.
8925         * unicodeio.c (print_unicode_char): Simplify accordingly.
8926
8927 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
8928
8929         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
8930         support for DOS/DJGPP.
8931
8932 2001-02-28  Paul Eggert  <eggert@twinsun.com>
8933
8934         * Makefile.am (libfetish_a_SOURCES):
8935         Add dup-safer.c, fopen-safer.c.
8936         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
8937
8938         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
8939
8940 2001-02-25  Paul Eggert  <eggert@twinsun.com>
8941
8942         The mkstemp replacement is taken from glibc 2.2.2, with some
8943         portability fixes for use outside glibc, as follows:
8944
8945         * tempname.c (struct_stat64): New macro.
8946         (direxists, __gen_tempname): Use it.
8947         This avoids a portability problem with Solaris 8.
8948
8949         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
8950         (<stddef.h>, <stdint.h>, <string.h>):
8951         Include only if STDC_HEADERS || _LIBC.
8952         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
8953         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
8954         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
8955         (__set_errno): Define this macro if <errno.h> doesn't.
8956         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
8957         Define these macros if <stdio.h> doesn't.
8958         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
8959         Define these macros if <sys/stat.h>
8960         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
8961         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
8962         __xstat64): Define if not _LIBC.
8963         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
8964         (__gen_tempname): Invoke gettimeofday only if
8965         HAVE_GETTIMEOFDAY || _LIBC;
8966         otherwise, fall back on plain "time".
8967         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
8968
8969         * mkstemp.c (__GT_FILE): Define to zero if not defined.
8970
8971         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
8972
8973 2001-02-17  Jim Meyering  <meyering@lucent.com>
8974
8975         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
8976         around included file name.
8977
8978         * strnlen.c (__strnlen): Merge in a change from GNU libc.
8979
8980         * strftime.c: Update from GNU libc (the only changes were to comments).
8981
8982 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
8983
8984         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
8985
8986 2001-02-17  Paul Eggert  <eggert@twinsun.com>
8987
8988         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
8989         Remove workaround macros for hosts that have mbrtowc but not
8990         mbstate_t, as we now insist on proper declarations for both
8991         before using mbrtowc.
8992
8993 2001-02-17  Jim Meyering  <meyering@lucent.com>
8994
8995         * regex.c: Update from libc.
8996
8997 2001-02-16  Paul Eggert  <eggert@twinsun.com>
8998
8999         * alloca.c (malloc): Undef before defining, since stdlib.h
9000         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9001         Reported by Mark Hounschell via Paul Eggert.
9002
9003 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9004
9005         * config.charset: Update for FreeBSD 4.2.
9006
9007 2001-01-26  Jim Meyering  <meyering@lucent.com>
9008
9009         * quotearg.c: Include stddef.h.
9010         * quote.c: Include stddef.h.
9011         Reported by Axel Kittenberger.
9012
9013         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9014         line in double quotes so that it evokes a better diagnostic.
9015         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9016         Reported by Axel Kittenberger.
9017
9018 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9019
9020         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9021         to avoid a warning.  Add back 'const' to inptr.
9022
9023 2001-01-16  Jim Meyering  <meyering@lucent.com>
9024
9025         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9026         From Bruno Haible.
9027
9028 2001-01-14  Jim Meyering  <meyering@lucent.com>
9029
9030         * rename.c: New file.  From Volker Borchert.
9031         Include stdlib.h, string.h or strings.h, and xalloc.h.
9032         Use strip_trailing_slashes rather than open-coding it.
9033
9034 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9035
9036         * strftime.c: Sync with glibc time/strftime.c 1.81.
9037
9038 2001-01-03  Jim Meyering  <meyering@lucent.com>
9039
9040         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9041         local `inptr' to avoid warning with some system declarations of iconv.
9042
9043 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9044
9045         * modechange.c: Do not assume that mode_t uses the
9046         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9047         the other-execute bit of FOO even if S_IXOTH != 1.
9048
9049         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9050         WOTH, XOTH, ALLM): New macros.
9051         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9052          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9053         Use them.
9054         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9055         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9056         (mode_compile):
9057         No need to use uintmax_t; unsigned long is long enough.
9058         Don't bother to get suffix since we don't use it.
9059
9060 2000-12-24  Jim Meyering  <meyering@lucent.com>
9061
9062         * hash.c (is_prime): Return explicit boolean values.
9063         (hash_get_first): Return NULL to appease Irix5.6's 89.
9064         Reported by Nelson Beebe.
9065
9066 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9067
9068         * localcharset.c (locale_charset): Add support for Win32.
9069
9070 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9071
9072         * physmem.h, physmem.c: New files.
9073
9074         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9075         (noinst_HEADERS): Add physmem.h.
9076
9077         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9078         't' for compatibility with Solaris 8 sort.
9079
9080 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9081
9082         * config.charset: Add support for BeOS.
9083
9084 2000-12-16  Jim Meyering  <meyering@lucent.com>
9085
9086         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9087         SHELLS_FILE to a file name that's useful on djgpp systems.
9088         Include stdlib.h.
9089         (ADDITIONAL_DEFAULT_SHELLS): Define.
9090         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9091         Based mostly on a patch from Prashant TR.
9092
9093 2000-12-16  Jim Meyering  <meyering@lucent.com>
9094
9095         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9096         N and M) would have treated it like `chown N:N FILE'.
9097
9098         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9099
9100 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9101
9102         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9103         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9104         to the list of canonical encodings. Rename EUC-CN to GB2312.
9105
9106 2000-12-08  Andreas Schwab  <schwab@suse.de>
9107
9108         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9109         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9110
9111 2000-12-07  Jim Meyering  <meyering@lucent.com>
9112
9113         * stripslash.c (ISSLASH): Define.
9114         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9115         From Prashant TR.
9116
9117         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9118         (dir_name_r): Declare this function as static.
9119         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9120         manifest itself on a name containing a mix of slashes and
9121         backslashes.
9122         Make this function work with names starting with a DOS-style
9123         drive letter and colon prefix.
9124         (dir_name): Append `.' if necessary.
9125         Based mostly on patches from Prashant TR and Eli Zaretskii.
9126
9127         * dirname.h (dir_name_r): Remove prototype.
9128
9129 2000-12-05  Jim Meyering  <meyering@lucent.com>
9130
9131         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9132
9133 2000-12-04  Jim Meyering  <meyering@lucent.com>
9134
9135         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9136         Also include memory.h, stdlib.h, unistd.h if appropriate.
9137         Reported by Andreas Jaeger (conflicting declaration of malloc).
9138
9139 2000-12-02  Jim Meyering  <meyering@lucent.com>
9140
9141         * closeout.h: Make idempotent, to avoid some obscure warnings.
9142
9143 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9144
9145         * memrchr.c: Include <config.h> before any system include file.
9146
9147 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9148
9149         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9150
9151 2000-11-26  Jim Meyering  <meyering@lucent.com>
9152
9153         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9154
9155 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9156
9157         * strftime.c (my_strftime): Do not invoke mbrlen with a
9158         size of (size_t) -1; it's not portable.
9159
9160 2000-11-17  Akim Demaille  <akim@epita.fr>
9161
9162         * obstack.h: Formatting changes.
9163         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9164         prevent type checking.
9165         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9166         cast the value to (void *): assigning a `foo *' to a `void *'
9167         variable is valid.
9168         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9169
9170 2000-11-17  Jim Meyering  <meyering@lucent.com>
9171
9172         * strstr.c: Update from GNU libc.
9173
9174 2000-11-16  Jim Meyering  <meyering@lucent.com>
9175
9176         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9177
9178 2000-11-11  Jim Meyering  <meyering@lucent.com>
9179
9180         * error.c: Add a couple #includes, merging from GNU libc version.
9181
9182 2000-11-10  Jim Meyering  <meyering@lucent.com>
9183
9184         * obstack.h: Update from GNU libc.
9185         * obstack.c: Likewise.
9186
9187 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9188
9189         * getusershell.c (setusershell): Use rewind rather than
9190         fseek/fseeko, to avoid configuration hassles with fseeko.
9191         Don't bother opening SHELLS_FILE if shellstream is NULL;
9192         it's not necessary.
9193
9194 2000-11-05  Jim Meyering  <meyering@lucent.com>
9195
9196         * makepath.h (make_dir): Declare.
9197         * makepath.c (make_dir): Remove `static' attribute.
9198         Tweak a comment.
9199
9200 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9201
9202         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9203         last one in a bucket, advance to the next bucket.
9204
9205 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9206
9207         * fnmatch.c: Do not comment out all the code if we are using
9208         the GNU C library, because in some cases we are replacing buggy
9209         code in the GNU C library itself.
9210
9211 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9212
9213         * error.h, getline.h, modechange.h:
9214         Remove "2000" from Copyright line, as the file hasn't been
9215         changed this year other than in the copyright notice.
9216
9217         * xalloc.h: Add "2000" to Copyright line, as this file
9218         was changed this year.
9219
9220 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9221
9222         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9223         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9224         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9225
9226 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9227
9228         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9229         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9230         doesn't define __restrict_arr.
9231
9232 2000-10-29  Jim Meyering  <meyering@lucent.com>
9233
9234         * xstat.in: Fix grammar in comment.
9235
9236 2000-10-28  Jim Meyering  <meyering@lucent.com>
9237
9238         * memchr.c: Update from libc.
9239         Adjust for portability:
9240         [HAVE_STDLIB_H]: Include stdlib.h.
9241         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9242         Undef __memchr, too.
9243         [!weak_alias]: Define __memchr to memchr.
9244
9245         * regex.c: Update from libc.
9246         * regex.h: Likewise.
9247         * getopt1.c: Likewise.
9248         * memcmp.c: Likewise.
9249
9250         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9251         Avoid using fseek, when possible -- it's broken by design.
9252         Patch by Ulrich Drepper.
9253
9254 2000-10-26  Jim Meyering  <meyering@lucent.com>
9255
9256         * strftime.c: Update from libc.
9257
9258 2000-10-25  Jim Meyering  <meyering@lucent.com>
9259
9260         * obstack.c: Update from libc.
9261
9262 2000-10-23  Jim Meyering  <meyering@lucent.com>
9263
9264         * hard-locale.c (hard_locale): Revert last change -- it was simply
9265         wrong.  That set_locale call must not have any side effects.
9266         From Paul Eggert.
9267
9268 2000-10-22  Jim Meyering  <meyering@lucent.com>
9269
9270         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9271         [CYCLIC]: Remove now-unused definition.
9272
9273         * save-cwd.c (O_DIRECTORY): Define, if needed.
9274         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9275         Suggestion from Ulrich Drepper.
9276
9277 2000-10-21  Jim Meyering  <meyering@lucent.com>
9278
9279         * dirname.c (dir_name_r): New function, factored out of dir_name.
9280         (dir_name): Use dir_name_r.
9281         * dirname.h (dir_name_r): Declare it.
9282
9283 2000-10-21  Jim Meyering  <meyering@lucent.com>
9284
9285         * dirname.c (memrchr): Declare if necessary.
9286         (dir_name): Remove the restriction that there be no
9287         trailing slashes.  Now, this code skips past them, effectively
9288         ignoring them.
9289         [TEST_DIRNAME] (main): New unit tests.
9290
9291         * memrchr.c: New file from GNU libc.
9292         Undef __memrchr, too.
9293         [!weak_alias]: Define __memrchr to memrchr.
9294         Guard weak_alias use with `#ifdef weak_alias'.
9295
9296 2000-10-17  Jim Meyering  <meyering@lucent.com>
9297
9298         * quote.h (PARAMS): Define and use.
9299         Reported by Akim Demaille.
9300
9301         * getopt.c: Update from libc.
9302
9303 2000-10-16  Jim Meyering  <meyering@lucent.com>
9304
9305         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9306         From Jan Fedak.
9307
9308 2000-09-25  Jim Meyering  <meyering@lucent.com>
9309
9310         * md5.h (rol): Define (from GnuPG).
9311
9312         * sha.c: Give credit (GnuPG) where due.
9313         (M): Use rol rather than open-coding it.
9314         Add a FIXME comment.
9315
9316 2000-09-21  Jim Meyering  <meyering@lucent.com>
9317
9318         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9319         Reported by Michael Stone.
9320
9321 2000-09-20  Jim Meyering  <meyering@lucent.com>
9322
9323         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9324         (noinst_HEADERS): Add sha.h.
9325         Based on code from Scott G. Miller and from GnuPG.
9326
9327 2000-09-15  Jim Meyering  <meyering@lucent.com>
9328
9329         * regex.c: Update from libc.
9330
9331 2000-09-10  Jim Meyering  <meyering@lucent.com>
9332
9333         * getopt.c (_getopt_internal): Update from glibc.
9334
9335 2000-09-09  Jim Meyering  <meyering@lucent.com>
9336
9337         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9338         think it should be used as a general replacement for isascii.
9339         * fnmatch.c: Likewise.
9340         * mbswidth.c: Likewise
9341         * regex.c: Likewise.
9342
9343         Don't use atoi.
9344         * userspec.c: Include sys/param.h and limits.h.
9345         Include xstrtol.h.
9346         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9347         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9348         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9349         UID, GID.  Check range.
9350
9351 2000-09-06  Jim Meyering  <meyering@lucent.com>
9352
9353         * getopt.c (_getopt_internal): Update from glibc.
9354
9355 2000-08-30  Jim Meyering  <meyering@lucent.com>
9356
9357         * strftime.c: Merge in changes from GNU libc.
9358
9359 2000-08-26  Jim Meyering  <meyering@lucent.com>
9360
9361         * closeout.c: Include "__fpending.h".
9362         (close_stdout_status): Return right away if there's nothing to flush.
9363
9364         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9365         * __fpending.c: New file.
9366         * __fpending.h: New file.
9367
9368 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9369
9370         Standardize on "memory exhausted" instead of "Memory exhausted"
9371         or "virtual memory exhausted".
9372         * obstack.c (print_and_abort): Use "memory exhausted", not
9373         "virtual memory exhausted".
9374         * same.c (same_name): Invoke xalloc_die instead of printing
9375         our own message.
9376         * userspec.c (parse_user_spec): Likewise.
9377         * bumpalloc.h: comment fix
9378         * same.c, userspec.c: Include xalloc.h.
9379
9380         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9381         not char *const and pointing to a constant array.
9382         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9383         (xrealloc): Comment fix.
9384
9385         * userspec.c (parse_user_spec):
9386         Don't translate a message until just before returning,
9387         to avoid unnecessary translation.
9388
9389 2000-08-07  Jim Meyering  <meyering@lucent.com>
9390
9391         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9392         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9393         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9394         getgroups.c, gethostname.c, getopt.h, group-member.c,
9395         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9396         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9397         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9398         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9399         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9400         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9401         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9402         yesno.c: Back out Copyright date changes for each file with no change
9403         this year.  This eases coordination with other programs using the same
9404         source code modules.  From Paul Eggert.
9405
9406 2000-08-03  Greg McGary  <greg@mcgary.org>
9407
9408         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9409         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9410         (EXTEND_BUFFER): Use them.
9411
9412 2000-08-01  Jim Meyering  <meyering@lucent.com>
9413
9414         * dirname.c (ISSLASH): Define.
9415         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9416         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9417         both `\' and `/' may be use as path separators.
9418         Based on a patch from Prashant TR.
9419
9420 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9421
9422         * quotearg.c (quotearg_n_options): Don't make the initial
9423         slot vector a constant, since it might get modified.
9424
9425 2000-07-31  Jim Meyering  <meyering@lucent.com>
9426
9427         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9428         * obstack.c (print_and_abort): Likewise.
9429
9430 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9431
9432         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9433         buffer, so that the caller can always quote one small
9434         component of a "memory exhausted" message in slot 0.
9435         From a suggestion by Jim Meyering.
9436
9437 2000-07-30  Jim Meyering  <meyering@lucent.com>
9438
9439         * makepath.c (make_path): Quote the other instance, too.
9440
9441         * quotearg.c (N_STATIC_SLOTVECS): Define.
9442         (STATIC_BUF_SIZE): Define.
9443         (quotearg_n_options): Use only statically allocated storage when
9444         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9445         than STATIC_BUF_SIZE.
9446
9447 2000-07-29  Jim Meyering  <meyering@lucent.com>
9448
9449         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9450         * dirname.c (dir_name): Likewise.
9451
9452         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9453
9454         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9455         (dir_name): Assert that there are no trailing slashes.
9456
9457 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9458
9459         * mbswidth.h (mbswidth): Add a flags argument.
9460         (mbswidth): New declaration.
9461         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9462         * mbswidth.c (mbswidth): Add a flags argument.
9463         (mbsnwidth): New function.
9464
9465 2000-07-24  Jim Meyering  <meyering@lucent.com>
9466
9467         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9468
9469 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9470
9471         * mbswidth.c (_XOPEN_SOURCE):
9472         Don't define; this causes problems on Solaris 7.
9473         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9474
9475 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9476
9477         * quotearg.c:
9478         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9479         so that mbstate_t is always defined.
9480
9481         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9482         be 1 in at least one GCC installation, and this configuration
9483         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9484         performance on hosts that have mbrtowc but have only unibyte
9485         locales, but I assume these hosts are rare.
9486
9487 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9488
9489         * quotearg.c: Streamline by invoking multibyte code only if needed.
9490         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9491         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9492         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9493         invoke multibyte primitives.
9494
9495 2000-07-23  Jim Meyering  <meyering@lucent.com>
9496
9497         * basename.c (base_name): Add an assertion.
9498
9499 2000-07-15  Bruno Haible  <clisp.cons.org>
9500
9501         * quotearg.c: When the system forces us to redefine mbstate_t,
9502         shadow its mbsinit function.
9503
9504 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9505
9506         * mbswidth.h: New file.
9507         * mbswidth.c: New file.
9508         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9509         (noinst_HEADERS): Add mbswidth.h.
9510
9511 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9512
9513         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9514         and IRIX 6.
9515
9516 2000-07-15  Jim Meyering  <meyering@lucent.com>
9517
9518         * makepath.c: Include quote.h.
9519         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9520         corresponding argument in a `quote (...)' call.
9521         Give better diagnostics.
9522
9523         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9524         (noinst_HEADERS): Add quote.h.
9525
9526         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9527         from tar's src/misc.c.
9528         * quote.h: New file.  Prototypes for same.
9529
9530 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9531
9532         From a suggestion by Bruno Haible.
9533         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9534         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9535         to decide whether to define the BeOS workaround macro;
9536         this adjusts to the change to AC_MBSTATE_T.
9537
9538 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9539
9540         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9541
9542         * quotearg.c (quoting_style_args, quoting_style_vals,
9543         quotearg_buffer_restyled): Add support for
9544         clocale_quoting_style.  Undo previous change to
9545         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9546         and "{RIGHT QUOTATION MARK}" msgids.
9547
9548 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9549
9550         The old behavior of quoting `like this' doesn't look good with
9551         newer, ISO-style fonts.  See:
9552         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9553
9554         Instead, quote "like this" by default.  Let the translator
9555         tailor the locale-specific quoting behavior by providing
9556         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9557
9558         * quotearg.c (N_): New macro.
9559         (gettext_default): New function.
9560         (quotearg_buffer_restyled): Use
9561         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9562         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9563
9564 2000-07-09  Jim Meyering  <meyering@lucent.com>
9565
9566         * Most files: Update copyright dates to include 2000.
9567
9568 2000-07-08  Jim Meyering  <meyering@lucent.com>
9569
9570         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9571         if not defined.
9572         (xgethostname): Remove now-unnecessary #ifdef.
9573         Move declaration of `err' into loop where it's used.
9574
9575 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9576
9577         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9578         by allocating a larger buffer. Test the gethostname return value for
9579         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9580         returns an error and ENAMETOOLONG isn't defined.
9581
9582 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9583         and Bruno Haible  <haible@clisp.cons.org>
9584
9585         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9586
9587 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9588
9589         * quotearg.c (struct quoting_options): Simplify quote_these_too
9590         dimension.
9591
9592 2000-07-03  Jim Meyering  <meyering@lucent.com>
9593
9594         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9595         Reported by Bruno Haible.
9596
9597 2000-07-04  Jim Meyering  <meyering@lucent.com>
9598
9599         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9600         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9601         lacks mbrtowc.
9602
9603 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9604         and Bruno Haible  <haible@clisp.cons.org>
9605
9606         * quotearg.c (mbrtowc):
9607         Assign to *pwc, and return 1 only if result is nonzero.
9608         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9609
9610 2000-07-03  Jim Meyering  <meyering@lucent.com>
9611
9612         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9613         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9614         From Bob Proulx.
9615
9616 2000-07-02  Jim Meyering  <meyering@lucent.com>
9617
9618         * quotearg.c (mbstate_t): Don't define here.
9619
9620 2000-07-02  Jim Meyering  <meyering@lucent.com>
9621
9622         * nanosleep.c (SIGCONT): Define if not already defined.
9623
9624 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9625
9626         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9627         per change in ../m4/ls-mntd-fs.m4.
9628         (read_filesystem_list): Ignore symbolic links.
9629
9630 2000-06-29  Jim Meyering  <meyering@lucent.com>
9631
9632         * same.c: Include <string.h> or <strings.h>, as appropriate,
9633         for declaration of strcmp.
9634
9635         * long-options.c: Include <stdlib.h>, for declaration of exit.
9636
9637         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9638         Avoid warning by casting result to `char *' to remove `const'.
9639
9640 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9641
9642         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9643
9644 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9645
9646         savedir now sets errno on failure and invokes xmalloc to get memory.
9647         Fix a couple of other minor bugs while we're at it.
9648
9649         * savedir.c (<unistd.h>): Do not include; there's no need.
9650         (NAMLEN): Remove macro.
9651         (malloc, realloc): Remove decls.
9652         (stpcpy): Likewise.
9653         ("xalloc.h"): Include.
9654         (NAME_SIZE_DEFAULT): New macro.
9655         (savedir): Use xmalloc / xrealloc to allocate memory.
9656         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9657         Skip "" directory entries.
9658         Use strlen to calculate directory entry length, since the old method
9659         is rarely used these days and isn't worth supporting.
9660         Don't use a pointer after freeing it.
9661         Check for integer overflow when calculating allocation size.
9662         Use memcpy to copy entries, instead of stpcpy.
9663         Set errno properly when returning NULL.
9664         Check for readdir error.
9665
9666 2000-06-26  Jim Meyering  <meyering@lucent.com>
9667
9668         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9669
9670 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9671
9672         * getusershell.c (xmalloc, xrealloc): Remove functions.
9673         Include xalloc.h.
9674         Don't include <stdlib.h>.  Don't declare malloc, realloc.
9675
9676 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
9677
9678         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9679
9680 2000-06-24  Jim Meyering  <meyering@lucent.com>
9681
9682         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9683
9684 2000-06-21  Jim Meyering  <meyering@lucent.com>
9685
9686         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
9687
9688 2000-06-19  Paul Eggert  <eggert@twinsun.com>
9689
9690         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9691         (mbrtowc, mbstate_t): Define substitutes if
9692         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9693         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9694         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9695
9696 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9697
9698         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9699         than 1024, return a memory chunk of least possible size, instead
9700         of size PATH_MAX + 2. In the loop, increment the size proportionally.
9701         Use free/xmalloc instead of xrealloc to avoid copying for very long
9702         paths.
9703
9704 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9705
9706         * canon-host.c (canon_host): Use malloc and memcpy to copy an
9707         address, not strdup.  Include <stdlib.h> and don't declare free().
9708
9709 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9710
9711         * path-concat.c (path_concat): Don't access dir[-1] if dir is
9712         the empty string.
9713
9714 2000-06-21  Jim Meyering  <meyering@lucent.com>
9715
9716         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
9717         (noinst_HEADERS): Add getstr.h.
9718
9719         * getline.c (getstr): Move into a separate file.
9720         * getstr.c (getstr): New file, extracted from getline.c, with
9721         the following changes: new parameter, delim2; both delim[12]
9722         parameters have type `int', not `char'.  The latter would lose
9723         with 8-bit delimiters.
9724         * getstr.h: New file.
9725
9726 2000-06-19  Jim Meyering  <meyering@lucent.com>
9727
9728         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
9729
9730 2000-06-18  Jim Meyering  <meyering@lucent.com>
9731
9732         * mkdir.c: Remove file, due mainly to copyright incompatibility.
9733         Besides, these days every porting target provides a mkdir function.
9734
9735         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
9736         (this snippet comes from src/system.h).
9737
9738 2000-06-15  Paul Eggert  <eggert@twinsun.com>
9739
9740         * human.c (adjust_value): New function.
9741         (human_readable_inexact): Apply rounding style even when
9742         printing approximate values.
9743
9744 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9745
9746         * human.c (human_readable_inexact): Allow an input block
9747         size that is not a multiple of the output block size, and vice versa.
9748         Reported by Piergiorgio Sartor.
9749
9750 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9751
9752         * getdate.y (get_date): Apply relative times after time
9753         zone indicator, not before.  Reported by Todd A. Jacobs.
9754
9755 2000-06-13  Jim Meyering  <meyering@lucent.com>
9756
9757         * Makefile.am (all-local): Depend on lstat.c and stat.c.
9758
9759         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
9760
9761 2000-06-12  Paul Eggert  <eggert@twinsun.com>
9762
9763         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
9764
9765 2000-06-04  Paul Eggert  <eggert@twinsun.com>
9766
9767         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
9768
9769 2000-06-04  Jim Meyering  <meyering@lucent.com>
9770
9771         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
9772         SunOS 4.1.4 for which gid_t is an unsigned type.
9773
9774 2000-06-03  Jim Meyering  <meyering@lucent.com>
9775
9776         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
9777
9778 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
9779
9780         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
9781         newer, don't install charset.alias.
9782         * config.charset: Change the Linux/glibc rules so they become empty
9783         on glibc-2.1 or newer.
9784
9785 2000-06-02  Jim Meyering  <meyering@lucent.com>
9786
9787         * mountlist.c: Back out last change.  Instead, do this...
9788         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
9789         member using the same `ignore'-testing code.
9790         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
9791         fs_type strings.
9792         From Mark D. Roth.
9793
9794 2000-05-29  Jim Meyering  <meyering@lucent.com>
9795
9796         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
9797         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
9798
9799 2000-05-22  Jim Meyering  <meyering@lucent.com>
9800
9801         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
9802
9803 2000-05-18  Jim Meyering  <meyering@lucent.com>
9804
9805         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
9806         back, too, since it may have been modified by allocate_entry.
9807         (hash_delete): Rewrite to use neither the assignment operator
9808         nor the comma operator in an if-expression.
9809
9810 2000-05-15  Paul Eggert  <eggert@twinsun.com>
9811
9812         * closeout.c:
9813         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
9814         Remove; no longer needed.
9815         "quotearg.h": Add include.
9816         (file_name): Do not bother to explicitly initialize to NULL; it's less
9817         efficient on some hosts.
9818         (close_stdout_status): Remove test as to whether stdout was already
9819         closed; it breaks for the case "echo x | sort >&-".
9820         Quote file name colons.
9821         Do not assume that _("write error") lacks format strings.
9822
9823 2000-05-15  Jim Meyering  <meyering@lucent.com>
9824
9825         * version-etc.c (version_etc_copyright): Update the copyright string
9826         used in all --version output.
9827
9828 2000-05-14  Jim Meyering  <meyering@lucent.com>
9829
9830         * closeout.c (close_stdout_set_file_name): New function.
9831         (close_stdout_status): Use new file-scoped global.
9832         Return right away if fstat says the stdout file descriptor is invalid.
9833         * closeout.h (close_stdout_set_file_name): Declare.
9834
9835 2000-05-10  Jim Meyering  <meyering@lucent.com>
9836
9837         * closeout.c [default_exit_status]: New file-scoped variable.
9838         (close_stdout_set_status): New function.
9839         * closeout.h (close_stdout_set_status): Declare.
9840
9841 2000-05-08  Jim Meyering  <meyering@lucent.com>
9842
9843         * long-options.c: Don't include closeout.h.
9844         (parse_long_options): Don't call close_stdout for --version.
9845
9846 2000-05-06  Jim Meyering  <meyering@lucent.com>
9847
9848         * strnlen.c: Undefine __strnlen and strnlen.
9849         [!weak_alias]: Define __strnlen to strnlen.
9850
9851         * atexit.c: New file, from libiberty.
9852
9853 2000-05-06  Jim Meyering  <meyering@lucent.com>
9854
9855         * closeout.c (close_stdout_status): Also check for errors on the
9856         stderr stream.
9857
9858 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
9859
9860         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
9861         instead of xmalloc, xrealloc, path_concat.
9862         (locale_charset): Treat empty environment variables as absent.
9863         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
9864
9865 2000-05-04  Jim Meyering  <meyering@lucent.com>
9866
9867         * getopt.c: Update from glibc.
9868         * obstack.c: Likewise.
9869         * obstack.h: Likewise.
9870         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
9871
9872         * regex.h: Likewise.
9873         * strndup.c: Likewise.
9874         * strnlen.c: New file, from glibc.
9875
9876 2000-05-01  Jim Meyering  <meyering@lucent.com>
9877
9878         * full-write.c (full_write): Remove `FIXME' part of comment.
9879
9880 2000-04-29  Jim Meyering  <meyering@lucent.com>
9881
9882         * path-concat.c: Declare strdup only if it's not defined.
9883         * canon-host.c: Likewise.
9884
9885 2000-04-28  Jim Meyering  <meyering@lucent.com>
9886
9887         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
9888         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
9889         included first, then limits.h is included by locale.h by libintl.h.
9890         From John David Anglin.
9891
9892 2000-04-25  Jim Meyering  <meyering@lucent.com>
9893
9894         * makepath.c (S_IRWXUGO): Define.
9895         (make_path): Always perform explicit chmod if MODE specifies any
9896         of the `special' permission bits.  Prompted by a bug report against
9897         install from Mate Wierdl and Joost van Baal.
9898
9899 2000-04-18  Jim Meyering  <meyering@lucent.com>
9900
9901         * README: New file.
9902
9903         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
9904         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
9905
9906 2000-04-17  Jim Meyering  <meyering@lucent.com>
9907
9908         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
9909         the definition of it to rpl_strftime also defined-away the system's
9910         declaration.
9911
9912 2000-04-15  Jim Meyering  <meyering@lucent.com>
9913
9914         Use `C' to denote so-called `contiguous' files, the same way
9915         that tar does.
9916         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
9917         (ftypelet): Use S_ISCTG.
9918         From Michael Deutschmann.
9919
9920 2000-04-14  Jim Meyering  <meyering@lucent.com>
9921
9922         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
9923
9924 2000-04-08  Jim Meyering  <meyering@lucent.com>
9925
9926         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
9927         names don't conflict.  Reported by Eli Zaretskii.
9928
9929 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
9930
9931         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
9932         bug.  Deal with the different error behavior of Irix iconv.
9933
9934 2000-04-07  Jim Meyering  <meyering@lucent.com>
9935
9936         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
9937         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
9938
9939 2000-04-05  Jim Meyering  <meyering@lucent.com>
9940
9941         Portability tweaks required for ultrix4.3.
9942         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
9943         * readutmp.c: Include sys/types.h before sys/stat.h.
9944         * canon-host.c: Declare strdup.
9945         * path-concat.c: Likewise.
9946         From John David Anglin.
9947
9948 2000-04-04  Jim Meyering  <meyering@lucent.com>
9949
9950         Be more DOS 8.3-friendly.
9951         * ref-add.sin: Renamed from ref-add.sed.in.
9952         * ref-del.sin: Renamed from ref-del.sed.in.
9953         * Makefile.am: Reflect renaming.
9954         Reported by Eli Zaretskii.
9955
9956         Use a temporary file name that won't clash with `charset.alias'
9957         in the DOS 8.3 name space.
9958         * Makefile.am (charset_tmp): Define.
9959         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
9960         (uninstall-local): Likewise.
9961         Reported by Eli Zaretskii.
9962
9963 2000-03-29  Paul Eggert  <eggert@twinsun.com>
9964
9965         * time/strftime.c (my_strftime): Make sure we call the system
9966         strftime, not ourselves, when invoking the underlying strftime.
9967
9968 2000-03-24  Jim Meyering  <meyering@lucent.com>
9969
9970         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
9971         (charset_alias): Define.
9972         (install-exec-local): Factor out common code.
9973         (uninstall-local): Split lines longer than 80.
9974         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
9975         (SUFFIXES): Define.
9976         (.sed.in.sed): New rule.  Don't redirect directly to $@.
9977         (CLEANFILES): Add ref-add.sed and ref-del.sed.
9978
9979 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
9980
9981         * config.charset: Output a line containing "Packages using this file".
9982         * ref-add.sed.in, ref-del.sed.in: New files.
9983         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
9984         ref-del.sed): New rules.
9985
9986 2000-03-17  Jim Meyering  <meyering@lucent.com>
9987
9988         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
9989         Otherwise, include <strings.h>
9990
9991 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
9992
9993         * unicodeio.c (utf8_wctomb): New function.
9994         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
9995         format instead of in UCS-4 with platform dependent endianness.
9996
9997 2000-03-07  Paul Eggert  <eggert@twinsun.com>
9998
9999         * savedir.c (savedir): Work even if directory size is
10000         negative; this can happen with some screwy NFS configurations.
10001
10002 2000-03-06  Jim Meyering  <meyering@lucent.com>
10003
10004         * localcharset.c (get_charset_aliases): Don't try to free file_name
10005         if it's NULL (because we ran out of memory).  From Bruno Haible.
10006
10007 2000-03-05  Jim Meyering  <meyering@lucent.com>
10008
10009         * localcharset.c ("path-concat.h"): Include.
10010         (get_charset_aliases): Use path_concat instead of ANSI string
10011         concatenation.
10012
10013         * unicodeio.h (PARAMS): Define.
10014         Use it to guard prototype.
10015
10016 2000-03-04  Jim Meyering  <meyering@lucent.com>
10017
10018         * Makefile.am (install-exec-local): Create $(libdir) before installing
10019         into it.
10020         (uninstall-local): Uncomment this rule so `make distcheck' works
10021         once again.
10022
10023         * unicodeio.c (<errno.h>): Include it.
10024         (errno): Declare if not defined.
10025
10026         * localcharset.c: Add Bruno's comment justifying use of volatile.
10027
10028         * config.charset: New version, incorporating remarks from a linux
10029         i18n mailing list.  From Bruno Haible.
10030
10031 2000-03-02  Jim Meyering  <meyering@lucent.com>
10032
10033         * Makefile.am (EXTRA_DIST): Add config.charset.
10034
10035 2000-03-01  Jim Meyering  <meyering@lucent.com>
10036
10037         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10038         * unicodeio.c: Likewise.
10039
10040 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10041
10042         * config.charset: New file.
10043         * localcharset.c: New file.
10044         * unicodeio.h, unicodeio.c: New files.
10045         * Makefile.am (DEFS): Add -DLIBDIR=...
10046         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10047         (noinst_HEADERS): Add unicodeio.h.
10048         (all-local, install-exec-local, charset.alias): New targets.
10049
10050 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10051
10052         * quotearg.c (ALERT_CHAR): New macro.
10053         (quotearg_buffer_restyled): Use it.
10054
10055 2000-02-27  Jim Meyering  <meyering@lucent.com>
10056
10057         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10058         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10059
10060         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10061         not `#if STDC_HEADERS'.
10062         Declare malloc if needed.
10063
10064         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10065         now that autoconf always defines the HAVE_DECL_ symbols.
10066         * human.c: Likewise.
10067         * same.c: Likewise.
10068         * strtoumax.c: Likewise.
10069
10070         * backupfile.c: Arrange for cpp to fail if the configure-time
10071         declaration check was not run.
10072         * hash.c: Likewise.
10073         * human.c: Likewise.
10074         * same.c: Likewise.
10075         * strtoumax.c: Likewise.
10076
10077         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10078         then first look up the entire `.'-containing string as a login name.
10079
10080 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10081
10082         * getdate.y: Handle two-digit years with leading zeros correctly.
10083         (textint): New typedef.
10084         (parser_control): Member year changed from int to textint.
10085         All uses changed.
10086         (YYSTYPE): Removed; replaced by %union with int and textint members.
10087         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10088         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10089         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10090         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10091         (date, number, to_year): Use width of number in digits, not its value,
10092         to determine whether it's a 2-digit year, or a 2-digit time.
10093         (yylex): Store number of digits of numeric tokens.
10094         Reported by John Kendall.
10095
10096         (parser_control): Changed from struct parser_control to typedef (for
10097         consistency).  All uses changed.
10098
10099         (tID): Removed; not used.
10100         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10101
10102 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10103
10104         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10105         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10106
10107 2000-02-12  Jim Meyering  <meyering@lucent.com>
10108
10109         * userspec.c (ISDIGIT): Define it.
10110         (isdigit): Remove definition.
10111         (is_number): Use ISDIGIT, not isdigit.
10112         <libintl.h>: Include.
10113         (_ and N_): Define.
10114         (parse_user_spec): Mark translatable strings.
10115
10116 2000-02-10  Jim Meyering  <meyering@lucent.com>
10117
10118         With these changes, nanosleep.[ch] are finally enough like the other
10119         lib/* replacement files to compile on a few more losing systems.
10120
10121         * nanosleep.h: Don't include config.h.
10122         Remove prototype from declaration of nanosleep.
10123         (PARAMS): Remove now-unneeded definition.
10124         * nanosleep.c: #undef nanosleep.
10125         (rpl_nanosleep): Rename from nanosleep.
10126
10127 2000-02-03  Jim Meyering  <meyering@lucent.com>
10128
10129         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10130         rather than with `#if HAVE_UTMPNAME'.
10131
10132 2000-02-01  Jim Meyering  <meyering@lucent.com>
10133
10134         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10135
10136 2000-01-31  Jim Meyering  <meyering@lucent.com>
10137
10138         * nanosleep.h (nanosleep): Guard declaration with
10139         `#if ! HAVE_DECL_NANOSLEEP'.
10140         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10141         the declaration in that vendor's sys/timers.h.
10142         Reported by Christian Krackowizer.
10143
10144         * quotearg.c (ISASCII): Add #undef and move definition to follow
10145         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10146         (ISPRINT): Likewise.
10147         Reported by Tom Tromey.
10148
10149 2000-01-30  Jim Meyering  <meyering@lucent.com>
10150
10151         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10152         uses of ->ut_name.  The latter doesn't work with new Linux header files
10153         where only utmpx.ut_user is declared.
10154
10155         * readutmp.h (UT_USER): Define.
10156
10157 2000-01-23  Jim Meyering  <meyering@lucent.com>
10158
10159         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10160         obstack.c.
10161
10162 2000-01-22  Jim Meyering  <meyering@lucent.com>
10163
10164         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10165         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10166         Required for some AIX systems.  Reported by Christian Krackowizer.
10167         [TESTING] (main): New function.
10168
10169         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10170         * dirname.c (dir_name): Support for DOS-style file names with drive
10171         letters.
10172
10173         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10174
10175         * strverscmp.c (ISDIGIT): Define.
10176         (strverscmp): Use ISDIGIT, not isdigit.
10177
10178 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10179
10180         * nanosleep.c (nanosleep):
10181         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10182         POSIX.1 doesn't require SA_INTERRUPT and some systems
10183         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10184         it's been part of POSIX.1 since day 1 (in 1988).
10185
10186 2000-01-17  Jim Meyering  <meyering@lucent.com>
10187
10188         * interlock: Remove unused file.  Reported by François Pinard.
10189
10190 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10191
10192         * quotearg.c (quotearg_buffer_restyled): Do not quote
10193         alert, backslash, formfeed, and vertical tab unnecessarily in
10194         shell quoting style.
10195
10196
10197 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10198 Free Software Foundation, Inc.
10199 Copying and distribution of this file, with or without modification,
10200 are permitted provided the copyright notice and this notice are preserved.