* gl_anylinked_list2.h [lint] (gl_linked_iterator)
[gnulib.git] / lib / ChangeLog
1 2006-09-22  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2
3         * gl_anylinked_list2.h [lint] (gl_linked_iterator)
4         (gl_linked_iterator_from_to): Initialize struct completely.
5         * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
6         (gl_tree_iterator_from_to): Likewise
7         * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
8         * gl_array_list.c [lint] (gl_array_iterator)
9         (gl_array_iterator_from_to): Likewise.
10         * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
11         * gl_carray_list.c [lint] (gl_carray_iterator)
12         (gl_carray_iterator_from_to): Likewise.
13
14         * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
15         * md4.c (md4_process_block): Remove unused variable.
16         * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
17         parentheses for clarity.
18
19 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
20
21         Import this patch from libc:
22
23         2006-09-06  Jakub Jelinek  <jakub@redhat.com>
24
25         * regex_internal.c (re_string_reconstruct): Handle
26         offset < pstr->valid_raw_len && pstr->offsets_needed case.
27         Ensure no bytes read before raw_mbs array.  Pass a saved copy of
28         pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
29         re_string_context_at.
30
31 2006-09-20  Bruno Haible  <bruno@clisp.org>
32
33         * mkdtemp.c: Import from libc.
34         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
35                 * sysdeps/posix/tempname.c (__gen_tempname): Change
36                 attempts_min into a macro.  Use preprocessor to decide how to
37                 initialize attempts [Coverity CID 67].
38         2001-11-27  Paul Eggert  <eggert@twinsun.com>
39                 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
40                 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
41
42 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
43
44         * mkstemp.h: New file, since some standard headers
45         #define mkstemp.
46         * mkstemp.c: Revamp to put the !_LIBC code together.
47         Include "mkstemp.h".
48         Make the _LIBC code resemble glibc original more,
49         e.g., use K&R style.
50         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
51         (mkstemp): Remove, since mkstemp.h does this for us.
52         * stdlib--.h: Include mkstemp.h.
53
54         Import this patch from libc:
55
56         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
57
58         * tempname.c (__gen_tempname): Change attempts_min
59         into a macro.  Use preprocessor to decide how to initialize
60         attempts [Coverity CID 67].
61
62 2006-09-18  Bruno Haible  <bruno@clisp.org>
63
64         * javaversion.c: Include configmake.h.
65
66 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
67
68         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
69         that prevented coreutils 6.1 from building.  Problem reported
70         by Petter Reinholdtsen.
71
72 2006-09-18  Jim Meyering  <jim@meyering.net>
73
74         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
75
76 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
77
78         * dirchownmod.c: Don't include fcntl.h; no longer needed.
79         (dirchownmod): New arg FD.  All callers changed.
80         Use FD rather than opening the directory ourself, as opening is
81         now the caller's responsibility.
82         * dirchownmod.h: Likewise.
83         * mkancesdirs.c: Include <sys/types.h>, for portability to older
84         hosts that require <sys/types.h> before <sys/stat.h>.  Include
85         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
86         (test_dir): Remove.
87         (mkancesdirs): Return length of prefix of FILE that has already
88         been made, or -2 if there is a child doing the work.  Redo
89         algorithm so that it is O(N) rather than O(N**2).  Optimize away
90         ".", and treat ".." specially since it might stray back into
91         already-created areas.  Use a subprocess if necessary.  New arg
92         WD; all users changed.  MAKE_DIR function should now return 1
93         if it creates a directory that is not readable.  Return -2 if
94         a child process is spun off.
95         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
96         Adjust signature to match code.
97         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
98         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
99         all users changed.
100         * savewd.c, savewd.h: New files.
101
102 2006-09-15  Jim Meyering  <jim@meyering.net>
103
104         * rename-dest-slash.c (has_trailing_slash): Use
105         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
106         (rpl_rename_dest_slash): Perform the cheaper trailing slash
107         test before testing whether SRC is a directory.
108         Suggestions from Bruno Haible.
109
110         Avoid a warning about an unused variable.
111         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
112         into the #ifdef block where it's used.
113
114         * rename-dest-slash.c: New file.
115
116 2006-09-14  Bruno Haible  <bruno@clisp.org>
117
118         * allocsa.c: Include <config.h> unconditionally.
119         * asnprintf.c: Likewise.
120         * asprintf.c: Likewise.
121         * c-strcasecmp.c: Likewise.
122         * c-strcasestr.c: Likewise.
123         * c-strncasecmp.c: Likewise.
124         * c-strstr.c: Likewise.
125         * classpath.c: Likewise.
126         * clean-temp.c: Likewise.
127         * concatpath.c: Likewise.
128         * copy-file.c: Likewise.
129         * csharpcomp.c: Likewise.
130         * csharpexec.c: Likewise.
131         * execute.c: Likewise.
132         * fatal-signal.c: Likewise.
133         * findprog.c: Likewise.
134         * fwriteerror.c: Likewise.
135         * gl_array_list.c: Likewise.
136         * gl_array_oset.c: Likewise.
137         * gl_avltree_list.c: Likewise.
138         * gl_avltree_oset.c: Likewise.
139         * gl_avltreehash_list.c: Likewise.
140         * gl_carray_list.c: Likewise.
141         * gl_linked_list.c: Likewise.
142         * gl_linkedhash_list.c: Likewise.
143         * gl_list.c: Likewise.
144         * gl_oset.c: Likewise.
145         * gl_rbtree_list.c: Likewise.
146         * gl_rbtree_oset.c: Likewise.
147         * gl_rbtreehash_list.c: Likewise.
148         * imaxabs.c: Likewise.
149         * imaxdiv.c: Likewise.
150         * javacomp.c: Likewise.
151         * javaexec.c: Likewise.
152         * javaversion.c: Likewise.
153         * linebreak.c: Likewise.
154         * localcharset.c: Likewise.
155         * lock.c: Likewise.
156         * mbchar.c: Likewise.
157         * mbswidth.c: Likewise.
158         * mkdtemp.c: Likewise.
159         * pipe.c: Likewise.
160         * printf-args.c: Likewise.
161         * printf-parse.c: Likewise.
162         * progname.c: Likewise.
163         * progreloc.c: Likewise.
164         * readlink.c: Likewise.
165         * sh-quote.c: Likewise.
166         * stpcpy.c: Likewise.
167         * stpncpy.c: Likewise.
168         * strcasecmp.c: Likewise.
169         * strcasestr.c: Likewise.
170         * strcspn.c: Likewise.
171         * striconv.c: Likewise.
172         * strncasecmp.c: Likewise.
173         * strnlen1.c: Likewise.
174         * strstr.c: Likewise.
175         * strtok_r.c: Likewise.
176         * tls.c: Likewise.
177         * tmpdir.c: Likewise.
178         * unicodeio.c: Likewise.
179         * unsetenv.c: Likewise.
180         * vasnprintf.c: Likewise.
181         * vasprintf.c: Likewise.
182         * wait-process.c: Likewise.
183         * xallocsa.c: Likewise.
184         * xsetenv.c: Likewise.
185         * xstriconv.c: Likewise.
186
187 2006-09-13  Eric Blake  <ebb9@byu.net>
188
189         * getopt.c: Fix typo in last commit.
190
191 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
192
193         * _fpending.c: Include <config.h> unconditionally, since we no
194         longer worry about uses that don't define HAVE_CONFIG_H.
195         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
196         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
197         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
198         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
199         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
200         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
201         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
202         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
203         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
204         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
205         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
206         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
207         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
208         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
209         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
210         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
211         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
212         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
213         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
214         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
215         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
216         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
217         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
218         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
219         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
220         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
221         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
222         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
223         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
224         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
225         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
226         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
227         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
228         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
229         Likewise.
230
231 2006-09-12  Jim Meyering  <jim@meyering.net>
232
233         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
234         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
235         Reported by Nelson H. F. Beebe.
236
237 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
238
239         * argp-help.c (argp_doc): Make sure NULL is not passed to
240         dgettext.
241
242 2006-09-10  Bruno Haible  <bruno@clisp.org>
243
244         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
245
246 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
247
248         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
249         program_invocation_name and program_invocation_short_name are
250         initialized.
251         * argp-namefrob.h: Move declarations of program_invocation_name
252         and program_invocation_short_name to argp.h, so they are visible
253         to user programs.
254         * argp.h: Likewise
255
256 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
257
258         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
259         convention.  Text proposed by Bruno Haible.
260         (struct argp_option): Document the use of N_() wrappers.
261
262         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
263         and translate the two parts separately, instead of feeding
264         the whole string to gettext.  This allows to exclude
265         '\v' from the strings visible to the translator by writing doc
266         strings as N_("..") "\v" N_("..").
267
268 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
269
270         * mktime.c (guess_time_tm): Fix bug where mktime
271         returned the maximum time_t value rather than (time_t) -1.
272         Problem originally reported by William Bardwell
273         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
274
275         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
276         Moved to here ...
277         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
278         ... from here.
279
280 2006-09-06  Bruno Haible  <bruno@clisp.org>
281
282         * striconv.h: New file.
283         * striconv.c: New file, merging iconvme.c with GNU gettext's
284         iconvstring.c.
285         * xstriconv.h: New file.
286         * xstriconv.c: New file.
287
288 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
289
290         * argz_.h: Sync from Libtool.
291
292         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
293                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
294
295         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
296
297 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
298
299         * trim.h: New file.
300         * trim.c: New file.
301
302 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
303
304         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
305         Problem reported by Ralf Wildenhues in
306         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
307
308         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
309         HAVE_STRUCT_STATFS_F_FSTYPENAME.
310
311 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
312
313         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
314         or stdbool.h, because they might not exist while configuring.
315
316         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
317         Don't include unistd.h or limits.h; not needed, since chdir-long.h
318         does that for us.
319         (O_DIRECTORY): Remove.
320
321 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
322
323         Work around a bug in both the Linux and SunOS 64-bit kernels:
324         nanosleep mishandles sleeps for longer than 2**31 seconds.
325         Problem reported by Frank v Waveren in
326         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
327         * nanosleep.c (BILLION): New constant.
328         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
329         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
330
331 2006-08-30  Jim Meyering  <jim@meyering.net>
332
333         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
334         the parameter.
335
336 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
337
338         * isapipe.c, isapipe.h: New files.
339
340 2006-08-29  Eric Blake  <ebb9@byu.net>
341
342         * error.c (error_at_line, print_errno_message): Match libc, after
343         resolution of upstream bug 3044.
344
345 2006-08-29  Bruno Haible  <bruno@clisp.org>
346
347         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
348
349 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
350
351         Sync from Libtool:
352
353         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
354
355         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
356         sharing with gnulib.  Report by Eric Blake.
357
358 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
359
360         * fcntl_.h: New file.
361         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
362         the fcntl module.
363         * dirchownmod.c: Likewise.
364         * fts.c: Likewise.
365
366         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
367         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
368         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
369         just before including <inttypes.h>, to avoid circular inclusion.
370
371 2006-08-28  Bruno Haible  <bruno@clisp.org>
372
373         * inttypes_.h (SCNX*): Remove definitions.
374         Reported by Eric Blake.
375
376 2006-08-26  Bruno Haible  <bruno@clisp.org>
377
378         * vasnprintf.c (EOVERFLOW): Remove definition.
379         (VASNPRINTF): Return a string of length > INT_MAX without failing.
380         * vasprintf.c: Include errno.h, limits.h.
381         (EOVERFLOW): New fallback definition.
382         (vasprintf): Test here whether the string length is > INT_MAX.
383         * vsnprintf.c: Include errno.h, limits.h.
384         (EOVERFLOW): New fallback definition.
385         (vsnprintf): Fix bug when generated string was too long for the buffer.
386         Test here whether the string length is > INT_MAX.
387
388 2006-08-26  Bruno Haible  <bruno@clisp.org>
389             Simon Josefsson  <jas@extundo.com>
390
391         BeOS portability.
392         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
393
394 2006-08-28  Bruno Haible  <bruno@clisp.org>
395
396         * c-strstr.h: New file, from GNU gettext.
397         * c-strstr.c: New file, from GNU gettext.
398
399 2006-08-26  Bruno Haible  <bruno@clisp.org>
400
401         * inttypes_.h: New file.
402         * inttypes.h: Remove file.
403         * stdint_.h: Include <inttypes.h> through its absolute filename.
404
405         * imaxabs.c: New file.
406
407         * imaxdiv.c: New file.
408
409 2006-08-22  Bruno Haible  <bruno@clisp.org>
410
411         * readutmp.h: Skip most definitions if neither <utmp.h> nor
412         <utmpx.h> exists.
413
414 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
415
416         BeOS portability.
417         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
418         Problem reported by Bruno Haible.
419
420 2006-08-21  Bruno Haible  <bruno@clisp.org>
421
422         BeOS portability.
423         * mbchar.h: Include <wctype.h> only if it exists.
424
425 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
426
427         * cycle-check.h: Include <stdint.h> unconditionally, since we
428         now assume the stdint module.  Do not include inttypes.h.
429         * fsusage.h: Likewise.
430         * getndelim2.c: Likewise.
431         * human.h: Likewise.
432         * inttostr.h: Likewise.
433         * obstack.c: Likewise.
434         * regex_internal.h: Likewise.
435         * tempname.c: Likewise.
436         * utimecmp.c: Likewise.
437         * xstrtol.h: Likewise.
438
439         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
440
441         * strtoimax.c: Adjust to macro name changes in Autoconf,
442         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
443         * xtime.h: Likewise.
444
445 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
446
447         * fchmodat.c: New file, from coreutils.  This was inadvertently
448         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
449
450 2006-08-18  Bruno Haible  <bruno@clisp.org>
451
452         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
453         (ME_DUMMY): Treat "kernfs" as a dummy.
454         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
455
456 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
457
458         Update from coreutils.
459
460         * __fpending.h: Add copyright notice.
461         * fprintftime.h: Likewise.
462         * savedir.c: Use (C) in copyright notice.
463         * savedir.h: Likewise.
464
465         2006-08-15  Jim Meyering  <jim@meyering.net>
466
467         * at-func.c: New file, with the logic of all emulated at-functions.
468         * openat-priv.h: Include <errno.h> and define ENOSYS,
469         in support of the EXPECTED_ERRNO macro.
470         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
471         Instead, define the appropriate symbols and include "at-func.c".
472         * mkdirat.c (mkdirat): Likewise.
473         * fchmodat.c (fchmodat): Likewise.
474         (ENOSYS): Remove definition.
475         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
476         Don't include "unistd--.h" -- it wasn't ever used.
477
478         2006-01-17  Jim Meyering  <jim@meyering.net>
479
480         Rewrite fts.c not to change the current working directory,
481         by using openat, fstatat, fdopendir, etc..
482
483         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
484         (HAVE_OPENAT_SUPPORT): Define.
485         [_LIBC] (fchdir): Don't undef or define; no longer used.
486         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
487         Now, this `function' always succeeds, and consumes its file descriptor
488         parameter -- so callers must not close such FDs.  Update callers.
489         (diropen_fd, opendirat, cwd_advance_fd): New functions.
490         (diropen): Add parameter, SP.  Adjust all callers.
491         Implement using diropen_fd, rather than open.
492         (fts_open): Initialize new member, fts_cwd_fd.
493         Remove fts_rft-setting code.
494         (fts_close): Close fts_cwd_fd, if necessary.
495         (__opendir2): Define in terms of opendir or opendirat,
496         depending on whether the FST_NOCHDIR flag is set.
497         (fts_build): Since fts_safe_changedir consumes its FD, and since
498         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
499         and close the dup'd file descriptor upon failure.
500         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
501         (fts_safe_changedir): Tweak semantics to reflect that this function
502         now calls cwd_advance_fd and hence consumes its FD argument.
503         * fts_.h [struct FTS] (fts_cwd_fd): New member.
504         [struct FTS] (fts_rft): Remove now-unused member.
505         [struct FTS] (fts_cycle.state): Improve comment.
506
507         * openat.c (openat_needs_fchdir): New function.
508         * openat.h (openat_needs_fchdir): Declare it.
509
510 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
511
512         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
513         Problem and fix reported by Pádraig Brady in
514         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
515
516 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
517
518         * memcoll.c (memcoll): Optimize for the common case where the
519         arguments are bytewise equal.
520
521 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
522
523         Change copyright notice from LGPL 2 to GPL 2, since that's the
524         standard form used in the gnulib repository.
525         * lock.c: LGPL -> GPL.
526         * lock.h: Likewise.
527         * strnlen1.c: Likewise.
528         * strnlen1.h: Likewise.
529         * tls.c: Likewise.
530         * tls.h: Likewise.
531         * tmpdir.c: Likewise.
532
533         * TODO: Remove; this belongs only in coreutils.
534
535 2006-08-14  Eric Blake  <ebb9@byu.net>
536
537         Import the following change from libc:
538
539         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
540
541         Upstream bug 2997.
542         * misc/error.c: Add space between program name and message if file
543         name is missing.
544
545 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
546
547         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
548         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
549
550         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
551         in wchar_t.  Problem reported by Eric Blake.
552
553         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
554         LEN is smaller than SIZE.  Suggested by Bruno Haible.
555         Also, help the compiler to keep LEN in a register.
556
557 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
558
559         * .cppi-disable: Add snprintf.h, socket_.h.
560         * snprintf.c: Include <errno.h> and <limits.h>.
561         (EOVERFLOW): Define if the system does not.
562         Do not include "minmax.h"; it wasn't used.
563         (snprintf): Don't assume size_t promotes to an unsigned type.
564         Fix bug when generated string was too long for the buffer: the
565         buffer's contents are supposed to be the initial prefix of the
566         output.  Don't assume vasnprintf returns EOVERFLOW if the size
567         exceeds INT_MAX; do the check ourselves.
568
569         Import the following changes from libc:
570
571         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
572
573         * posix/regex_internal.c (re_string_skip_chars): If no character has
574         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
575         to the byte which couldn't be converted.
576         (re_string_reconstruct): Don't clear valid_raw_len before calling
577         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
578         tip_context using re_string_context_at.
579
580         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
581
582         * posix/regex.h: g++ still cannot handled [restrict].
583
584         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
585
586         * posix/regex.h: Remove special handling for VMS.
587
588 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
589
590         Sync from coreutils.
591
592         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
593
594         * mountlist.c [ME_REMOTE]: Filter out cifs.
595         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
596
597 2006-08-08  Eric Blake  <ebb9@byu.net>
598
599         * verror.c (verror_at_line): Work around glibc bug 2997, so that
600         verror_at_line output complies with GNU Coding Standards even when
601         file is NULL.
602
603 2006-08-08  Eric Blake  <ebb9@byu.net>
604
605         * verror.h, verror.c: New files.
606
607 2006-08-07  Bruno Haible  <bruno@clisp.org>
608
609         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
610         versions of AIX.
611         Reported by Ralf Wildenhues.
612
613 2006-08-06  Eric Blake  <ebb9@byu.net>
614
615         * error.h: Fold in some upstream changes from glibc.
616         * error.c: Likewise.
617
618 2006-07-29  Bruno Haible  <bruno@clisp.org>
619
620         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
621
622 2006-07-29  Bruno Haible  <bruno@clisp.org>
623
624         * setenv.c: Undo unintended modification done on 2006-02-27.
625
626 2006-07-28  Eric Blake  <ebb9@byu.net>
627
628         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
629         macro expansion.
630
631 2006-07-28  Simon Josefsson  <jas@extundo.com>
632
633         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
634         #include's.
635
636 2006-07-28  Simon Josefsson  <jas@extundo.com>
637
638         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
639         #include's.
640
641 2006-07-28  Bruno Haible <bruno@clisp.org>
642
643         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
644
645 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
646
647         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
648         arpa/inet.h.
649
650 2006-07-28  Bruno Haible  <bruno@clisp.org>
651
652         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
653         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
654         fallbacks.
655         Avoids link error on FreeBSD 4.x.
656         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
657
658         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
659         encoding.
660         * mbswidth.c (iswcntrl): Likewise.
661
662 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
663
664         * modechange.c (mode_compile): Numeric modes now affect setuid and
665         setgid on directories only if they set these bits.
666         * modechange.h: Remove obsolete comment about masks.
667
668 2006-07-27  Bruno Haible  <bruno@clisp.org>
669
670         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
671         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
672         defined.
673
674 2006-07-26  Eric Blake  <ebb9@byu.net>
675
676         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
677         like mingw that lack mkstemp.
678         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
679         avoid compilation warning on mingw.
680
681 2006-07-25  Bruno Haible  <bruno@clisp.org>
682
683         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
684         <stdarg.h> or config.h.
685
686 2006-07-24  Bruno Haible  <bruno@clisp.org>
687
688         * clean-temp.h: New file, from GNU gettext.
689         * clean-temp.c: New file, from GNU gettext.
690
691 2006-07-24  Bruno Haible  <bruno@clisp.org>
692
693         * tmpdir.h: New file, from GNU gettext.
694         * tmpdir.c: New file, from GNU gettext.
695
696 2006-07-23  Bruno Haible  <bruno@clisp.org>
697
698         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
699         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
700         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
701         gl_linked_remove_at): Use it.
702
703 2006-07-23  Eric Blake  <ebb9@byu.net>
704
705         * tmpfile-safer.c: New file.
706         * stdio-safer.h (fopen_safer): Add prototype.
707         * stdio--.h (tmpfile): Make safer.
708
709 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
710
711         * close-stream.c, close-stream.h: New files.
712
713 2006-07-22  Bruno Haible  <bruno@clisp.org>
714
715         Merge from GNU gettext 0.15.
716
717         2005-07-05  Bruno Haible  <bruno@clisp.org>
718
719                 * printf-args.c (printf_fetchargs): Work around broken
720                 definition of wint_t on mingw.
721
722         2005-02-12  Bruno Haible  <bruno@clisp.org>
723
724                 * xallocsa.h: Add extern "C" for C++.
725
726         2006-05-17  Bruno Haible  <bruno@clisp.org>
727
728                 Cygwin portability.
729                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
730
731         2006-04-30  Bruno Haible  <bruno@clisp.org>
732
733                 * progreloc.c: Include <mach-o/dyld.h> if available.
734                 (find_executable): Use _NSGetExecutablePath when possible.
735
736         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
737
738                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
739                 function.
740
741         2005-12-29  Bruno Haible  <bruno@clisp.org>
742
743                 * progreloc.c (set_program_name_and_installdir): Fix
744                 compilation error.
745
746         2005-12-04  Bruno Haible  <bruno@clisp.org>
747
748                 Cygwin portability.
749                 * progreloc.c: Include <windows.h> also on Cygwin.
750                 (find_executable): Add support for Cygwin.
751                 (set_program_name_and_installdir): Handle also platforms with
752                 nonempty EXEEXT.
753
754         2006-07-11  Bruno Haible  <bruno@clisp.org>
755
756                 * javacomp.c: Fix a comment.
757                 Reported by Jim Meyering.
758
759         2006-04-30  Bruno Haible  <bruno@clisp.org>
760
761                 * javacomp.h (compile_java_class): Add source_version,
762                 target_version arguments.
763                 * javacomp.c: Rewritten to choose only a compiler that
764                 respects the specified source_version and target_version.
765
766         2006-06-27  Bruno Haible  <bruno@clisp.org>
767
768                 Assume correct S_ISDIR macro.
769                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
770
771         2006-07-22  Bruno Haible  <bruno@clisp.org>
772
773                 * javaversion.h: New file, from GNU gettext.
774                 * javaversion.c: New file, from GNU gettext.
775                 * javaversion.java: New file, from GNU gettext.
776                 * javaversion.class: New file, from GNU gettext.
777
778         2006-05-17  Bruno Haible  <bruno@clisp.org>
779
780                 Cygwin portability.
781                 * javaexec.c (execute_java_class): Test for jview program
782                 also on Cygwin.
783
784         2006-04-09  Bruno Haible  <bruno@clisp.org>
785
786                 * fatal-signal.c: Don't include string.h.
787                 (at_fatal_signal): Use a copying loop instead of memcpy.
788
789         2005-12-04  Bruno Haible  <bruno@clisp.org>
790
791                 * csharpexec.c: Add support for 'clix' launcher (untested).
792                 (execute_csharp_using_sscli): New function.
793                 (execute_csharp_program): Call it.
794
795         2006-06-21  Bruno Haible  <bruno@clisp.org>
796
797                 Avoid warnings from recent versions of mcs.
798                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
799                 -o, -L, -r any more. Use options documented since mcs-1.0
800                 instead. Similarly for -g.
801
802         2005-07-09  Bruno Haible  <bruno@clisp.org>
803
804                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
805                 add a .dll suffix.
806                 Reported by Mark Junker <mjscod@gmx.de>.
807
808         2006-06-17  Bruno Haible  <bruno@clisp.org>
809
810                 * config.charset: Update for NetBSD 3.0.
811
812         2006-05-17  Bruno Haible  <bruno@clisp.org>
813
814                 Cygwin portability.
815                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
816
817         2006-05-16  Bruno Haible  <bruno@clisp.org>
818
819                 * localcharset.c [CYGWIN]: Include <windows.h>.
820                 (get_charset_aliases): For Cygwin, return the same CPxxx
821                 aliases list as under WIN32.
822                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
823                 the environment variables. Fall back to GetACP().
824
825         2006-04-05  Bruno Haible  <bruno@clisp.org>
826
827                 * config.charset: Update Juan Manuel Guerrero's address.
828
829         2005-02-12  Bruno Haible  <bruno@clisp.org>
830
831                 * allocsa.h: Add extern "C" for C++.
832
833         2005-02-10  Bruno Haible  <bruno@clisp.org>
834
835                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
836                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
837
838         2006-07-22  Bruno Haible  <bruno@clisp.org>
839
840                 * gettext.h: Update to GNU gettext-0.15.
841
842 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
843         and Simon Josefsson <jas@extundo.com>
844
845         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
846
847         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
848
849 2006-07-21  Eric Blake  <ebb9@byu.net>
850
851         * stdlib-safer.h: New file from coreutils, required by
852         stdlib--.h.
853
854 2006-07-19  Derek R. Price  <derek@ximbiot.com>
855
856         * getaddrinfo.h: Don't define unimplemented AI_* flags.
857         Reindent and repaginate.
858
859 2006-07-17  Bruno Haible  <bruno@clisp.org>
860
861         * gl_list.h: New file.
862         * gl_list.c: New file.
863         * gl_array_list.h: New file.
864         * gl_array_list.c: New file.
865         * gl_carray_list.h: New file.
866         * gl_carray_list.c: New file.
867         * gl_linked_list.h: New file.
868         * gl_linked_list.c: New file.
869         * gl_anylinked_list1.h: New file.
870         * gl_anylinked_list2.h: New file.
871         * gl_avltree_list.h: New file.
872         * gl_avltree_list.c: New file.
873         * gl_anyavltree_list1.h: New file.
874         * gl_anyavltree_list2.h: New file.
875         * gl_rbtree_list.h: New file.
876         * gl_rbtree_list.c: New file.
877         * gl_anyrbtree_list1.h: New file.
878         * gl_anyrbtree_list2.h: New file.
879         * gl_anytree_list1.h: New file.
880         * gl_anytree_list2.h: New file.
881         * gl_linkedhash_list.h: New file.
882         * gl_linkedhash_list.c: New file.
883         * gl_anyhash_list1.h: New file.
884         * gl_anyhash_list2.h: New file.
885         * gl_avltreehash_list.h: New file.
886         * gl_avltreehash_list.c: New file.
887         * gl_rbtreehash_list.h: New file.
888         * gl_rbtreehash_list.c: New file.
889         * gl_anytreehash_list1.h: New file.
890         * gl_anytreehash_list2.h: New file.
891
892         * gl_oset.h: New file.
893         * gl_oset.c: New file.
894         * gl_array_oset.h: New file.
895         * gl_array_oset.c: New file.
896         * gl_avltree_oset.h: New file.
897         * gl_avltree_oset.c: New file.
898         * gl_rbtree_oset.h: New file.
899         * gl_rbtree_oset.c: New file.
900         * gl_anytree_oset.h: New file.
901
902 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
903
904         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
905         New files.
906         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
907         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
908         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
909         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
910         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
911         callers changed.  Revamp internals significantly, by not
912         attempting to create directories that are temporarily more
913         permissive than the final results.  Do not attempt to use
914         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
915         This removes some race conditions, fixes some bugs, and simplifies
916         things.  Use new dirchownmod function to do owner and mode changes.
917         * mkdir-p.h: Likewise.
918         * modechange.c (octal_to_mode): New function.
919         (struct mode_change): New member mentioned.
920         (make_node_op_equals): New arg mentioned.  All callers changed.
921         (mode_compile): Keep track of which mode bits the user has explicitly
922         mentioned.
923         (mode_adjust): New arg DIR, so that we implement the X op correctly.
924         New arg PMODE_BITS, to keep track of which mode bits the user
925         mentioned; it treats S_ISUID and S_ISGID speciall.
926         All callers changed.
927         * modechange.h: Likewise.
928
929 2006-07-11  Derek R. Price  <derek@ximbiot.com>
930
931         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
932
933 2006-07-10  Derek R. Price  <derek@ximbiot.com>
934
935         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
936         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
937         macros into the GNU _D_EXACT_NAMLEN.
938         * savedir.c:  Likewise.
939         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
940
941 2006-07-09  Jim Meyering  <jim@meyering.net>
942
943         * argp-pv.c: Remove a doubled word in a comment.
944         * check-version.c (check_version): Likewise.
945         * javacomp.c (compile_java_class): Likewise.
946
947 2006-07-08  Jim Meyering  <jim@meyering.net>
948
949         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
950
951 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
952
953         * getaddrinfo.c: Changes to compile under MSVC6: changed
954         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
955         brackets.  Other minor changes to suppress some compiler
956         warnings.
957
958 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
959
960         * getloadavg.c: Use __VMS, not VMS.
961         * getopt.c: Likewise.
962         * getpagesize.h: Likewise.
963         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
964         probably does not work.
965
966 2006-07-06  Derek R. Price  <derek@ximbiot.com>
967         and Paul Eggert  <eggert@cs.ucla.edu>
968
969         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
970         Don't worry about this obsolete case any more.
971         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
972         directories.
973         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
974         worry about this obsolete case any more.
975         * fts.c: Likewise.
976         * getcwd.c: Likewise.
977         * glob.h: Likewise.
978         * savedir.c: Likewise.
979
980 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
981
982         * .cppi-disable: Add wcwidth.
983         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
984         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
985         (ISGRAPH): Remove.  All uses changed to isgraph.
986         (FOLD) [!defined _LIBC]: Remove special case.
987         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
988         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
989         HAVE_ISBLANK.
990         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
991
992 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
993
994         * strtod.c (strtod): cast the argument of tolower to unsigned char.
995
996 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
997
998         * memcasecmp.c: Include <limits.h>.
999         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1000         * strtod.c (strtod): Don't assume isspace works on negative chars.
1001         Don't assume isdigit succeeds only on '0' through '9'.
1002
1003 2006-07-05  Derek R. Price  <derek@ximbiot.com>
1004
1005         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1006         All uses of is_space replaced by isspace.
1007         * exit.h: Don't talk about STDC_HEADERS.
1008         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
1009         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1010         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
1011         replaced by isprint etc.
1012         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1013         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1014         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1015         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1016         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1017         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1018
1019 2006-07-05  Eric Blake  <ebb9@byu.net>
1020
1021         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1022         missing from netdb.h.
1023         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1024
1025 2006-06-27  Bruno Haible  <bruno@clisp.org>
1026
1027         Assume ANSI C header files and <ctype.h> functions.
1028         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1029         (mbsnwidth): Use isprint, iscntrl instead.
1030
1031 2006-07-03  Jim Meyering  <jim@meyering.net>
1032
1033         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1034         macro is used before the first cycle_check call.
1035
1036 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1037
1038         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1039         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
1040         reported by Mark D. Baushke, one in
1041         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1042
1043         Merge from coreutils.
1044
1045         * .cppi-disable: Add stdint_.h.
1046         * .cvsignore: Add stdint.h.
1047
1048         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1049
1050         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1051         both double and long double versions.
1052         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1053         * xstrtold.c: New file.
1054         * xstrtod.h (xstrtold): New decl.
1055
1056         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1057
1058         * filemode.c (setst): Remove.
1059         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1060         (arguably) clearer, and the generated code is a bit smaller on my
1061         Debian GNU/Linux stable x86 host.
1062
1063         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1064
1065         * filemode.c: Include "filemode.h" first, to test the interface.
1066         Assume that filemode.h includes sys/types.h and sys/stat.h.
1067         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1068         (ftypelet): Reorder to put common cases first, for efficiency.
1069         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1070         to do 'M'.
1071         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1072         of 10, for compatibility with FreeBSD.  All callers changed.
1073         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1074         that can't be deduced solely from st_mode.  First arg is now a const
1075         pointer.
1076         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1077         (strmode): Renamed from mode_string.
1078         (filemodestring): New decl.
1079         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1080         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1081         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1082
1083         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1084
1085         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1086         fsusage.h now does that.  Include fsusage.h first, to test interface.
1087         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1088         at most one method (the old code could have generated decls that
1089         didn't conform to C89, not that this was ever exercised).
1090         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1091
1092         2006-03-19  Jim Meyering  <jim@meyering.net>
1093
1094         Work even in a chroot where d_ino values for entries in "/"
1095         don't match the stat.st_ino values for the same names.
1096         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1097         number, iterate through all entries again, using lstat instead.
1098         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1099         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1100
1101         * getcwd.c (__getcwd): Clarify a comment.
1102         Use memcpy in place of a call to strcpy.
1103
1104         2006-03-12  Jim Meyering  <jim@meyering.net>
1105
1106         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1107         that of the current directory (which we're about to chdir ".." out of),
1108         then save the dev-ino of the parent, instead.
1109
1110         * same-inode.h (SAME_INODE): New file/macro.
1111         * chdir-safer.c (SAME_INODE): Remove definition.
1112         Include "same-inode.h", instead.
1113         * same.c: Likewise.
1114         * cycle-check.h: Include "same-inode.h".
1115         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1116         * cycle-check.c (SAME_INODE): Remove definition.
1117         * root-dev-ino.h: Include "same-inode.h".
1118
1119         2006-03-11  Eric Blake  <ebb9@byu.net>
1120
1121         * same.c (same_name): s/base_name/last_component/
1122         * backupfile.c (check_extension, numbered_backup): Likewise.
1123         * filenamecat.c (file_name_concat): Likewise.
1124
1125         2006-03-11  Eric Blake  <ebb9@byu.net>,
1126                     Paul Eggert  <eggert@cs.ucla.edu>
1127
1128         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1129         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1130         drive prefix.
1131         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1132         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1133         (last_component): New method.
1134         * dirname.c (dir_len): Determine when drive letters need a
1135         subsequent slash.  Preserve // when it is special.
1136         (dir_name): Don't append dot when drive letter is absolute.
1137         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1138         * basename.c (base_name): New semantics - malloc the result.
1139         Preserve // when it is special.  Preserve relative files that look
1140         like drive letters.
1141         (base_len): Preserve // when it is special.
1142         (last_component): New method, similar to old base_name semantics.
1143         * stripslash.c (strip_trailing_slashes): Use last_component, not
1144         base_name.  Strip redundant slashes from ///.
1145
1146 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1147
1148         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1149         both are 64 bits, since this seems to be the tradition, and this
1150         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1151         we ever run into a host that prefers long long to long in this
1152         case, we'll need another configure-time test.  Problem reported by
1153         Jim Meyering.
1154
1155 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1156
1157         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1158         possible collision with system files.
1159         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1160         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1161         WCHAR_MIN and WCHAR_MAX in this case.
1162         (<stddef.h>): Do not include; no longer needed.
1163         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1164         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1165         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1166         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1167         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1168         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1169         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1170         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1171         !defined(__c99))]: Include in this case too, since it's harmless
1172         now.
1173         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1174         dangerous to do so.
1175         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1176         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1177         (_STDINT_MIN, _STDINT_MAX): New macros.
1178         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1179         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1180         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1181         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1182         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1183         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1184         macros, not typedefs; this simplifies things quite a bit.
1185         Use long int for all types narrower than int64_t.
1186         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1187         Define in terms of long long int or int64_t or long int,
1188         not int64_t or int32_t.  This saves some compile-time testing.
1189         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1190         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1191         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1192         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1193         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1194         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1195         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1196         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1197         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1198         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1199         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1200         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1201         undef any previous version and define our own version, for
1202         simplicity and consistency with the new macros for types.
1203         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1204         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1205         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1206         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1207         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1208         @WINT_T_SUFFIX@ to keep things simple here.
1209         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1210         Simplify by assuming typical 8/16/32/64 host, since we're
1211         already doing that elsewhere anyway.
1212         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1213         and assume long long int is 64 bits if available.  This
1214         speeds up 'configure'.
1215
1216 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1217
1218         * getaddrinfo.c: fixed typo
1219
1220 2006-06-29  Eric Blake  <ebb9@byu.net>
1221
1222         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1223         unused static function.
1224
1225 2006-06-29  Eric Blake  <ebb9@byu.net>
1226
1227         * stat_.h: New file.
1228
1229 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1230
1231         * strftime.c: Assume strftime() exists.
1232
1233 2006-06-28  Bruno Haible  <bruno@clisp.org>
1234
1235         * getaddrinfo.h: Fix POSIX URL.
1236         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1237         (use_win32_p): Make static.
1238         (getaddrinfo): Reject service name if it is empty or does not consist
1239         solely of decimal digits, or if its value is > 65535.
1240         (getnameinfo): Remove useless casts.
1241
1242 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1243
1244         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1245         Autoconf 2.60 says this stuff was obsolete.
1246
1247 2006-05-12  Bruno Haible  <bruno@clisp.org>
1248
1249         * mkdtemp.c [MINGW]: Include <io.h>.
1250         (mkdir): Define using _mkdir.
1251
1252 2006-06-28  Bruno Haible  <bruno@clisp.org>
1253
1254         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1255         declaration for wcwidth.
1256         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1257
1258 2006-06-28  Eric Blake  <ebb9@byu.net>
1259
1260         * xvasprintf.h: Fix comments.
1261
1262 2006-06-28  Eric Blake  <ebb9@byu.net>
1263
1264         * mbchar.h (wcwidth): Include wcwidth.h.
1265         * mbswidth.c (wcwidth): Move from here...
1266         * wcwidth.h: ...to this new file.
1267
1268 2006-06-28  Simon Josefsson  <jas@extundo.com>
1269
1270         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1271         functions there.  It will succeed on Windows XP, but on Windows
1272         2000 and (presumably) earlier, it will fail, and use the internal
1273         re-implementation.
1274         (use_win32_p): New function.
1275         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1276         Support AI_NUMERICSERV to disable getservbyname.
1277         (getnameinfo): New function, only supports
1278         NI_NUMERICHOST|NI_NUMERICSERV for now.
1279
1280         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1281         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1282         getnameinfo.
1283
1284 2006-06-27  Bruno Haible  <bruno@clisp.org>
1285
1286         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1287
1288 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1289
1290         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1291         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1292         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1293
1294 2006-06-26  Bruno Haible  <bruno@clisp.org>
1295
1296         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1297         WCHAR_MAX.
1298         Reported by Mark D. Baushke and Larry Jones.
1299
1300 2006-06-26  Bruno Haible  <bruno@clisp.org>
1301
1302         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1303         in pre-C99 mode.
1304         Suggested by Mark D. Baushke and Larry Jones.
1305
1306 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1307
1308         * stdint_.h: Treat BSD/OS like OpenBSD.
1309
1310 2006-06-23  Bruno Haible  <bruno@clisp.org>
1311
1312         * stdint_.h: Treat IRIX like OpenBSD.
1313
1314 2006-06-23  Bruno Haible  <bruno@clisp.org>
1315
1316         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1317         ISO C 99 Technical Corrigendum 1.
1318
1319 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1320
1321         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1322         Some compiler complained about some of them.  Problem reported by
1323         Larry Jones in
1324         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1325
1326 2006-06-21  Simon Josefsson  <jas@extundo.com>
1327
1328         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1329         variable.
1330
1331         * socket_.h: Don't define WINVER.
1332
1333         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1334         slightly modified to work in gnulib.
1335
1336 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1337
1338         * read-file.c (fread_file): Start with buffer allocation of
1339         0 bytes rather than 1 byte; this simplifies the code.
1340         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1341         code to free buffer and save/restore errno.
1342         (internal_read_file): Remove unused local.
1343
1344 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1345
1346         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1347         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1348         Problem reported by Denis Excoffier in
1349         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1350
1351 2006-06-19  Simon Josefsson  <jas@extundo.com>
1352
1353         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1354
1355 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1356
1357         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1358
1359 2006-06-17  Bruno Haible  <bruno@clisp.org>
1360
1361         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1362
1363 2006-06-17  Bruno Haible  <bruno@clisp.org>
1364
1365         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1366         problem on Solaris 2.5.1.
1367
1368 2006-06-16  Eric Blake  <ebb9@byu.net>
1369
1370         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1371         * unicodeio.c [!defined errno]: Likewise.
1372         * strtol.c [!defined errno]: Likewise.
1373         * strtod.c [!defined errno]: Likewise.
1374
1375 2006-06-15  Bruno Haible  <bruno@clisp.org>
1376
1377         * stdint_.h: Rewritten to be fully auto-configured.
1378         Fixes bug on HP-UX/IA64.
1379
1380 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1381
1382         * getdate.y (__attribute__): Don't define if already defined.
1383         Problem reported by Larry Jones.
1384         * utimens.c (__attribute__): Likewise.
1385
1386 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1387
1388         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1389         reported by Andreas Schwab.
1390
1391 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1392             Bruno Haible  <bruno@clisp.org>
1393
1394         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1395
1396 2006-05-26  Martin Lambers  <marlam@marlam.de>
1397
1398         * getpass.c: Updates the test for the native W32 API, and adds
1399         missing includes, thus fixing compilation warnings.
1400
1401 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1402
1403         * tempname.c (small_open, large_open): New macros.
1404         (__open, __open64) [!_LIBC]: Remove.
1405         (__gen_tempname): Use small_open and large_open instead of __open
1406         and __open64.  This fixes a portability bug on HP-UX 11.11i
1407         reported by Simon Wing-Tang in
1408         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1409
1410 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1411
1412         * exclude.c (exclude_fnmatch): New function.
1413         (excluded_file_name): Call exclude_fnmatch.
1414         * exclude.h (excluded_file_name): New prototype
1415
1416 2006-05-24  Bruno Haible  <bruno@clisp.org>
1417
1418         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1419         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1420         Reported by Thorsten Maerz <torte@netztorte.de> via
1421         Aaron Stone <aaron@serendipity.cx>.
1422
1423 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1424
1425         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1426         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1427         (my_usleep): Don't mishandle maximum value.
1428
1429 2006-05-19  Jim Meyering  <jim@meyering.net>
1430
1431         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1432
1433 2006-05-17  Bruno Haible  <bruno@clisp.org>
1434
1435         Cygwin portability.
1436         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1437
1438 2006-05-17  Bruno Haible  <bruno@clisp.org>
1439
1440         * stdint_.h: Fix recognition of Cygwin.
1441
1442 2006-05-11  Jim Meyering  <jim@meyering.net>
1443
1444         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1445
1446 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1447
1448         * crc.c (crc32_update): Remove unnecessary L suffix.
1449         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1450         unwanted sign propagation, e.g., on hosts with 64-bit int.
1451         There still are some problems with reeelly weird theoretical hosts
1452         (e.g., 33-bit int) but it's not worth worrying about now.
1453         * sha1.c (rol): Likewise.
1454         (K1, K2, K3, K4): Remove unnecessary L suffix.
1455
1456 2006-05-10  Bruno Haible  <bruno@clisp.org>
1457
1458         * des.c: Cast to avoid warnings.
1459
1460 2006-05-10  Simon Josefsson  <jas@extundo.com>
1461
1462         * md4.c: Typo fix, update copyright years.
1463         (K1, K2): Don't use L because it turn computations into 64-bit on
1464         64-bit platforms.
1465
1466 2006-05-09  Bruno Haible  <bruno@clisp.org>
1467
1468         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1469         (EOVERFLOW): Define fallback value.
1470         (xstrcat): New function.
1471         (xvasprintf): Recognize the special case of a string concatenation.
1472
1473 2006-05-01  Bruno Haible  <bruno@clisp.org>
1474
1475         * stdint_.h: Shorter URL.
1476         * inttypes.h: Likewise.
1477
1478 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1479
1480         * verify.h: Document the internals better.  Most of this change
1481         was written by Bruno Haible.
1482
1483 2006-04-29  Bruno Haible  <bruno@clisp.org>
1484
1485         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1486         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1487
1488 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1489
1490         * getdate.y (get_date): When adding relative date, start with the
1491         initial time, not with the result of the first mktime call.
1492
1493 2006-04-23  Bruno Haible  <bruno@clisp.org>
1494
1495         * copy-file.c: Include <unistd.h> unconditionally.
1496         * execute.c: Likewise.
1497         * fatal-signal.c: Likewise.
1498         * findprog.c: Likewise.
1499         * mkdtemp.c: Likewise.
1500         * pipe.h: Likewise.
1501         * pipe.c: Likewise.
1502         * wait-process.h: Likewise.
1503
1504 2006-04-23  Bruno Haible  <bruno@clisp.org>
1505
1506         * fwriteerror.c (fwriteerror): Call fclose also when an error
1507         condition was already detected.
1508         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1509
1510 2006-04-19  Derek Price  <derek@ximbiot.com>
1511             Eric Blake  <ebb9@byu.net>
1512
1513         * inttypes.h: Correct grammar in comment.
1514
1515 2006-04-18  Derek Price  <derek@ximbiot.com>
1516             Paul Eggert  <eggert@cs.ucla.edu>
1517
1518         * inttypes.h: New file.
1519         * strtoimax.c: Assume <inttypes.h>.
1520
1521 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1522
1523         * utimens.c (futimens): glibc futimesat messes up if /proc
1524         isn't mounted.  Problem reported by Kir Kolyshkin.
1525
1526 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1527
1528         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1529         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1530         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1531
1532 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1533
1534         Merge regex changes from libc, removing some of our
1535         POSIX-conformance changes that were rejected and redoing them in a
1536         less-intrusive way.
1537
1538         * regcomp.c (re_compile_internal, init_dfa):
1539         Length arg is now size_t, not Idx.  All uses changed.
1540         (peek_token): Forward decl now says internal_function.
1541         (__re_error_msgid, __re_error_msgid_idx):
1542         Now static rather than extern with attribute_hidden.
1543         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1544         For some reason libc prefers K&R style defns for external functions.
1545         (regerror) [!defined _LIBC]: Likewise.
1546         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1547         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1548         (build_range_exp, build_collating_symbol):
1549         Use K&R-style defn.
1550         (re_compile_fastmap): Use '\0' to memset, not 0.
1551         (utf8_sb_map): Make the calculations more obvious.
1552         (init_dfa, parse_bracket_exp, build_charclass_op):
1553         Call calloc and cast result, as glibc does.
1554         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1555         (build_range_exp, build_collating_symbol):
1556         Now internal functions.
1557
1558         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1559
1560         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1561         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1562         Don't depend on VMS; depend on __VMS instead, for POSIX
1563         namespace cleanness.
1564         (regoff_t): Define to ssize_t, not long int.
1565
1566         Remove the REG_ macros named below.  Instead, make the old names
1567         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1568         __USE_GNU_REGEX.
1569         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1570         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1571         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1572         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1573         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1574         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1575         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1576         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1577         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1578         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1579         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1580         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1581         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1582         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1583         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1584         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1585         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1586         (REG_NREGS):
1587         Remove.  All uses replaced by the old RE_* names.
1588         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1589         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1590         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1591         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1592         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1593         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1594         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1595         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1596         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1597         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1598         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1599         Don't bother having these macros be independent of each others'
1600         values, since they no longer exist in the POSIX name space.
1601
1602         Rename the following member names back to their old names,
1603         unless !__USE_GNU_REGEX.  All uses changed back.
1604         (buffer): Renamed from re_buffer.
1605         (allocated): Renamed from re_allocated.
1606         (used): Renamed from re_used.
1607         (syntax): Renamed from re_syntax.
1608         (fastmap): Renamed from re_fastmap.
1609         (translate): Renamed from re_translate.
1610         (can_be_null): Renamed from re_can_be_null.
1611         (regs_allocated): Renamed from re_regs_allocated.
1612         (fastmap_accurate): Renamed from re_fastmap_accurate.
1613         (no_sub): Renamed from re_no_sub.
1614         (not_bol): Renamed from re_not_bol.
1615         (not_eol): Renamed from re_not_eol.
1616         (newline_anchor): Renamed from re_newline_anchor.
1617         (num_regs): Renamed from rm_num_regs.
1618         (start): Renamed from rm_start.
1619         (end): Renamed from rm_end.
1620
1621         (free_state): Move up a bit.
1622
1623         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1624         #define to be empty.
1625         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1626         when that is what is intended.
1627         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1628         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1629         (MAX): New macro.
1630         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1631         All uses changed back to re_malloc, etc.  It's now the caller's
1632         responsibility to check for overflow; all callers changed.
1633         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1634         (re_x2nrealloc): Remove.
1635         (free_state): Remove decl.
1636
1637         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1638         (re_set_registers, re_exec):
1639         Use K&R-style defn.
1640
1641         2006-01-31  Roland McGrath  <roland@redhat.com>
1642
1643         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1644         Reported by Mike Frysinger <vapier@gentoo.org>.
1645
1646         2006-01-15  Andreas Jaeger  <aj@suse.de>
1647
1648         [BZ #1950]
1649         * regex_internal.c (re_string_reconstruct): Adjust for
1650         build_wcs_upper_buffer change.
1651         (build_wcs_upper_buffer): Change return type.
1652
1653         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1654
1655         * regex_internal.h: Include <stdint.h> if available.
1656
1657         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1658
1659         * regex_internal.h (SIZE_MAX): Provide a default definition.
1660
1661         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1662
1663         * regcomp.c: Adjust for changed secondary hash function.
1664
1665         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1666
1667         * regex.h: Pretty printing.
1668         Clean up namespace a bit.
1669
1670         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1671
1672         * regexec.c (update_cur_sifted_state, check_arrival,
1673         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1674
1675         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1676                     Ulrich Drepper  <drepper@redhat.com>
1677
1678         [BZ #1302]
1679         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1680         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1681
1682         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1683
1684         [BZ #281]
1685         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1686         * regcomp.c: Remove unnecessary uses of
1687         unsigned RE_TRANSLATE_TYPE.
1688         * regex_internal.h: Likewise.
1689         * regex_internal.c: Likewise.
1690         * regexec.c: Likewise.
1691         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1692
1693         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1694
1695         * regexec.c (find_recover_state): Remove unnecessary
1696         initialization.
1697         (transit_state_bkref): Make DFA a const pointer.
1698         (get_subexp): Likewise.
1699         (check_arrival): Likewise.
1700         (update_cur_sifted_state): Likewise.
1701         (re_search_internal): Likewise.
1702         (prune_impossible_nodes): Likewise.
1703         (acquire_init_state_context): Likewise.
1704         (proceed_next_node): Likewise.
1705         (set_regs): Likewise.
1706         (free_fail_stack_return): Likewise.
1707         (check_arrival_expand_ecl): Mark DFA parameter as const.
1708         (check_arrival_expand_ecl_sub): Likewise.
1709         (check_subexp_limits): Likewise.
1710         (sub_epsilon_src_nodes):  Likewise.
1711         (add_epsilon_src_nodes):  Likewise.
1712         (merge_state_array): Likewise.
1713         (update_regs): Likewise.
1714         (build_trtable): Likewise.
1715         (sift_states_backward): Mark MCTX parameter as const.
1716         (build_sifted_states): Likewise.
1717         (update_cur_sifted_state): Likewise.
1718         (sift_states_mkref): Likewise.
1719         (check_arrival_expand_ecl): Mark eclosure as const.
1720         (check_dst_limits_calc_pos_1): Likewise.
1721         * regex_internal.h (re_match_context_t): Make dfa a const
1722         pointer.
1723
1724         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1725
1726         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1727         (transit_state_sb): Likewise.
1728         (transit_state_mb): Likewise.
1729         (sift_states_iter_mb): Likewise.
1730         (check_arrival_add_next_nodes): Likewise.
1731         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1732         [_LIBC] (re_search_2_stub): Use mempcpy.
1733
1734         * regex_internal.c (re_string_reconstruct): Avoid calling
1735         mbrtowc for very simple UTF-8 case.
1736
1737         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1738         a pointer-to-const.
1739         (re_acquire_state_context): Likewise.
1740         * regex_internal.h: Adjust prototypes.
1741
1742         * regex.c: Prevent using C++ compilers.
1743
1744         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1745         (re_acquire_state_context): Likewise.
1746
1747 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1748             Bruno Haible  <bruno@clisp.org>
1749
1750         * stdint_.h: On OpenBSD, don't redefine types already included in
1751         <sys/types.h> and <inttypes.h>.
1752
1753 2006-03-24  Eric Blake  <ebb9@byu.net>
1754
1755         * time_r.c (copy_string_result): Remove, as it is no longer used.
1756
1757 2006-03-24  Simon Josefsson  <jas@extundo.com>
1758
1759         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1760         including some doc fixes.
1761         (base64_encode_alloc): Fix +1 bug on allocation failures.
1762
1763 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1764
1765         * base64.c (base64_encode): Do not read past end of array with
1766         unsanitized input on systems with CHAR_BIT > 8.
1767
1768 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1769
1770         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1771         Typedef to long int, not to off_, as POSIX will likely change
1772         in that direction.
1773
1774 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1775
1776         * argp-help.c (validate_uparams): Fix typo
1777         * argp-parse.c (argp_default_options): Consistently begin help
1778         messages with a lowercase letter.
1779
1780 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1781
1782         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1783         overrun buffers and shouldn't be used (much as gets shouldn't be
1784         used).
1785         * time_r.c (asctime_r, ctime_r): Likewise.
1786
1787 2006-03-08  Simon Josefsson  <jas@extundo.com>
1788
1789         * gc-gnulib.c (randomize): Don't open files called 'no', they
1790         signal that configure disabled the device.
1791
1792 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1793
1794         * c-stack.c: Include unistd.h unconditionally, since we now assume
1795         the unistd module.
1796         * getlogin_r.c: Likewise.
1797         * getlogin_r.h: Likewise.
1798         * glob.c: Likewise.
1799         * pagealign_alloc.c: Likewise.
1800         * unistd_.h: Remove; no longer needed.
1801
1802 2006-03-07  Simon Josefsson  <jas@extundo.com>
1803
1804         * unistd_.h: New file.
1805
1806 2006-03-07  Simon Josefsson  <jas@extundo.com>
1807
1808         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1809
1810 2006-03-01  Simon Josefsson  <jas@extundo.com>
1811
1812         * readline.c: Fix typo, tiny patch from Stepan Kasal
1813         <kasal@ucw.cz>.
1814
1815 2006-02-28  Simon Josefsson  <jas@extundo.com>
1816
1817         * getopt.c: Protect #include of unistd.h, for MSVS.
1818
1819 2006-02-27  Simon Josefsson  <jas@extundo.com>
1820
1821         * base64.h: Indent #define's.  From Jim Meyering
1822         <jim@meyering.net>.
1823
1824 2006-02-27  Jim Meyering  <jim@meyering.net>
1825
1826         Revert the change of 2006-02-24, so these files can continue
1827         to be sync'd from gettext.
1828         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1829         of `config.h'.
1830
1831 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1832
1833         * glob.c: Say "invalid" rather than "illegal" in comments.
1834
1835 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1836
1837         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1838
1839 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1840
1841         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1842         AT_FDCWD exceeds INT_MAX.
1843         * openat.h (AT_FDCWD): Likewise.
1844
1845 2006-02-14  Jim Meyering  <jim@meyering.net>
1846
1847         Sync from coreutils.
1848
1849         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1850         failure on deficient systems, and simplify gnulib lgpl dependencies.
1851         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1852         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1853
1854         * xalloc-die.c: Remove unused definition of N_.
1855
1856 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1857
1858         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1859
1860 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1861
1862         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1863         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1864
1865 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1866
1867         * argp-namefrob.h: Restore changes accidentally lost during the
1868         "autoupdate" on 2005-12-12.
1869
1870 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1871
1872         * fnmatch.c (L_): Renamed from L, to work around a bug in
1873         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1874         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1875         All uses changed.
1876
1877 2006-01-26  Simon Josefsson  <jas@extundo.com>
1878
1879         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1880         prototype is visible on mingw32.
1881
1882         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1883         for mingw32.
1884
1885         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1886         mingw32).
1887
1888 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1889
1890         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1891         attempt to open for write; this always fails, at least on POSIX
1892         hosts.  This reinstates the 2006-01-09 change, which was
1893         inadvertently removed.
1894
1895 2006-01-26  Bruno Haible  <bruno@clisp.org>
1896             Paul Eggert  <eggert@cs.ucla.edu>
1897
1898         * stdbool_.h (_Bool)
1899         [(! (defined __cplusplus || defined __BEOS__)
1900           && !defined __GNUC__
1901           && !(defined __HP_cc || defined __xlc__
1902                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1903                || defined __sgi))]:
1904         #define to signed char in these cases too; this simplifies
1905         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1906         etc., separately) and makes it more conservative.
1907
1908 2006-01-21  Jim Meyering  <jim@meyering.net>
1909
1910         Sync from the stable (b5) branch of coreutils:
1911
1912         * fts.c (fts_children): Don't let close() clobber errno from
1913         failed fchdir().
1914
1915         * fts.c (fts_stat): When following a symlink-to-directory,
1916         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1917         a dangling symlink.  That can also happen at least for ELOOP.
1918         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1919         FYI, this bug predates the inclusion of fts.c in coreutils.
1920
1921         * fts.c (fts_open): Put new maxarglen declaration and uses
1922         in their own block, so pre-c99 compilers don't object.
1923
1924         Avoid the double-free (first in fts_read, second in fts_close) that
1925         would occur when an `active' directory is made inaccessible (e.g.,
1926         via chmod a-x) during a traversal.
1927         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1928         before returning.  Reproduce this failure by
1929         mkdir -p a/b; cd a; chmod a-x . b
1930         Reported by Stavros Passas.
1931
1932 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1933
1934         * argp-namefrob.h: Bugfix. Remove stray #
1935
1936 2006-01-25  Bruno Haible  <bruno@clisp.org>
1937
1938         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1939         warnings.
1940         Reported by Paul Eggert.
1941
1942 2006-01-25  Jim Meyering  <jim@meyering.net>
1943
1944         * fileblocks.c: Remove more useless parentheses.
1945         * readutmp.h: Likewise.
1946
1947 2006-01-24  Bruno Haible  <bruno@clisp.org>
1948
1949         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1950         has it.
1951         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1952         2005-11-26.
1953
1954         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1955         to avoid problems with the built-in _Bool type.
1956         Reported by Paul Eggert on 2005-11-26.
1957
1958 2006-01-24  Jim Meyering  <jim@meyering.net>
1959
1960         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1961
1962 2006-01-24  Simon Josefsson  <jas@extundo.com>
1963
1964         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1965         Bruno.
1966
1967 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1968
1969         Work around porting bugs reported by Dieter in
1970         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1971         * getopt.c (_NOPROTO): Remove; no longer needed.
1972         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1973         Include "getopt.h" first, to check interface.
1974         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1975         !HAVE_DECL_GETENV.
1976         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1977         (__strndup): Revert to K&R-style function dfns, the glibc style.
1978         * strnlen.c: Don't claim it's taken from glibc; it's not.
1979         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1980         Include strnlen.h first, to get prototype properly.
1981         (strnlen): Renamed from __strnlen.
1982         Remove weak alias.
1983
1984 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1985
1986         These changes imported from libc.
1987         * getopt.c: Use __fxprintf instead of inline stream orientation
1988         test and two separate function calls.
1989         * strndup.c (__strndup): Add libc_hidden_def.
1990
1991 2006-01-22  Bruno Haible  <bruno@clisp.org>
1992
1993         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1994         temporary buffer for sprintf, take into account the precision also
1995         for 'd', 'i', 'u', 'o', 'x', 'X'.
1996
1997 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1998
1999         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2000         to pacify gcc -Wswitch-default.
2001
2002 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2003
2004         * argp-help.c (usage_long_opt): Do not print DOC options.
2005         (__argp_base_name): Removed
2006         * argp-namefrob.h (__argp_basename): Removed definition. Was a
2007         typo.
2008         (__argp_base_name): Provide macro definition or extern declaration
2009         depending on the configuration
2010
2011 2006-01-20  Simon Josefsson  <jas@extundo.com>
2012
2013         * inet_ntop.h: Unconditionally include sys/socket.h.
2014
2015 2006-01-19  Simon Josefsson  <jas@extundo.com>
2016
2017         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2018
2019 2006-01-12  Simon Josefsson  <jas@extundo.com>
2020
2021         * base64.c: Fix warning, reported by Bruno Haible
2022         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2023
2024 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2025
2026         Sync from coreutils.
2027         * md5.c: Fix commentary typos.
2028         (alignof, UNALIGNED_P): No need for a GCC-specific version.
2029         * md5.h (__attribute__): Remove; unused.
2030         * sha1.c: Fix commentary to match md5 better.
2031         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2032         so that we don't need to worry about alignment.  All uses changed.
2033         This merges the 2005-10-28 md5 change into sha1.
2034
2035 2006-01-11  Jim Meyering  <jim@meyering.net>
2036
2037         Sync from coreutils.
2038         * md5.c (OP): Fix spacing.
2039
2040 2006-01-11  Simon Josefsson  <jas@extundo.com>
2041
2042         * stdint_.h (SIZE_MAX): Add missing (.
2043
2044 2006-01-10  Bruno Haible  <bruno@clisp.org>
2045
2046         * argp.h (__const): Remove macro. Use const instead.
2047         * argp-fmtstream.h (__const): Likewise.
2048         * glob_.h (__const): Remove macro.
2049         * glob-libc.h: Use const instead of __const.
2050
2051 2006-01-10  Jim Meyering  <jim@meyering.net>
2052
2053         Avoid the double-free (first in fts_read, second in fts_close) that
2054         would occur when an `active' directory is made inaccessible (e.g.,
2055         via chmod a-x) during a traversal.
2056         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2057         before returning.  Reproduce this failure by
2058         mkdir -p a/b; cd a; chmod a-x . b
2059         Reported by Stavros Passas.
2060
2061         Sync from coreutils.
2062         * sha1.c: Tweak grammar in a comment.
2063
2064 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2065
2066         * regex_internal.h (BITSET_WORD_BITS):
2067         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2068         preprocessor mishandles large unsigned values as if they were signed.
2069         Problem reported by Claudio Fontana in
2070         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2071
2072 2006-01-10  Simon Josefsson  <jas@extundo.com>
2073
2074         * socket_.h: New file.
2075
2076 2006-01-10  Bruno Haible  <bruno@clisp.org>
2077
2078         * localcharset.c: Update from GNU gettext.
2079
2080 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2081
2082         Sync from coreutils.
2083         * chdir-long.c (cdb_free): Don't bother trying to open directory
2084         for write access: POSIX says that must fail.
2085         * fts.c (diropen): Likewise.
2086         * save-cwd.c (save_cwd): Likewise.
2087         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2088         well, for minor improvements on hosts that lack O_DIRECTORY.
2089         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2090         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2091         Fall back on chown if open failed with EACCES.
2092
2093         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2094         Report an error at compile-time if only a 1-second nominal clock
2095         resolution is found.
2096
2097         * lchmod.h: New file.
2098         * mkdir-p.c: Include lchmod.h, lchown.h.
2099         (make_dir_parents): Use lchown rather than chown, and
2100         lchmod rather than chmod.
2101
2102         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2103         too.  Problem with "none" reported by Bob Proulx.  Problem with
2104         "proc" reported by n0dalus.
2105
2106         * mountlist.c: Include <limits.h>.
2107         (dev_from_mount_options)
2108         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2109         New function.  It no longer assumes "dev=" has the System V meaning
2110         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2111         (read_file_system_list)
2112         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2113         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2114         dev= in that case.
2115
2116         * posixtm.h (PDS_PRE_2000): New macro.
2117         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2118         All usages changed.  Reject dates outside the range 1969-1999 if
2119         PDS_PRE_2000 is used.
2120
2121 2006-01-09  Jim Meyering  <jim@meyering.net>
2122
2123         Sync from coreutils.
2124
2125         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2126
2127         * chdir-safer.h, chdir-safer.c: New files.
2128
2129         * modechange.c (mode_compile): Reject an invalid mode string
2130         that starts with an octal digit.  From Andreas Gruenbacher.
2131
2132         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2133         and dup to open_safer and dup_safer, respectively.
2134         (openat_permissive): Fix typo in comment.
2135
2136         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2137         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2138         (_): Remove; no longer needed.
2139         (openat): Renamed from rpl_openat; no need for rpl_openat
2140         since openat.h renames openat for us.
2141         Replace most of the body with a call to openat_permissive,
2142         to avoid duplicate code.
2143         Port to (probably hypothetical) environments were mode_t is
2144         wider than int.
2145         (openat_permissive): Require mode arg, so that we can check
2146         types better.  Put it just after flags.  Change cwd failure
2147         indicator from pointer-to-bool to pointer-to-errno-value.
2148         All callers changed.
2149         Invoke openat_save_fail and/or openat_restore_fail if
2150         cwd_errno is null, so that openat can call us.
2151         (openat_permissive, fdopendir, fstatat, unlinkat):
2152         Simplify errno handling to avoid some duplicate code,
2153         as it's OK to set errno on success.
2154         * openat.h: Revamp code so that function macros depend on
2155         __OPENAT_PREFIX only, not also on AT_FDCWD.
2156         (openat_ro): Remove.  Caller changed to use openat_permissive.
2157         (openat_permissive): Now a macro, if not a function.
2158         (openat_restore_fail, openat_save_fail): Now always functions,
2159         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2160
2161         * openat-priv.h: New file, defining macros used by mkdirat.c
2162         and openat.c.
2163         * mkdirat.c: Include openat-priv.h.
2164         Remove definitions of macros defined therein.
2165         * openat.c: Likewise.
2166
2167         * mkdirat.c (mkdirat): New file and function.
2168         * openat.h (mkdirat): Declare.
2169
2170         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2171
2172         * openat.h (openat_permissive): Declare.
2173         (openat_ro): Define.
2174
2175         * openat.c (EXPECTED_ERRNO): New macro.
2176         (openat_permissive): New function -- used in remove.c rewrite.
2177         (all functions): Set errno just before returning, only if there
2178         was an actual failure.
2179         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2180
2181         Emulate openat-family functions using Linux's procfs, if possible.
2182         Idea and some code based on Ulrich Drepper's glibc changes.
2183
2184         * openat.c: (BUILD_PROC_NAME): New macro.
2185         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2186         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2187         before falling back on save_cwd and restore_cwd.
2188         (fdopendir, fstatat, unlinkat): Likewise.
2189
2190         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2191         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2192
2193         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2194         as second argument to va_arg.  Otherwise, some versions of gcc
2195         warn that `if this code is reached, the program will abort'.
2196
2197 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2198
2199         Sync from coreutils.
2200
2201         Add POSIX ACL support
2202         * acl.h (copy_acl, set_acl): Add declarations.
2203         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2204         systems other than Linux.
2205         (chmod_or_fchmod): New function: use fchmod when possible,
2206         and chmod otherwise.
2207         (file_has_acl): Add a POSIX ACL implementation, with a
2208         Linux-specific subcase.
2209         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2210         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2211         acls are unsupported.
2212         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2213         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2214         are unsupported.
2215
2216 2006-01-09  Bruno Haible  <bruno@clisp.org>
2217
2218         * sysexit_.h (EX_OK): New macro.
2219         Suggested by Martin Lambers <marlam@marlam.de>.
2220
2221 2006-01-09  Bruno Haible  <bruno@clisp.org>
2222
2223         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2224         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2225         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2226         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2227
2228 2006-01-09  Bruno Haible  <bruno@clisp.org>
2229
2230         * stdint_.h (SIZE_MAX): Write the value without involving negative
2231         numbers.
2232
2233 2005-10-16  Bruno Haible  <bruno@clisp.org>
2234
2235         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2236         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2237
2238 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2239
2240         * strftime.c (tzname): Don't declare if it is already #defined.
2241         Problem reported for Mingw by Mark Junker.
2242
2243 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2244
2245         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2246         long int, not int, for nanosecond counts, so that people who are
2247         used to POSIX struct timespec won't be surprised.  Reported by Jim
2248         Meyering.
2249
2250 2005-12-16  Jim Meyering  <jim@meyering.net>
2251
2252         * fprintftime.c, fprintftime.h: New files.
2253
2254 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2255
2256         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2257         * argp-help.c (fill_in_uparams): Check if the constructed
2258         struct uparams is valid. Fall back to the default values if it is
2259         not.
2260
2261 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2262
2263         * argp-help.c (__argp_base_name): New function
2264         (__argp_short_program_name): Rewrite using __argp_base_name
2265         * argp-namefrob.h: Define program_invocation_name and
2266         program_invocation_short_name if requested
2267         (__argp_base_name): Add prototype
2268         * argp-parse.c (argp_def): Use gettext wrappers
2269         (argp_default_parser): Use __argp_base_name
2270         * argp-pin.c: New file. Defines program_invocation_name and
2271         program_invocation_short_name on systems that lack them.
2272
2273 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2274
2275         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2276         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2277         porting problem reported by Georg Schwarz in
2278         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2279
2280 2005-07-09  Bruno Haible  <bruno@clisp.org>
2281
2282         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2283         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2284         Reported by Mark Junker <mjscod@gmx.de>.
2285
2286 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2287
2288         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2289         (uintmax_t) [defined uintmax_t]: Do not declare.
2290         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2291         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2292         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2293         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2294         sake of portability to weird hosts that C allows (though we don't
2295         know of any practical examples).
2296
2297         * savedir.h (fdsavedir): New decl.
2298         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2299         contains most of the former guts of savedir.
2300         (savedir): Use savedirstream.
2301         Include "openat.h".
2302
2303 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2304
2305         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2306         coreutils no longer futzes with rounding modes.
2307
2308 2005-11-14  Jim Meyering  <jim@meyering.net>
2309
2310         * mkstemp-safer.c: Include <config.h>, required for possible
2311         replacement of mkstemp.
2312
2313 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2314
2315         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2316         business.
2317         (gethrxtime) [! (HAVE_NANOUPTIME
2318         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2319         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2320         our own approximation.
2321
2322 2005-11-10  Simon Josefsson  <jas@extundo.com>
2323
2324         * readline.c: Remove EOL.
2325
2326 2005-11-08  Eric Blake  <ebb9@byu.net>
2327
2328         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2329
2330 2005-11-08  Eric Blake  <ebb9@byu.net>
2331
2332         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2333
2334 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2335
2336         Fix porting problem reported by Theodoros V. Kalamatianos.
2337         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2338         Don't assume that futimes failing means we must fail.
2339
2340 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2341
2342         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2343         leave errno alone.  Problem reported by Dmitry V. Levin.
2344
2345 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2346
2347         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2348         errno alone.  Problem reported by Frederic Jolliton.
2349
2350 2005-10-28  Simon Josefsson  <jas@extundo.com>
2351
2352         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2353         "restrict" keywords, as per POSIX.  Protect the function
2354         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2355         Don't use K&R prototypes.  Check the sprintf return values.
2356         Re-define EAFNOSUPPORT if not present.  Indent.
2357
2358         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2359         suggested by Bruno Haible <bruno@clisp.org>.
2360
2361         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2362
2363         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2364
2365         * gc-libgcrypt.c: Add MD2 (which is not available through
2366         libgcrypt).
2367
2368         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2369
2370         * md2.h, md2.c: New files.
2371
2372 2005-10-24  Simon Josefsson  <jas@extundo.com>
2373
2374         * md4.h: Shrink buffer size, now that we changed the type.
2375
2376 2005-10-22  Simon Josefsson  <jas@extundo.com>
2377
2378         * arcfour.h, arcfour.c: Use fixed size indices in the
2379         arcfour_context struct (simplify test vector testing in GNU
2380         Shishi).
2381
2382 2005-10-22  Simon Josefsson  <jas@extundo.com>
2383
2384         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2385         suggested by Bruno Haible <bruno@clisp.org>.
2386
2387 2005-10-22  Simon Josefsson  <jas@extundo.com>
2388
2389         * crc.h: Include stddef.h, for size_t.
2390
2391 2005-10-21  Simon Josefsson  <jas@extundo.com>
2392
2393         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2394         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2395
2396 2005-10-21  Simon Josefsson  <jas@extundo.com>
2397
2398         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2399         block.
2400
2401 2005-10-21  Simon Josefsson  <jas@extundo.com>
2402
2403         * gc-gnulib.c: Support ARCTWO in CBC mode.
2404
2405 2005-10-21  Simon Josefsson  <jas@extundo.com>
2406
2407         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2408         <bruno@clisp.org>.
2409
2410         * hmac-sha1.c (hmac_sha1): Likewise.
2411
2412         * crc.c (crc32_update): Actually use crc parameter, suggested by
2413         Bruno Haible <bruno@clisp.org>.
2414
2415         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2416         <bruno@clisp.org>.
2417
2418 2005-10-21  Simon Josefsson  <jas@extundo.com>
2419
2420         * des.h, des.c: New files.
2421
2422         * gc-gnulib.c: Support DES.c
2423
2424 2005-10-21  Simon Josefsson  <jas@extundo.com>
2425
2426         * arctwo.h, arctwo.c: New files.
2427
2428         * gc-gnulib.c: Support ARCTWO.
2429
2430 2005-10-21  Simon Josefsson  <jas@extundo.com>
2431
2432         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2433
2434 2005-10-19  Simon Josefsson  <jas@extundo.com>
2435
2436         * gc-gnulib.c: Support ARCFOUR.
2437
2438 2005-10-19  Simon Josefsson  <jas@extundo.com>
2439
2440         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2441         support.
2442
2443         * gc.h: Add ECB enum type.
2444
2445         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2446
2447 2005-10-19  Simon Josefsson  <jas@extundo.com>
2448
2449         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2450
2451 2005-10-18  Simon Josefsson  <jas@extundo.com>
2452
2453         * md4.h, md4.c: New files, based on md5.?.
2454
2455 2005-10-17  Simon Josefsson  <jas@extundo.com>
2456
2457         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2458
2459         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2460
2461 2005-10-17  Simon Josefsson  <jas@extundo.com>
2462
2463         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2464
2465 2005-10-17  Simon Josefsson  <jas@extundo.com>
2466
2467         * gc.h, gc-libgcrypt.c: Add ciphers.
2468
2469 2005-10-17  Simon Josefsson  <jas@extundo.com>
2470
2471         * sha1.c: Use uint32_t instead of md5_uint32.t
2472
2473         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2474         md5.h.
2475
2476         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2477
2478         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2479
2480 2005-10-15  Simon Josefsson  <jas@extundo.com>
2481
2482         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2483
2484         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2485
2486 2005-10-14  Simon Josefsson  <jas@extundo.com>
2487
2488         * arcfour.h, arcfour.c: New files.
2489
2490 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2491
2492         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2493         include <wchar.h>; no longer needed.
2494
2495 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2496         and  Ulrich Drepper  <drepper@redhat.com>
2497
2498         Import from libc.
2499         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2500         instead of inline stream orientation test and two separate
2501         function calls.  Pay no attention to USE_IN_LIBIO.
2502
2503 2005-10-14  Roland McGrath  <roland@redhat.com>
2504
2505         Import from libc.  [BZ #1331]
2506         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2507         macro argument.
2508         Reported by Matej Vela <vela@debian.org>.
2509
2510 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2511
2512         * mkdir-p.c (make_dir_parents): Don't report an error if an
2513         intermediate directory is in a read-only file system.  Problem
2514         reported by Eric Blake.
2515
2516 2005-10-13  Simon Josefsson  <jas@extundo.com>
2517
2518         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2519         Move memory allocation outside of loop.
2520
2521 2005-10-12  Simon Josefsson  <jas@extundo.com>
2522
2523         * gc-pbkdf2-sha1.c: New file.
2524
2525         * gc.h: Add gc_pbkdf2_sha1 prototype.
2526
2527 2005-10-12  Simon Josefsson  <jas@extundo.com>
2528
2529         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2530         suggested by Bruno Haible <bruno@clisp.org>.
2531
2532 2005-10-12  Simon Josefsson  <jas@extundo.com>
2533
2534         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2535
2536         * gc-gnulib.c (gc_hmac_sha1): New function.
2537
2538 2005-10-12  Simon Josefsson  <jas@extundo.com>
2539
2540         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2541
2542 2005-10-12  Simon Josefsson  <jas@extundo.com>
2543
2544         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2545         GC_USE_HMAC_MD5, respectively.
2546
2547         * gc-libgcrypt.c (gc_md5): Fix assert call.
2548         (gc_md5): Fix typo.
2549
2550         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2551
2552         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2553
2554         * gc-gnulib.c (gc_hash_buffer): Ditto.
2555
2556 2005-10-11  Bruno Haible  <bruno@clisp.org>
2557
2558         * c-strcasestr.h: New file, from GNU gettext.
2559         * c-strcasestr.c: New file, from GNU gettext.
2560
2561 2005-10-11  Bruno Haible  <bruno@clisp.org>
2562
2563         * c-strcase.h: New file, from GNU gettext.
2564         * c-strcasecmp.c: New file, from GNU gettext.
2565         * c-strncasecmp.c: New file, from GNU gettext.
2566
2567 2005-10-11  Simon Josefsson  <jas@extundo.com>
2568
2569         * crc.h, crc.c: New files.
2570
2571         * gc.h (gc_hash_buffer): Add doc.
2572
2573 2005-10-08  Simon Josefsson  <jas@extundo.com>
2574
2575         * gc.h: Add gc_hash and gc_hash_buffer.
2576
2577         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2578
2579         * gc-libgcrypt.c (gc_hash_buffer): Add.
2580
2581 2005-10-11  Bruno Haible  <bruno@clisp.org>
2582
2583         * strcasecmp.c: Include limits.h.
2584         (strcasecmp): Avoid integer overflow on exotic platforms.
2585         * strncasecmp.c: Include limits.h.
2586         (strncasecmp): Avoid integer overflow on exotic platforms.
2587         Reported by Paul Eggert.
2588
2589 2005-10-06  Simon Josefsson  <jas@extundo.com>
2590
2591         * hmac-md5.c: New file.
2592
2593         * hmac.h: New file.
2594
2595 2005-10-06  Simon Josefsson  <jas@extundo.com>
2596
2597         * memxor.c (memxor): Avoid casts and warnings.
2598
2599 2005-10-05  Derek Price  <derek@ximbiot.com>
2600
2601         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2602
2603 2005-10-05  Simon Josefsson  <jas@extundo.com>
2604
2605         * memxor.c (memxor): Fix compiler error.
2606
2607         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2608         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2609
2610         * memxor.h, memxor.c: New files.
2611
2612         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2613         we assume all systems have it, suggested by Jim Meyering
2614         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2615         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2616         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2617         same reasons.
2618
2619 2005-10-04  Bruno Haible  <bruno@clisp.org>
2620
2621         * verify.h (verify_true): Provide alternative definition for C++.
2622
2623 2005-10-04  Simon Josefsson  <jas@extundo.com>
2624
2625         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2626         D. Baushke" <mdb@gnu.org>.
2627
2628 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2629
2630         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2631         (SSIZE_MAX): New macro, if not already defined.
2632         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2633         than 2 GiB.
2634
2635 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2636
2637         * exclude.c: Include verify.h.
2638         (verify): Remove.  All callers changed to use verify.h's version.
2639         * strtoimax.c: Likewise.
2640         * utimecmp.c: Likewis.e
2641
2642         Sync from coreutils.
2643         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2644         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2645         * .cvsignore: Add fts.h, search.h, t-fpending.
2646         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2647         bother returning ENOSYS if settimeofday or stime fails; just let
2648         them return whatever errno they want to return.
2649         * utimens.c: Include unistd.h, for dup2.
2650         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2651         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2652
2653 2005-10-02  Jim Meyering  <jim@meyering.net>
2654
2655         Sync from coreutils.
2656         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2657         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2658         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2659         Remove AT_FDCWD test.
2660         Do not consume the fd unless successful.
2661         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2662         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2663         block, so that we don't even try to compile it if settimeofday is
2664         available.  This works around a compilation failure on OSF1 V5.1,
2665         due to stime requiring a `long int*' while tv_sec is `int'.
2666
2667 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2668
2669         * getdelim.c (getdelim): Remove unused variables.
2670
2671 2005-10-01  Simon Josefsson  <jas@extundo.com>
2672
2673         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2674         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2675         AI_* and EAI_* definitions.  Protect function declarations.
2676
2677 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2678
2679         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2680         so that the code works even with ancient cpp.  Portability problem
2681         with GCC 2.7.2.1 reported by Thomas M.Ott.
2682
2683 2005-09-27  Jim Meyering  <jim@meyering.net>
2684
2685         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2686
2687         * intprops.h (signed_type_or_expr__): Define.
2688         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2689         for unsigned types.
2690
2691 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2692
2693         * verify.h (verify_expr): Remove, replacing with:
2694         (verify_true): New macro that returns true instead of void.
2695         (verify_type__): Remove.
2696         (verify): Use verify_true rather than verify_type__.
2697
2698 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2699
2700         * utimens.c (ENOSYS): Define if not already defined.
2701         (futimens): Support having a null PATH if the file descriptor
2702         is nonnegative.
2703
2704         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2705         Remove.
2706         (__attribute): Define to empty unless GCC 3.1 or later.
2707         This works around a core dump on OpenBSD 3.4, which has GCC
2708         2.95.3, which dumps core when given __attribute__(()).  It also
2709         simplifies other tests, since we really don't want to bother with
2710         worrying about which ancient version of GCC supported what.
2711         Original problem reported by Yoann Vandoorselaere, with part of
2712         the fix suggested by Derek Price.
2713
2714 2005-09-24  Jim Meyering  <jim@meyering.net>
2715
2716         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2717         so we can once again use a positive bitfield width of 1 -- now we
2718         don't have to explain why we were using a bitfield width of 2.
2719
2720 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2721
2722         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2723         Problem reported by Eric Blake.
2724         (getaddrinfo): Initialize se so that it's not garbage.
2725         Redo internal storage allocation so that it doesn't make unportable
2726         assumptions about alignment.
2727         Fix a memory leak.
2728
2729         * utimens.c (futimens): Use futimesat if available.
2730         Prefer it to futimes since it doesn't have the futimes bug.
2731
2732         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2733         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2734         Instead, declare a function that returns a pointer to an array,
2735         and use verify_type__ to declare the size of the array.
2736         Problem and germ of a solution reported by Bruno Haible.
2737         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2738         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2739
2740 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2741
2742         Sync from coreutils.
2743
2744         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2745         stat-time.h.
2746         * argmatch.h: Include verify.h
2747         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2748         (ARGMATCH_ASSERT): Remove; unused.
2749         * canonicalize.c: Assume STDC_HEADERS.
2750         * exclude.c: Include "strcase.h".
2751         * regex_internal.h [!defined _LIBC]: Likewise.
2752         * getusershell.c: Include stdio--.h rather than stdio.h
2753         and stdio-safer.h.
2754         (getusershell): Call fopen, not fopen_safer.
2755         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2756         Do not include unistd-safer.h.
2757         (save_cwd): Don't call fd_safer; no longer needed
2758         now that we include fcntl--.h.
2759
2760         * getdate.y (relative_time): New type.
2761         (RELATIVE_TIME_0): New constant.
2762         (parser_control): Use relative_time instead of doing it ourselves.
2763         (%union): Add new relative_time rel member.
2764         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2765         Now typeless.
2766         (relunit, relunit_snumber): Now of type rel.
2767         (zone, rel, relunit, get_date): Adjust to above changes.
2768
2769         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2770         Do not include unistd-safer.h.
2771         (getloadavg): Don't call fd_safer; no longer needed
2772         now that we include fcntl--.h.
2773
2774         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2775         (make_dir_parents): Treat ENOSYS like EEXIST.
2776
2777         Improve quality of diagnostics on restore_cwd failure.
2778         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2779         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2780         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2781         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2782         each time through the loop.  Do not diagnose restore_cwd failure;
2783         that is the caller's job (and perhaps the caller does not care).
2784
2785         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2786         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2787         If the file already exists but is not a directory, don't bother
2788         to try to make its parents.
2789         Close potential file descriptor leak if we can't chdir("/") (!).
2790         Don't always return true if chdir($PWD) fails; return true only
2791         if the requested action was done successfully (except for the
2792         chdir($PWD)).
2793         Don't log final directory unless we actually made it.
2794         Refactor to avoid duplicate code to fix up permissions.
2795         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2796
2797         * strftime.c (my_strftime): Rewrite the previous change slightly,
2798         to make it a bit faster and (I hope) clearer.
2799         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2800         Fix bug in formats like %2N.
2801
2802         * verify.h: New file.
2803
2804 2005-09-22  Jim Meyering  <jim@meyering.net>
2805
2806         Sync from coreutils.
2807
2808         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2809
2810         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2811         the .tm_year member, since otherwise gcc-4.0 would now warn about
2812         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2813
2814         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2815         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2816
2817         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2818         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2819         when run in a time zone for which daylight savings time is in effect
2820         for the starting date.
2821
2822         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2823         stop us from restricting permissions of just-created absolute-named
2824         directories.
2825         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2826         to restore initial working directory.
2827         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2828         to tell caller if/when we change the working directory and are
2829         unable to return to the initial one.
2830         * mkdir-p.h (make_dir_parents): Update prototype.
2831         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2832         `return false'.  This fixes a bug introduced on 2004-07-30.
2833
2834         * openat.c (fdopendir): Be sure to close the supplied
2835         file descriptor before returning.  This makes our replacement
2836         implementation a little closer to Solaris's, where fdopendir
2837         ties the file descriptor to the returned DIR* pointer.
2838         * openat.c (unlinkat): New function.
2839         * openat.h (unlinkat): Add prototype.
2840         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2841         (openat_restore_fail): Rename from openat_restore_die.
2842         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2843
2844         Provide an alternative to exiting immediately upon save_cwd or
2845         restore_cwd failure.  Now, an application can arrange e.g.,
2846         to perform a longjump in that case.
2847         * openat.c: Include dirname.h.
2848         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2849         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2850         and openat_restore_die rather than calling error directly.
2851         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2852
2853         * openat-die.c (openat_save_die, openat_restore_die): New file.
2854         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2855
2856         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2857         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2858                             int utc, int nanoseconds);
2859         Background:
2860         date should not have to allocate a megabyte of virtual memory to
2861         handle a format argument like +%1048575T.  When implemented with
2862         strftime, it must allocate such a buffer, use strftime to fill it
2863         in, print it, then free it.
2864         With fprintftime, it simply prints everything and exits.
2865         With no need for memory allocation, that's one fewer way to fail.
2866         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2867         optional field width, not before, so we accept %9:z, not %:9z.
2868         (my_strftime): Be sure to use L_('x') for literals.
2869
2870         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2871         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2872         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2873         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2874         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2875         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2876         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2877         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2878         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2879
2880         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2881         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2882         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2883         and don't include <sys/file.h>).
2884
2885 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2886
2887         Sync from coreutils.
2888
2889         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2890         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2891         [!LDAV_DONE]: Avoid unused variable warning.
2892
2893 2005-09-21  Bruno Haible  <bruno@clisp.org>
2894
2895         * unicodeio.h (unicode_to_mb): New declaration.
2896
2897 2005-09-20  Derek Price  <derek@ximbiot.com>
2898
2899         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2900
2901 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2902
2903         Use a consistent style for including <config.h>.
2904         * __fpending.c, acl.c, argmatch.c,
2905         argp-help.c, argp-parse.c,
2906         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2907         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2908         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2909         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2910         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2911         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2912         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2913         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2914         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2915         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2916         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2917         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2918         modechange.c, mountlist.c, open-safer.c, physmem.c,
2919         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2920         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2921         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2922         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2923         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2924         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2925         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2926         userspec.c, utimecmp.c, version-etc-fsf.c,
2927         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2928         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2929         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2930         Standardize inclusion of config.h.
2931         * __fpending.h, dirfd.h, getdate.h, human.h,
2932         inttostr.h:  Removed inclusion of config.h from header files.
2933         * inttostr.c:  Adjusted in-tree users.
2934         * timespec.h: Remove superfluous warning to include config.h.
2935         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2936         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2937         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2938         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2939
2940 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2941
2942         * stat-time.h: New file.
2943         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2944         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2945         in a different way.
2946         (timespec_cmp): New function.
2947         * utimecmp.c: Include stat-time.h.
2948         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2949         members exist, not on the obsolescent ST_MTIM_NSEC.
2950         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2951
2952 2005-09-15  Derek Price  <derek@ximbiot.com>
2953             Paul Eggert  <eggert@cs.ucla.edu>
2954
2955         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2956         changes, consolidating in...
2957         * regex_internal.h: ...this file.
2958
2959 2005-09-15  Derek Price  <derek@ximbiot.com>
2960
2961         * regex_internal.h: Blank `pure' for GNUC < 3.
2962         * regex_internal.c: Ditto, using this...
2963         (__GNUC_PREREQ): ...new macro.
2964         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2965         (__GNUC_PREREQ): ...this new macro.
2966
2967         * strstr.h: Include string.h. Define strstr as a macro here.
2968
2969 2005-09-13  Derek Price  <derek@ximbiot.com>
2970
2971         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2972         failure.
2973         Reported by Jim Meyering  <jim@meyering.net>.
2974
2975 2005-09-13  Jim Meyering  <jim@meyering.net>
2976
2977         * canon-host.c: Filter through gnu indent and reword comments slightly.
2978         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2979
2980 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2981
2982         * base64.c: Typo.
2983         (base64_encode): Put b64str in initialized data section.
2984
2985 2005-09-12  Derek Price  <derek@ximbiot.com>
2986
2987         Return usable errors from canon-host.
2988         * canon-host.h: New file.
2989         * canon-host.c (canon_host): Wrap...
2990         (canon_host_r): ...this new function, which now relies exclusively on
2991         getaddrinfo.
2992         (ch_strerror): New function.
2993         (last_cherror): New global.
2994         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2995         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2996         void *.
2997         (freeaddrinfo): Free ai->ai_canonname when set.
2998
2999 2005-09-12  Derek Price  <derek@ximbiot.com>
3000             Paul Eggert  <eggert@cs.ucla.edu>
3001
3002         * glob-libc.h: Renamed from glob_.h.  The new version is
3003         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3004         protecting things that should be done only in gnulib contexts.
3005         * glob_.h: New file, containing only the glob things needed for
3006         gnulib.
3007         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
3008         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3009         (glob, globfree, glob_pattern_p): Now defined simply in terms of
3010         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3011         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3012         and to respect the namespace rules better.
3013
3014 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3015
3016         Merge glibc and coreutils changes into gnulib, plus a few
3017         extra fixes.
3018         * md5.c: Use #error rather than a string.
3019         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
3020         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3021         (__attribute__): Define to empty for non recent-GCC.
3022         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3023         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3024         Renamed from their non-__ counterparts, with new macros replacing
3025         them if not _LIBC.  Add __THROW attribute.
3026         (rol): Remove.
3027         (struct md5_ctx): Align buffer if using GCC.
3028         * sha1.h (struct sha1_ctx): Likewise.
3029         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
3030         The old name was backwards.
3031         (NOTSWAP): Remove; not used.
3032         (rol): New macro, moved here from md5.h.
3033         (sha1_process_block): Remove a FIXME that doesn't make sense.
3034
3035 2005-09-12  Derek Price  <derek@ximbiot.com>
3036
3037         * gai_strerror.c: Include config.h when available.  Include
3038         getaddrinfo.h before other headers to test interface.
3039         Reported by Larry Jones <lawrence.jones@ugs.com>.
3040
3041 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3042
3043         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3044         definitions, since that's the preferred style in glibc.
3045         Fix a minor spacing issue, and update copyright notice to match glibc's.
3046
3047 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3048
3049         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3050
3051 2005-09-06  Simon Josefsson  <jas@extundo.com>
3052
3053         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3054         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3055
3056 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3057
3058         Change bitset word type from unsigned int to unsigned long int,
3059         as this has better performance on typical 64-bit hosts.
3060         Port bitset code to hosts with unusual word sizes.
3061         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3062         (build_collating_symbol):
3063         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3064         argument is a bitset.  This is merely a style issue, but it makes
3065         it clearer that an entire array is expected.
3066         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3067         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3068         Port to the case where bitset_word is not the same as unsigned int.
3069         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3070         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3071         Likewise.
3072         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3073         (build_trtable, group_nodes_into_DFAstates):
3074         Likewise.
3075         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3076         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3077         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3078         * regexec.c (group_nodes_into_DFAstates): Likewise.
3079         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3080         * regcomp.c (optimize_subexps, lower_subexp):
3081         Work even if bitset_word has holes in its bitwise representation.
3082         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3083         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3084         Likewise.
3085         * regex_internal.c (re_string_reconstruct):
3086         Don't assume UCHAR_MAX == 255.
3087         * regex_internal.h (bitset_set_all): Likewise.
3088         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3089         All uses changed.
3090         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3091         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3092         All uses changed.
3093         (BITSET_WORD_MAX): New macro.
3094         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3095         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3096         (bitset_empty, bitset_copy):
3097         Prefer sizeof (bitset) to multiplying it out ourselves.
3098         (bitset_not_merge): Remove; unused.
3099         (bitset_contain): Return bool, not unsigned int with one bit on.
3100         All callers changed.
3101         * regexec.c (build_trtable): Don't assume bitset has no stricter
3102         alignment than re_node_set; do this by defining a new internal
3103         type struct dests_alloc and using it to allocate memory.
3104
3105 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3106
3107         Check for arithmetic overflow when calculating sizes, to prevent
3108         some buffer-overflow issues.  These patches are conservative, in the
3109         sense that when I couldn't determine whether an overflow was possible,
3110         I inserted a run-time check.
3111         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3112         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3113         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3114         (re_xnrealloc, re_x2nrealloc): New inline functions.
3115         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3116         (build_equiv_class, build_charclass): Check for arithmetic overflow
3117         in size expression calculations.
3118         * regex_internal.c (re_string_realloc_buffers):
3119         (build_wcs_upper_buffer, re_node_set_add_intersect):
3120         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3121         (re_dfa_add_node, register_state): Likewise.
3122         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3123         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3124         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3125         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3126
3127 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3128
3129         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3130         to avoid a collision with bits/local_lim.h in glibc.
3131         All uses changed.  Problem reported by Dmitry V. Levin in
3132         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3133
3134         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3135         bugs in int versus size_t comparisons.
3136         (re_string_context_at): Fix bug where the code assumed that
3137         Idx is signed.
3138
3139         Use bool where appropriate.
3140         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3141         All callers changed.
3142         (calc_eclosure_iter): Likewise, for ROOT arg.
3143         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3144         (build_charclass_op): Likewise, for NON_MATCH arg.
3145         * regex_internal.c (re_string_allocate, re_string_construct):
3146         (re_string_construct_common): Likewise, for ICASE arg.
3147         * regexec.c (re_search_2_stub, re_search_stub):
3148         Likewise, for RET_LEN arg.
3149         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3150         (set_regs): Likewise, for FL_BACKTRACK arg.
3151         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3152         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3153         (calc_eclosure_iter, parse_bracket_exp):
3154         Use bool for internal variables that are booleans.
3155         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3156         (set_regs, build_sifted_states, sift_states_bkref):
3157         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3158         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3159         (find_collation_sequence_value):
3160         Likewise.
3161         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3162         (re_node_set_compare):
3163         Return bool, not int. All callers changed.
3164         * regexec.c (check_halt_node_context, check_dst_limits):
3165         (build_trtable, check_node_accept): Likewise.
3166         * regex_internal.h: Include stdbool.h.
3167
3168         Fix bugs uncovered when converting to bool.
3169         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3170         failure instead of charging ahead blindly.
3171         * regex_internal.c (register_state): Likewise.
3172         * regexec.c (re_search_2_stub): Use simpler method than boolean
3173         for freeing internal storage.
3174         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3175         bitset pieces used as boolean, to avoid undefined behavior
3176         on hosts that do int overflow checking.
3177
3178 2005-08-31  Derek Price  <derek@ximbiot.com>
3179
3180         * getdelim.c (getdelim): Return EOF on EOF.
3181         Reported by Larry Jones <lawrence.jones@ugs.com>.
3182
3183 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3184
3185         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3186         lengths fit in regoff_t; this isn't true if regoff_t is the same
3187         width as size_t.
3188         * regex.c (re_search_internal): 5th arg is LAST_START
3189         (= START + RANGE) instead of RANGE.  This avoids overflow
3190         problems when regoff_t is the same width as size_t.
3191         All callers changed.
3192         (re_search_2_stub): Check for overflow when adding the
3193         sizes of the two strings.
3194         (re_search_stub): Check for overflow when adding START
3195         to RANGE; if it occurs, substitute the extreme value.
3196
3197 2005-08-31  Jim Meyering  <jim@meyering.net>
3198
3199         * regcomp.c (search_duplicated_node): Make first pointer arg
3200         a pointer-to-const.
3201         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3202         (register_state): Likewise.
3203         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3204         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3205         (group_nodes_into_DFAstates): Likewise.
3206
3207 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3208
3209         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3210         old glibc regex code mishandles strings longer than 2**31 bytes.
3211         This patch fixes this when the regex code is used in gnulib
3212         (i.e., outside glibc).
3213
3214         This patch should not affect the use of the regex code inside
3215         glibc.  No doubt this problem also needs to be handled for glibc
3216         as well, but the result will be an incompatible change to the
3217         glibc ABI, and the old ABI will have to be supported too.  That
3218         can be the the subject for another patch.
3219
3220         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3221         governing whether the rest of this patch is active.  By default,
3222         the macro is disabled and the patch has no effect.
3223         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3224         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3225         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3226         (re_match_2, re_set_registers): Use the new types.
3227         * regex_internal.h (Idx, re_hashval_t): New types.
3228         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3229         New macros.
3230         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3231         (re_string_context_at, bin_tree_t, re_dfastate_t):
3232         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3233         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3234         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3235         (re_string_char_size_at, re_string_wchar_at):
3236         (re_string_elem_size_at):
3237         Use the new types and macros to port to 64-bit hosts.
3238         Use unsigned types for internal values, so that the code
3239         mostly works even for arrays larger than SSIZE_MAX.
3240         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3241         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3242         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3243         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3244         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3245         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3246         (calc_inveclosure, parse_dup_op, build_range_exp):
3247         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3248         (fetch_number, create_token_tree, mark_opt_subexp):
3249         Likewise.
3250         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3251         (create_cd_newstate, re_string_allocate, re_string_construct):
3252         (re_string_realloc_buffers, build_wcs_upper_buffer):
3253         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3254         (re_string_reconstruct, re_string_peek_byte_case):
3255         (re_string_fetch_byte_case, re_string_context_at):
3256         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3257         (re_node_set_init_copy, re_node_set_add_intersect):
3258         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3259         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3260         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3261         (re_acquire_state, re_acquire_state_context, register_state):
3262         Likewise.
3263         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3264         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3265         (re_search_internal, re_search_2_stub, re_search_stub)
3266         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3267         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3268         (update_cur_sifted_state, check_dst_limits):
3269         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3270         (check_subexp_limits, sift_states_bkref, merge_state_array):
3271         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3272         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3273         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3274         (expand_bkref_cache, check_node_accept_bytes):
3275         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3276         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3277         (acquire_init_state_context, check_halt_node_context):
3278         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3279         (sift_states_backward, clean_state_log_if_needed):
3280         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3281         (find_recover_state, transit_state_sb, transit_state_mb):
3282         (transit_state_bkref, build_trtable, match_ctx_clean):
3283         Likewise.
3284         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3285         to work around an assumption that REG_MISSING is negative.
3286
3287         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3288         (seek_collating_symbol_entry) [defined _LIBC]:
3289         (lookup_collation_sequence_value) [defined _LIBC]:
3290         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3291         Use prototypes rather than old-style function definitions.
3292         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3293         (transit_state_sb) [0]:
3294         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3295
3296         * regexec.c (re_search_internal): Simplify update of rm_so and
3297         rm_eo.
3298
3299         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3300         (optimize_subexps, lower_subexp):
3301         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3302         since the signed shift might overflow.  Use 1u<<31 instead.
3303         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3304         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3305         Likewise.
3306
3307         * regcomp.c (optimize_subexps, lower_subexp):
3308         Use CHAR_BIT rather than 8, for clarity.
3309         * regexec.c (check_dst_limits_calc_pos_1):
3310         (check_subexp_matching_top): Likewise.
3311         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3312         have to worry about portability issues when shifting it left.
3313         Remove no-longer-needed test for table_size > 0.
3314         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3315         in a word, as the resulting behavior is undefined.
3316         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3317         in one case, a <= should have been an <, and in another case the
3318         whole test was missing.
3319         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3320         the standard name CHAR_BIT.
3321         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3322         this is not true on one's complement and signed-magnitude hosts.
3323
3324         * regex_internal.h (re_sub_match_top_t): Remove unused member
3325         next_last_offset.
3326         (struct re_dfa_t): Remove unused member states_alloc.
3327         * regcomp.c (init_dfa): Don't initialize unused members.
3328
3329 2005-08-31  Bruno Haible  <bruno@clisp.org>
3330
3331         * strstr.c: Include <stddef.h>, for NULL.
3332         * strcasestr.c: Likewise.
3333         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3334
3335 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3336
3337         * iconvme.h: Add prototype for iconv_alloc.
3338
3339 2005-08-29  Simon Josefsson  <jas@extundo.com>
3340
3341         * iconvme.c: Fix errno.
3342
3343 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3344
3345         * iconvme.c: Split iconv_string into iconv_alloc.
3346
3347 2005-08-27  Jim Meyering  <jim@meyering.net>
3348
3349         * fopen-safer.c: Merge minor changes from coreutils.
3350         * dup-safer.c: Likewise.
3351         * fd-safer.c: Likewise.
3352
3353         Merge from coreutils.
3354         * stdio--.h: New file.
3355         * stdlib--.h: New file.
3356         * mkstemp-safer.c: New file.
3357
3358         GNU tar needs these.
3359         * pipe-safer.c: New file.
3360         * creat-safer.c: New file.
3361         * fcntl--.h (creat): Define to creat_safer.
3362         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3363         * unistd--.h (pipe): Define to pipe_safer.
3364         * unistd-safer.h: Declare pipe_safer.
3365
3366 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3367
3368         * regex_internal.h: Remove all references to
3369         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3370         or better.
3371         (bitset_not, bitset_merge, bitset_not_merge):
3372         (bitset_mask, re_string_allocate, re_string_construct):
3373         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3374         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3375         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3376         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3377         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3378         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3379         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3380         (re_acquire_state_context):
3381         Remove unnecessary forward decls.
3382         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3383         Put __attribute at function definition,
3384         now that the function decl has been removed.
3385         * regex_internal.c (re_string_peek_byte_case):
3386         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3387         Likewise.
3388
3389 2005-08-26  Simon Josefsson  <jas@extundo.com>
3390
3391         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3392         Haible <bruno@clisp.org>.
3393
3394 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3395
3396         * regexec.c (set_regs): Don't alloca with an unbounded size.
3397
3398         alloca modernization/simplification for regex.
3399         * regex.c: Remove portability cruft for alloca.  This no longer
3400         needs to be at the start of the file, and can be moved into
3401         regex_internal.h and simplified.
3402         * regex_internal.h: Include <alloca.h>.
3403         (__libc_use_alloca) [!defined _LIBC]: New macro.
3404         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3405         now works outside glibc.
3406
3407 2005-08-24  Simon Josefsson  <jas@extundo.com>
3408
3409         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3410         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3411         GLIBC specific code.
3412
3413 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3414
3415         Make regex safe for g++.  This fixes one real bug (an "err"
3416         that should have been "*err").  g++ problem reported by
3417         Sam Steingold.
3418         * regex_internal.h (re_calloc): New macro, consistent with
3419         re_malloc etc.  All callers of calloc changed to use re_calloc.
3420         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3421         not int.  All callers changed.
3422         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3423         just use an array of size MB_LEN_MAX.
3424         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3425         (find_recover_state): Change "err" to "*err"; this fixes what
3426         appears to be a real bug.
3427         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3428         versus int.
3429
3430 2005-08-25  Jim Meyering  <jim@meyering.net>
3431
3432         * open-safer.c: Include <config.h>.
3433         Otherwise, we'd lose LARGEFILE support in any file using
3434         e.g. "fcntl--.h"
3435
3436 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3437
3438         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3439         * regex.h (regerror): Likewise.
3440
3441         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3442         requires this.  (The code never needed it.)
3443
3444         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3445         All uses of recently-renamed identifiers changed to use the new,
3446         POSIX-compliant names.  The code will build and run just fine
3447         without these changes, but it's better to eat our own dog food
3448         and use the standard-conforming names.
3449
3450         * regex.h: Fix a multitude of POSIX name space violations.
3451         These changes have an effect only for programs that define
3452         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3453         do not change anything for programs compiled in the normal way.
3454         Also, there is no effect on the ABI.
3455
3456         (_REGEX_SOURCE): New macro.
3457         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3458         defined and _GNU_SOURCE is not; this fixes a name space violation.
3459
3460         Rename the following macros to obey POSIX requirements.
3461         The old names are still visible as macros if _REGEX_SOURCE is defined.
3462         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3463         RE_BACKSLASH_ESCAPE_IN_LISTS.
3464         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3465         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3466         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3467         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3468         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3469         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3470         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3471         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3472         (REG_INTERVALS): renamed from RE_INTERVALS.
3473         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3474         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3475         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3476         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3477         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3478         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3479         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3480         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3481         RE_UNMATCHED_RIGHT_PAREN_ORD.
3482         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3483         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3484         (REG_DEBUG): renamed from RE_DEBUG.
3485         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3486         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3487         unusual, since we can't clash with the POSIX REG_ICASE.
3488         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3489         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3490         (REG_NO_SUB): renamed from RE_NO_SUB.
3491         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3492         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3493         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3494         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3495         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3496         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3497         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3498         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3499         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3500         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3501         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3502         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3503         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3504         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3505         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3506         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3507         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3508         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3509         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3510         (REG_FIXED): Renamed from REGS_FIXED.
3511         (REG_NREGS): Renamed from RE_NREGS.
3512
3513         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3514         of other REG_* macros, since POSIX says the user is allowed to
3515         #undef these macros selectively.
3516
3517         (reg_errcode_t): Update comment stating what other tables need
3518         to be consistent.
3519
3520         Rename the following enum values to obey POSIX requirements.
3521         The old names are still visible as macros.
3522         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3523         is not defined, since GNU is supposed to be a superset of POSIX as
3524         much as possible, and since we want reg_errcode_t to be a signed
3525         type for implementation consistency.
3526         (_REG_NOERROR): Renamed from REG_NOERROR.
3527         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3528         (_REG_BADPAT): Renamed from REG_BADPAT.
3529         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3530         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3531         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3532         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3533         (_REG_EBRACK): Renamed from REG_EBRACK.
3534         (_REG_EPAREN): Renamed from REG_EPAREN.
3535         (_REG_EBRACE): Renamed from REG_EBRACE.
3536         (_REG_BADBR): Renamed from REG_BADBR.
3537         (_REG_ERANGE): Renamed from REG_ERANGE.
3538         (_REG_ESPACE): Renamed from REG_ESPACE.
3539         (_REG_BADRPT): Renamed from REG_BADRPT.
3540         (_REG_EEND): Renamed from REG_EEND.
3541         (_REG_ESIZE): Renamed from REG_ESIZE.
3542         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3543         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3544         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3545         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3546         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3547
3548         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3549         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3550         changed.  But support the old name if the new one is not defined
3551         and if _REGEX_SOURCE.
3552
3553         Change the following member names in struct re_pattern_buffer.
3554         The old names are still supported if !_REGEX_SOURCE.
3555         The new names are always supported, regardless of _REGEX_SOURCE.
3556         (re_buffer): Renamed from buffer.
3557         (re_allocated): Renamed from allocated.
3558         (re_used): Renamed from used.
3559         (re_syntax): Renamed from syntax.
3560         (re_fastmap): Renamed from fastmap.
3561         (re_translate): Renamed from translate.
3562         (re_can_be_null): Renamed from can_be_null.
3563         (re_regs_allocated): Renamed from regs_allocated.
3564         (re_fastmap_accurate): Renamed from fastmap_accurate.
3565         (re_no_sub): Renamed from no_sub.
3566         (re_not_bol): Renamed from not_bol.
3567         (re_not_eol): Renamed from not_eol.
3568         (re_newline_anchor): Renamed from newline_anchor.
3569
3570         Change the following member names in struct re_registers.
3571         The old names are still supported if !_REGEX_SOURCE.
3572         The new names are always supported, regardless of _REGEX_SOURCE.
3573         (rm_num_regs): Renamed from num_regs.
3574         (rm_start): Renamed from start.
3575         (rm_end): Renamed from end.
3576
3577         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3578         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3579         Prepend __ to parameter names.
3580
3581         Undo yesterday's changes.
3582
3583 2005-08-24  Jim Meyering  <jim@meyering.net>
3584
3585         Sync from coreutils.
3586         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3587
3588 2005-08-21  Bruno Haible  <bruno@clisp.org>
3589
3590         * lock.h: Add multiple inclusion guard.
3591         * tls.h: Add multiple inclusion guard.
3592
3593 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3594
3595         * regex.h (REG_NOSYS)
3596         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3597         Define, since POSIX requires it as of 2001.
3598         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3599         New private symbol, used to keep the enum signed in all cases.
3600         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3601         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3602
3603         * regex_internal.c (re_string_skip_chars, register_state):
3604         (calc_state_hash):
3605         Remove forward decls; no longer needed now that we use prototypes.
3606         * regexec.c (acquire_init_state_context, check_halt_node_context):
3607         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3608         (clean_state_log_if_needed): Likewise.
3609
3610 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3611
3612         Fix problems reported by Sam Steingold in
3613         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3614         * regexec.c (sift_states_bkref): Fix portability bug: the code
3615         assumed that reg_errcode_t is a signed type, which is not
3616         necessarily true if _XOPEN_SOURCE is not defined.
3617         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3618         some compilers warn about it otherwise.
3619
3620 2005-08-20  Jim Meyering  <jim@meyering.net>
3621
3622         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3623         of unused local, dfa.
3624
3625 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3626
3627         * regcomp.c (create_initial_state): Remove duplicate decl.
3628         (init_word_char, create_initial_state, duplicate_node_closure):
3629         (fetch_token, peek_token_bracket, build_range_exp):
3630         (build_collating_symbol): Remove forward decls; no longer needed
3631         now that we use prototypes.
3632
3633         * regcomp.c:
3634         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3635         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3636         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3637         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3638         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3639         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3640         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3641         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3642         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3643         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3644         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3645         (build_charclass, build_charclass_op, fetch_number, create_tree):
3646         (create_token_tree, mark_opt_subexp, duplicate_tree):
3647         Use prototypes rather than old-style definitions.
3648
3649         * regex_internal.c:
3650         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3651         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3652         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3653         (re_string_reconstruct, re_string_peek_byte_case):
3654         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3655         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3656         (re_node_set_init_copy, re_node_set_add_intersect):
3657         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3658         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3659         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3660         (re_acquire_state, re_acquire_state_context, register_state):
3661         (create_ci_newstate, create_cd_newstate, free_state):
3662         Likewise.
3663         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3664         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3665         (re_search_internal, prune_impossible_nodes):
3666         (acquire_init_state_context, check_matching, static):
3667         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3668         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3669         (update_regs, sift_states_backward, build_sifted_states):
3670         (clean_state_log_if_needed, merge_state_array):
3671         (update_cur_sifted_state, add_epsilon_src_nodes):
3672         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3673         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3674         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3675         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3676         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3677         (check_arrival, check_arrival_add_next_nodes):
3678         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3679         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3680         (check_node_accept_bytes, check_node_accept, extend_buffers):
3681         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3682         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3683         (sift_ctx_init):
3684         Likewise.
3685
3686         * regex_internal.h:
3687         (re_string_allocate, re_string_construct, re_string_reconstruct):
3688         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3689         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3690         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3691         (re_string_context_at, re_string_peek_byte_case):
3692         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3693         is defined, since we now use prototypes always.
3694
3695         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3696         C89 or better.  All uses removed.
3697
3698 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3699
3700         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3701         [defined lint]: Suppress bogus uninitialized-variable warnings.
3702
3703         * regcomp.c (duplicate_node): Return new index, not an error code,
3704         and let the caller return REG_ESPACE if out of space.  This
3705         removes an uninitialied-variable warning with GCC 4.0.1, and also
3706         avoids taking the address of a local variable.  All callers
3707         changed.
3708
3709 2005-08-19  Jim Meyering  <jim@meyering.net>
3710
3711         * regexec.c (proceed_next_node): Redo local variables to
3712         avoid GCC shadowing warnings.
3713
3714 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3715
3716         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3717         (re_node_set_insert_last, re_dfa_add_node):
3718         Rename local variables to avoid GCC shadowing warnings.
3719
3720 2005-08-18  Bruno Haible  <bruno@clisp.org>
3721
3722         * strstr.c (strstr): Fix return value in multibyte case.
3723         * strcasestr.c (strcasestr): Likewise.
3724
3725 2005-08-17  Jim Meyering  <jim@meyering.net>
3726
3727         Make the %s format (seconds since the epoch) work for a negative
3728         number and when used with a zero-padded field width, e.g. %015s.
3729
3730         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3731         label so that it precedes the code to set `digits'.  Otherwise,
3732         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3733         print `00-22'.  Now, it prints `-0022', as it should.
3734
3735 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3736
3737         * regex.h: Remove useless space-before-tab.  From coreutils.
3738
3739 2005-08-17  Bruno Haible  <bruno@clisp.org>
3740
3741         * strcasestr.h: New file.
3742         * strcasestr.c: New file.
3743
3744 2005-08-17  Bruno Haible  <bruno@clisp.org>
3745
3746         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3747         * strstr.c: Completely rewritten, with multibyte locale support.
3748
3749 2005-08-17  Bruno Haible  <bruno@clisp.org>
3750
3751         * strcasecmp.c: Use mbuiter.h.
3752
3753 2005-08-17  Bruno Haible  <bruno@clisp.org>
3754
3755         * mbuiter.h: New file.
3756
3757 2005-08-16  Bruno Haible  <bruno@clisp.org>
3758
3759         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3760         (mbi_init): Update.
3761         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3762         NUL byte, not after it.
3763
3764 2005-08-16  Bruno Haible  <bruno@clisp.org>
3765
3766         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3767         the valid ones. Makes the comparison operations transitive:
3768         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3769         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3770
3771 2005-08-16  Bruno Haible  <bruno@clisp.org>
3772
3773         * strcase.h (strcasecmp): Add note in comments.
3774         * strncasecmp.c: Use code from strcasecmp.c.
3775         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3776         (strcasecmp): Work correctly in multibyte locales.
3777
3778 2005-08-16  Bruno Haible  <bruno@clisp.org>
3779
3780         * strnlen1.h: New file.
3781         * strnlen1.c: New file.
3782
3783 2005-08-16  Bruno Haible  <bruno@clisp.org>
3784
3785         * mbfile.h: New file.
3786
3787 2005-08-16  Bruno Haible  <bruno@clisp.org>
3788
3789         * mbiter.h: New file.
3790
3791 2005-08-16  Bruno Haible  <bruno@clisp.org>
3792
3793         * mbchar.h: New file.
3794         * mbchar.c: New file.
3795
3796 2005-08-16  Bruno Haible  <bruno@clisp.org>
3797
3798         * tls.h: New file, from GNU gettext.
3799         * tls.c: New file, from GNU gettext.
3800
3801 2005-08-15  Bruno Haible  <bruno@clisp.org>
3802
3803         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3804         is defined.
3805
3806 2005-08-14  Jim Meyering  <jim@meyering.net>
3807
3808         Sync from coreutils.
3809
3810         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3811         Use the hash-table-based cycle-detection code not just when
3812         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3813         Reported by James Youngman in
3814         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3815         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3816         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3817         This lets us compile with -DFTS_DEBUG, once again.
3818         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3819         * fts.c (fd_safer): Remove decl.
3820         Include fcntl--.h rather than unistd-safer.h
3821         (fts_safe_changedir): Don't call fd_safer; no longer needed
3822         now that we include fcntl--.h.
3823
3824 2005-08-11  Simon Josefsson  <jas@extundo.com>
3825
3826         * readline.h, readline.c: New file.
3827
3828 2005-08-11  Bruno Haible  <bruno@clisp.org>
3829
3830         * strnlen.h (strnlen): Change parameter name to match comment.
3831
3832 2005-08-10  Simon Josefsson  <jas@extundo.com>
3833
3834         * strndup.c: Use strnlen.h.
3835
3836         * strnlen.h: New file.
3837
3838 2005-08-02  Simon Josefsson  <jas@extundo.com>
3839
3840         * getline.h, getline.c: Rewrite.
3841
3842         * getdelim.h, getdelim.c: New files, ported from glibc.
3843
3844 2005-07-31  Bruno Haible  <bruno@clisp.org>
3845
3846         * lock.h (gl_lock_initializer): New macro.
3847         (gl_lock_define_initialized): Use it.
3848         (gl_rwlock_initializer): New macro.
3849         (gl_rwlock_define_initialized): Use it.
3850         (gl_recursive_lock_initializer): New macro.
3851         (gl_recursive_lock_define_initialized): Use it.
3852
3853 2005-07-26  Bruno Haible  <bruno@clisp.org>
3854
3855         * lock.h: Update from GNU gettext.
3856         * lock.c: Update from GNU gettext.
3857
3858 2005-07-18  Bruno Haible  <bruno@clisp.org>
3859
3860         * lock.h (gl_once_t): New type.
3861         (gl_once_define, gl_once): New macros.
3862         * lock.c (fresh_once): New variable.
3863         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3864         functions.
3865
3866 2005-07-18  Simon Josefsson  <jas@extundo.com>
3867
3868         * check-version.c (check_version): Accept identical versions too.
3869
3870 2005-07-18  Bruno Haible  <bruno@clisp.org>
3871
3872         * lock.h: New file, from GNU gettext.
3873         * lock.c: New file, from GNU gettext.
3874
3875 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3876
3877         * quotearg.c: Add translator comment suggested by Bruno Haible,
3878         with a minor change.
3879
3880 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3881
3882         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3883         copyright symbol and the year.
3884         * version-etc.c (COPYRIGHT_YEAR): New constant.
3885         (version_etc_va): Use parameterized copyright notice.
3886         Reword to conform to the current GNU coding standards.
3887
3888 2005-07-11  Simon Josefsson  <jas@extundo.com>
3889
3890         * size_max.h: New file.
3891
3892 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3893
3894         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3895         block of defines.
3896
3897 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3898        and  Paul Eggert  <eggert@cs.ucla.edu>
3899
3900         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3901         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3902
3903 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3904
3905         * regex.c, regex.h: Sync from libc.
3906         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3907         New files, synced from libc, except that regex_internal.h
3908         currently has a small porting fix.
3909
3910 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3911
3912         Remove the dependency of the strftime module on the tzset module.
3913         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3914         Copy the input structure, to work around some of the bug with
3915         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3916         Solaris releases, you should also use the tzset module, but we won't
3917         require it as a dependency any more since we don't want LGPLed code
3918         to depend on GPLed code.
3919
3920 2005-07-02  Jim Meyering  <jim@meyering.net>
3921
3922         * backupfile.c (backup_args): Change a `0' to NULL.
3923
3924 2005-07-01  Jim Meyering  <jim@meyering.net>
3925
3926         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3927         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3928         * save-cwd.c, tempname.c:
3929         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3930         and don't include <sys/file.h>).
3931
3932 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3933
3934         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3935         declares only 'struct timespec;' (!).
3936
3937 2005-06-29  Jim Meyering  <jim@meyering.net>
3938
3939         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3940         type name.  Use the variable name instead.
3941         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3942
3943 2005-06-28  Simon Josefsson  <jas@extundo.com>
3944
3945         * check-version.h, check-version.c: New files.
3946
3947 2005-06-28  Simon Josefsson  <jas@extundo.com>
3948
3949         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3950         collision with global variable.  Better indentation.  Don't
3951         increment buffer pointer beyond buffer end.  Based on comments
3952         from Paul Eggert <eggert@cs.ucla.edu>.
3953
3954         * base64.h: Indent.
3955
3956 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3957
3958         * canon-host.c (canon-host): Append trailing "," to 0 in
3959         initializer of struct addrinfo, as an indication that we don't
3960         care how many members the structure has.
3961
3962 2005-06-24  Derek Price  <derek@ximbiot.com>
3963         and Bruno Haible  <bruno@clisp.org>
3964
3965         Remove stat module & update lstat.
3966         * stat.c: Remove this file...
3967         (slash_aware_lstat): ...moving this content and its support...
3968         * lstat.c (rpl_lstat): ...into here.
3969         * lstat.h: New file.
3970
3971 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3972
3973         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3974         (ranged_convert): Don't save conversion in a temporary struct.
3975         This causes a warning with GCC 4.0.0, and anyway in the typical
3976         case it's not worth the extra 100 bytes or so of code.
3977         (ranged_convert, __mktime_internal): When calling a function via a
3978         pointer P, use P () rather than (*P) (), as we now assume C89 or
3979         better.
3980
3981 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3982
3983         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3984         "who -r" failed to give output.  Problem reported by Tim Waugh.
3985
3986         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3987         (xcalloc): Use it to avoid needless tests.
3988         Problem reported by Jim Meyering.
3989
3990 2005-06-16  Jim Meyering  <jim@meyering.net>
3991
3992         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3993         when either N or S is zero.
3994
3995 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3996
3997         * argp.h (__option_is_short): Check upper limit of
3998         __key. Isprint() requires its argument to have the value
3999         of an unsigned char or EOF.
4000
4001 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4002
4003         * fnmatch.c (fnmatch): If there is an encoding error in a
4004         multibyte string or pattern, fall back on unibyte matching.
4005         Problem reported by James Youngman.
4006
4007 2005-06-08  Bruno Haible  <bruno@clisp.org>
4008
4009         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4010         warning on mingw.
4011
4012 2005-06-08  Bruno Haible  <bruno@clisp.org>
4013
4014         * csharpcomp.h: New file, from GNU gettext.
4015         * csharpcomp.c: New file, from GNU gettext.
4016         * csharpcomp.sh.in: New file, from GNU gettext.
4017
4018 2005-06-07  Derek Price  <derek@ximbiot.com>
4019
4020         Sync from CVS.
4021         * glob_.h: Indent nested #ifdef.
4022
4023 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4024
4025         Sync from coreutils.
4026         Use "file name" when talking about file names, instead of "filename"
4027         or "path", as per the GNU coding standards.
4028         * mkdir-p.c: Renamed from makepath.c.
4029         (make_dir_parents): Renamed from make_path.  All callers changed.
4030         * mkdir-p.h: Likewise.  All includers changed.
4031         * filenamecat.c: Renamed from path-concat.c.
4032         (file_name_concat): Renamed from path_concat.  All callers changed.
4033         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4034         * filenamecat.h: Likewise.  All includers changed.
4035         * acl.c: Don't use "path" or "filename" to mean "file name"
4036         in comments or local variable names.
4037         * basename.c: Likewise.
4038         * canonicalize.c, canonicalize.h: Likewise.
4039         * dirname.c, dirname.h: Likewise.
4040         * euidaccess.c: Likewise.
4041         * exclude.c: Likewise
4042         * fnmatch_.h, fnmatch_loop.c: Likewise.
4043         * fsusage.c, fsuage.h: Likewise.
4044         * fts.c, fts_.h: Likewise.
4045         * getcwd.c: Likewise.
4046         * getloadavg.c: Likewise.
4047         * mkstemp.c: Likewise.
4048         * mountlist.c, mountlist.h: Likewise.
4049         * openat.c, openat.h: Likewise.
4050         * readlink-stub.c: Likewise.
4051         * readutmp.c, readutmp.h: Likewise.
4052         * rename.c: Likewise.
4053         * rmdir.c: Likewise.
4054         * same.c: Likewise.
4055         * savedir.c: Likewise.
4056         * stripslash.c: Likewise.
4057         * tempname.c: Likewise.
4058         * xreadlink.c: Likewise.
4059         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4060         All uses changed.
4061         * exclude.h: Likewise.
4062
4063         * euidaccess.c (getuid, getgid, getuid, getegid)
4064         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4065         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4066         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4067         * pathmax.h: Include <limits.h> unconditionally, since other
4068         files have been getting away with it for years (MORE/BSD 4.3
4069         is extinct now).
4070         * userspec.c (getpwnam, getgrnam, getgrgid)
4071         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4072
4073         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4074         Define to 256, not 255, as per modern POSIX.
4075
4076 2005-06-01  Bruno Haible  <bruno@clisp.org>
4077
4078         * csharpexec.h: New file, from GNU gettext.
4079         * csharpexec.c: New file, from GNU gettext.
4080         * csharpexec.sh.in: New file, from GNU gettext.
4081
4082 2005-05-31  Derek Price  <derek@ximbiot.com>
4083             Paul Eggert  <eggert@cs.ucla.edu>
4084
4085         Sync from cvs.
4086         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4087
4088 2005-05-29  Derek Price  <derek@ximbiot.com>
4089             Paul Eggert  <eggert@cs.ucla.edu>
4090
4091         * glob_.h, glob.c: New files.
4092
4093 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4094
4095         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4096
4097         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4098         the configuration hassle isn't worth it.
4099         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4100         (LONGEST_MODIFIER, PRIuMAX): Remove.
4101
4102 2005-05-27  Bruno Haible  <bruno@clisp.org>
4103
4104         * getlogin_r.h: Remove second include of <stddef.h>.
4105
4106 2005-05-25  Bruno Haible  <bruno@clisp.org>
4107             Derek Price  <derek@ximbiot.com>
4108
4109         * getlogin_r.h: Simplify API documentation.
4110
4111 2005-05-25  Derek Price  <derek@ximbiot.com>
4112             Paul Eggert  <eggert@cs.ucla.edu>
4113
4114         * getlogin_r.c, getlogin_r.h: New files.
4115
4116 2005-05-22  Bruno Haible  <bruno@clisp.org>
4117
4118         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4119         Also include <sys/param.h> if it defines MIN, MAX.
4120         Based on a patch by Derek Price <derek@ximbiot.com>.
4121
4122 2005-05-22  Bruno Haible  <bruno@clisp.org>
4123
4124         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4125         (INT64_MIN): Fix definition.
4126         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4127
4128         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4129         NEED_SIGNED_INT_TYPES.
4130
4131         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4132         HAVE_SYSTEM_INTTYPES.
4133
4134 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4135
4136         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4137         so that unistd-safer.h (GPL'ed code) need not be included.
4138
4139 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4140
4141         New fts module.
4142         * fts.c: Don't include "cycle-check.h" or "hash.h".
4143         (setup_dir, free_dir): New functions.
4144         (enter_dir, leave_dir): Define trivial
4145         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4146         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4147         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4148         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4149         Move to fts-cycle.c.
4150         (fts_open): Use setup_dir.
4151         (fts_close): Use free_dir.
4152         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4153         This adds a label and some gotos, but the alternatives were messier.
4154         Check for memory allocation failure when entering a dir.
4155         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4156         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4157         (FTS): New member fts_cycle, that is a union that contains the
4158         old active_dir_ht and cycle_state.  All uses changed to mention
4159         fts_cycle.ht and fts_cycle.state.
4160         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4161         fts.c, with the following changes:
4162         (setup_dir, free_dir): New functions.
4163         (enter_dir): Now returns bool.  Return true if successful, false
4164         if memory exhausted.  All callers changed.
4165         Do not bother partly cleaning up on
4166         memory allocation failure; that is free_dir's job.
4167         However, free ad if hash_insert fails, to avoid memory leak.
4168         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4169         fts->fts_options to see which union member to use.
4170
4171 2005-05-20  Jim Meyering  <jim@meyering.net>
4172
4173         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4174         Now a macro, to pacify GCC.
4175
4176 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4177
4178         * chown.c (rpl_chown): Return -1 on failure.
4179
4180 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4181
4182         * canonicalize.c: Include canonicalize.h first, to test interface.
4183         Include <stddef.h> unconditionally, since we assume C89 now.
4184         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4185         * fts.c: Include fts_.h first, to check interface.
4186         Do not include intprops.h; no longer needed.
4187         Include cycle-check.h and hash.h, since fts_.h no longer does.
4188         Remove unnecessary casts of closedir to void.
4189         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4190         decide whether to decrement nlinks.
4191         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4192         (FTS): Use struct hash_table * instead of Hash_table, so that
4193         we no longer need to include hash.h here.
4194
4195 2005-05-17  Jim Meyering  <jim@meyering.net>
4196
4197         * fts.c, fts_.h: New files, from coreutils.
4198
4199 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4200
4201         Sync from coreutils.
4202         * unlinkdir.c, unlinkdir.h: New files.
4203         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4204         regex.h, unlocked-io.h, xtime.h:
4205         White space changes only.
4206         * makepath.c (make_path): Port to hosts where leading "//" is special.
4207         * yesno.c: Include getline.h, not ctype.h.
4208         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4209         Use getline to remove arbitrary restriction on response length.
4210
4211 2005-05-13  Bruno Haible  <bruno@clisp.org>
4212
4213         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4214         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4215         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4216         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4217         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4218         Add support for 64-bit integers in the MSVC compiler.
4219
4220 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4221
4222         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4223         Change the initial comment to refer to GPL, not LGPL.
4224         gnulib-tool will change it to LGPL as needed.
4225
4226         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4227         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4228         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4229         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4230         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4231         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4232         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4233         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4234         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4235         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4236         concatpath.c, config.charset, copy-file.c, copy-file.h,
4237         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4238         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4239         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4240         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4241         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4242         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4243         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4244         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4245         full-read.c, full-read.h, full-write.c, full-write.h,
4246         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4247         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4248         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4249         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4250         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4251         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4252         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4253         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4254         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4255         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4256         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4257         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4258         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4259         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4260         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4261         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4262         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4263         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4264         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4265         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4266         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4267         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4268         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4269         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4270         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4271         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4272         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4273         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4274         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4275         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4276         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4277         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4278         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4279         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4280         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4281         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4282         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4283         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4284         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4285         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4286         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4287         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4288         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4289         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4290         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4291         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4292         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4293         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4294         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4295         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4296         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4297         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4298         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4299         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4300         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4301         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4302         Update FSF postal mail address.
4303
4304 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4305
4306         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4307         specified in ai_socktype. Fix invalid ai_protocol
4308         check. ai_protocol is usually set to 0 or depending on
4309         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4310         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4311         ai_socktype / ai_protocol in the returned addrinfo structure.
4312
4313 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4314             Bruno Haible  <bruno@clisp.org>
4315
4316         * inet_ntop.h: New file.
4317         * inet_ntop.c: New file, from glibc with modifications.
4318
4319 2005-05-08  Jim Meyering  <jim@meyering.net>
4320
4321         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4322
4323 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4324
4325         Merge from coreutils.  Among other things,
4326         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4327         * fd-safer.c: New file.
4328         * fcntl-safer.h, open-safer.c: Remove.
4329         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4330         * dup-safer.c: Include unistd-safer.h first.
4331         Don't include errno.h.
4332         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4333         * file-type.h: Don't assume invoker included sys/stat.h first.
4334         * file-type.c: Rely on file-type.h change.
4335         * getloadavg.c: Include unistd-safer.h.
4336         (getloadavg): Use safer open.
4337         * getusershell.c: Include "stdio-safer.h".
4338         (getusershell): Use safer fopen.
4339         * long-options.c (long_options): Use NULL rather than 0.
4340         * modechange.h (mode_free): Remove; all callers changed to invoke
4341         'free'.
4342         * modechange.c: Likewise.
4343         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4344         (MODE_DONE): New constant.
4345         (struct mode_change): Remove 'next' member.
4346         (make_node_op_equals): New function; like the old one of the
4347         same name, except it allocates an array.
4348         (mode_compile, mode_create_from_ref): Use it.
4349         (mode_compile): Allocate result as an array, not a linked list.
4350         Parse octal string ourself, so that we catch mistakes like "+0".
4351         (mode_adjust): Arg is an array, not a linked list.
4352         * modechange.c: Include stat-macros.h, xalloc.h.
4353         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4354         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4355         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4356         Remove.  This is now stat-macros.h's job.
4357         (talloc): Remove.  All callers replaced by xalloc, so that
4358         our invokers don't have to worry about reporting memory failures.
4359         (make_node_op_equals): Remove.
4360         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4361         New constants.
4362         (struct mode_change): Moved here from modechange.h.
4363         (mode_append_entry): Remove.
4364         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4365         apps to have incorrect behavior.  Use simpler algorithm for head
4366         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4367         Detect more invalid usages rather than having somewhat-random behavior.
4368         Don't insert an "a=" action, as that leads to incorrect behavior.
4369         (mode_compile, mode_create_from_ref): Return NULL on error instead
4370         of an enum, since now there's only one way to have an error.  All
4371         callers changed.
4372         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4373         at the correct time.  Simplify calculation of "+u" and its ilk.
4374         Don't mishandle "+X".
4375         (mode_free): Remove "register" and localize decls.
4376         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4377         (struct mode_change): Move to modechange.c; callers don't
4378         need to see this stuff.
4379         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4380         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4381         (mode_change, mode_adjust): Reflect the new signatures noted above.
4382         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4383         that might redefine system include files.
4384         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4385         (my_usleep): Use NULL rather than (void *) 0.
4386         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4387         Use siginterrupt to specify that system calls should be interrupted.
4388         (rpl_nanosleep): Move initialization of suspended closer to call of
4389         my_usleep.
4390         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4391         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4392         (desirable_utmp_entry): New function.
4393         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4394         using x2nrealloc, to simplify logic.
4395         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4396         size calculation.  Do not assume utmp file is a regular file.
4397         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4398         (READ_UTMP_CHECK_PIDS): New constant.
4399         * save-cwd.c: Include unistd-safer.h.
4400         (save_cwd): Use fd_safer.
4401         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4402         [!_LIBC] Include "stat-macros.h" instead.
4403         * unistd-safer.h (fd_safer): New decl.
4404
4405 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4406
4407         * byteswap_.h: New file.
4408
4409 2005-04-25  Albert Chin  <china@thewrittenword.com>
4410
4411         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4412         Toolkit C bug.
4413
4414 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4415
4416         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4417         that "UTC +1 second" continues to work.  Problem reported
4418         by Dmitry V. Levin.
4419         (relunit_snumber): New rule.
4420         (relunit): Use it.
4421
4422 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4423
4424         * getdate.y (universal_time_zone_table): New constant.
4425         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4426         universal_time_zone_table.
4427         (lookup_zone): Prefer universal_time_zone_table to
4428         local_time_zone_table, so that "GMT" time stamps are allowed in
4429         London during the summer.  Problem reported by Ian Abbott.
4430
4431 2005-04-12  Jim Meyering  <jim@meyering.net>
4432
4433         * human.c (humblock): Set *options even when returning due to
4434         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4435         warning from gcc-4.
4436
4437 2005-04-09  Jim Meyering  <jim@meyering.net>
4438
4439         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4440         -Wuninitialized: initialize tm0.tm_year.
4441
4442 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4443
4444         * getdate.y (parser_control): rels_seen is now a boolean, not a
4445         count, since there's no maximum.  All uses changed.
4446         Add member dsts_seen.
4447         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4448         not being INT_MAX.
4449         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4450         Use pc_rels_seen to decide whther a date is absolute.
4451
4452         * getdate.y (number): Don't overwrite year.
4453         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4454         check.
4455
4456 2005-04-02  Simon Josefsson  <jas@extundo.com>
4457
4458         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4459         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4460
4461 2005-03-27  Jim Meyering  <jim@meyering.net>
4462
4463         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4464
4465 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4466
4467         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4468         "one's complement" -> "ones' complement" in comment, as per Knuth.
4469         "value of type" -> "type or expression" in comment.
4470         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4471
4472 2005-03-26  Jim Meyering  <jim@meyering.net>
4473
4474         Comment nits.
4475         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4476         Correct typos: s/or/of/.
4477
4478 2005-03-23  Jim Meyering  <jim@meyering.net>
4479
4480         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4481
4482 2005-03-21  Jim Meyering  <jim@meyering.net>
4483
4484         Changes imported from coreutils.
4485
4486         * cycle-check.c: Don't include xalloc.h.
4487
4488         * path-concat.c: Don't include assert.h.
4489         (path_concat): Remove assertion that would have triggered
4490         for ABASE starting with more than one slash.
4491         Reported by Andreas Schwab.
4492
4493         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4494         properly when ABASE is an absolute file name.
4495         Correct the description of this function.
4496         Include <assert.h>.
4497         Add an assertion and a test driver.
4498         This fixes a bug introduced on 2004-07-02.
4499         Andreas Schwab reported the resulting failure of cp --parents:
4500         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4501
4502 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4503
4504         * strftime.c (my_strftime): If the underlying strftime returns 0
4505         (which shouldn't happen), generate nothing instead of returning 0
4506         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4507
4508 2005-03-16  Bruno Haible  <bruno@clisp.org>
4509
4510         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4511
4512 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4513
4514         * strftime.c (my_strftime): Prepend space to format so that we can
4515         reliably distinguish strftime failure from empty output on POSIX
4516         hosts.
4517
4518 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4519
4520         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4521         (iconv_string): Don't guess a size-zero buffer, as that might cause
4522         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4523         result would be 'too large', where 'too large' is (heuristically)
4524         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4525         overflow concerns.  This will prevent some unwanted malloc failures
4526         when the inputs are very large.
4527
4528 2005-03-15  Bruno Haible  <bruno@clisp.org>
4529
4530         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4531         'negate'.
4532
4533         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4534         variable.
4535
4536         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4537
4538 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4539
4540         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4541         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4542         intprops.h.
4543         * strtol.c: Likewise.
4544
4545 2005-03-14  Simon Josefsson  <jas@extundo.com>
4546
4547         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4548         <fx@gnu.org>.
4549
4550 2005-03-14  Jim Meyering  <jim@meyering.net>
4551
4552         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4553         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4554         to be nonzero so that we (and caller) can detect the difference
4555         between a valid zero-length expansion and an error return, even
4556         when the underlying strftime fails before writing anything into
4557         that location.
4558
4559 2005-03-10  Jim Meyering  <jim@meyering.net>
4560
4561         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4562         so that this module works on systems without fchdir.
4563
4564 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4565
4566         Factor int-properties macros into a single file, except for
4567         glibc-related files.
4568         * intprops.h: New file.
4569         * getloadavg.c: Include it instead of limits.h.
4570         (INT_STRLEN_BOUND): Remove.
4571         * human.c: Include intprops.h.
4572         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4573         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4574         * inttostr.h: Include intprops.h instead of limits.h.
4575         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4576         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4577         for consistency with intprops.h.
4578         (time_t_is_integer, twos_complement_arithmetic): Use them.
4579         * sig2str.h: Include <signal.h>, intprops.h.
4580         (INT_STRLEN_BOUND): Remove.
4581         * strftime.c (TYPE_SIGNED): Remove.
4582         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4583         * strtol.c: Adjust comments to match intprops.h.
4584         * userspec.c: Include intprops.h.
4585         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4586         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4587         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4588         instead of rolling our own expressions.
4589         * xstrtol.c: Include xstrtol.h first, to test interface.
4590
4591         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4592         instead of int.
4593         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4594         the right thing even if adding 1900 would overflow.  Similarly
4595         for tm_mon + 1 and tm_yday + 1.
4596         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4597         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4598         (DO_SIGNED_NUMBER): New macro.
4599         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4600
4601 2005-03-07  Bruno Haible  <bruno@clisp.org>
4602
4603         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4604
4605 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4606             Bruno Haible  <bruno@clisp.org>
4607
4608         * pagealign_alloc.h: New file.
4609         * pagealign_alloc.c: New file.
4610
4611 2005-01-28  Bruno Haible  <bruno@clisp.org>
4612
4613         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4614         stpncpy.c uses it.
4615
4616 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4617
4618         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4619         The workaround isn't strictly needed for POSIX conformance, and
4620         it's too much of a pain to configure and maintain.  We'll ask
4621         people to fix their kernels instead.
4622         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4623         (NANOSLEEP_BUG_WORKAROUND): Remove.
4624         (xnanosleep): Remove the workaround.
4625
4626 2005-02-12  Bruno Haible  <bruno@clisp.org>
4627
4628         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4629
4630 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4631
4632         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4633         * timespec.h (gettime): Return void, since it always
4634         succeeds now.  All uses changed.
4635         * gettime.c (gettime) Likewise.
4636         [HAVE_NANOTIME]: Prefer nanotime.
4637         Assume gettimeofday succeeds, as POSIX requires.
4638         Assime time () succeeds, since other code already does.
4639         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4640         (timespec_subtract): Remove.
4641         (NANOSLEEP_BUG_WORKAROUND): New constant.
4642         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4643         things considerably.  Use it only on GNU/Linux hosts, since the
4644         workaround shouldn't be needed elsewhere.
4645
4646 2005-02-24  Bruno Haible  <bruno@clisp.org>
4647
4648         * gettext.h: Update from GNU gettext 0.14.2.
4649
4650 2005-02-24  Bruno Haible  <bruno@clisp.org>
4651
4652         * localcharset.c: Update from GNU gettext 0.14.2.
4653         * config.charset: Update from GNU gettext 0.14.2.
4654
4655 2005-02-22  Simon Josefsson  <jas@extundo.com>
4656
4657         * iconvme.h, iconvme.c: New files, from libc.
4658
4659 2005-02-20  Neil Conway  <neilc@samurai.com>
4660
4661         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4662         returned by OSX/Darwin if the specified buffer is not large
4663         enough for the hostname.
4664
4665 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4666
4667         * memrchr.h: New file.
4668         * chdir-long.c: Include it.
4669         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4670         Don't bother including stddef.h.
4671
4672 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4673
4674         * argp-help.c (__argp_help): Create a fake struct argp_state and
4675         pass it to _help, otherwise the latter coredumps trying to
4676         dereference state.root_argp.
4677
4678 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4679
4680         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4681         inclusion.
4682         Include <sys/types.h>, for dev_t.
4683         (ME_DUMMY, ME_REMOTE): Move from here....
4684         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4685         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4686         Dmitry V. Levin.
4687         Include mountlist.h first, to test the interface.
4688
4689 2005-01-29  Bruno Haible  <bruno@clisp.org>
4690
4691         * progname.c (program_name): Initialize.
4692         Needed when linking statically on MacOS X.
4693
4694 2005-01-28  Bruno Haible  <bruno@clisp.org>
4695
4696         * javacomp.sh.in: New file, from GNU gettext.
4697         * javacomp.h: New file, from GNU gettext.
4698         * javacomp.c: New file, from GNU gettext.
4699
4700 2005-01-26  Bruno Haible  <bruno@clisp.org>
4701
4702         * javaexec.sh.in: New file, from GNU gettext.
4703         * javaexec.h: New file, from GNU gettext.
4704         * javaexec.c: New file, from GNU gettext.
4705
4706 2005-01-26  Simon Josefsson  <jas@extundo.com>
4707
4708         * gai_strerror.c: Use GPL in header.
4709
4710 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4711
4712         * argp-help.c (hol_entry_help): Avoid using non-constant
4713         initializers for struct pentry_state.
4714         (__argp_error): Check return value of __asprintf
4715         (__argp_failure): Translate error message
4716
4717         * argp-parse.c: Removed braces around the expansion of N_()
4718
4719 2005-01-21  Jim Meyering  <jim@meyering.net>
4720
4721         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4722         same value as for Solaris 9.
4723
4724         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4725         component length.  This included changing the parameter to be
4726         of type `char *' rather than `char const *'.
4727         * chdir-long.h (chdir_long): Update prototype.
4728
4729         * openat.c (fdopendir, fstatat): New functions.
4730         * openat.h: Include headers required for use of DIR and struct stat.
4731         [AT_SYMLINK_NOFOLLOW]: Define.
4732         (fdopendir, fstatat): Add prototypes.
4733
4734 2005-01-21  Bruno Haible  <bruno@clisp.org>
4735
4736         * classpath.h: New file, from GNU gettext.
4737         * classpath.c: New file, from GNU gettext.
4738
4739 2005-01-20  Simon Josefsson  <jas@extundo.com>
4740
4741         * version-etc-fsf.c: New file, with version_etc_copyright.
4742         * version-etc.c: Remove version_etc_copyright.
4743         * version-etc.h (version_etc_copyright): Use [] instead of * in
4744         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4745
4746 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4747
4748         * save-cwd.c (save_cwd): Remove code to support the case
4749         where fchdir is missing or flaky.
4750
4751 2005-01-20  Simon Josefsson  <jas@extundo.com>
4752
4753         * base64.h (isbase64): Add.
4754
4755         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4756         using a unsigned prototype, don't inline.
4757         (base64_decode): Use it.
4758
4759 2005-01-19  Bruno Haible  <bruno@clisp.org>
4760
4761         * sh-quote.h: New file, from GNU gettext.
4762         * sh-quote.c: New file, from GNU gettext.
4763
4764 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4765
4766         Merge changes from coreutils, as described below in several
4767         changelogs dated today.
4768
4769         * save-cwd.c: Include "save-cwd.h" before other include files.
4770         (O_DIRECTORY): Remove; not needed here, since "." must be
4771         a directory.  All uses removed.
4772         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4773         universal on Suns, and we also need to test for IRIX.
4774         Revamp code to use 'if' rather than '#if'.
4775         Avoid unnecessary comparison of cwd->desc to 0.
4776
4777         * utimens.c (futimens): Robustify the previous patch, by checking
4778         for known valid error numbers rather than observed invalid ones.
4779
4780 2005-01-18  Jim Meyering  <jim@meyering.net>
4781
4782         * version-etc.c (version_etc_copyright): Update copyright date.
4783
4784         * utimens.c (futimens): Account for the fact that futimes
4785         can also fail with errno == ENOSYS or errno == ENOENT.
4786         Patch from Dmitry V. Levin.
4787
4788         Change the name of the robust chdir function from chdir to chdir_long.
4789         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4790         (restore_cwd): Use chdir_long, not chdir.
4791         * chdir-long.c: Renamed from chdir.c.
4792         * chdir-long.h: Renamed from chdir.h.
4793         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4794         Hurd.
4795
4796 2005-01-18  Bob Proulx  <bob@proulx.com>
4797
4798         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4799         offsetof() macro construct to avoid compile failure with native HP-UX
4800         11.0 ANSI C compiler.
4801
4802 2005-01-06  Bruno Haible  <bruno@clisp.org>
4803
4804         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4805         because stpncpy.m4 takes care of it.
4806
4807 2004-01-24  Bruno Haible  <bruno@clisp.org>
4808
4809         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4810
4811 2003-10-09  Bruno Haible  <bruno@clisp.org>
4812
4813         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4814
4815 2005-01-06  Bruno Haible  <bruno@clisp.org>
4816
4817         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4818         * fwriteerror.c: Include <stdbool.h>.
4819         (fwriteerror): At the end, close the file stream. Record whether
4820         stdout was already closed.
4821
4822 2004-05-27  Bruno Haible  <bruno@clisp.org>
4823
4824         * execute.c (environ): Declare if needed.
4825         * pipe.c (environ): Likewise.
4826         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4827
4828 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4829
4830         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4831         definitions to be after all include files, to avoid collisions.
4832         Problem reported by Bob Proulx.
4833
4834 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4835
4836         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4837         not needed.  This removes a dependency on the gettext module.
4838         [defined _LIBC]: Do not include <libintl.h>; not needed.
4839
4840 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4841
4842         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4843         HAVE_DECL_STRTOLD.
4844
4845 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4846
4847         * argp-parse.c: Include <stddef.h>.
4848         (alignof, alignto): New macros.
4849         (parser_init): Don't assume that void * is aligned sufficiently
4850         for struct option.
4851
4852         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4853         need to extend the stack.
4854         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4855         large.
4856
4857 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4858
4859         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4860
4861 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4862
4863         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4864         Remove now-obsolete comment about AIX.
4865         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4866         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4867         (YYMAXDEPTH): New macro.
4868
4869 2004-12-18  Bruno Haible  <bruno@clisp.org>
4870
4871         * fatal-signal.c (fatal_signals): Make non-const.
4872         (init_fatal_signals): New function.
4873         (uninstall_handlers, install_handlers): Ignore signals that were set to
4874         SIG_IGN.
4875         (at_fatal_signal): Call init_fatal_signals.
4876         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4877         SIG_IGN.
4878         Reported by Paul Eggert.
4879
4880 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4881
4882         * getdate.y (textint): New member "negative".
4883         (time_zone_hhmm): New function.
4884         Expect 14 shift-reduce conflicts, not 13.
4885         (o_colon_minutes): New rule.
4886         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4887         (yylex): Set the "negative" member of signed numbers.
4888
4889 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4890
4891         Changes imported from coreutils.
4892         * hard-locale.c: Assume <locale.h> exists.
4893         Include "strdup.h".
4894         (GLIBC_VERSION): New macro.
4895         (hard_locale): Assume setlocale exists.
4896         Rewrite to avoid #ifdef.
4897         Use strdup rather than malloc + strcpy.
4898         * human.c: Assume <locale.h> exists.
4899         (human_readable): Assume localeconv exists.
4900
4901 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4902
4903         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4904         convert T2, not T.  (Imported from libc.)
4905
4906 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4907
4908         * getcwd.c (is_ENAMETOOLONG): New macro.
4909         (__getcwd.c): Don't restore errno; glibc doesn't.
4910         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4911         first, falling back to our code only if its results look suspicious.
4912         Ensure that the resulting buffer is only as large as necessary.
4913
4914         * readutmp.c: Include readutmp.h first.
4915         Include <errno.h>, since readutmp.h no longer does that.
4916         * readutmp.h: Don't include <errno.h>,
4917         <sys/param.h>, <time.h>; not needed to establish interface.
4918         (errno): Remove decl.
4919         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4920         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4921         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4922
4923 2004-11-28  Simon Josefsson  <jas@extundo.com>
4924
4925         * base64.h, base64.c: New file.
4926
4927 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4928
4929         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4930
4931 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4932
4933         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4934         HP's ANSI C compiler.
4935         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4936         Declaring int functions causes warnings on some modern systems and
4937         shouldn't be needed to compile on ancient ones.
4938         * same.c (MIN) [defined MIN]: Don't define, since it's already
4939         defined.
4940
4941         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4942         with the following changes.
4943         (__set_errno): Parenthesize properly.
4944         Include <stdbool.h>.
4945         (MIN, MAX, MATCHING_INO): New macros.
4946         (__getcwd): Define with prototype, not K&R form.
4947         Use heuristics to allocate default buffer on stack if possible.
4948         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4949         behavior, and to avoid the PATH_MAX limit when computing
4950         ../../../../...
4951         Use MATCHING_INO to compare inode number to file.
4952         Check for arithmetic overflow in size calculations.
4953         Fix bug in reallocation of dot array that caused getcwd to fail
4954         on directories nested deeper than 75.
4955         Be more careful about saving errno on error.
4956         Do not use realloc; use only free+malloc, as this is a bit
4957         more flexible and avoids a needless copy operation.
4958         Do not inspect st_dev and st_ino for symbolic links; POSIX
4959         doesn't specify the latter.
4960         Check for closedir errors.
4961         Avoid needless casts.
4962         Use "#ifdef weak_alias" around weak_alias, to be like other
4963         glibc code.
4964         The following changes to getcwd.c have effect only when used in
4965         gnulib; they have no effect inside glibc proper.
4966         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4967         as alloca isn't used.
4968         (alloca, __alloca): Likewise.
4969         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4970         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4971         unconditionally, as gnulib assumes C89 or better.
4972         Do not include <sys/param.h>.
4973         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4974         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4975         better.
4976         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4977         Include <dirent.h> in a way that is compatible with modern Autoconf.
4978         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4979         New macros, if not already defined.
4980         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4981         Use "_LIBC", not "defined _LIBC", for consistency.
4982         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4983         a mempcpy module.
4984         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4985         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4986         * xgetcwd.c: David MacKenzie's old code was removed, so give
4987         credit only to Jim Meyering and adjust the copyright dates.
4988         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4989         <stdlib.h>, <unistd.h>, "pathmax.h".
4990         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4991         (INITIAL_BUFFER_SIZE): Remove.
4992         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4993
4994 2004-11-23  Jim Meyering  <jim@meyering.net>
4995
4996         * getopt_.h: Remove trailing blanks.
4997
4998 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4999
5000         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5001         (futimens): New function, which uses futimes if available.
5002         (futimens, utimens): Support timespec==NULL, with same semantics
5003         as utime and utimens.
5004         * utimens.h (futimens): New decl.
5005
5006 2004-11-23  Jim Meyering  <jim@meyering.net>
5007
5008         * __fpending.c: Add comment.
5009
5010 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5011
5012         * getopt_.h: Re-addition of __getopt_argv_const caused
5013         redefinition warnings. To avoid them, include the defines
5014         in `#if !defined __need_getopt ... #endif'. The only place
5015         where __getopt_argv_const is used is in definitions
5016         of getopt_long and getopt_long_only below, which are as well
5017         protected by `#ifndef __need_getopt'.
5018         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5019         __need_getopt after including <stdio.h> and <unistd.h> These
5020         headers might have defined it.
5021
5022 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
5023
5024         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5025         New macros.
5026         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5027         optopt): Use them instead of invoking ## directly; otherwise, the
5028         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5029
5030 2004-11-19  Bruno Haible  <bruno@clisp.org>
5031
5032         * strtok_r.c: Move comments from here...
5033         * strtok_r.h: ... to here.
5034
5035 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
5036
5037         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5038         might fail.  Problem reported by Yoann Vandoorselaere.
5039         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5040         that mishandle size_t overflow.
5041
5042 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5043
5044         * canon-host.c: Include "strdup.h".
5045         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5046         Use strdup instead of malloc/strcpy to duplicate strings.
5047
5048         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5049         (human_space_before_unit): New constant.
5050         * human.c (human_readable): Support it.
5051
5052         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5053         (xgetcwd): Set errno correctly when failing.
5054         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5055         the failure is actually due to a PATH_MAX problem.
5056
5057         Further getopt changes to make it more likely that glibc will
5058         buy the changes back.
5059         * getopt.c (POSIXLY_CORRECT): New constant.
5060         (getopt): Use it, so to preserve glibc semantic
5061         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5062         when compiling for libc.
5063         * getopt_.h (__getopt_argv_const): Bring it back.
5064         (getopt_long, getopt_long_only): Use it.
5065
5066         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5067         New arg POSIXLY_CORRECT.  All callers changed.
5068         (getopt): Argv is now char * const *, as per standard.
5069         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5070         not char *__getopt_argv_const *.
5071         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5072         _getopt_long_only_r): Likewise.
5073         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5074         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5075         _getopt_long_r, _getopt_long_only_r): Likewise.
5076         * getopt_.h (__getopt_argv_const): Remove.
5077         (getopt): Argv is now char * const *, as per standard.
5078
5079         * getdate.y (tORDINAL): New token.
5080         (day, relunit): Allow it for relative times.
5081         (relative_time_table): Use tORDINAL for ordinals.
5082
5083 2004-11-15  Jim Meyering  <jim@meyering.net>
5084
5085         * closeout.c: Include "__fpending.h" once again.
5086         Include <stdbool.h>.
5087         (close_stdout): Don't fail just because stdout was closed initially,
5088         since some programs don't write to stdout in the normal course of
5089         operation (other than --version and --help), and we don't want this
5090         function to make e.g. `touch file >&-' fail.
5091         But do fail if it was closed and someone has tried to write to it.
5092         E.g., `printf foo >&-' must fail.
5093
5094 2004-11-11  Simon Josefsson  <jas@extundo.com>
5095
5096         * strtok_r.h, strtok_r.c: New file.
5097
5098 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5099
5100         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5101         we can stop lying to compilers about the constness of argv when we
5102         are compiled outside glibc.
5103         (getopt, getopt_long, getopt_long_only): Use it.
5104         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5105         getopt): Likewise.
5106         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5107         _getopt_long_only_r): Likewise.
5108         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5109         _getopt_long_only_r): Likewise.
5110
5111         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5112         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5113         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5114         the other external symbols.
5115         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5116         declaration, since the above renaming now works around collisions.
5117
5118 2004-11-11  Jim Meyering  <jim@meyering.net>
5119
5120         * linebreak.c: Remove trailing blanks.
5121         * alloca_.h: Likewise.
5122         * acosl.c: Likewise.
5123         * euidaccess.c: Likewise.
5124         * allocsa.h: Likewise.
5125
5126 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5127
5128         * mktime.c (SHR): New macro, which is a portable
5129         substitute for >> that should work even on Crays.
5130         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5131         Problem reported by Mark D. Baushke in
5132         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5133         * getdate.y (SHR): Likewise.
5134         (tm_diff): Use it.
5135         * strftime.c (SHR): Likewise.
5136         (tm_diff): Use it.
5137         * quotearg.c (struct quoting_options): Use unsigned int for
5138         quote_these_too, so that right shifts are well defined.  All uses
5139         changed.
5140
5141 2004-11-10  Simon Josefsson  <jas@extundo.com>
5142
5143         * getaddrinfo.h, getaddrinfo.c: New files.
5144
5145 2004-11-10  Jim Meyering  <jim@meyering.net>
5146
5147         Ensure that no close failure goes unreported.
5148         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5149         return early when it seems there's nothing to flush.
5150         Don't include __fpending.h.
5151
5152 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5153
5154         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5155
5156 2004-11-05  Bruno Haible  <bruno@clisp.org>
5157
5158         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5159         Reported by Mark D. Baushke <mdb@cvshome.org>.
5160
5161 2004-11-04  Bruno Haible  <bruno@clisp.org>
5162
5163         2004-09-11  Bruno Haible  <bruno@clisp.org>
5164                 * allocsa.valgrind: New file.
5165         2004-02-06  Bruno Haible  <bruno@clisp.org>
5166                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5167                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5168                 Reported by Christopher Seip <chris.seip@hp.com>.
5169
5170 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5171
5172         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5173         with errno == ERANGE if the buffer is too small.
5174         Problem reported by Mark D. Baushke.
5175
5176 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5177
5178         * xreadlink.c (MAXSIZE): New macro.
5179         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5180         size does not exceed MAXSIZE.  Avoid cast.
5181         As suggested by Mark D. Baushke in
5182         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5183         if readlink fails with buffer size just under MAXSIZE, try again
5184         with MAXSIZE.
5185
5186 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5187         and  Paul Eggert  <eggert@cs.ucla.edu>
5188
5189         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5190         (get_date): Overparenthesize to avoid GCC warning.
5191
5192 2004-11-02  Bruno Haible  <bruno@clisp.org>
5193
5194         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5195         function returns void.
5196
5197 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5198
5199         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5200         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5201         already declared.
5202
5203 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5204
5205         * getdate.y: Add support for TZ="foo" within a date string.
5206         Fix some bugs near time_t boundaries.  Reject dates with
5207         out-of-range components, e.g., "Sept 31".
5208         Include <stdlib.h>, "setenv.h", "xalloc.h".
5209         (ISDIGIT_LOCALE): Remove; unused.
5210         Note that the TZ and time functions used here are not reentrant.
5211         (mktime_ok, get_tz): New functions.
5212         (TZBUFSIZE): New constant.
5213         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5214         This requires that we sometimes generate our own TZ="XXX..." setting.
5215
5216 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5217
5218         * mktime.c (not_equal_tm): Remove redundant check.
5219
5220 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5221
5222         * getdate.y: Use Bison 1.875 features, and some minor
5223         code cleanups.  This change does not affect semantics.
5224         Don't include <stdlib.h>; no longer needed.
5225         Don't include unlocked-io.h; only the "#if TEST" code uses
5226         stdio, and performance isn't crucial there.
5227         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5228         Bison 1.875 features as described below.
5229         All uses of "PC." replaced by "pc->".
5230         (YYSTYPE): Add a forward declaration.
5231         (yylex, yyerror): Use full prototypes in forward decls.
5232         Use "%pure-parser" rather than obsolescent "%pure_parser".
5233         Use %parse-param and %lex-param instead of obsolescent
5234         YYPARSE_PARAM and YYLEX_PARAM.
5235         (meridian_table, month_and_day_table, time_units_table,
5236         relative_time_table, time_zone_table, military_table,
5237         lookup_zone, lookup_word, get_date):
5238         Use NULL instead of 0 where appropriate.
5239         (to_hour): Avoid abort (), to avoid a dependency on
5240         stdlib.h.
5241         (yyerror, yylex): Now accepts parser_control * arg.
5242         (main) [TEST]: Use '\0' rather than 0 for char.
5243
5244 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5245
5246         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5247         It's now the caller's responsibility to handle the case where
5248         !HAVE_GETPAGESIZE && !defined getpagesize.
5249
5250         * mktime.c (leapyear): Arg is long int, not int.
5251
5252 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5253
5254         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5255
5256 2004-10-12  Simon Josefsson  <jas@extundo.com>
5257
5258         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5259         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5260         to real functions.
5261
5262 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5263
5264         * vsnprintf.h: New file.
5265         * vsnprintf.c: New file.
5266
5267 2004-10-07  Bruno Haible  <bruno@clisp.org>
5268
5269         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5270         into the provided buffer.
5271
5272 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5273
5274         * diacrit.c, diacrit.h: Add GPL notice.
5275
5276         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5277         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5278         * logl.c (logl): Keep the code as similar to glibc as possible.
5279         This avoids a potential constant-folding bug.
5280
5281 2004-10-05  Bruno Haible  <bruno@clisp.org>
5282
5283         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5284
5285 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5286
5287         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5288         * xmalloc.c (xmemdup): Likewise.
5289         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5290         XFREE): Remove these long-obsolescent macros.
5291         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5292         * xstrdup.c: Remove.
5293
5294         * regex.c (re_comp): Cast gettext return value to char *,
5295         Problem reported by Martin Neitzel via Mark D. Baushke.
5296
5297 2004-10-04  Simon Josefsson  <jas@extundo.com>
5298
5299         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5300         '#ifdef USE_UNLOCKED_IO'.
5301
5302 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5303
5304         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5305         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5306         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5307         regex.c, sha1.c, version-etc.c, yesno.c:
5308         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5309         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5310         the includer's responsibility.
5311
5312         Sync from coreutils.
5313
5314         * modechange.c (mode_compile): Don't decrement a pointer that
5315         points to the start of a string, as the C Standard says the
5316         resulting behavior is undefined.
5317
5318         * backupfile.h (enum backuptype): Rename none -> no_backups,
5319         simple -> simple_backups, numbered_existing ->
5320         numbered_existing_backups, numbered -> numbered_backups
5321         to avoid shadowing problems.  All uses changed.
5322         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5323         * backupfile.c (check_extension, numbered_backup):
5324         Rename locals to avoid shadowing 'basename'.
5325         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5326         once.
5327
5328         * .cppi-disable: Add getopt_.h, getopt_int.h.
5329         * .cvsignore: Add getopt.h.
5330
5331 2004-10-04  Simon Josefsson  <jas@extundo.com>
5332
5333         * memmem.h: New file.
5334         * memmem.c: New file, taken from glibc.
5335
5336 2004-10-02  Jim Meyering  <jim@meyering.net>
5337
5338         * dirfd.h, getpagesize.h: Add copyright notice.
5339
5340 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5341
5342         * snprintf.c: Remove comments as to why each header is needed.
5343
5344 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5345
5346         * strsep.h: New file.
5347         * strsep.c: New file.
5348
5349 2004-10-01  Simon Josefsson  <jas@extundo.com>
5350
5351         * snprintf.c (snprintf): Handle size==0.
5352
5353 2004-10-01  Simon Josefsson  <jas@extundo.com>
5354             Bruno Haible  <bruno@clisp.org>
5355
5356         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5357         (snprintf): Declare 'args'.
5358
5359 2004-09-30  Simon Josefsson  <jas@extundo.com>
5360
5361         * snprintf.h, snprintf.c: New files.
5362
5363 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5364
5365         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5366         (hol_entry_help): Never translate an empty string.
5367         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5368         * argp.h (OPTION_NO_TRANS): New option.
5369
5370 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5371
5372         * xvasprintf.c: Include xalloc.h.
5373         (xvasprintf): Use xalloc_die, not xmalloc_die.
5374
5375 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5376
5377         * dummy.c: Change copyright notice to FSF, and license to GPL.
5378
5379 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5380
5381         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5382         Problem reported by Bruno Haible in:
5383         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5384
5385 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5386
5387         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5388         in case some system header has #define'd it.  Problem reported by
5389         Soeren D. Schulze in
5390         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5391
5392 2004-09-08  Bruno Haible  <bruno@clisp.org>
5393
5394         * stdint_.h: New file, taken from GNU clisp.
5395
5396 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5397
5398         * xvasprintf.h: New file.
5399         * xvasprintf.c: New file.
5400         * xasprintf.c: New file.
5401
5402 2004-09-08  Bruno Haible  <bruno@clisp.org>
5403
5404         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5405         is > INT_MAX.
5406         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5407
5408 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5409
5410         Import from coreutils.
5411         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5412         strings on unbounded length.  alloca's performance benefits aren't
5413         that important here.
5414         (V_STRDUP): Remove.
5415         (parse_with_separator): New function, with most of the internals
5416         of the old parse_user_spec.  Allow user to omit both user and group,
5417         for compatibility with FreeBSD.
5418         Clone only the user name, not the entire spec.
5419         Do not set *uid, *gid unless entirely successful.
5420         Avoid memory leak in some failing cases.
5421         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5422         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5423         (parse_user_spec): Rewrite to use parse_with_separator.
5424
5425 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5426
5427         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5428         its complicated substitute.
5429         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5430         and program_invocation_name.
5431         (__argp_basename) [!_LIBC]: Remove; the only use was
5432         replaced by its body.
5433         (__argp_short_program_name): Change condition from
5434         !defined __argp_short_program_name to
5435         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5436         to match argp-namefrob.h.
5437         (__argp_failure): Don't assume strerror_r returns char *.
5438         * argp-parse.c (N_): Define unconditionally.
5439         (argp_default_options): Fill out initializers with 0 to avoid
5440         gcc warnings.
5441
5442 2004-08-12  Simon Josefsson  <jas@extundo.com>
5443
5444         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5445         * getopt_.h: Renamed from getopt.h.
5446
5447 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5448
5449         Merge from coreutils.
5450
5451         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5452         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5453         for Reliant Unix 5.43.
5454
5455         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5456         (union fooround): Use uintmax_t, not long int.
5457         The rest is a merge from libc:
5458         [defined _LIBC]: Include <shlib-compat.h>.
5459         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5460
5461         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5462
5463         * strverscmp.c: Convert to UTF-8.
5464
5465 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5466
5467         * obstack.h (obstack_empty_p):
5468         Don't assume that chunk->contents is suitably aligned.
5469         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5470         Likewise. Problem reported by Benno in
5471         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5472
5473         * chown.c (rpl_chown): Work even if the file is writeable but not
5474         readable.  This could be improved further but it'd take some work.
5475
5476 2004-08-08  Simon Josefsson  <jas@extundo.com>
5477
5478         * xgethostname.c: Don't include error.h (not used).
5479
5480         * getpass.h: Add.
5481         * getpass.c: Include getpass.h first.
5482
5483 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5484
5485         * xalloc-die.c: New files.
5486         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5487         All uses removed.
5488         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5489         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5490         (_, N_, xalloc_die): Move to xalloc-die.c.
5491         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5492         so that we needn't mess with xalloc_msg_memory_exhausted.
5493
5494         * sha1.h: Renamed from sha.h.
5495         (SHA1_H): Renamed from _SHA_H.
5496         (sha1_ctx): Renamed from sha_ctx.
5497         (sha1_init_ctx): Renamed from sha_init_ctx.
5498         (sha1_process_block): Renamed from sha_process_block.
5499         (sha1_process_bytes): Renamed from sha_process_bytes.
5500         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5501         (sha1_read_ctx): Renamed from sha_read_ctx.
5502         (sha1_stream): Renamed from sha_stream.
5503         (sha1_buffer): Renamed from sha_buffer.
5504         * sha1.c: Likewise; renamed from sha.c.
5505         Do not include <sys/types.h>.
5506         Include <stddef.h> rather than <stdlib.h>.
5507
5508 2004-08-08  Bruno Haible  <bruno@clisp.org>
5509
5510         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5511         FILESYSTEM_PREFIX_LEN.
5512         * progreloc.c: Likewise.
5513         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5514
5515 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5516
5517         Merge from tar.
5518         * argp-help.c (make_hol, hol_append): Don't assume that
5519         SIZE_MAX is a valid preprocessor constant.
5520         (__argp_basename): Change from "#ifndef _LIBC"
5521         to "#ifndef __argp_short_program_name", so that
5522         we don't compile these functions for tar.
5523
5524         More merges from coreutils.
5525         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5526         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5527         yesno.h: New files.
5528         * addext.c: Remove; no longer needed.
5529         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5530         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5531         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5532         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5533         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5534         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5535         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5536         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5537         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5538         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5539         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5540         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5541         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5542         Import changes from coreutils.
5543
5544 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5545
5546         Merge from coreutils.
5547
5548         * .gdb-history: Remove; this doesn't belong here.
5549
5550         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5551         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5552         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5553
5554         * dirname.h: Include <stdbool.h>.
5555         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5556         for consistency with POSIX terminology.  All uses changed.
5557         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5558         (strip_trailing_slashes): Use bool for booleans.
5559         * stripslash.c (strip_trailing_slashes): Likewise.
5560
5561         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5562         sometimes returns a positive errno value even when it succeeds.
5563         (print_errno_message) [!LIBC]: Fall back on strerror if
5564         __strerror_r fails.
5565
5566         * path-concat.c (mempcpy): Don't define if a system header defines it.
5567         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5568         (longest_relative_suffix): New function.
5569         (path_concat): Use it.  Assume first argument is not NULL.
5570         Port to DOS.  Omit redundant separators.
5571         Report an error instead of returning NULL.
5572         Use mempcpy instead of memcpy.
5573         (xpath_concat): Remove: not declared or used.
5574
5575         * same.h: Include <stdbool.h>
5576         (same_name): Return bool, not int.
5577         * same.c (same_name): Likewise.
5578         (errno): Don't declare; we assume C89 or better now.
5579
5580         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5581         if not already defined.
5582
5583         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5584         * dup-safer.c (errno): Likewise.
5585
5586 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5587
5588         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5589         working.
5590
5591 2004-08-03  Simon Josefsson  <jas@extundo.com>
5592
5593         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5594         * progname.h: Don't include stdbool.h.
5595
5596 2004-08-02  Simon Josefsson  <jas@extundo.com>
5597
5598         * getsubopt.h: New file, with comments from Bruno Haible.
5599         * getsubopt.c: New file, from glibc, but slightly modified based on
5600         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5601
5602 2004-08-01  Simon Josefsson  <jas@extundo.com>
5603
5604         * xgetdomainname.c: Include stdlib.h, for free().
5605
5606 2004-07-16  Simon Josefsson  <jas@extundo.com>
5607
5608         * dummy.c: New file.
5609
5610 2004-07-16  Bruno Haible  <bruno@clisp.org>
5611
5612         * backupfile.h: Add extern "C" for C++.
5613         * closeout.h: Likewise.
5614         * copy-file.h: Likewise.
5615         * findprog.h: Likewise.
5616         * full-write.h: Likewise.
5617         * pathname.h: Likewise.
5618         * progname.h: Likewise.
5619         * stpcpy.h: Likewise.
5620         * stpncpy.h: Likewise.
5621         * strcase.h: Likewise.
5622         * strstr.h: Likewise.
5623         * xalloc.h: Likewise.
5624
5625         * mbswidth.h: Add extern "C" for C++.
5626         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5627
5628 2004-07-09  Simon Josefsson  <jas@extundo.com>
5629
5630         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5631         failed without this.)
5632
5633 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5634
5635         * fchown-stub.c: New file.
5636
5637 2004-06-24  Jim Meyering  <jim@meyering.net>
5638
5639         * obstack.h (obstack_base): Cast to (void *), per documentation.
5640
5641 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5642
5643         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5644
5645 2004-06-01  Jim Meyering  <jim@meyering.net>
5646
5647         * calloc.c: New file.
5648
5649 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5650
5651         * getdate.y (yylex): Allow space between sign and number.
5652         Problem reported by Dan Jacobson.
5653
5654 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5655         and  Jim Meyering  <jim@meyering.net>
5656
5657         Merge from coreutils CVS.
5658
5659         * stat-macros.h: New file, with contents from file-type.h
5660         and coreutils' system.h.
5661         * file-type.c: Include "stat-macros.h".
5662         * file-type.h (file_type): Move all macro definitions to new file,
5663         stat-macros.h.
5664
5665         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5666         Wrap old code with this conditional.
5667         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5668         function that does not dereference symlinks.
5669         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5670
5671         * xreadlink.c: Include xreadlink.h first, to catch .h file
5672         dependency problems.
5673         (xreadlink): Accept new arg SIZE, for efficiency.
5674         All decls and uses changed.
5675         * xreadlink.h: Include <stddef.h>, for size_t.
5676
5677         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5678         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5679
5680         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5681
5682 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5683
5684         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5685         macros to be defined.
5686         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5687         the allocator returns NULL because the requested size is zero.
5688
5689 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5690
5691         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5692         var.  Add comment explaining why libc still defines it.  This
5693         merges the following patch from glibc:
5694         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5695
5696 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5697
5698         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5699         present in glibc since revision 1.1 of this file.
5700         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5701         obstack_alignment_mask, obstack_alloc, obstack_base,
5702         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5703         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5704         obstack_grow0, obstack_init, obstack_int_grow,
5705         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5706         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5707         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5708         nonexistent functions.
5709
5710 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5711             Paul Eggert  <eggert@cs.ucla.edu>
5712
5713         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5714
5715 2004-05-14  Bruno Haible  <bruno@clisp.org>
5716
5717         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5718         that consists of a '.' followed by an empty digit string.
5719         Patch by Tor Lillqvist <tml@iki.fi>.
5720
5721 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5722
5723         Port obstack to the AS/400, where pointers are 16 bytes wide and
5724         you cannot cast an integer to a valid pointer.  This patch is
5725         currently waiting to be integrated into glibc; see
5726         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5727
5728         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5729         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5730         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5731         (struct obstack): temp member is now a union of a pointer and
5732         an integer, instead of an integer.  All integer uses changed.
5733         This does not affect the physical layout of struct obstack,
5734         except on hosts (like the AS/400) where the size or alignment of
5735         void * is greater than that of ptrdiff_t.
5736         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5737         __STDC__)]: Store temporary in pointer member of union, not
5738         integer member.
5739         * obstack.c: Include <stddef.h>, for offsetof.
5740         (struct fooalign): Remove; it doesn't need a name.
5741         (union fooround): Change double to long double, and add void *.
5742         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5743         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5744         not a macro.  Hence the values are always int; so remove all
5745         casts-to-int in uses.
5746
5747 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5748             Derek Price  <derek@ximbiot.com>
5749
5750         * alloca.c: Include <alloca.h>, to get our interface.
5751         * alloca_.h: Use __alloca on AIX, so that we don't have to
5752         include <alloca.h> first.  Use C89 prototype for alloca; this
5753         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5754         Use #elif for simplicity, since we can assume C89 now.
5755         Don't try to source the system alloca.h since it will not be found
5756         and to prevent recursively including its replacement.
5757         * fnmatch.c: Include <alloca.h> instead of opencoding.
5758         * regex.c: Likewise.
5759
5760 2004-05-16  Derek Price  <derek@ximbiot.com>
5761             Paul Eggert  <eggert@cs.ucla.edu>
5762
5763         getline cleanup.  This changes the getndelim2 API: both order of
5764         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5765         no delimiter).
5766
5767         * getline.c: Don't include stddef.h or stdio.h, since our
5768         interface does that.
5769         (getline): Always use getdelim, so that we don't have two
5770         copies of this code.
5771         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5772         if available.
5773         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5774         (GETNDELIM2_MAXIMUM): New macro.
5775         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5776         instead of the old practice of delim2==0.  All callers changed.
5777         Return -1 on overflow, instead of returning junk.
5778         Do not set *linesize unless allocation succeeds.
5779         * getndelim2.h: Do not include stddef.h; no longer needed, now
5780         that we include sys/types.h.
5781         * getnline.h: Likewise.
5782         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5783         (getndelim2): Reorder arguments.
5784         * getnline.c (getnline, getndelim):
5785         Don't discard the NMAX argument.
5786         (getnline): Invoke getndelim, to avoid code duplication.
5787         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5788         of (size_t) -1 by callers of the getnline family.
5789
5790 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5791
5792         * nanosleep.c (suspended): Change its type from int to
5793         sig_atomic_t volatile.
5794         (first_call): Make it private to rpl_nanosleep, and have it
5795         be zero initially as that's a bit faster.
5796         (my_usleep): Round up fractional times instead of truncating them,
5797         as this is the usual meaning for 'sleep'.
5798
5799         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5800         doesn't work.
5801         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5802         (ENOSYS): Define if not defined.
5803         (settime): Fall back on stime if it exists and settimeofday fails.
5804         But don't bother with fallbacks if a method fails with errno == EPERM.
5805
5806 2004-05-11  Jim Meyering  <jim@meyering.net>
5807
5808         Prior to this change, the save_cwd caller required read access to the
5809         current directory on most systems (ones with the fchdir function).
5810
5811         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5812         fails, try write-only, and finally, resort to using xgetcwd.
5813
5814 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5815
5816         * obstack.c, obstack.h: Import changes from libc.
5817
5818 2004-04-28  Bruno Haible  <bruno@clisp.org>
5819
5820         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5821         implicitly appends .exe to executables.
5822         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5823         accepts Windows pathnames.
5824         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5825         Cygwin like Windows, since it now accepts Windows pathnames.
5826         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5827         Cygwin like Windows, since it now accepts Windows pathnames.
5828         Reported by Derek Robert Price <derek@ximbiot.com>.
5829
5830 2004-04-20  Jim Meyering  <jim@meyering.net>
5831
5832         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5833
5834 2004-04-20  Jim Meyering  <jim@meyering.net>
5835             Bruno Haible  <bruno@clisp.org>
5836
5837         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5838         memory when realloc fails.
5839
5840 2004-04-18  Jim Meyering  <jim@meyering.net>
5841
5842         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5843         don't leak memory and do call END_UTMP_ENT.
5844
5845 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5846
5847         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5848         (CHAR_BIT): Remove, since we assume C89.
5849         Include <stdint.h> if available, as per current Autoconf CVS advice.
5850
5851 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5852
5853         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5854         not bool, to be more consistent with Unix conventions.
5855         Suggested by Bruno Haible.
5856
5857         Merge from coreutils.
5858
5859         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5860         New files.
5861
5862         * getdate.h: Include stdbool.h, and timespec.h instead of
5863         the usual <time.h> dance.
5864         (get_date): Change signature to support fractional time stamps.
5865         All callers changed.
5866         * getdate.y: Include "getdate.h" first, as we can now
5867         assume C89 and don't need to worry about 'const'.
5868         Similarly, include "unlocked-io.h" near start, not in middle.
5869         Include <limits.h>.
5870         (textint.value): Use long int rather than int.
5871         (textint.digits): Use size_t rather than int.
5872         (BILLION, LOG10_BILLION): New constants.
5873         (parser_control): New member rel_ns.  Members day_ordinal,
5874         time_zone, month, day, hour, minutes, rel_year, rel_month,
5875         rel_day, rel_hour, rel_minutes, rel_seconds
5876         are now long int, not int.  Member seconds is now struct timespec,
5877         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5878         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5879         not int.
5880         (%union.intval): Now long int, not int.
5881         New member timespec.
5882         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5883         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5884         (spec): Now is a timespec or an item list.
5885         (timespec, items): New nonterminals.
5886         (time, rel, relunit, number, get_date):
5887         Add support for fractional seconds.
5888         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5889         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5890         (to_hour): First arg is now long int, not int.
5891         (to_year): Returns long int, not int.
5892         Don't treat year -70 like 70.
5893         (tm_diff): Returns long int, not int.
5894         (lookup_word): Use bool instead of int when appropriate.
5895         (yylex): Use size_t for count, not int.
5896         Detect overflow when parsing large integer constants.
5897         Add support for fractions.
5898         (get_date): Make pointers 'const' if possible.
5899         Use more-portable code to detect integer overflow.
5900         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5901         Don't use ctime; it's not reliable if the year has >4 digits.
5902
5903         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5904         This is for compatibility with BSD.
5905
5906         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5907         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5908         From coreutils' system.h.
5909
5910         * userspec.c: Don't include "posixver.h".
5911         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5912         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5913         compatible extension.  Simplify code by removing a boolean int
5914         that was always nonzero if a string was nonnull.
5915
5916 2004-03-30  Jim Meyering  <jim@meyering.net>
5917
5918         Merge from coreutils.
5919
5920         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5921
5922         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5923         an empty input stream.
5924
5925         * readtokens.c: Include <stdbool.h>.
5926         (readtoken): Use `size_t' rather than int/long.
5927         All callers adjusted.
5928         Use `bool' rather than `int' where appropriate.
5929         Use memset rather than an explicit loop.
5930         Use x2nrealloc rather than xrealloc.
5931         Allow the use of `\0' as a delimiter.
5932         (readtokens): Likewise.
5933         * readtokens.h (readtoken, readtokens): Update prototypes.
5934
5935 2004-03-30  Bruno Haible  <bruno@clisp.org>
5936
5937         * getloadavg.c (getloadavg): Don't assume setlocale returns
5938         nonnull.
5939
5940 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5941
5942         Merge changes to getloadavg.c from coreutils and Emacs.
5943
5944         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5945         Define to an expression, not to the empty string.
5946         Include cloexec.h and xalloc.h.
5947         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5948         Use set_cloexec_flag rather than rolling our own.
5949         * cloexec.c, cloexec.h: New files.
5950
5951 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5952
5953         * getopt.h: Sync with libc CVS.
5954
5955 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5956             Bruno Haible  <bruno@clisp.org>
5957
5958         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5959         not on all platforms that have <wchar.h>.
5960         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5961
5962 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5963
5964         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5965         Sync with libc CVS.
5966         * getopt_int.h: New file, also synced from libc.
5967
5968 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5969
5970         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5971         '#if' expressions.  Unlike the code it replaces, it does not
5972         depend on (defined _SC_PAGESIZE).  However, it does depend on
5973         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5974         first reported by Jason Andrade in
5975         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5976
5977 2004-01-18  Simon Josefsson  <jas@extundo.com>
5978
5979         * strdup.h: New file.
5980         * strdup.c: Include it.
5981         * path-concat.c: Include strdup.h. Drop strdup declaration.
5982         * userspec.c: Include strdup.h. Drop strdup declaration.
5983
5984 2004-02-06  Karl Berry  <karl@gnu.org>
5985
5986         * config.charset: update from gettext 0.14.1.
5987
5988 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5989
5990         Add comments and code, prompted by suggestions from Bruno Haible
5991         for sh-quote.
5992         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5993         describing the enum quoting_style values.
5994         * quotearg.c (quotearg_alloc): New function.
5995         (quotearg_buffer_restyled): Treat lone { and } as special.
5996         Treat = as special.  Work around bug with older shells
5997         that "see" a '\' that is really the 2nd byte of a multibyte char.
5998         Quote empty string with shell_quoting_style.
5999
6000 2004-02-03  Bruno Haible  <bruno@clisp.org>
6001
6002         * pipe.h: New file, from GNU gettext.
6003         * pipe.c: New file, from GNU gettext.
6004
6005 2004-01-27  Bruno Haible  <bruno@clisp.org>
6006
6007         * execute.h: New file, from GNU gettext.
6008         * execute.c: New file, from GNU gettext.
6009         * w32spawn.h: New file, from GNU gettext.
6010
6011 2004-01-23  Paul Eggert  <eggert@twinsun.com>
6012
6013         Exit-status fix from coreutils.
6014
6015         Use exit_failure consistently in place of EXIT_FAILURE,
6016         so that program exit statuses are consistent on failure.
6017
6018         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6019         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6020         * argmatch.h: Comment fix to match the above.
6021         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6022         Now a macro referring to exit_failure, instead of a separate
6023         variable.  Include "exitfail.h" to get it.
6024         * xstrtol.h: Include "exitfail.h".
6025         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6026
6027         * long-options.c (parse_long_options): Use prototype
6028         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
6029         for clarity.
6030
6031 2004-01-21  Jim Meyering  <jim@meyering.net>
6032
6033         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6034         so as not to conflict with a different-sized __mktime_internal
6035         function in GNU libc.
6036         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6037         Problem building statically-linked `ls' reported by Michael Brunnbauer.
6038
6039 2004-01-18  Paul Eggert  <eggert@twinsun.com>
6040
6041         Merge from diffutils.
6042
6043         * file-type.c (file_type): Add typed memory objects.
6044         * file-type.h (S_TYPEISTMO): New macro.
6045
6046         * c-stack.h (c_stack_action): Remove argv argument.
6047         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6048         (die): Don't calculate message unless segv_action returns.
6049         (get_stack_location, min_address_from_argv, max_address_from_argv,
6050         volatile stack_base, volatile_stack_size): Remove.
6051         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6052         that every segmentation violation is a stack overflow.  (Ouch!)
6053         See Debian bug 136249 (still outstanding) for more info about why
6054         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6055
6056 2003-11-30  Bruno Haible  <bruno@clisp.org>
6057
6058         Safer stack allocation.
6059         * setenv.c: Include allocsa.h.
6060         (alloca): Remove fallback definition.
6061         (freea): Remove macro.
6062         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6063         instead of freea.
6064
6065 2003-10-17  Bruno Haible  <bruno@clisp.org>
6066
6067         * binary-io.h: Avoid warnings on Cygwin.
6068
6069 2003-12-28  Bruno Haible  <bruno@clisp.org>
6070
6071         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6072         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6073
6074 2003-11-28  Bruno Haible  <bruno@clisp.org>
6075
6076         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6077
6078 2003-11-27  Bruno Haible  <bruno@clisp.org>
6079
6080         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6081
6082 2003-11-17  Bruno Haible  <bruno@clisp.org>
6083
6084         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6085
6086 2003-11-24  Bruno Haible  <bruno@clisp.org>
6087
6088         * xallocsa.h: New file, from GNU gettext.
6089         * xallocsa.c: New file, from GNU gettext.
6090
6091 2003-11-24  Bruno Haible  <bruno@clisp.org>
6092
6093         * allocsa.h: New file, from GNU gettext.
6094         * allocsa.c: New file, from GNU gettext.
6095
6096 2003-11-24  Bruno Haible  <bruno@clisp.org>
6097
6098         * eealloc.h: New file.
6099
6100 2004-01-15  Jim Meyering  <jim@meyering.net>
6101
6102         Merge from coreutils.
6103
6104         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6105         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6106         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6107
6108         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6109         optional configure-time default.
6110
6111         * version-etc.c (version_etc_copyright): Update copyright date.
6112
6113         * xreadlink.c (xreadlink): Correct outdated comment.
6114
6115 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6116
6117         Merge from coreutils.
6118
6119         * posixver.c: Include posixver.h.
6120
6121         * same.c: Include <stdbool.h>, <limits.h>.
6122         (_POSIX_NAME_MAX): Define if not defined.
6123         (MIN): New macro.
6124         (same_name): If file names are silently truncated, report
6125         that the file names are the same if they are the same after
6126         the silent truncation.
6127
6128         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6129         conversion function.
6130         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6131         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6132         longer needed.
6133
6134 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6135
6136         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6137         with like-named macro in fnmatch.c.
6138         (EXT): Use an internal constant instead.
6139
6140         Merge fnmatch patches from glibc.
6141         * fnmatch.c (mbsinit): Remove define.
6142         Add libc_hidden_ver (__fnmatch, fnmatch).
6143         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6144         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6145
6146 2003-12-14  Karl Berry  <karl@gnu.org>
6147
6148         * config.charset: update from gettext-runtime.
6149
6150 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6151
6152         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6153         Bug reported by Alfred M. Szmidt.
6154
6155 2003-11-29  Karl Berry  <karl@gnu.org>
6156
6157         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6158
6159 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6160             Bruno Haible  <bruno@clisp.org>
6161
6162         * printf-parse.h: Don't include sys/types.h.
6163         (ARG_NONE): New macro.
6164         (char_directive): Change type of *arg_index fields to size_t.
6165         * printf-parse.c: Don't include sys/types.h.
6166         (SSIZE_MAX): Remove macro.
6167         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6168         Remove unnecessary overflow check.
6169         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6170         fields.
6171
6172 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6173
6174         * alloca.c: Remove dependency on xalloc module.
6175         (xalloc_die): Remove.
6176         (memory_full) [!defined emacs]: New macro.
6177         [!defined emacs]: Don't include xalloc.h.
6178         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6179         address arithmetic overflows.  Change datatypes a bit to avoid
6180         unnecessary casts.
6181
6182 2003-11-22  Jim Meyering  <jim@meyering.net>
6183
6184         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6185
6186 2003-11-17  Bruno Haible  <bruno@clisp.org>
6187
6188         * vasnprintf.c (alloca): Remove fallback definition.
6189         (freea): Remove definition.
6190         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6191         Reported by Paul Eggert.
6192
6193 2003-11-17  Jim Meyering  <jim@meyering.net>
6194
6195         On systems without utime and without a utimes function capable of
6196         dealing with a NULL struct utimbuf* argument, this utime replacement
6197         could -- in unusual circumstances -- leak a file descriptor.
6198         * utime.c: Include <unistd.h> and <errno.h>.
6199         (utime_null): Be sure to close `fd' and to preserve errno.
6200         Reported by Geoff Collyer via Arnold Robbins.
6201
6202 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6203             Bruno Haible  <bruno@clisp.org>
6204
6205         Protect against address arithmetic overflow.
6206         * printf-args.h: Include stddef.h.
6207         (arguments): Change type of field 'count' to size_t.
6208         * printf-args.c (printf_fetchargs): Use size_t instead of
6209         'unsigned int' where appropriate.
6210         * printf-parse.h: Include sys/types.h.
6211         (char_directive): Change type of *arg_index fields to ssize_t.
6212         (char_directives): Change type of fields 'count', max_*_length to
6213         size_t.
6214         * printf-parse.c: Include sys/types.h and xsize.h.
6215         (SSIZE_MAX): Define fallback value.
6216         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6217         instead of 'int' where appropriate. Check a_allocated, d_allocated
6218         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6219         * vasnprintf.c: Include xsize.h.
6220         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6221         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6222         overflow. Avoid wraparound when converting a width or precision from
6223         decimal to binary.
6224
6225 2003-11-16  Bruno Haible  <bruno@clisp.org>
6226
6227         Update from GNU gettext.
6228         * printf-parse.c: Generalize to it can be compiled for wide strings.
6229         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6230         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6231         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6232         SNPRINTF): New macros.
6233         Don't include <alloca.h> if the file is used inside libintl.
6234         (local_wcslen): New function, for Solaris 2.5.1.
6235         (VASNPRINTF): Use it instead of wcslen.
6236
6237 2003-11-16  Bruno Haible  <bruno@clisp.org>
6238
6239         * xsize.h (xmax): New function.
6240         (xsum, xsum3, xsum4): Declare as "pure" functions.
6241
6242 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6243
6244         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6245         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6246         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6247         heuristic is just as accurate as far as we know, and it removes a
6248         dependency on size_max.m4 and ptrdiff_max.m4.
6249
6250 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6251
6252         * xstrtol.c (__xstrtol): Remove "break" immediately after
6253         "return", to pacify some unknown compiler.  Problem reported
6254         by Joerg Schilling.
6255
6256 2003-11-11  Bruno Haible  <bruno@clisp.org>
6257
6258         * xsize.h (SIZE_MAX): Remove fallback definition.
6259         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6260         defined.
6261
6262 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6263
6264         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6265         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6266         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6267         From Bruno Haible.
6268         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6269         not (size_t) -1, since it's defined here.
6270
6271 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6272
6273         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6274         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6275         Reject sizes of exactly SIZE_MAX bytes.
6276         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6277         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6278
6279 2003-11-05  Bruno Haible  <bruno@clisp.org>
6280
6281         * xsize.h: Include limits.h, to avoid a possible collision with
6282         SIZE_MAX defined in <limits.h> on Solaris.
6283
6284 2003-11-04  Bruno Haible  <bruno@clisp.org>
6285
6286         * xsize.h: New file.
6287         * linebreak.c: Include xsize.h.
6288         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6289         argument for overflow.
6290         Suggested by Paul Eggert.
6291
6292 2003-10-31  Bruno Haible  <bruno@clisp.org>
6293
6294         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6295         to avoid (extremely rare) race condition.
6296         Suggested by Paul Eggert.
6297
6298 2003-11-03  Jim Meyering  <jim@meyering.net>
6299
6300         * userspec.c: Include "userspec.h".
6301         * userspec.h: New file.
6302
6303 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6304
6305         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6306         * mountlist.c (SIZE_MAX): Define if not defined already.
6307         (read_filesystem_list): Set and use me_type_malloced.
6308         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6309         whatever the type happens to be), for brevity and consistency.
6310         Check for size calculation overflow on Alphas running OSF/1.
6311
6312 2003-10-31  Jim Meyering  <jim@meyering.net>
6313
6314         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6315
6316         * linebuffer.c: Include <string.h> for declaration of memset.
6317
6318 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6319             Bruno Haible  <bruno@clisp.org>
6320
6321         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6322         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6323
6324 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6325
6326         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6327         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6328         no longer needed.
6329         * quotearg.c (quotearg_n_options): Use it.
6330         * group-member.c: Include <stdbool.h>.
6331         (free_group_info): Arg is now const *; don't free arg.
6332         (get_group_info): Now returns bool and accepts struct group_info *,
6333         rather than returning a malloc'ed struct group_info *.
6334         All uses changed.  Check for overflow in internal size calculation.
6335
6336         * getusershell.c (readname): Simplify the code by using x2nrealloc
6337         rather than xmalloc/xrealloc.
6338         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6339         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6340         conformance bug: the old code used a pointer after freeing the
6341         storage that it addressed.
6342         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6343         rather than doing it by hand.
6344         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6345         the buffer preserved.  Use free and xmalloc instead.
6346         * quotearg.c (quotearg_n_options): Likewise.
6347         Use a simpler test for size overflow.  Don't use xalloc_oversized
6348         because unsigned int might be wider than size_t (!); this suggests
6349         that we should switch from unsigned int to size_t for slot numbers.
6350
6351 2003-10-27  Bruno Haible  <bruno@clisp.org>
6352
6353         * stdbool_.h: Better support for BeOS.
6354
6355 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6356
6357         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6358         to allocate the returned structure.  Do not allocate a subarray,
6359         as x2nrealloc will do that.
6360         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6361         instead of xnrealloc.
6362         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6363
6364 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6365
6366         * xalloc.h (xalloc_oversized): New static inline function, for
6367         callers that want to do their own size-overflow checking.  Include
6368         <stdbool.h>, since xalloc_oversized returns bool.
6369         * xalloc.c (array_size_overflow): Remove.  All callers changed
6370         to use xalloc_oversized.
6371
6372         Add two functions x2realloc, x2nrealloc, for programs that grow
6373         arrays dynamically by doubling their sizes.
6374         * xalloc.h (x2realloc, x2nrealloc): New decls.
6375         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6376         New functions.
6377
6378         Port to C99 semantics for 'inline' of external functions.
6379         Bug reported by Bruno Haible.
6380         * xmalloc.c (xnmalloc_inline): New static inline function,
6381         with the old contents of xnmalloc.
6382         (xnmalloc, xmalloc): Use it.
6383         (xnrealloc_inline): New static inline function,
6384         with the old contents of xnrealloc.
6385         (xnrealloc, xrealloc): Use it.
6386
6387         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6388
6389 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6390
6391         Fix several address-calculation bugs in the hash modules,
6392         plus some minor code cleanup.
6393
6394         * hash.h: Include <stdbool.h>, for bool.
6395         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6396         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6397         hash_get_n_entries, hash_get_max_bucket_length,
6398         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6399         hash_rehash): Use size_t rather than unsigned.
6400         * hash.c (struct hash_table, hash_get_n_buckets,
6401         hash_get_n_buckets_used, hash_get_n_entries,
6402         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6403         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6404         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6405         Likewise.
6406         (SIZE_MAX): Define if not defined.
6407         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6408         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6409         hash_print):
6410         Use const * when possible.
6411         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6412         (check_tuning): Fix bug: if tuning parameters were very close to
6413         0 or 1, rounding errors could have caused subscript violations.
6414         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6415         (hash_initialize): Add 'fail:' label
6416         to free table and return NULL, and use it to simplify code.
6417         Use calloc rather than clearing the storage ourself.
6418         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6419         buffer size calculations.
6420         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6421         Include <stddef.h>, for size_t.
6422         * hash-pjw.c (hash_pjw): Likewise.
6423         Switch to method described by Bruno Haible.
6424         Include <limits.h>, for CHAR_BIT.
6425         (SIZE_BITS): New macro.
6426
6427 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6428
6429         * getndelim2.c (getndelim2): When size calculation overflows,
6430         ceiling the allocation at NMAX bytes rather than silently
6431         discarding input bytes before NMAX is reached.  This makes
6432         a difference only if NMAX exceeds SIZE_MAX / 2.
6433
6434         * obstack.c: Merge from glibc.
6435         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6436         Add libc_hidden_def (_obstack_newchunk).
6437         (_obstack_free) [! defined _LIBC]: Remove.
6438         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6439         a clone of the function body.
6440         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6441         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6442
6443         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6444         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6445         arg to memcpy.
6446
6447         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6448         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6449         Don't use lvalue casts, as GCC plans to remove support for them
6450         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6451         was also present in the non-GCC version, indicating that this
6452         code had always been buggy and had never been widely used.
6453         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6454         Use the fast variant of each macro, rather than copying the
6455         definiens of the fast variant; that way, we'll be more likely to
6456         catch future bugs in the fast variants.
6457
6458 2003-10-20  Bruno Haible  <bruno@clisp.org>
6459
6460         * wait-process.h: New file, from GNU gettext.
6461         * wait-process.c: New file, from GNU gettext.
6462
6463 2003-10-19  Jim Meyering  <jim@meyering.net>
6464
6465         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6466
6467 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6468
6469         * getgroups.c: Include <errno.h>, <stdlib.h>.
6470         (getgroups): First arg is int, not size_t.
6471         Don't let 'free' mangle errno.
6472
6473 2003-10-16  Jim Meyering  <jim@meyering.net>
6474
6475         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6476
6477 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6478
6479         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6480         (SIZE_MAX): Remove.
6481         (new_exclude, add_exclude_file): Initial size no longer needs to
6482         be a power of 2.
6483         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6484         our own address arithmetic overflow checking.
6485
6486         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6487         (fnmatch): Do not alloca more than 2000 wide characters;
6488         instead, use malloc for large buffers.
6489         Check for address arithmetic overflow, and return -1
6490         with errno set to ENOMEM in that case.
6491         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6492         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6493         instead, return -1.  Check for address arithmetic overflow.
6494
6495 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6496
6497         Handle invalid suffixes and overflow independently, so that
6498         callers can treat them independently as needed.  Fix some bugs in
6499         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6500         suffix for a human-readable blocksize.  The major caller-visible
6501         change is the addition of a new
6502         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6503         that both overflow and suffix chars were found.
6504
6505         * human.c (humblock): Don't check separately for invalid suffix
6506         char; that is xstrtoumax's job (now that its bug is fixed).
6507         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6508         INTMAX_MAX]: New macros.
6509         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6510         TYPE_MAXIMUM): New macros.
6511         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6512         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6513         if overflow occurs, as it's what __strtol does and it's more useful
6514         in practice.
6515         (__xstrtol): If __strtol reports some error other than ERANGE,
6516         reflect it to the caller as LONGINT_INVALID.  If it reports
6517         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6518         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6519         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6520         value.
6521         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6522         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6523         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6524         [defined UINTMAX_MAX]: New macros.
6525
6526 2003-10-14  Bruno Haible  <bruno@clisp.org>
6527
6528         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6529         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6530         Also use volatile where needed.
6531
6532 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6533
6534         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6535         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6536         and define in terms of the other primitives.
6537         * xmalloc.c: Include stdbool.h; do not include exit.h.
6538         (SIZE_MAX): Define if not already defined.
6539         (array_size_overflow): New function.
6540         (xalloc_die): Abort instead of exiting if 'error' returns.
6541         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6542         (xmalloc, xrealloc): Use them.
6543         (xcalloc): Check for address arithmetic overflow.
6544         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6545         a bit faster than strcpy.
6546
6547 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6548
6549         Merge getpass from libc, plus a few fixes.
6550
6551         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6552         Include <stdbool.h>.
6553         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6554         __fsetlocking to empty.
6555         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6556         do include <bits/libc-lock.h>.
6557         Do not include <fcntl.h>; not needed.
6558         [_LIBC]: Include <wchar.h>.
6559         (NOTCANCEL_MODE): New macro.
6560         (flockfile, funlockfile) [_LIBC]: New macros.
6561         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6562         [!_LIBC]: New macros.
6563         (call_fclose): New function.
6564         (getpass): Use it.  Save tty stream separately; this simplifies the
6565         code and makes it more reliable if stdin happens to equal stdout.
6566         Invoke __fsetlocking on tty.
6567         Handle thread cancellation if needed.
6568         Namespace cleanup (use __tcgetattr, __getline).
6569         Use bool for Booleans.
6570         [USE_IN_LIBIO]: Handle wide streams.
6571         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6572         stream might go where.
6573
6574         * unlocked-io.h: Include <stdio.h>, so that the caller
6575         doesn't have to include <stdio.h> before us.
6576         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6577         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6578         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6579         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6580         if not declared, so that we can use getpass.c code from libc without
6581         rewriting it.
6582         (flockfile, ftrylockfile, funlockfile): New macros.
6583
6584 2003-10-06  Bruno Haible  <bruno@clisp.org>
6585
6586         * version-etc-2.h: Remove file.
6587         * version-etc-2.c: Remove file.
6588
6589 2003-09-25  Jim Meyering  <jim@meyering.net>
6590             Bruno Haible  <bruno@clisp.org>
6591
6592         This lets translators provide better translations for the
6593         "Written by ..." part of --version output.
6594         * version-etc.h: Include stdarg.h.
6595         (version_etc_copyright): Declare as readonly.
6596         (version_etc): Make this function variadic with a NULL-terminated list
6597         of author name strings.
6598         (version_etc_va): New declaration.
6599         * version-etc.c: Include stdarg.h, stdlib.h.
6600         (version_etc_copyright): Declare as readonly.
6601         (version_etc_va): New function. Provide a different translatable string
6602         for each possible number of authors < 10. Abbreviate when there are 10
6603         authors or more.
6604         (version_etc): Make this function variadic. Call version_etc_va.
6605         Suggestion from Gary V. Vaughan.
6606
6607         * long-options.h (parse_long_options): Change prototype: the authors
6608         string is moved to the end and becomes variadic.
6609         * long-options.c: Include stdarg.h.
6610         (parse_long_options): Make this function variadic, too.
6611         Call version_etc_va, not version_etc.
6612
6613 2003-10-06  Bruno Haible  <bruno@clisp.org>
6614
6615         * fatal-signal.h: New file, from GNU gettext.
6616         * fatal-signal.c: New file, from GNU gettext.
6617
6618 2003-10-04  Karl Berry  <karl@gnu.org>
6619
6620         * argp*: update from libc.
6621
6622 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6623
6624         * getpass.c (getpass): Use a no-op fseek when switching from input to
6625         output mode on the same stream.
6626
6627 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6628
6629         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6630         Fix arg typo in previous patch.
6631
6632 2003-09-28  Jim Meyering  <jim@meyering.net>
6633
6634         * error.c: Correct cpp indentation.
6635
6636 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6637
6638         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6639         Omit the special code that used __typeof__, since we worry that
6640         it could be more trouble than it's worth.  See:
6641         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6642         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6643
6644         * free.c: New file.
6645
6646 2003-09-26  Jim Meyering  <jim@meyering.net>
6647
6648         * error.c (error_tail): Move some declarations
6649         into inner scope where the local variables are used.
6650
6651 2003-09-26  Bruno Haible  <bruno@clisp.org>
6652
6653         * stpncpy.h (gnu_stpncpy): New declaration.
6654         (stpncpy): Define as alias for gnu_stpncpy.
6655         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6656
6657 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6658
6659         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6660         (error_tail): Do not loop, reallocating temporary buffer, since
6661         the output cannot contain more wide characters than the input
6662         contains bytes, the size must be big enough already.  This avoids
6663         one potential size overflow calculation.  Check for size overflow
6664         when calculating temporary buffer size.  Free temporary buffer
6665         when done, if it was allocated with malloc; this plugs a memory
6666         leak.  Remove casts from void * to pointers, that are no longer
6667         needed now that we're assuming C89 or better.
6668
6669         Merge error changes from glibc.
6670
6671         * error.c, error.h: Update copyright notice header to match glibc.
6672         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6673         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6674         Disable cancellation while printing error.
6675         * error.h: Prepend __ to parameter names.
6676
6677 2003-09-25  Karl Berry  <karl@gnu.org>
6678
6679         * argp-fmtstream.c, argp-help.c: update from libc.
6680
6681 2003-09-25  Bruno Haible  <bruno@clisp.org>
6682
6683         * version-etc-2.h: New file, from version-etc.h with modifications.
6684         * version-etc-2.c: New file, from version-etc.c with modifications.
6685
6686 2003-09-25  Simon Josefsson  <jas@extundo.com>
6687
6688         * xgetdomainname.h: New file.
6689         * xgetdomainname.c: New file.
6690
6691 2003-09-25  Simon Josefsson  <jas@extundo.com>
6692             Bruno Haible  <bruno@clisp.org>
6693
6694         * getdomainname.h: New file.
6695         * getdomainname.c: New file.
6696
6697 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6698
6699         * linebuffer.c (freebuffer): Don't free the argument, just
6700         the buffer associated with the argument.  Bug reported by
6701         Simon Josefsson.
6702
6703 2003-09-19  Karl Berry  <karl@gnu.org>
6704
6705         * argp.h: update from libc.
6706
6707 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6708
6709         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6710         input error, instead of returning NULL the next time we are called
6711         (and therefore losing track of errno).
6712
6713 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6714
6715         * getndelim2.c (getndelim2): Don't trash errno when a read
6716         fails, so that the caller gets the proper errno.
6717
6718         * readutmp.c (read_utmp): Likewise.
6719         Check for fstat error.  Close stream and free storage
6720         when failing.
6721
6722 2003-09-14  Bruno Haible  <bruno@clisp.org>
6723
6724         * fwriteerror.h: New file.
6725         * fwriteerror.c: New file.
6726
6727 2003-09-14  Jim Meyering  <jim@meyering.net>
6728
6729         * getloadavg.c: Correct cpp indentation.
6730         * strdup.c: Likewise.
6731         * vasnprintf.c: Likewise.
6732
6733 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6734
6735         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6736         * obstack.c [!defined _LIBC]: Likewise.
6737         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6738         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6739         * exitfail.c: Don't include stdlib.h; no longer needed.
6740
6741         More changes to assume C89 or better.
6742
6743         * error.c (error_tail): Assume vprintf.
6744
6745         * argmatch.c (getenv): Remove decl.
6746         * progreloc.c (get_full_program_name): Define via prototype.
6747         * setenv.c (clearenv): Likewise.
6748         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6749         needed.
6750         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6751         (malloc, memcpy): Remove decls.
6752         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6753         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6754         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6755         (memcpy): Remove macro.
6756         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6757         (__P): Remove.  All uses removed.
6758         (PTR): Remove.  All uses changed to void *.
6759         (CHAR_BIT, NULL): Remove.
6760         (spaces, zeros, memset_space, memset_zero)
6761         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6762         Remove.
6763         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6764         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6765         Define with prototype.
6766         Remove now-unnecessary prototype decl.
6767         (extra_args_spec): Assume ANSI C.  All uses changed.
6768         (extra_args_spec_iso): Remove.
6769         (my_strftime, emacs_strftimeu): Define via prototype.
6770         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6771         unconditionally.
6772         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6773         * strtoimax.c: Include <stdlib.h> unconditionally.
6774         (strtoul, strtol): Remove decls.
6775         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6776         LONG_MAX): Remove.
6777         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6778         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6779         (LOCALE_PARAM_PROTO): New macro.
6780         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6781         (INTERNAL (strtol), strtol): Define with a prototype.
6782         (PARAMS): Remove.  All uses removed.
6783         * tempname.c: Include <string.h> unconditionally.
6784         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6785         * xgethostname.c (main): Define with a prototype.
6786         * xmalloc.c: Include "xalloc.h" first, to check interface.
6787         Include <stdlib.h> unconditionally.
6788         (calloc, malloc, realloc, free): Remove decls.
6789         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6790         Include <stdlib.h> unconditionally.  Sort include file names.
6791         (strtod): Remove.
6792         (xstrtod): Define with a prototype.
6793         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6794         (strtol, strtoul): Remove decls.
6795
6796 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6797
6798         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6799         Include <stdlib.h>, <string.h> unconditionally.
6800         Remove now-unnecessary cast to char *.
6801         * strnlen.c: Include <string.h> unconditionally.
6802         * yesno.c (yesno): Define with a prototype.
6803
6804 2003-09-10  Bruno Haible  <bruno@clisp.org>
6805
6806         * strcspn.c: Include <string.h> unconditionally.
6807         * strpbrk.c: Include <string.h> unconditionally.
6808         * strstr.c: Include <string.h> unconditionally.
6809         * unicodeio.c: Include <string.h> unconditionally.
6810         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6811         * unsetenv.c: Likewise.
6812         * xreadlink.c: Include <stdlib.h> unconditionally.
6813         * yesno.c: Include <stdlib.h> unconditionally.
6814         (rpmatch): Add prototype.
6815
6816 2003-09-10  Jim Meyering  <jim@meyering.net>
6817
6818         * error.c: Correct indentation of cpp directives.
6819
6820 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6821
6822         More K&R removal.
6823
6824         * acosl.c (main): Use a prototype.
6825         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6826         tanl.c: Likewise.
6827
6828         * getloadavg.c (getloadavg, main): Define via prototypes.
6829
6830         * getopt.h (struct option.name): Assume C89, and use 'const'.
6831         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6832         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6833         with a prototype.
6834         * getopt.c (const): Remove macro.
6835         Include <string.h> unconditionally.
6836         (my_index): Remove; all uses changed to strchr.
6837         (strlen): Remove decl.
6838         (exchange): Remove forward decl; no longer needed.
6839         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6840         Define with prototype.
6841         * getopt1.c (const): Remove macro.
6842         (getopt_long, getopt_long_only, main): Define with prototype.
6843
6844         * getugroups.c: Include <string.h> unconditionally.
6845
6846         * getusershell.c: Include <stdlib.h> unconditionally.
6847         (getusershell, setusershell, endusershell, readname, main):
6848         Define with prototypes.
6849
6850         * group-member.c: Include group-member.h first.
6851         Include <stdlib.h> unconditionally.
6852
6853         * hard-locale.c: Include hard-locale.h first.
6854         Include <stdlib.h>, <string.h> unconditionally.
6855
6856         * hash.c (free, malloc): Remove decls.
6857         Include <stdlib.h> unconditionally.
6858
6859         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6860         (getenv): Do not declare.
6861
6862         * idcache.c: Include <string.h> unconditionally.
6863
6864         * long-options.c: Include long-options.h first, to test interface.
6865         Include <stdlib.h> unconditionally.
6866
6867         * makepath.c: Include makepath.h first, to test interface.
6868         Include <stdlib.h> and <string.h> unconditionally.
6869
6870         * linebuffer.c: Include <stdlib.h>.
6871         (free): Remove decl.
6872
6873         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6874         rpl_malloc returns void *, not char *.
6875         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6876
6877         * md5.h: Include <limits.h> unconditionally.
6878         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6879         (__P): Remove; all uses removed.
6880         * md5.c: Include "md5.h" first.
6881         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6882         md5_buffer, md5_process_bytes, md5_process_block):
6883         Define with prototypes.
6884         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6885         * sha.c: Include "sha.h" first.
6886         Include <stdlib.h>, <string.h> unconditionally.
6887
6888         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6889         * memcmp.c (__ptr_t): Likewise.
6890         * memrchr.c (__ptr_t): Likewise.
6891         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6892         Include <string.h> unconditionally.
6893         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6894         * memchr.c: Include <stdlib.h> unconditionally.
6895         * memchr.c (LONG_MAX): Remove.
6896         * memrchr.c (LONG_MAX): Likewise.
6897         * memchr.c (__memchr): Define via a prototype.
6898         * memrchr.c (__memrchr): Likewise.
6899         * memcmp.c (__P): Remove, and remove all uses.
6900         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6901         Remove forward decls; no longer needed.
6902         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6903         Use types required by C89 in prototype.
6904
6905         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6906         * savedir.c: Likewise.
6907         * mkdir.c (free): Remove decl.
6908         * rmdir.c (rmdir): Define with a prototype.
6909         * savedir.c: Include savedir.h first, to test interface.
6910
6911         * mktime.c (STDC_HEADERS): Remove.
6912         Include <stdlib.h>, <string.h> unconditionally.
6913
6914         * modechange.c: Include <stdlib.h> unconditionally.
6915         (malloc): Remove decl.
6916
6917         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6918         (free): Remove decl.
6919
6920         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6921         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6922         (This type really should be intptr_t, but that's a C99ism.)
6923         (_obstack_memcpy): Remove: all uses changed to memcpy.
6924         Include <string.h> unconditionally.
6925         (struct obstack): Assume __STDC__ for types of members
6926         chunkfun, freefun, extra_arg.
6927         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6928         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6929         obstack_begin, obstack_specify_allocation,
6930         obstack_specify_allocation_with_arg, obstack_chunkfun,
6931         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6932         Remove unprototyped decls and the macros that use them.
6933         * obstack.c (POINTER): Remove.  All uses changed to void *.
6934         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6935         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6936         (defined __STDC__ && __STDC__)]:
6937         Remove nonprototyped code.
6938         Include <stdlib.h> unconditionally.
6939         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6940         _obstack_allocated_p, _obstack_free, obstack_free,
6941         _obstack_memory_used, print_and_abort):
6942         Define using prototypes.
6943         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6944         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6945         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6946         obstack_next_free, obstack_object_size, obstack_room) [0]:
6947         Remove unused, unprototyped code.
6948
6949         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6950
6951         * physmem.c (physmem_total, physmem_available, main): Define
6952         with prototypes.
6953
6954         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6955         (main): Define with a prototype.
6956
6957         * posixver.c (getenv): Remove decl.
6958
6959         * putenv.c (malloc): Returns void *, not char *.
6960         Include <string.h> unconditionally.
6961         (strchr, memcpy, NULL): Do not define.
6962
6963         * readtokens.c: Include readtokens.h first, to test interface.
6964         Include <stdlib.h>, <string.h> unconditionally.
6965         (init_tokenbuffer): Define with a prototype.
6966
6967         * regex.c (PARAMS): Remove.  All uses removed.
6968         All uses of _RE_ARGS removed, too.
6969         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6970         unconditionally.
6971         (bzero): Assume memset exists.
6972         (memcmp, memcpy, NULL): Remove.
6973         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6974         char, or assignments to local vars of type signed char.
6975         (init_syntax_once, PREFIX(extract_number_and_incr),
6976         PREFIX(print_partial_compiled_pattern),
6977         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6978         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6979         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6980         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6981         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6982         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6983         wcs_compile_range, byte_compile_range, truncate_wchar,
6984         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6985         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6986         count_mbs_length, wcs_re_match_2_internal,
6987         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6988         PREFIX(alt_match_null_string_p),
6989         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6990         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6991         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6992         now-unnecessary declaration, if any.
6993         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6994         regcomp, regexec):
6995         Remove now-unnecessary casts among pointer types.
6996         * regex.h (_RE_ARGS): Remove.  All uses removed.
6997
6998         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6999         (free): Remove decl.
7000
7001         * rpmatch.c: Include <stdlib.h> unconditionally.
7002
7003         * same.c: Include <stdlib.h>, <string.h> unconditionally.
7004         (free): Remove decl.
7005
7006         * save-cwd.c: Include <stdlib.h> unconditionally.
7007         * xgetcwd.c: Likewise.
7008
7009         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7010         (free): Remove decl.
7011
7012         * strchrnul.c (strchrnul): Define with a prototype.
7013         Fix bug: c_in was not converted to char before searching.
7014
7015         The following changes are not K&R related:
7016
7017         * group-member.h: Include <sys/types.h>, so that this file is
7018         self-contained.
7019         * makepath.h: Likewise.
7020
7021         * getusershell.c (readname, default_index, line_size, readname):
7022         Use size_t, not int, for sizes.
7023         (readname): If the size overflows, report an error instead of
7024         looping forever.
7025
7026 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
7027
7028         * getndelim2.c: Assume stdlib.h per the C89 spec.
7029
7030 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7031
7032         Assume C89 or better; remove K&R cruft.
7033         A few of these changes were first proposed by Derek Robert Price
7034         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7035
7036         * addext.c: Include <string.h> unconditionally.
7037         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7038         Don't declare getenv or malloc.
7039
7040         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7041         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7042         (NULL): Remove.
7043         (find_stack_direction, alloca): Use prototypes.
7044
7045         * atexit.c (atexit): Define using a prototype.
7046
7047         * basename.c, dirname.c, stripslash.c:
7048         Include <string.h> unconditionally.
7049
7050         * bcopy.c: Include <stddef.h>.
7051         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7052
7053         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7054
7055         * error.h (error, error_at_line, error_print_progname)
7056         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7057         * error.c: Include error.h first, to check interface.
7058         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7059         (VA_START): Remove; all uses changeed to va_start.
7060         (exit, strerror): Remove decls.
7061         (error_print_progname): Prototype uncondionally.
7062         Don't include <errno.h>; no longer needed.
7063         (private_strerror): Remove.
7064         (error_tail): Always define.
7065         (error, error_at_line): Assume C89 or better; always use prototypes.
7066         * fatal.c: Include "fatal.h" first, to test interface.
7067         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7068         (VA_START): Remove; all uses changed to va_start.
7069         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7070         this case.
7071         (exit): Remove decl.
7072         (fatal): Prototype unconditionally.  Assume va_start works.
7073         Abort at end, to pacify gcc.
7074
7075         * euidaccess.c (main): Define with a prototype.
7076
7077         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7078
7079         * exitfail.c: Include <stdlib.h> unconditionally.
7080
7081         * fnmatch_.h (__P): Remove.  All uses changed to assume
7082         prototypes.
7083         * fnmatch.c: Include fnmatch.h first, to test interface.
7084         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7085         (getenv): Remove decl.
7086         (fnmatch): Define using a prototype.
7087         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7088         (FCT): Define using a prototype.
7089
7090         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7091
7092         * gethostname.c: Include <stddef.h>.
7093         (gethostname): Define with prototype.  Length is size_t, not int.
7094
7095 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7096
7097         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7098         getversion.c should have been removed then, but was accidentally
7099         preserved.
7100
7101         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7102         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7103
7104 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7105
7106         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7107         copy_tm_result.  Bug reported by Simon Josefsson in
7108         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7109
7110 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7111
7112         * time_r.c, time_r.h: New files.
7113
7114         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7115         __localtime_r.
7116         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7117         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7118
7119         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7120         __gmtime_r.
7121         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7122         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7123         Include <time_r.h>.
7124
7125         * timegm.c: Switch to glibc implementation, with the following changes:
7126         [defined HAVE_CONFIG_H]: Include <config.h>.
7127         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7128         (__mktime_internal) [!defined _LIBC]: New decl.
7129         (__gmtime_r) [!defined _LIBC]: New macro and function.
7130         (timegm): Use a prototype, since gnulib assumes C89.
7131         Do not bother declaring tmp to be const, as it's not really usefu.
7132         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7133         (timegm): Declare only if HAVE_DECL_TIMEGM.
7134
7135 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7136
7137         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7138         Bug reported by Lute Kamstra in
7139         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7140
7141         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7142         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7143         course with correspondingly smaller numbers for tomorrow and
7144         yesterday.  From Tadayoshi Funaba.  Originally installed into
7145         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7146         coreutils merge?).
7147
7148 2003-08-31  Simon Josefsson  <jas@extundo.com>
7149
7150         * timegm.h: New file.
7151         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7152
7153 2003-08-31  Karl Berry  <karl@gnu.org>
7154
7155         * argp.h: update from libc.
7156
7157 2003-08-28  Bruno Haible  <bruno@clisp.org>
7158
7159         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7160         warning on QNX, which defines O_BINARY to 000000.
7161
7162 2003-08-24  Bruno Haible  <bruno@clisp.org>
7163
7164         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7165         MSVC7 <stdio.h> is included later.
7166
7167 2003-08-20  Bruno Haible  <bruno@clisp.org>
7168
7169         * progname.h: New file, from GNU gettext.
7170         * progname.c: New file, from GNU gettext.
7171         * progreloc.c: New file, from GNU gettext.
7172
7173 2003-08-19  Bruno Haible  <bruno@clisp.org>
7174
7175         * xstrdup.c: Assume <string.h> exists.
7176
7177 2003-08-18  Jim Meyering  <jim@meyering.net>
7178
7179         * setenv.h: Indent nested cpp directive.
7180         * vasnprintf.c: Remove trailing blanks.
7181
7182 2003-08-17  Simon Josefsson  <jas@extundo.com>
7183             Bruno Haible  <bruno@clisp.org>
7184
7185         * xstrndup.h: New file.
7186         * xstrndup.c: New file.
7187
7188 2003-08-17  Bruno Haible  <bruno@clisp.org>
7189
7190         * strndup.h: New file.
7191
7192 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7193
7194         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7195         space, undoing this 2003-08-12 change:
7196         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7197
7198 2003-08-16  Jim Meyering  <jim@meyering.net>
7199
7200         Merge from coreutils.
7201         * xstrtoimax.c: #else #if -> #elif.
7202         * xstrtoumax.c: Likewise.
7203
7204 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7205
7206         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7207         rather than tab, after '#' in shell-script copyright notices.
7208         Suggested by Bruno Haible.
7209
7210 2003-08-15  Jim Meyering  <jim@meyering.net>
7211         and Paul Eggert  <eggert@twinsun.com>
7212
7213         Merge from coreutils.
7214         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7215         member but strut utmpx does not.  Needed for AIX 4.3.3.
7216         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7217
7218 2003-08-15  Jim Meyering  <jim@meyering.net>
7219
7220         Merge from coreutils.
7221         * xgethostname.c: Include <stdlib.h>.
7222         (xghostname): Don't exit for anything other than memory-related
7223         failure; just return NULL.
7224         * userspec.c: Include "posixver.h".
7225         (parse_user_spec): Accept `.' as a separator only
7226         in pre-POSIX-200112 mode.
7227         * strtoimax.c: Use #elif rather than #else #if.
7228         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7229         Remove function, now that we can rely on a working tzset function.
7230         [!_LIBC]: Ensure that the required autoconf test has been run.
7231         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7232         Use underlying_strftime for %r.
7233         * sha.c: Merge in some clean-up and optimization changes from glibc.
7234         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7235         Ensure that it is a multiple of 64.
7236         Rearrange loop exit tests so as to avoid performing an
7237         additional fread after encountering an error or EOF.
7238         * realloc.c: Update copyright date.
7239
7240 2003-08-14  Jim Meyering  <jim@meyering.net>
7241
7242         Merge from coreutils.
7243         * obstack.h: Whitespace changes.
7244         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7245         and xcalloc return values.
7246         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7247         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7248         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7249         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7250         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7251         error from mntctl.
7252         Use mntctl's return value to drive the entry-processing loop, since
7253         we can't rely on the value of the vmt_length member in the last
7254         entry.  On some systems doing so could result in exhausting
7255         virtual memory.  Based in part on a patch from Mike Jetzer.
7256
7257 2003-08-14  Jim Meyering  <jim@meyering.net>
7258         and Paul Eggert  <eggert@twinsun.com>
7259
7260         Merges from coreutils, plus other fixes.
7261         * physmem.c: Merge in portability changes from gcc/libiberty
7262         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7263         for credits and details.  Thanks to Kaveh Ghazi for helping
7264         to keep these files in sync.
7265         (ARRAY_SIZE): Define it.
7266         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7267         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7268         (memcasecmp): Don't assume size_t fits in unsigned int.
7269         Remove casts and duplicate code.
7270         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7271         (memcpy): Remove definition.
7272         Merge in some clean-up and optimization changes from glibc.
7273         [BLOCKSIZE]: Move definition to top of file.
7274         Ensure that it is a multiple of 64.
7275         Rearrange loop exit tests so as to avoid performing an
7276         additional fread after encountering an error or EOF.
7277         * md5.h (md5_uintptr): Define.
7278         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7279         return to the initial working directory.  Preserve errno
7280         for caller.
7281         * idcache.c: Include "xalloc.h".
7282         (xmalloc, xrealloc): Remove decls.
7283         (getuser): Remove casts no longer required in C89.
7284         * human.c: Include stdio.h, for sprintf.
7285         * group-member.c: Include "xalloc.h".
7286         (xmalloc, xrealloc): Remove decls.
7287         (get_group_info): Remove casts no longer required in C89.
7288         * getusershell.c (readname): Remove casts no longer required in C89.
7289         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7290         * getline.c: Whitespace fix, from coreutils.
7291
7292 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7293
7294         * exclude.c: Include <ctype.h>
7295         (IN_CTYPE_DOMAIN): New macro.
7296         (is_space): New fn.
7297         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7298         and empty lines.
7299
7300         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7301         Undo previous (whitespace-only) change.
7302
7303 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7304
7305         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7306         Normalize leading white space and remove trailing white space.
7307         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7308         notice, as per ../config/srclist-update.
7309
7310         Merge from coreutils.
7311         * euidaccess.h: New file.
7312         * euidaccess.c: Include it.
7313         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7314         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7315         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7316
7317 2003-08-11  Bruno Haible  <bruno@clisp.org>
7318
7319         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7320         (vasnprintf): Use it instead of wcslen.
7321
7322 2003-08-11  Bruno Haible  <bruno@clisp.org>
7323
7324         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7325         value to ensure that _Bool promotes to int. Use #define for _Bool when
7326         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7327
7328 2003-08-10  Karl Berry  <karl@gnu.org>
7329
7330         * regex.h: update from libc (whitespace fix).
7331
7332 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7333
7334         Merge some files from coreutils.  These changes were
7335         originally made by Jim Meyering.
7336         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7337         many older Unixes require this.
7338         * alloca.c (alloca): Remove cast to argument of free;
7339         no longer needed in C89.
7340         * alloca_.h, regex.h: Fix white space to match
7341         what GNU indent does.
7342
7343 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7344
7345         * bumpalloc.h: Remove.
7346
7347 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7348
7349         * getloadavg.c: Change copyright notice and spacing to conform to
7350         GNU coding style.
7351
7352         Merge from coreutils.
7353         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7354         From glibc.
7355         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7356         from Karl Berry, implemented by Jim Meyering.
7357         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7358         from Dmitry V. Levin.
7359         Remove anachronistic cast of xrealloc.
7360         * fnmatch_.h (__const): Remove.  Use 'const'.
7361         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7362         type. Otherwise, it wouldn't compile with at least /bin/cc on
7363         ymp-cray-unicos9.0.2.X.
7364         Combine two mostly-identical uses of alloca into one.
7365         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7366
7367 2003-08-04  Dave Love <d.love@dl.ac.uk>
7368
7369         [From Emacs.]
7370
7371         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7372         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7373         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7374         obsolete NLIST_NAME_UNION.
7375         [__GNU__]: Undef BSD and FSCALE.
7376         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7377
7378 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7379
7380         * stdbool_.h (_Bool): Make it signed char, instead of
7381         an enum type, so that it's guaranteed to promote to int.  See:
7382         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7383
7384 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7385
7386         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7387         (strerror): Don't assume that a printable int fits in 14 bytes.
7388
7389 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7390             Bruno Haible  <bruno@clisp.org>
7391
7392         * getline.h (getline, getdelim): Change return type to ssize_t.
7393         * getline.c (getline, getdelim): Likewise.
7394         Remove _GNU_SOURCE define; now it's defined in config.h through
7395         m4/getline.m4.
7396
7397 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7398
7399         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7400         over-parenthesization in macros.
7401
7402         Sync with coreutils.
7403
7404         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7405         required by C99.
7406
7407         Use `exit_failure' for xalloc and xmemcoll instead of their own
7408         private exit-failure variables.
7409         * xalloc.h (xalloc_exit_failure): Remove.
7410         * xmalloc.c: Likewise.  Include exitfail.h.
7411         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7412         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7413         * xmemcoll.c: Likewise.  Include exitfail.h.
7414         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7415
7416 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7417
7418         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7419         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7420         to test that it can stand by itself.  Include "exitfail.h".
7421         Clients should set exit_failure instead.
7422         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7423
7424 2003-07-18  Andreas Schwab  <schwab@suse.de>
7425
7426         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7427
7428 2003-07-18  Bruno Haible  <bruno@clisp.org>
7429
7430         * getndelim2.h: New file.
7431         * getndelim2.c: Make into a module of its own. Include config.h,
7432         getndelim2.h.
7433         (getndelim2): Make non-static. Change return type to ssize_t.
7434         * getline.h: Change argument names.
7435         * getline.c: Include getndelim2.h instead of getndelim2.c.
7436         * getnline.c: Include getndelim2.h.
7437
7438 2003-07-17  Bruno Haible  <bruno@clisp.org>
7439
7440         * Makefile.am: Remove file.
7441         * Makefile.in: Remove file.
7442
7443 2003-07-17  Bruno Haible  <bruno@clisp.org>
7444
7445         * getnline.h: New file.
7446         * getnline.c: New file.
7447         * getndelim2.c: New file, extracted from getline.c.
7448         (getndelim2): Renamed from getdelim2, with added nmax argument.
7449         * getline.c: Include getndelim2.c.
7450         (getdelim2): Moved out to getndelim2.c.
7451         (getline, getdelim): Update.
7452
7453 2003-07-15    <karl@gnu.org>
7454
7455         * vasnprintf.c: update from gettext.
7456
7457 2003-07-15  Jim Meyering  <jim@meyering.net>
7458
7459         * makepath.c (make_path): Enclose diagnostic in _(...).
7460
7461 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7462
7463         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7464         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7465         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7466         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7467         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7468         updated automatically by ../config/srclist-update.  This changes
7469         their license from LPGL to GPL.
7470
7471 2003-07-14  Jim Meyering  <jim@meyering.net>
7472
7473         Don't emit diagnostics.  Let callers do that.
7474         * save-cwd.c: Don't include "error.h".
7475         (save_cwd): Don't call error.  Ensure that errno is valid
7476         when returning nonzero.
7477
7478         * save-cwd.h (restore_cwd): Update prototype.
7479         * save-cwd.c (restore_cwd): Remove two parameters.
7480         Simplify.  Don't call error upon failure.  Let callers do that.
7481         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7482         when auditing is enabled.  But don't bother updating the #if.
7483
7484 2003-07-14  Simon Josefsson  <jas@extundo.com>
7485
7486         * mempcpy.h: New file.
7487         * mempcpy.c: New file.
7488
7489 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7490
7491         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7492         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7493         unicodeio.c, unicodeio.h, unlocked-io.h:
7494         Switch from LGPL to GPL.
7495
7496 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7497
7498         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7499         it breaks C++ compilation.
7500         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7501
7502 2003-07-10  Jim Meyering  <jim@meyering.net>
7503
7504         * vasnprintf.c: Remove trailing blanks.
7505         Make cpp indentation consistent.
7506
7507 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7508
7509         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7510         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7511         Switch from LGPL to GPL.
7512
7513 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7514
7515         * mktime.c: Fix some boundary cases and remove need for floating point.
7516
7517         Issue a compile-time diagnostic if time_t is floating point, or if
7518         two's complement arithmetic is not in effect, or if arithmetic
7519         right shift does not propagate the sign.  These assumptions were
7520         all in the original code but they weren't checked.
7521
7522         (TIME_T_MIDPOINT, verify): New macros.
7523         (__isleap): Remove; it has integer overflow problems.
7524         (leapyear): New function, without those problems.
7525         (ydhms_tm_diff): Remove; splitting into two parts.
7526         (ydhms_diff): New function, containing the arithmetic part of
7527         the old ydhms_tm_diff function.  Issue a compile-time
7528         diagnostic if we are not using C99 integer division.
7529         Avoid casts when possible.
7530         (guess_time_tm): New function, containing the checking part of
7531         the old ydhms_tm_diff function.  Return the new value, rather than
7532         the difference between it and the old.  Accept a new argument T
7533         so that *T specifies the old value.  Check for overflow in the result.
7534
7535         (__mktime_internal): Use a time_t offset, not a long int offset.
7536         This undoes the 2003-06-04 change, which is no longer needed now
7537         that we have better overflow checking.
7538         (localtime_offset): Likewise.
7539
7540         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7541         and long are 64-bit but int is only 32-bit.
7542         (ydhms_diff): Use long int to store year1 and yday1.
7543         Issue a compile-time diagnostic if long int is not wide enough.
7544
7545         (__mktime_internal): Use long int to store adjusted year and yday.
7546         Use plain C rather than preprocessor commands, if that doesn't
7547         affect efficiency.
7548         Check for overflow (and try to repair) after each probe
7549         rather than checking only at the very end.  This avoids some bugs
7550         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7551         does not equal GMT offset at maximum time).
7552         Use integer to check for overflow rather than floating point; this
7553         is more portable to non-IEEE hosts, and is a tad faster.
7554         When we detect that we are oscillating between two values,
7555         don't check whether tm_isdst has the requested value, since
7556         we already know the answer.  When tm_isdst has the wrong value,
7557         use a different heuristic to find the right one, based on the
7558         extreme values actually observed in practice in tz2003a,
7559         rather than the (overly optimistic) "previous 3 calendar quarters".
7560
7561         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7562         "T const" to accommodate glibc style.
7563         (check_result): Use less-confusing report format.  "long" -> "long int.
7564         (main): Likewise.
7565         Don't loop if the iteration overflows time_t.
7566         Allow a negative step in the iteration.
7567
7568 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7569
7570         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7571         having it depend on HAVE_SYS_TYPES_H.
7572
7573 2003-06-25  Bruno Haible  <bruno@clisp.org>
7574
7575         * readlink.c: New file.
7576
7577 2003-06-20  Bruno Haible  <bruno@clisp.org>
7578
7579         Assume C89, so PARAMS isn't needed.
7580         * unicodeio.h (PARAMS): Remove.
7581         * unicodeio.c: Don't use PARAMS.
7582
7583 2003-06-18  Jim Meyering  <jim@meyering.net>
7584
7585         Merge changes from coreutils.
7586         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7587         Remove explicit declarations of xmalloc and realloc.
7588         Include xalloc.h.
7589         (read_utmp): Remove anachronistic cast of xmalloc.
7590
7591 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7592
7593         Assume C89, so PARAMS isn't needed.
7594         * backupfile.h (PARAMS): Remove.  All uses removed.
7595         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7596         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7597         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7598         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7599         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7600         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7601         xstrtol.h: Likewise.
7602         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7603         same.h, strverscmp.h: Do not include config.h; no longer needed.
7604         Anyway, config.h should always be included before any other file.
7605
7606 2003-06-11  Simon Josefsson  <jas@extundo.com>
7607
7608         * sysexit_.h: New file.
7609
7610 2003-05-20  Derek Price  <derek@ximbiot.com>
7611
7612         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7613
7614 2003-06-10  Simon Josefsson  <jas@extundo.com>
7615
7616         * strchrnul.h: New file.
7617         * strchrnul.c: New file.
7618
7619 2003-06-10  Simon Josefsson <jas@extundo.com>
7620
7621         * argp.h: New file, from glibc.
7622         * argp-ba.c: New file, from glibc.
7623         * argp-eexst.c: New file, from glibc.
7624         * argp-fmtstream.c: New file, from glibc.
7625         * argp-fmtstream.h: New file, from glibc.
7626         * argp-fs-xinl.c: New file, from glibc.
7627         * argp-help.c: New file, from glibc.
7628         * argp-namefrob.h: New file, from glibc.
7629         * argp-parse.c: New file, from glibc.
7630         * argp-pv.c: New file, from glibc.
7631         * argp-pvh.c: New file, from glibc.
7632         * argp-xinl.c: New file, from glibc.
7633
7634 2003-06-07  Jim Meyering  <jim@meyering.net>
7635
7636         * readtokens.h: Put `Free Software Foundation, Inc.'
7637         in place of my name in the copyright comment.
7638         Remove definition and uses of __P.
7639
7640         From coreutils.
7641         * stat.c: Don't declare xmalloc explicitly.
7642         Instead, include "xalloc.h".
7643         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7644         xrealloc, and xcalloc return values.
7645         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7646         Improve comment.
7647         * xgetcwd.h: Remove definition/uses of PARAMS.
7648
7649 2003-06-06  Jim Meyering  <jim@meyering.net>
7650
7651         * stdbool_.h: Renamed from stdbool.h.in.
7652
7653 2003-06-06  Jim Meyering  <jim@meyering.net>
7654
7655         Merge from coreutils.
7656         * same.c: (same_name): Declare *_basename locals to be `const'.
7657         Consolidate declarations and initializations of *_base* locals.
7658
7659         Merge from coreutils.
7660         This avoids a core dump on systems without GNU putenv,
7661         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7662         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7663         (unsetenv): New static function, from GNU libc.
7664         (rpl_putenv): Use it.
7665
7666         * modechange.c: Remove trailing blanks.
7667
7668         Merge from coreutils.
7669         * fsusage.c: Remove declaration of statfs.
7670         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7671
7672         * posixtm.c: Include <stdbool.h> unconditionally.
7673
7674 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7675
7676         * mktime.c (__mktime_internal): When resolving a tm_isdst
7677         mismatch, look in future quarters as well as past.  This fixes a
7678         bug when processing fall-backwards gaps immediately after a long
7679         period of daylight-saving time.
7680
7681         * mktime.c: Assume freestanding C89 or better.
7682         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7683         (__P): Remove; not used.
7684         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7685         (mktime, not_equal_tm, print_tm, check_result,
7686         main): Use prototypes.  Use const * where appropriate.
7687         (main): Fix typo in testing code that uncovered by above changes.
7688         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7689
7690 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7691
7692         * mktime.c: Fix Debian bug 177940
7693         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7694         (localtime_offset): Now long int, not time_t, because we want it
7695         to be guaranteed to be signed.  All uses changed.
7696         (__mktime_internal): If overflow would occur when adding offset,
7697         don't add it.
7698
7699         Merge 'human' changes from coreutils.  Rewrite to support
7700         locale-specific notations like thousands separators.
7701         * human.c: Simplify authorship notice.
7702         Include human.h immediately after config.h.
7703         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7704         <limits.h>: Do not include, since human.h does.
7705         (SIZE_MAX, UINTMAX_MAX): New macros.
7706         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7707         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7708         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7709         (power_letter): Renamed from suffixes.
7710         (generate_suffix_backwards): Remove.
7711         (adjust_value): Now takes int style (because of human.h changes)
7712         and long double value (for greater precision on some platforms).
7713         (group_number): New function.
7714         (human_readable): Use it.  Use integer options, not enum.
7715         Put the options before the sizes in the arg list.
7716         Support all the new options.
7717         The old human_readable function has been removed;
7718         use inttostr.h instead.
7719         (human_readable, default_block_size, humblock):
7720         Use uintmax_t, not int, for block sizes.
7721         (human_readable_inexact, block_size_types): Remove.
7722         (block_size_opts): New constant.
7723         (human_options): Renamed from human_block_size, with new signature
7724         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7725         * human.h: Add copyright and authorship notice.
7726         Include <limits.h> and <stdbool.h> unconditionally.
7727         (PARAMS): Remove.  All uses removed.
7728         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7729         (enum human_inexact_style): Remove tag; now a nameless enum.
7730         (human_floor, human_ceiling, human_round_to_even): Now have
7731         values 2, 0, 1 rather than -1, 1, 0.
7732         (human_group_digits, human_suppress_point_zero, human_autoscale,
7733         human_base_1024, human_SI, human_B): New constants.
7734         (human_readable_inexact, human_block_size): Remove.
7735         (human_readable): Size args are now uintmax_t, not int.
7736         (human_options): New decl.
7737
7738         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7739         unnecessary now that we assume C89 or better.  This change
7740         imported from coreutils.
7741
7742         * mktime.c (__mktime_internal): Do not reject negative timestamps
7743         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7744         in the 2003-05-30 sync from glibc.
7745
7746         .h files should stand alone, but we shouldn't include <sys/types.h>
7747         if we can get away with just <stddef.h>.
7748
7749         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7750         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7751         rather than <sys/types.h>, as we merely need size_t.
7752         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7753         to get size_t.
7754         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7755         Include <stdio.h>, to get FILE.
7756         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7757         memcasecmp.h has included <stddef.h> and all we need is size_t.
7758         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7759         our interface, instead of including <sys/types.h>
7760
7761 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7762
7763         [from coreutils]
7764         Fix some minor time-related bugs with POSIX time arguments.
7765         Some valid time stamps were being rejected (notably -1, and
7766         time stamps before 1900 on 64-bit hosts).  And some invalid
7767         time stamps were being accepted, e.g. September 31.
7768
7769         * posixtm.h (posixtime): Return bool instead of time_t, so
7770         that we can return (time_t) -1 successfully.
7771         * posixtm.c: Likewise.
7772         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7773         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7774         (t): Remove static var.
7775         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7776         of static var.  All uses changed.
7777         (year): Do not reject years before 1900; they can occur with
7778         64-bit time_t.
7779         (posix_time_parse): Do not check for out-of-range components;
7780         that is now the caller's responsibility, since our checks were
7781         only approximations.
7782         (posixtime): Use mktime to check for out-of-range components,
7783         since it knows them exactly.
7784         If mktime returns (time_t) -1, check whether an error actually occurred
7785         by invoking localtime on -1.
7786         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7787         posixtime failures better.
7788         Improve the test data (in comments only).
7789
7790 2003-05-30    <karl@gnu.org>
7791
7792         * mktime.c: update from libc.
7793
7794 2003-05-30  Bruno Haible  <bruno@clisp.org>
7795
7796         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7797         * localcharset.h: Likewise.
7798         * localcharset.c: Likewise.
7799
7800 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7801
7802         Assume the headers required for C89 freestanding compilers.
7803         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7804         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7805         without checking for HAVE_LIMITS_H.
7806         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7807         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7808         to do that.
7809         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7810         * exclude.c: Include <stdbool.h> unconditionally.
7811         * tempname.c: Include <stddef.h> unconditionally.
7812         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7813         * modechange.c, rpmatch.c (NULL): Don't define, since
7814         <stddef.h> does that.
7815         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7816         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7817         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7818         * xstrtol.c: Likewise.
7819         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7820         * savedir.c: Include <stddef.h> instead of defining NULL.
7821
7822         * addext.c (addext): Use assignment rather than cast, to avoid
7823         warnings on some platforms.
7824
7825         * mktime.c (__mktime_internal): Do not reject negative timestamps
7826         arbitrarily.
7827
7828 2003-05-10  Bruno Haible  <bruno@clisp.org>
7829
7830         * linebreak.c (iconv_string_length): Don't return -1 just because the
7831         string is longer than 4 KB.
7832
7833 2003-05-12  Jim Meyering  <jim@meyering.net>
7834
7835         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7836         the space-padded-by-default conversion specifiers, %e, %k, %l.
7837
7838 2003-05-03  Bruno Haible  <bruno@clisp.org>
7839
7840         Upgrade to Unicode-4.0.
7841         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7842         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7843         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7844         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7845         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7846         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7847         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7848         Change width of U+E0100..U+E01EF from 1 to 0.
7849
7850 2003-04-25  Bruno Haible  <bruno@clisp.org>
7851
7852         * copy-file.c: Include <stddef.h>, for size_t.
7853
7854 2003-04-25  Jim Meyering  <jim@meyering.net>
7855
7856         * copy-file.c (copy_file_preserving): Declare buf_size to be
7857         of type size_t, not int.
7858
7859 2003-04-11  Jim Meyering  <jim@meyering.net>
7860
7861         Merge changes from Coreutils.
7862
7863         2003-03-22  Jim Meyering  <jim@meyering.net>
7864
7865         * strftime.c (widen): Cast alloca return value to proper type.
7866
7867         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7868
7869         From GNU libc.
7870         * strftime.c (my_strftime): Handle very large width
7871         specifications for numeric values correctly.  Improve checks for
7872         overflow.
7873
7874         2003-01-19  Jim Meyering  <jim@meyering.net>
7875
7876         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7877         (nl_get_alt_digit) [! defined my_strftime]: Define.
7878         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7879         _nl_get_alt_digit and _nl_get_walt_digit.
7880
7881         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7882         These changes have no effect outside of _LIBC.
7883
7884 2003-04-10  Bruno Haible  <bruno@clisp.org>
7885
7886         * findprog.h: New file, from GNU gettext.
7887         * findprog.c: New file, from GNU gettext.
7888
7889 2003-04-05  Jim Meyering  <jim@meyering.net>
7890
7891         Merge changes from Coreutils.
7892
7893         * exclude.h (PARAMS): Remove definition and uses.
7894         * exclude.c: Remove uses of `PARAMS'.
7895
7896         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7897         Add test-cases for DOS filenames. Declare program_name.
7898         (main): Set up program_name.  Patch by Rich Dawe.
7899
7900         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7901         error from mntctl.
7902         Use mntctl's return value to drive the entry-processing loop, since
7903         we can't rely on the value of the vmt_length member in the last
7904         entry.  On some systems doing so could result in exhausting
7905         virtual memory.  Based in part on a patch from Mike Jetzer.
7906
7907 2003-04-04  Bruno Haible  <bruno@clisp.org>
7908
7909         * linebreak.h: New file, from GNU gettext.
7910         * linebreak.c: New file, from GNU gettext with slight modifications.
7911         * lbrkprop.h: New file, from GNU gettext.
7912
7913 2003-04-03  Bruno Haible  <bruno@clisp.org>
7914
7915         * utf8-ucs4.h: New file, from GNU gettext.
7916         * utf16-ucs4.h: New file, from GNU gettext.
7917         * ucs4-utf8.h: New file, from GNU gettext.
7918         * ucs4-utf16.h: New file, from GNU gettext.
7919
7920 2003-04-02  Bruno Haible  <bruno@clisp.org>
7921
7922         * binary-io.h: New file, from GNU gettext.
7923
7924 2003-04-01  Bruno Haible  <bruno@clisp.org>
7925
7926         * pathname.h: New file, from GNU gettext.
7927         * concatpath.c: New file, from GNU gettext.
7928
7929 2003-03-30  Bruno Haible  <bruno@clisp.org>
7930
7931         * copy-file.c (copy_file_preserving): Don't set owner if the function
7932         chown() doesn't exist.
7933
7934 2003-03-28  Bruno Haible  <bruno@clisp.org>
7935
7936         * copy-file.h: New file, from GNU gettext.
7937         * copy-file.c: New file, from GNU gettext.
7938
7939 2003-03-18  Jim Meyering  <jim@meyering.net>
7940
7941         * quote.c (quote_n): Fix typo in comment.
7942
7943 2003-03-14  Jim Meyering  <jim@meyering.net>
7944
7945         Merge changes from Coreutils.
7946         * obstack.h (obstack_object_size): Declare temporary, __o,
7947         to be const, in order to avoid warnings.
7948         (obstack_room): Likewise.
7949         (obstack_empty_p): Likewise.
7950
7951 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7952
7953         Merge changes from Bison.
7954         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7955         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7956         when compiling Bison 1.875's `bitset bset = obstack_alloc
7957         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7958         * hash.c: Include <stdbool.h> unconditionally.
7959
7960 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7961
7962         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7963         Reported by Bruce Becker; see:
7964         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7965
7966 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7967             Bruno Haible  <bruno@clisp.org>
7968
7969         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7970         Reported by John Hughes, see
7971         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7972
7973 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7974
7975         * poll_.h: New file.
7976         * poll.c: New file.
7977
7978 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7979
7980         * mathl.h: New file.
7981         * acosl.c: New file.
7982         * asinl.c: New file.
7983         * atanl.c: New file.
7984         * ceill.c: New file.
7985         * cosl.c: New file.
7986         * expl.c: New file.
7987         * floorl.c: New file.
7988         * frexpl.c: New file.
7989         * ldexpl.c: New file.
7990         * logl.c: New file.
7991         * sincosl.c: New file.
7992         * sinl.c: New file.
7993         * sqrtl.c: New file.
7994         * tanl.c: New file.
7995         * trigl.c: New file.
7996         * trigl.h: New file.
7997
7998 2003-02-17  Bruno Haible  <bruno@clisp.org>
7999
8000         * mkdtemp.h: New file, from GNU gettext.
8001         * mkdtemp.c: New file, from GNU gettext.
8002
8003 2003-01-31  Bruno Haible  <bruno@clisp.org>
8004
8005         * rename.c: #undef rename before defining rpl_rename.
8006         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8007
8008 2003-01-30  Bruno Haible  <bruno@clisp.org>
8009
8010         * printf-args.h: New file, from GNU gettext.
8011         * printf-args.c: New file, from GNU gettext.
8012         * printf-parse.h: New file, from GNU gettext.
8013         * printf-parse.c: New file, from GNU gettext.
8014         * vasnprintf.h: New file, from GNU gettext.
8015         * vasnprintf.c: New file, from GNU gettext.
8016         * asnprintf.c: New file, from GNU gettext.
8017         * vasprintf.h: New file, from GNU gettext with modifications.
8018         * vasprintf.c: New file, from GNU gettext.
8019         * asprintf.c: New file, from GNU gettext.
8020
8021 2003-01-29  Bruno Haible  <bruno@clisp.org>
8022
8023         * stpncpy.h: New file, from GNU gettext with modifications.
8024         * stpncpy.c: New file, from GNU gettext with modifications.
8025
8026 2003-01-28  Bruno Haible  <bruno@clisp.org>
8027
8028         * c-ctype.h: New file, from GNU gettext, with changes suggested by
8029         Paul Eggert.
8030         * c-ctype.c: New file, from GNU gettext, with changes suggested by
8031         Paul Eggert.
8032
8033 2003-01-27  Bruno Haible  <bruno@clisp.org>
8034
8035         * xsetenv.h: New file, from GNU gettext.
8036         * xsetenv.c: New file, from GNU gettext.
8037
8038 2003-01-23  Bruno Haible  <bruno@clisp.org>
8039
8040         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8041
8042 2003-01-22  Bruno Haible  <bruno@clisp.org>
8043
8044         * exit.h: New file, from GNU gettext.
8045
8046 2003-01-11  Bruno Haible  <bruno@clisp.org>
8047
8048         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8049         * strcase.h (strcasecmp, strncasecmp): Likewise.
8050
8051 2003-01-14  Jim Meyering  <jim@meyering.net>
8052
8053         * same.c (same_name): Tweak a comment.
8054
8055 2003-01-11  Bruno Haible  <bruno@clisp.org>
8056
8057         * same.c (same_name): Reorder tests so as to avoid calling stat()
8058         when a string comparison is sufficient.
8059
8060 2003-01-11  Bruno Haible  <bruno@clisp.org>
8061
8062         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8063         'unsigned int'.
8064
8065 2003-01-11  Bruno Haible  <bruno@clisp.org>
8066
8067         * hash-pjw.c: Add comment about low quality of this function.
8068
8069 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8070
8071         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8072         to avoid collisions with libcurses and libreadline.
8073
8074         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8075         * getstr.h, getstr.c: Remove.
8076         * getline.c: Include "getline.h", to check interface.
8077         Move body of old getstr.c here: this defines MIN_CHUNK and
8078         declares getdelim2, which is renamed from getstr.
8079         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8080
8081         * linebuffer.c (readlinebuffer): Renamed from readline.
8082         All uses changed.
8083         * linebuffer.h: Likewise.
8084         (readline): Remove backward-compatibility macro.
8085
8086 2003-01-12  Jim Meyering  <jim@meyering.net>
8087
8088         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8089
8090 2003-01-10  Bruno Haible  <bruno@clisp.org>
8091
8092         * alloca_.h: New file.
8093         * getdate.y: Unconditionally include alloca.h.
8094         * makepath.c: Likewise.
8095         * setenv.c: Likewise.
8096         * userspec.c: Likewise.
8097
8098 2003-01-09  Bruno Haible  <bruno@clisp.org>
8099
8100         * stdbool.h.in: New file.
8101
8102 2003-01-08  Bruno Haible  <bruno@clisp.org>
8103
8104         * safe-read.c: Include specification header first, to ensure its
8105         selfcontainedness.
8106         * full-write.c: Likewise.
8107
8108 2003-01-08  Jim Meyering  <jim@meyering.net>
8109
8110         * full-write.c: Undefine and define-away `const' after inclusion
8111         of errno.h, not before.  Suggestion from Bruno Haible.
8112
8113 2003-01-07  Jim Meyering  <jim@meyering.net>
8114
8115         * full-write.c: Rework so that it may serve to define full_read, too.
8116         * full-read.c: Simply #define FULL_READ and include full-write.c.
8117
8118 2003-01-06  Jim Meyering  <jim@meyering.net>
8119
8120         * version-etc.c: Update year in translatable copyright string.
8121
8122 2002-12-25  Bruno Haible  <bruno@clisp.org>
8123
8124         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8125         * xstrtol.h: Likewise.
8126         * xstrtoimax.c: Likewise.
8127         * xstrtoumax.c: Likewise.
8128         * human.h: Likewise.
8129
8130         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8131         on systems that have <inttypes.h> but not <stdint.h>.
8132
8133 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8134
8135         * memcoll.c (memcoll): Fall back on a simple algorithm using
8136         memcmp if strcoll doesn't work.
8137
8138 2002-12-23  Bruno Haible  <bruno@clisp.org>
8139
8140         * localcharset.h: New file.
8141         * localcharset.c: Include it.
8142         * unicodeio.c: Likewise.
8143
8144 2002-12-22  Bruno Haible  <bruno@clisp.org>
8145
8146         * utime.c (utime_null): No need to call ftruncate if the file was
8147         nonempty.
8148
8149 2002-12-23  Bruno Haible  <bruno@clisp.org>
8150
8151         * memcoll.c (STRCOLL): New macro.
8152         (memcoll): Use it.
8153
8154 2002-12-22  Bruno Haible  <bruno@clisp.org>
8155
8156         * getstr.h (getstr): Define, to avoid clash with libcurses.
8157         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8158
8159 2002-12-22  Bruno Haible  <bruno@clisp.org>
8160
8161         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8162
8163 2002-12-23  Bruno Haible  <bruno@clisp.org>
8164
8165         * getline.h: Include <stddef.h>, for size_t.
8166
8167         * unicodeio.h: Include <stddef.h>, for size_t.
8168         * unicodeio.c: Don't include <stddef.h>.
8169
8170 2002-12-17  Bruno Haible  <bruno@clisp.org>
8171
8172         * canon-host.c (strdup): Remove unused declaration.
8173
8174         * fsusage.c: Include full_read.h.
8175         (get_fs_usage): Use full_read instead of safe_read.
8176
8177         * utime.c (utime_null): Use SAFE_READ_ERROR.
8178
8179 2002-12-11  Bruno Haible  <bruno@clisp.org>
8180
8181         * setenv.h: Rewritten to cope with systems that have setenv() but not
8182         unsetenv().
8183         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8184         modifications:
8185
8186         2002-12-11  Bruno Haible  <bruno@clisp.org>
8187
8188                 * setenv.c (alloca): Fall back to malloc.
8189                 (freea): New macro.
8190                 (setenv): Use freea() to free memory allocated with alloca().
8191
8192         2002-11-13  Bruno Haible  <bruno@clisp.org>
8193
8194                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8195                 function declarations.
8196                 * unsetenv.c (unsetenv): Likewise.
8197
8198         2002-03-04  Bruno Haible  <bruno@clisp.org>
8199
8200                 Portability to AIX 4.3.3.
8201                 * unsetenv.c: New file, extracted from setenv.c.
8202                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8203
8204         2001-12-20  Bruno Haible  <bruno@clisp.org>
8205
8206                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8207                 use malloc instead. For SunOS 4.
8208
8209         2001-12-11  Bruno Haible  <bruno@clisp.org>
8210
8211                 * setenv.c: Declare alloca.
8212                 (compar_fn_t): New typedef.
8213                 (KNOWN_VALUE, STORE_VALUE): Use it.
8214
8215         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8216         setenv.h.
8217
8218 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8219
8220         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8221         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8222         Choose values that are less likely to collide with system fnmatch
8223         options.
8224         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8225         defined (e.g., a pure POSIX system).
8226         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8227         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8228
8229 2002-12-06  Jim Meyering  <jim@meyering.net>
8230
8231         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8232
8233         Merge in changes from libc's misc/error.c, in preparation
8234         for the merge of gnulib's changes back into libc.
8235
8236         * error.c (_): Define only if not already defined.
8237         Move definition to follow all #include directives.
8238         Include unlocked-io.h only if !_LIBC.
8239         [_LIBC]: Include <libio/libioP.h>.
8240         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8241         (fflush): Tweak definition to use INTUSE.
8242         (putc): Define.
8243
8244 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8245
8246         * alloca.c [defined emacs]: Include "lisp.h".
8247         (xalloc_die) [defined emacs]: New macro.
8248         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8249         [! defined emacs]: Include <xalloc.h>.
8250         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8251         (pointer): Typedef to POINTER_TYPE *.
8252         (malloc): Remove decl; we now always use xmalloc.
8253         (alloca): Use old-style definition, since Emacs needs this.
8254         Check for arithmetic overflow when computing combined size.
8255
8256 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8257
8258         Do not generate unlocked-io.h automatically, since it's easier to
8259         maintain it by hand.
8260
8261         * unlocked-io.h: New file, from GNU diffutils,
8262         but with proper copyright notice and attribution.
8263         * gen-uio: Remove.
8264         * Makefile.am: Add copyright notice.
8265         (libfetish_a_SOURCES): Add unlocked-io.h.
8266         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8267         (DISTCLEANFILES, io_functions): Remove macros.
8268         (EXTRA_DIST): Remove gen_uio.
8269         (unlocked-io.h): Remove rule.
8270
8271 2002-12-04  Jim Meyering  <jim@meyering.net>
8272
8273         Reflect the fact that stat.c and lstat.c are no longer generated.
8274         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8275         (DISTCLEANFILES): Likewise.
8276         (EXTRA_DIST): Likewise.
8277         (all_local): Don't depend on stat.c or lstat.c.
8278         (stat.c, lstat.c): Remove rules.
8279         (EXTRA_DIST): Remove xstat.in.
8280
8281         * xstat.in: Remove file.  Contents moved into stat.c.
8282         * stat.c: New file.  Contents mostly from xstat.in.
8283         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8284         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8285
8286         * safe-read.c: Rework so that it may serve to define safe_write, too.
8287         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8288
8289 2002-12-03  Jim Meyering  <jim@meyering.net>
8290
8291         * safe-read.c, safe-write.c: Change variable names and comments, but
8292         not semantics, to minimize the differences between these two files.
8293         (safe_read): Change comment to mention SAFE_READ_ERROR.
8294
8295         * safe-read.c (IS_EINTR): Define.
8296         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8297
8298 2002-12-02  Bruno Haible  <bruno@clisp.org>
8299
8300         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8301         Define, taken from safe-read.c.
8302         (INT_MAX): Provide fallback.
8303         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8304         * safe-write.h (SAFE_WRITE_ERROR): Define.
8305
8306         * safe-read.c (EINTR): Remove definition.
8307         (safe_read): Don't use EINTR if it is absent.
8308
8309 2002-12-02  Jim Meyering  <jim@meyering.net>
8310
8311         * safe-read.c (EINTR): Define.
8312         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8313         (INT_MAX): Provide fallback.
8314         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8315
8316         * safe-read.h (SAFE_READ_ERROR): Define.
8317
8318 2002-12-01  Jim Meyering  <jim@meyering.net>
8319
8320         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8321         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8322
8323 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8324
8325         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8326         hash_rehash): Replace `if (limit <= value) abort ();' with
8327         `if (! (value < limit)) abort ();', for readability.
8328
8329 2002-11-26    <karl@gnu.org>
8330
8331         * strdup.c: copy from libc again, with jim's ok.
8332         * .cppi-disable: re-add strdup.c
8333
8334 2002-11-25    <karl@gnu.org>
8335
8336         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8337         instead of "strtol.c".
8338
8339 2002-11-25  Jim Meyering  <jim@meyering.net>
8340
8341         * mktime.c: Sync from libc, now that it has the latest fix.
8342
8343 2002-11-24    <karl@gnu.org>
8344
8345         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8346         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8347
8348 2002-11-24  Jim Meyering  <jim@meyering.net>
8349
8350         Update from coreutils:
8351
8352         * mktime.c: Merge in changes from libc.
8353
8354         Avoid a link-time failure on some Linux systems.
8355         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8356         (__mon_yday): Declare with the STATIC attribute.
8357         (__mktime_internal): Likewise.
8358         Based on a report from Greg Schafer.
8359
8360 2002-11-23  Jim Meyering  <jim@meyering.net>
8361
8362         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8363         Use `unsigned', not `int', as type of index.
8364
8365         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8366
8367         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8368
8369 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8370
8371         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8372         hint that one should use `if (! x) abort ();' rather than `assert
8373         (x);', and anyway it's one less thing to worry about configuring.
8374         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8375         hash_rehash, hash_insert): Use abort rather than assert.
8376
8377 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8378
8379         * quotearg.h: Allow multiple inclusion by surrounding with
8380         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8381         so that we can be included first.
8382         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8383         * quotearg.c: Include quotearg.h immediately after config.h.
8384         No need to include stddef.h or sys/types.h any more.
8385         Surround local include files with "", not "<>".
8386         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8387         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8388         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8389         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8390         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8391         (ISPRINT): Remove; no longer needed now that we assume C89.
8392
8393         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8394         Preserve errno.
8395
8396         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8397         quotearg_char): Use SIZE_MAX rather than
8398         (size_t) -1 when we are talking about "infinity".
8399
8400         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8401
8402 2002-11-22  Bruno Haible  <bruno@clisp.org>
8403
8404         * safe-read.h: Assume C89. Add comments.
8405         (safe_read): Change return type to size_t.
8406         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8407         counts > SSIZE_MAX correctly.
8408         * safe-write.h: New file.
8409         * safe-write.c: New file.
8410         * full-read.h: New file.
8411         * full-read.c: New file.
8412         * full-write.h: Assume C89. Add comments.
8413         * full-write.c: Include safe-write.h.
8414         (full_write): Rewritten to use safe_write.
8415         Suggested by Jim Meyering and Paul Eggert.
8416
8417 2002-11-21  Bruno Haible  <bruno@clisp.org>
8418
8419         Remove case insensitive option matching.
8420         * argmatch.h (argcasematch): Remove declaration.
8421         (ARGCASEMATCH): Remove macro.
8422         (__xargmatch_internal): Remove case_sensitive argument.
8423         (XARGMATCH): Update.
8424         (XARGCASEMATCH): Remove macro.
8425         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8426         case_sensitive argument.
8427         (argcasematch): Remove function.
8428         (__xargmatch_internal): Remove case_sensitive argument.
8429         (main): Use XARGMATCH instead of XARGCASEMATCH.
8430
8431         * xmalloc.c: Change compile-time error message. Add comment about
8432         required autoconf version.
8433
8434 2002-11-21  Jim Meyering  <jim@meyering.net>
8435
8436         * strdup.c (strdup): Tweak comment and initial #if/#include.
8437
8438         Merge in changes from the coreutils.
8439
8440         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8441         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8442         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8443         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8444         int.  Work more efficiently if X is the same width as uintmax_t.
8445         Do not compare X to -1, to avoid bogus compiler warning.
8446         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8447         Don't assume that f_frsize and f_bsize are the same type.
8448
8449         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8450         on FreeBSD.
8451
8452         * makepath.c (make_path): Restore umask *before* creating the final
8453         component.
8454         (make_path): Minor reformatting.
8455
8456         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8457         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8458
8459         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8460         ones.  At least on GNU/Linux systems, `auto' means something else.
8461         From Michael Stone.
8462
8463 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8464
8465         Merge argmatch cleanups from Bison.  Assume C89.
8466
8467         * argmatch.c: Include config.h here, not in argmatch.h.
8468         Include stdlib.h, for EXIT_FAILURE.
8469         Always include <string.h>, since we assume C89.
8470         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8471         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8472         Include <stddef.h> instead, since it's all we need for size_t.
8473         (PARAMS): Remove.  All uses removed.
8474         (ARRAY_CARDINALITY): Do not bother to #undef.
8475         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8476         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8477         Remove unnecessary parentheses.
8478         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8479         Insert necessary parentheses.
8480         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8481         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8482
8483 2002-11-19  Bruno Haible  <bruno@clisp.org>
8484
8485         * mbswidth.c: Include mbswidth.h right at the beginning.
8486         * mbswidth.h: Include <stddef.h>, for size_t.
8487
8488         * mbswidth.h (PARAMS): Remove macro.
8489         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8490         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8491
8492         * gcd.h (PARAMS): Remove macro.
8493         (gcd): Use ANSI C function declarations.
8494         * gcd.c (gcd): Likewise.
8495
8496 2002-11-15  Bruno Haible  <bruno@clisp.org>
8497
8498         * strcspn.c: Include <stddef.h>.
8499         (strcspn): Use ANSI C function declaration. Change return type to
8500         size_t. Use NULL.
8501         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8502         (strpbrk): Use NULL.
8503         * strpbrk.h (PARAMS): Remove macro.
8504         (strpbrk): Use ANSI C function declaration.
8505         * strstr.c: Don't include <sys/types.h>.
8506         * strstr.h (PARAMS): Remove macro.
8507         (strstr): Use ANSI C function declarations.
8508
8509 2002-11-06  Bruno Haible  <bruno@clisp.org>
8510
8511         * gcd.h (gcd): Change argument type to 'unsigned long'.
8512         * gcd.c (gcd): Likewise.
8513
8514 2002-11-05  Bruno Haible  <bruno@clisp.org>
8515
8516         * gcd.h: New file, from gettext-0.11.5.
8517         * gcd.c: New file, from gettext-0.11.5.
8518
8519 2002-11-05  Bruno Haible  <bruno@clisp.org>
8520
8521         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8522         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8523         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8524         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8525
8526         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8527         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8528
8529         * closeout.c: Include gettext.h instead of <libintl.h>.
8530         * human.c: Include gettext.h instead of <libintl.h>.
8531         * quotearg.c: Include gettext.h instead of <libintl.h>.
8532         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8533         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8534         * userspec.c: Include gettext.h instead of <libintl.h>.
8535         * version-etc.c: Include gettext.h instead of <libintl.h>.
8536         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8537         (textdomain): Remove definition.
8538         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8539
8540         * long-options.c: Remove include of <libintl.h> and definition of _.
8541         * same.c: Remove include of <libintl.h> and definition of _.
8542
8543 2002-11-04  Bruno Haible  <bruno@clisp.org>
8544
8545         * stpcpy.h: New file, from GNU gettext-0.11.5.
8546         * strcase.h: New file, from GNU gettext-0.11.5.
8547         * strpbrk.h: New file, from GNU gettext-0.11.5.
8548         * strstr.h: New file, from GNU gettext-0.11.5.
8549         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8550
8551 2002-05-09  Bruno Haible  <bruno@clisp.org>
8552
8553         * config.charset: Update for newest glibc. Add canonical names
8554         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8555
8556 2002-05-09  Bruno Haible  <bruno@clisp.org>
8557
8558         * localcharset.c (get_charset_aliases): Add more Windows specific
8559         aliases.
8560
8561 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8562
8563         * config.charset: A few additions for Solaris.
8564
8565 2001-12-05  Bruno Haible  <bruno@clisp.org>
8566
8567         * localcharset.c (locale_charset): Don't return an empty string.
8568
8569 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8570
8571         * config.charset: msdos in uk_UA uses CP1125.
8572
8573 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8574
8575         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8576         * localcharset.c (locale_charset): Declare as extern "C".
8577
8578 2002-02-15  Bruno Haible  <bruno@clisp.org>
8579
8580         * config.charset [msdosdjgpp]: For Russian, use CP866.
8581
8582 2002-02-11  Bruno Haible  <bruno@clisp.org>
8583
8584         * config.charset: Add support for NetBSD.
8585
8586 2002-09-25    <karl@gnu.org>
8587
8588         * strdup.c: copy from libc/string (via ../config/srclist*).
8589         * getopt*: copy from libc/posix.
8590         * gettext.h: copy from gettext.
8591         * .cppi-disable: add strdup.c, gettext.h.
8592
8593 2002-07-01  Jim Meyering  <meyering@lucent.com>
8594
8595         * c-stack.c: Include sys/time.h.
8596         From Volker Borchert.
8597
8598 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8599
8600         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8601         New macro.  Use it uniformly instead of
8602         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8603         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8604         reported by Vin Shelton.
8605
8606 2002-06-22  Jim Meyering  <meyering@lucent.com>
8607
8608         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8609         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8610
8611 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8612
8613         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8614         Do not assume SA_SIGINFO behavior.
8615         Bug reported by Jim Meyering on NetBSD 1.5.2.
8616
8617 2002-06-22  Jim Meyering  <meyering@lucent.com>
8618
8619         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8620
8621         * exitfail.c, exitfail.h: Likewise.
8622         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8623
8624         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8625         of fnmatch.h.
8626         (EXTRA_DIST): Add fnmatch_loop.c.
8627         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8628
8629         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8630         * fnmatch.c: Update from diffutils-2.8.2.
8631         * fnmatch_.h: New file.  From diffutils-2.8.2.
8632         * fnmatch.h: Remove file.
8633
8634 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8635
8636         * file-type.h: Report an error if neither S_ISREG nor
8637         S_IFREG is defined, instead of using a test specific to glibc
8638         2.2.  This should be safe, since POSIX requires S_ISREG and
8639         Unix Version 7 had S_IFREG.  We don't need to check for
8640         <sys/types.h> since we don't use any symbols that it defines.
8641
8642 2002-06-15  Jim Meyering  <meyering@lucent.com>
8643
8644         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8645         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8646         have been included before this file.
8647
8648 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8649
8650         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8651         so that each temporary file name is unique and valid in the first
8652         8 characters, for operation under DOS.
8653
8654 2002-06-15  Jim Meyering  <meyering@lucent.com>
8655
8656         Work even with DJGPP 2.03, which lacks support for symlinks.
8657         From Richard Dawe.
8658         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8659         is defined.
8660         * lchown.c (S_ISLNK): Likewise.
8661
8662 2002-06-14  Jim Meyering  <meyering@lucent.com>
8663
8664         * file-type.h: Use the version from diffutils-2.8.2.
8665         * file-type.c: Likewise.
8666
8667 2002-05-27  Jim Meyering  <meyering@lucent.com>
8668
8669         Fix a problem seen only on nonconforming systems whereby ls.c's
8670         use of localtime, and then of gettimeofday would cause trouble:
8671         the localtime call used to initialize rpl_gettimeofday's save
8672         mechanism would clobber ls's current local time information so
8673         that in any long listing the first file would always be listed
8674         with date 1970-01-01.  Analysis by Volker Borchert.
8675
8676         * gettimeofday.c (localtime): Undefine.
8677         (rpl_localtime): New function.
8678
8679 2002-05-22  Jim Meyering  <meyering@lucent.com>
8680
8681         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8682         * file-type.h: New file.
8683         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8684
8685 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8686
8687         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8688
8689 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8690
8691         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8692         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8693         of 127, since 64 is the largest conceivable number for ancient
8694         nonstandard hosts.
8695         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8696
8697 2002-04-28  Jim Meyering  <meyering@lucent.com>
8698
8699         * sig2str.c (WTERMSIG): Remove definition (unused).
8700
8701 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8702
8703         * sig2str.h, sig2str.c: New files.
8704         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8705
8706 2002-04-24  Jim Meyering  <meyering@lucent.com>
8707
8708         * gettext.h: New file, from Gettext.
8709         * Makefile.am (INCLUDES): Remove -I../intl.
8710         (libfetish_a_SOURCES): Add gettext.h.
8711
8712 2002-04-16  Jim Meyering  <meyering@lucent.com>
8713
8714         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8715         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8716         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8717
8718 2002-04-12  Jim Meyering  <meyering@lucent.com>
8719
8720         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8721
8722 2002-03-10  Jim Meyering  <meyering@lucent.com>
8723
8724         * makepath.c (make_path): Remove a comma from a diagnostic.
8725         Suggestion from Santiago Vila.
8726
8727 2002-03-08  Jim Meyering  <meyering@lucent.com>
8728
8729         * rename.c: Mention that this wrapper is needed also on
8730         mips-dec-ultrix4.4 systems.
8731
8732 2002-03-02  Jim Meyering  <meyering@lucent.com>
8733
8734         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8735         not HAVE_CLOCK_SETTIME.
8736
8737 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8738
8739         * nanosleep.h: Rename to....
8740         * timespec.h: New name for nanosleep.h.  All uses changed.
8741
8742         * gettime.c: New file.
8743         * settime.c: New file.
8744         * stime.c: Remove.
8745
8746         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8747         timespec.h.  Remove nanosleep.h.
8748
8749 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8750
8751         * acl.c, acl.h: New files.
8752         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8753
8754 2002-02-24  Jim Meyering  <meyering@lucent.com>
8755
8756         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8757         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8758         cause trouble.  Reported by Nelson Beebe.
8759
8760 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8761
8762         * path-concat.c (xpath_concat): Reorder code to pacify
8763         compilers that don't know that xalloc_die never returns.
8764
8765 2002-02-20  Jim Meyering  <meyering@lucent.com>
8766
8767         * getdate.c: Regenerate using bison-1.33.
8768
8769 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8770
8771         * posixver.c, posixver.h: New files.
8772         * Makefile.am (libfetish_a_SOURCES): Add them.
8773
8774 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8775             Bruno Haible  <bruno@clisp.org>
8776
8777         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8778         (fwrite_success_callback): New declaration.
8779         * unicodeio.c (unicode_to_mb): New function, extracted from
8780         print_unicode_char. Call failure callback instead of error.
8781         (fwrite_success_callback): New function.
8782         (exit_failure_callback): New function.
8783         (fallback_failure_callback): New function.
8784         (print_unicode_char): Call unicode_to_mb.
8785
8786 2002-01-26  Jim Meyering  <meyering@lucent.com>
8787
8788         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8789
8790 2002-01-22  Jim Meyering  <meyering@lucent.com>
8791
8792         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8793         Otherwise, some versions of automake would omit the rule that makes
8794         Makefile from Makefile.in.
8795
8796 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8797
8798         * xmemcoll.h, xmemcoll.c: New files.
8799         * Makefile.am (libfetish_a_SOURCES): Add them.
8800         * memcoll.c: Include errno.h, and declare errno if not defined.
8801         (memcoll): Set errno to zero if there is no error.
8802
8803         * quotearg.c (quotearg_buffer_restyled):
8804         Fix bug with quoting buffers containing NUL when backslashing escapes.
8805         This bug was exposed by the other changes in this patch.
8806         (quotearg_n_options): New arg ARGSIZE.
8807         All callers changed.
8808         (quoting_options_from_style): New function.
8809         (quotearg_n_style): Use it.
8810         (quotearg_n_style_mem): New function.
8811
8812         * quotearg.h (quotearg_n_style_mem): New function.
8813
8814 2002-01-16  Jim Meyering  <meyering@lucent.com>
8815
8816         * getdate.y: Add three semicolons, each just before a closing brace.
8817         Bison (as of version 1.31) no longer papers over that mistake.
8818
8819 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8820
8821         * backupfile.c (ISDIGIT): Comment fix.
8822         * getdate.y (ISDIGIT): Likewise.
8823         * posixtm.c (ISDIGIT, year): Likewise.
8824         * strverscmp.c (ISDIGIT): Likewise.
8825         * userspec.c (ISDIGIT): Likewise.
8826
8827 2002-01-05  Jim Meyering  <meyering@lucent.com>
8828
8829         * version-etc.c (version_etc_copyright): Update copyright year.
8830
8831 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8832
8833         * closeout.c (close_stdout_status): If ferror (stdout), do
8834         not silently exit merely because the output buffer happens to
8835         have nothing pending.
8836
8837 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8838
8839         See the big note in ../ChangeLog.
8840         * human.c (suffixes): Prefer K to k for 1024.
8841         (generate_suffix_backwards): New function.
8842         (human_readable_inexact): Use it.
8843         * xstrtol.c (__xstrtol): If there is no number but there
8844         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8845         Accept 'K' as well as 'k'.
8846
8847 2001-12-15  Jim Meyering  <meyering@lucent.com>
8848
8849         * regex.h (__restrict_arr): Update from libc.
8850
8851         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8852         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8853         (STREQ): Define.
8854
8855 2001-12-10  Jim Meyering  <meyering@lucent.com>
8856
8857         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8858         Instead, include "xalloc.h".
8859         (initbuffer): Don't cast xmalloc return value to char*.
8860         (readline): Reword comment.
8861         Don't cast xrealloc return value to char*
8862         Return NULL, not 0.
8863
8864 2001-12-09  Jim Meyering  <meyering@lucent.com>
8865
8866         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8867         `signed and unsigned type in conditional expression'.
8868         * posixtm.c (posix_time_parse): Likewise.
8869
8870         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8871
8872         * readtokens.c (readtoken): Declare an index to be of type unsigned
8873         to avoid a pedantic warning.
8874
8875         * getstr.c: Don't include assert.h.
8876         (getstr): Remove warning-evoking assertions.
8877         Return -1 if offset parameter is out of bounds.
8878         Change the type of a local from int to size_t.
8879
8880         * strftime.c (my_strftime_localtime_r): Include this function
8881         definition in the `#if ! HAVE_TM_GMTOFF' block.
8882
8883         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8884         Include xalloc.h instead.
8885
8886 2001-12-02  Jim Meyering  <meyering@lucent.com>
8887
8888         * tempname.c: Don't declare getenv, thus reverting the change of
8889         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8890         included.
8891
8892         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8893         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8894
8895 2001-11-30  Akim Demaille  <akim@epita.fr>
8896
8897         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8898         before being defined.
8899
8900 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8901
8902         * quotearg.h (quotearg_n, quotearg_n_style):
8903         First arg is int, not unsigned.
8904         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8905         (SIZE_MAX, UINT_MAX): New macros.
8906         (quotearg_n_options): Abort if N is negative.
8907         Avoid overflow check on hosts where size_t is 64 bits and int
8908         is 32 bits, as overflow is impossible there.
8909         Fix off-by-one typo that caused unnecessary reallocation.
8910
8911 2001-11-27  Jim Meyering  <meyering@lucent.com>
8912
8913         * tempname.c: Merge with version from libc.
8914         * regex.c: Likewise.
8915
8916         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8917         for which STDC_HEADERS is 0, it was not included, resulting in a
8918         warning about an integer-to-pointer conversion problem with getenv.
8919         Reported by Volker Borchert.
8920
8921 2001-11-26  Jim Meyering  <meyering@lucent.com>
8922
8923         * gtod.h: Remove file.
8924         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8925         * gettimeofday.c: Don't include gtod.h.
8926         (GTOD_init): Remove function.
8927         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8928         Suggestion from Volker Borchert.
8929
8930 2001-11-23  Jim Meyering  <meyering@lucent.com>
8931
8932         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8933         * hash.c (struct hash_table): Define it here instead.
8934
8935 2001-11-22  Jim Meyering  <meyering@lucent.com>
8936
8937         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8938
8939 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8940
8941         * tempname.c (TMP_MAX): Remove; no longer needed.
8942         (TEMPORARIES): New macro.
8943         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8944         removes an artificial limitation (e.g. HP-UX 10.20, where
8945         TMP_MAX is 17576).
8946
8947 2001-11-18  Jim Meyering  <meyering@lucent.com>
8948
8949         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8950         on SunOS 4.
8951
8952         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8953         files will be created before anything else.
8954
8955 2001-11-17  Jim Meyering  <meyering@lucent.com>
8956
8957         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8958         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8959         rather than group writable.  Patch by Juan F. Codagnone.
8960
8961         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8962         Instead, include "xalloc.h".
8963
8964         * mountlist.c: Include unlocked-io.h after all system headers.
8965         Remove explicit declarations of xmalloc, xrealloc,
8966         and xstrdup.  Instead, include "xalloc.h".
8967
8968         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8969         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8970         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8971
8972         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8973         Reported by Padraig Brady.
8974
8975         * mkstemp.c: #undef mkstemp.
8976         Include config.h.
8977         (rpl_mkstemp): Rename from mkstemp.
8978         Protoize.
8979
8980 2001-11-16  Jim Meyering  <meyering@lucent.com>
8981
8982         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8983         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8984         determine the amount of total physical memory, use pstat_getstatic.
8985         HPUX-11 doesn't define _SC_PHYS_PAGES.
8986         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8987         If sysconf couldn't be used to determine the amount of available
8988         physical memory, use both pstat_getstatic and pstat_getdynamic.
8989         Based on a patch from Bob Proulx.
8990
8991 2001-11-05  Jim Meyering  <meyering@lucent.com>
8992
8993         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8994
8995 2001-11-03  Jim Meyering  <meyering@lucent.com>
8996
8997         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8998         in argmatch_to_argument call.
8999
9000         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9001         argument.
9002
9003         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9004         e.g., a fault due to an attempt to free a NULL pointer.
9005
9006 2001-11-01  Jim Meyering  <meyering@lucent.com>
9007
9008         * dirfd.c, dirfd.h: New files.
9009         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9010
9011         * hash.c (hash_print) [TESTING]: Clean up.
9012
9013 2001-10-22  Paul Eggert  <eggert@twinsun.com>
9014
9015         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9016         to avoid a warning if -Wall.
9017
9018 2001-10-21  Paul Eggert  <eggert@twinsun.com>
9019
9020         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9021
9022 2001-10-21  Jim Meyering  <meyering@lucent.com>
9023
9024         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
9025         this code would end up calling gettext even in packages built
9026         with --disable-nls.
9027         * getopt.c (_): Likewise.
9028         * regex.c (_): Likewise.
9029
9030 2001-10-20  Paul Eggert  <eggert@twinsun.com>
9031
9032         * error.c (strerror_r): Do not declare unless !_LIBC.
9033         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9034         Use strerror_r that is only a macro, even if it is not a function.
9035         (strerror): Check for HAVE_DECL_STRERROR before declaring.
9036         (private_strerror): Use prototypes, not old-style function definition.
9037         (print_errno_message): New function.
9038         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9039         char*-flavored one.
9040         (error_tail, error, error_at_line): Use it.
9041
9042 2001-10-11  Jim Meyering  <meyering@lucent.com>
9043
9044         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9045         and quote_n (1, ... to avoid clobbering a buffer.
9046
9047 2001-10-05  Jim Meyering  <meyering@lucent.com>
9048
9049         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9050         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9051         * hash-pjw.h: New file.
9052
9053 2001-09-30  Jim Meyering  <meyering@lucent.com>
9054
9055         * mountlist.c [MOUNTED_GETFSSTAT]:
9056         Include <sys/ucred.h>, for Apple Darwin.
9057         Include sys/mount.h and sys/fs_types.h only if available.
9058         (FS_TYPE): Define.
9059         (read_filesystem_list): Use FS_TYPE.
9060
9061 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9062
9063         * exclude.c (excluded_filename): 0 -> false, since it's
9064         a boolean context.
9065
9066 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9067
9068         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9069         #defines strtoimax.  Also treat the other strto* functions
9070         like strtoimax.
9071
9072         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9073         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9074         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9075
9076 2001-09-26  Jim Meyering  <meyering@lucent.com>
9077
9078         Most macros in unlocked-io.h had the wrong number of arguments.
9079         * gen-uio: New script.
9080         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9081         * unlocked-io.hin: Remove file.
9082         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9083         rather than trying to embed it here.
9084         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9085         Reported by Padraig Brady.
9086
9087 2001-09-25  Volker Borchert  <bt@teknon.de>
9088
9089         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9090
9091 2001-09-23  Jim Meyering  <meyering@lucent.com>
9092
9093         * mountlist.c: Remove useless parentheses in #if directives.
9094         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9095         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9096
9097 2001-09-22  Jim Meyering  <meyering@lucent.com>
9098
9099         * localcharset.c: Update from latest gettext.
9100         * config.charset: Likewise.
9101
9102 2001-09-20  Jim Meyering  <meyering@lucent.com>
9103
9104         * xstrtol.c (strtoimax): Guard declaration with
9105         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9106         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9107         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9108         (strtoumax): Likewise, for completeness (it wasn't necessary).
9109
9110 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9111
9112         * strtoimax.c (HAVE_LONG_LONG):
9113         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9114         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9115         to work around bug in IBM C compiler.
9116
9117 2001-09-16  Jim Meyering  <meyering@lucent.com>
9118
9119         * mkdir.c: New file.
9120
9121 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9122
9123         * xgetcwd.c: Revert some of the previous change; intead,
9124         fix the HAVE_GETCWD_NULL code to behave more like the
9125         !HAVE_GETCWD_NULL code used to.
9126
9127         Include "xalloc.h".
9128         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9129         invoke xalloc_die.
9130
9131 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9132
9133         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9134         Use ssize_t, not int, to store result of readlink.
9135         Check for ssize_t overflow as well as size_t overflow,
9136         as POSIX says the result of readlink is implementation-defined
9137         when ssize_t overflows.
9138         Remove unnecessary cast to char*.
9139         Use free+malloc instead of realloc, as the storage doesn't need
9140         to be preserved and it's clearer and can be more efficient that way.
9141         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9142         * xreadlink.h (xreadlink): Update prototype.
9143
9144 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9145
9146         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9147         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9148         spotted by Jim Meyering.
9149
9150 2001-09-03  Jim Meyering  <meyering@lucent.com>
9151
9152         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9153
9154 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9155
9156         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9157         like the HAVE_GETCWD_NULL code.
9158         Include pathmax.h if not HAVE_GETCWD.
9159         Do not include xalloc.h.
9160         (INITIAL_BUFFER_SIZE): New symbol.
9161         Do not use xmalloc / xrealloc, since the caller is responsible for
9162         handling errors.  Preserve errno around `free' during failure.
9163         Do not overrun buffer when using getwd.
9164
9165 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9166
9167         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9168         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9169
9170 2001-09-02  Jim Meyering  <meyering@lucent.com>
9171
9172         * error.c: Update from GNU libc.
9173
9174 2001-09-01  Jim Meyering  <meyering@lucent.com>
9175
9176         * xreadlink.c: New file.
9177         * xreadlink.h: New file.
9178         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9179
9180         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9181         doesn't conflict with sparc Solaris 7's definition in
9182         /usr/include/sys/int_types.h.
9183
9184         * exclude.c: Use `""', not `<>' to #include non-system header files.
9185         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9186         and strncasecmp as r-values.  Unixware didn't have declarations.
9187
9188 2001-08-31  Jim Meyering  <meyering@lucent.com>
9189
9190         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9191         Use an initial, malloc'd, buffer of length 128 rather than
9192         a statically allocated one of length 1024.
9193
9194 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9195
9196         * xgetcwd.c: Don't include pathmax.h.
9197         Include stdlib.h and unistd.h if available.
9198         Include xalloc.h.
9199         (xmalloc, xstrdup, free): Remove decls.
9200         (xgetcwd): Don't assume sizes fit in unsigned.
9201         Check for overflow when computing sizes.
9202         Simplify reallocation code.
9203
9204 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9205
9206         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9207
9208         * strtoimax.c: Renamed from strtoxmax.c, removing the
9209         old strtoimax.c.
9210
9211         Also, make the following further changes to make this file's
9212         configuration more similar to that of strtol.c:
9213         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9214         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9215         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9216         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9217         changed to signed values.
9218
9219         And make the following changes as well:
9220         Fix copyright notice, as 1999 was missing.
9221         (verify): New macro.
9222         (strtoimax): Check sizes at compile-time, not run-time.
9223         Prefer strtol to strtoll if both work.
9224         (main): Remove; it was not that useful and was a pain to maintain.
9225
9226         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9227
9228 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9229
9230         * savedir.c (savedir): Remove size parameter, as POSIX says that
9231         a directory's st_size can have an arbitrary value, so the old
9232         usage could waste an arbitrary amount of memory.  All uses
9233         changed.
9234         * savedir.h: Update prototype.
9235
9236 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9237
9238         * xstrtol.c (strtoimax): New decl.
9239
9240 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9241
9242         * xstrtol.h: Add copyright notice.
9243         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9244         LONGINT_INVALID_SUFFIX_CHAR.
9245
9246 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9247
9248         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9249         tm to be declared.
9250
9251 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9252
9253         * hash.c: Remove '2001' from copyright notice.
9254
9255 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9256
9257         * full-write.h: New file.
9258         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9259         * full-write.c: Correct credits, as cccp.c no longer
9260         exists and anyway it was so heavily changed from the old cccp
9261         code as to be unrecognizable.  Include full-write.h.
9262         (full_write) Return size_t, with short writes meaning failure.
9263         All callers changed.  This fixes a bug with large buffers
9264         on 64-bit hosts.
9265         * utime.c: Include full-write.h.
9266
9267 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9268
9269         Merge 'exclude' changes from tar 1.13.22.
9270         This fixes one or two unlikely storage allocation overflow bugs,
9271         but doesn't change user-visible behavior otherwise.
9272
9273 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9274
9275         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9276         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9277         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9278         Include if available.
9279         (<xalloc.h>): Include
9280         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9281         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9282         collide with FNM macros.
9283         (struct patopts): New struct.
9284         (struct exclude): Use it, as exclude patterns now come with options.
9285         (new_exclude): Support above changes.
9286         (new_exclude, add_exclude_file):
9287         Initial size must now be a power of two to simplify overflow checking.
9288         (free_exclude, fnmatch_no_wildcards): New function.
9289         (excluded_filename): No longer requires options arg, as the options
9290         are determined by add_exclude.  Now returns bool, not int.
9291         (excluded_filename, add_exclude):
9292         Add support for the fancy new exclusion options.
9293         (add_exclude, add_exclude_file): Now takes int options arg.
9294         Check for arithmetic overflow when computing sizes.
9295         (add_exclude_file): xrealloc might modify errno, so don't
9296         realloc until after errno might be used.
9297
9298         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9299         New macros.
9300         (free_exclude): New decl.
9301         (add_exclude, add_exclude_file): Now takes int options arg.
9302         (excluded_filename): No longer requires options arg, as the options
9303         are determined by add_exclude.  Now returns bool, not int.
9304
9305 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9306
9307         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9308
9309 2001-08-27  Jim Meyering  <meyering@lucent.com>
9310
9311         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9312
9313         * version-etc.c (N_): Remove definition.
9314         Revert most of last change.
9315         Instead, simply don't mark the `Copyright...' string for translation.
9316         Based on advice from Paul Eggert.
9317
9318         * strtoxmax.c: Tweak comment.
9319
9320 2001-08-26  Jim Meyering  <meyering@lucent.com>
9321
9322         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9323         of copyright with `%s' so translators don't get an untranslated
9324         message in 2002.
9325         (COPYRIGHT_YEAR): Define.
9326         (version_etc): Use fprintf rather than fputs.
9327         Suggestion from Ulrich Drepper.
9328
9329         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9330
9331         * strtoll.c: New file, from GNU libc.
9332         * xstrtoimax.c: New file.
9333
9334         * xstrtol.h: Add xstrtoimax.
9335         * strtoumax.c: New file.  Simply include "strtoumax.c".
9336         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9337
9338         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9339         * strtoxmax.c: ... then renamed to this.
9340
9341 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9342
9343         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9344         Port to Solaris 8, where 'sed' requires a space after the 'r'
9345         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9346         Redirect output to $tmp just once.
9347
9348 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9349
9350         * addext.c (<errno.h>): Include.
9351         (errno): Declare if not defined.
9352         (addext): Work correctly when pathconf returns -1 and leaves
9353         errno alone because there is no limit.  Also, work even if
9354         pathconf returns a value greater than SIZE_MAX.
9355
9356 2001-08-12  Jim Meyering  <meyering@lucent.com>
9357
9358         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9359         Simply `return getcwd (NULL, 0);'.
9360         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9361         Use 1300 as initial value for length, not PATH_MAX.
9362
9363         * pathmax.h: Clean up cpp syntax.
9364
9365 2001-08-12  Jim Meyering  <meyering@lucent.com>
9366
9367         * gettimeofday.c: New file.
9368         * gtod.h: New file.
9369         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9370
9371 2001-08-04  Jim Meyering  <meyering@lucent.com>
9372
9373         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9374         to get in sync with glibc.
9375
9376 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9377
9378         The following changes are from gettext 0.10.39 as maintained by
9379         Bruno Haible.
9380
9381         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9382         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9383         with inverted sense.  All uses changed.
9384
9385         * mbswidth.c: Don't include <limits.h>.
9386         Include <stdlib.h> and <string.h> unconditionally.
9387         (iswcntrl, mbsinit, ISCNTRL): New macros.
9388         (mbsnwidth): Use K&R style function declarations.
9389         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9390         can optimize it when MB_CUR_MAX == 1.
9391         The width of control characters is zero, not 1.
9392
9393 2001-07-15  Jim Meyering  <meyering@lucent.com>
9394
9395         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9396         (BUILT_SOURCES): Add unlocked-io.h.
9397         (io_functions): Define.
9398         (unlocked-io.h): New rule.
9399         (DISTCLEANFILES): Add unlocked-io.h.
9400         (all-local): Depend on unlocked-io.h, to ensure it is created.
9401
9402         * unlocked-io.hin: New file
9403
9404         * regex.c: Update from glibc.
9405
9406 2001-07-05  Jim Meyering  <meyering@lucent.com>
9407
9408         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9409         recommendation.
9410         (libfetish_a_SOURCES): Put all .h files here instead.
9411         Remove a thus-exposed (better checks in automake) duplicate and
9412         two unnecessary .h files.
9413
9414 2001-06-11  Jim Meyering  <meyering@lucent.com>
9415
9416         * regex.c: Update from GNU libc.
9417
9418 2001-05-27  Jim Meyering  <meyering@lucent.com>
9419
9420         * readutmp.h (UT_TYPE): Define.
9421
9422 2001-05-24  Jim Meyering  <meyering@lucent.com>
9423
9424         * argmatch.c: Include "quote.h".
9425         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9426         quote function.  Reported by Göran Uddeborg.
9427
9428 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9429
9430         * dirname.c (dir_name): Compute append_dot using path, not newpath
9431         which is not yet declared.
9432
9433 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9434
9435         * Makefile.am (libfetish_a_SOURCES):
9436         Add strftime.c, since we now compile it on all hosts.
9437
9438         * strftime.c (my_strftime):
9439         Define to nstrftime if emacs, but only if my_strftime is not defined.
9440         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9441         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9442         Add one more extra argument: a nanoseconds value.
9443         All uses changed.
9444         (ns): New macro.
9445         (my_strftime function): Add %N format.
9446         (emacs_strftimeu): Renamed from emacs_strftime,
9447         with extra ut argument.
9448
9449 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9450
9451         dirname code cleanup.  base_name now behaves more compatibly
9452         with POSIX basename when given file names that have trailing
9453         slashes, and similarly for dir_name.  Add new primitives
9454         base_len and dir_len.  Put the directory-name-related decls
9455         into dirname.h.
9456
9457         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9458         * backupfile.c (base_name): Likewise.
9459         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9460         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9461         * makepath.c (strip_trailing_slashes): Likewise.
9462         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9463         Likewise.
9464         * rename.c (strip_trailing_slashes): Likewise.
9465         * same.c (base_name): Likewise.
9466         * stripslash.c (ISSLASH): Likewise.
9467
9468         * addext.c: Include <dirname.h> after size_t is defined.
9469         * backupfile.c: Likewise.
9470
9471         * addext.c (addext): Use base_len to trim redundant
9472         trailing slashes instead of doing it ourselves.
9473         But do not trim the last slash if it is not redundant.
9474
9475         * backupfile.c (find_backup_file_name,
9476         max_backup_version): Use base_len instead of rolling it ourselves.
9477         Handle the case of "" and (on DOS) "C:" correctly.
9478
9479         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9480         Include <string.h>, <dirname.h>.
9481         (base_name): Allow file names ending in slashes, other than names
9482         that are all slashes.  In this case, return the basename followed
9483         by the slashes.  This is more general, and can be used in places
9484         where the original base_name purposely had an assertion failure.
9485         (base_len): New function.
9486
9487         * dirname.c: Include <string.h> instead of <stdlib.h>.
9488         Do not include <assert.h>; no longer needed.
9489         Include xalloc.h.
9490         (memrchr): Remove decl.
9491         (dir_name_r): Remove.
9492         (dir_len): Renamed from dirlen.  All callers changed.
9493         Rewrite in terms of base_name, for simplicity and consistency.
9494         (dir_name): Never return NULL.  All callers changed.
9495         Do not include <stdlib.h> in test program; no longer needed.
9496         return 0; is fine for test program.
9497
9498         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9499         New macros.
9500         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9501
9502         * path-concat.c (path_concat): Use base_len to compute
9503         base length, not strlen; this means we cannot rely on memcpy
9504         to null-terminate.
9505
9506         * same.c (STREQ): Remove.
9507         (same_name): Handle the case where the basename ends in trailing '/'.
9508
9509         * stripslash.c (strip_trailing_slashes): Return nonzero if
9510         a slash was stripped.  Do not strip the last slash after a
9511         file system prefix.
9512
9513 2001-04-08  Jim Meyering  <meyering@lucent.com>
9514
9515         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9516         recomputed; that's necessary when the offset spans a DST transition.
9517         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9518
9519 2001-04-02  Jim Meyering  <meyering@lucent.com>
9520
9521         * regex.h, regex.c: Update from GNU libc.
9522
9523 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9524
9525         * version-etc.c (version_etc_copyright): Update to 2001.
9526
9527 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9528
9529         * tempname.c (uint64_t): Define to uintmax_t if
9530         not defined, and if UINT64_MAX is not defined.
9531         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9532         Reported by John David Anglin.
9533
9534 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9535
9536         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9537         alias if codeset is empty.
9538         * config.charset (BeOS): Use wildcard syntax.
9539
9540 2001-03-13  Jim Meyering  <meyering@lucent.com>
9541
9542         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9543         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9544         From Bruno Haible.
9545
9546 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9547
9548         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9549         Don't return NULL.
9550         * unicodeio.c (print_unicode_char): Simplify accordingly.
9551
9552 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9553
9554         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9555         support for DOS/DJGPP.
9556
9557 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9558
9559         * Makefile.am (libfetish_a_SOURCES):
9560         Add dup-safer.c, fopen-safer.c.
9561         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9562
9563         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9564
9565 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9566
9567         The mkstemp replacement is taken from glibc 2.2.2, with some
9568         portability fixes for use outside glibc, as follows:
9569
9570         * tempname.c (struct_stat64): New macro.
9571         (direxists, __gen_tempname): Use it.
9572         This avoids a portability problem with Solaris 8.
9573
9574         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9575         (<stddef.h>, <stdint.h>, <string.h>):
9576         Include only if STDC_HEADERS || _LIBC.
9577         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9578         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9579         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9580         (__set_errno): Define this macro if <errno.h> doesn't.
9581         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9582         Define these macros if <stdio.h> doesn't.
9583         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9584         Define these macros if <sys/stat.h>
9585         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9586         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9587         __xstat64): Define if not _LIBC.
9588         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9589         (__gen_tempname): Invoke gettimeofday only if
9590         HAVE_GETTIMEOFDAY || _LIBC;
9591         otherwise, fall back on plain "time".
9592         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9593
9594         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9595
9596         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9597
9598 2001-02-17  Jim Meyering  <meyering@lucent.com>
9599
9600         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9601         around included file name.
9602
9603         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9604
9605         * strftime.c: Update from GNU libc (the only changes were to comments).
9606
9607 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9608
9609         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9610
9611 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9612
9613         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9614         Remove workaround macros for hosts that have mbrtowc but not
9615         mbstate_t, as we now insist on proper declarations for both
9616         before using mbrtowc.
9617
9618 2001-02-17  Jim Meyering  <meyering@lucent.com>
9619
9620         * regex.c: Update from libc.
9621
9622 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9623
9624         * alloca.c (malloc): Undef before defining, since stdlib.h
9625         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9626         Reported by Mark Hounschell via Paul Eggert.
9627
9628 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9629
9630         * config.charset: Update for FreeBSD 4.2.
9631
9632 2001-01-26  Jim Meyering  <meyering@lucent.com>
9633
9634         * quotearg.c: Include stddef.h.
9635         * quote.c: Include stddef.h.
9636         Reported by Axel Kittenberger.
9637
9638         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9639         line in double quotes so that it evokes a better diagnostic.
9640         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9641         Reported by Axel Kittenberger.
9642
9643 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9644
9645         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9646         to avoid a warning.  Add back 'const' to inptr.
9647
9648 2001-01-16  Jim Meyering  <meyering@lucent.com>
9649
9650         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9651         From Bruno Haible.
9652
9653 2001-01-14  Jim Meyering  <meyering@lucent.com>
9654
9655         * rename.c: New file.  From Volker Borchert.
9656         Include stdlib.h, string.h or strings.h, and xalloc.h.
9657         Use strip_trailing_slashes rather than open-coding it.
9658
9659 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9660
9661         * strftime.c: Sync with glibc time/strftime.c 1.81.
9662
9663 2001-01-03  Jim Meyering  <meyering@lucent.com>
9664
9665         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9666         local `inptr' to avoid warning with some system declarations of iconv.
9667
9668 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9669
9670         * modechange.c: Do not assume that mode_t uses the
9671         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9672         the other-execute bit of FOO even if S_IXOTH != 1.
9673
9674         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9675         WOTH, XOTH, ALLM): New macros.
9676         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9677          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9678         Use them.
9679         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9680         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9681         (mode_compile):
9682         No need to use uintmax_t; unsigned long is long enough.
9683         Don't bother to get suffix since we don't use it.
9684
9685 2000-12-24  Jim Meyering  <meyering@lucent.com>
9686
9687         * hash.c (is_prime): Return explicit boolean values.
9688         (hash_get_first): Return NULL to appease Irix5.6's 89.
9689         Reported by Nelson Beebe.
9690
9691 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9692
9693         * localcharset.c (locale_charset): Add support for Win32.
9694
9695 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9696
9697         * physmem.h, physmem.c: New files.
9698
9699         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9700         (noinst_HEADERS): Add physmem.h.
9701
9702         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9703         't' for compatibility with Solaris 8 sort.
9704
9705 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9706
9707         * config.charset: Add support for BeOS.
9708
9709 2000-12-16  Jim Meyering  <meyering@lucent.com>
9710
9711         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9712         SHELLS_FILE to a file name that's useful on djgpp systems.
9713         Include stdlib.h.
9714         (ADDITIONAL_DEFAULT_SHELLS): Define.
9715         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9716         Based mostly on a patch from Prashant TR.
9717
9718 2000-12-16  Jim Meyering  <meyering@lucent.com>
9719
9720         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9721         N and M) would have treated it like `chown N:N FILE'.
9722
9723         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9724
9725 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9726
9727         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9728         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9729         to the list of canonical encodings. Rename EUC-CN to GB2312.
9730
9731 2000-12-08  Andreas Schwab  <schwab@suse.de>
9732
9733         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9734         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9735
9736 2000-12-07  Jim Meyering  <meyering@lucent.com>
9737
9738         * stripslash.c (ISSLASH): Define.
9739         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9740         From Prashant TR.
9741
9742         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9743         (dir_name_r): Declare this function as static.
9744         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9745         manifest itself on a name containing a mix of slashes and
9746         backslashes.
9747         Make this function work with names starting with a DOS-style
9748         drive letter and colon prefix.
9749         (dir_name): Append `.' if necessary.
9750         Based mostly on patches from Prashant TR and Eli Zaretskii.
9751
9752         * dirname.h (dir_name_r): Remove prototype.
9753
9754 2000-12-05  Jim Meyering  <meyering@lucent.com>
9755
9756         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9757
9758 2000-12-04  Jim Meyering  <meyering@lucent.com>
9759
9760         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9761         Also include memory.h, stdlib.h, unistd.h if appropriate.
9762         Reported by Andreas Jaeger (conflicting declaration of malloc).
9763
9764 2000-12-02  Jim Meyering  <meyering@lucent.com>
9765
9766         * closeout.h: Make idempotent, to avoid some obscure warnings.
9767
9768 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9769
9770         * memrchr.c: Include <config.h> before any system include file.
9771
9772 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9773
9774         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9775
9776 2000-11-26  Jim Meyering  <meyering@lucent.com>
9777
9778         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9779
9780 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9781
9782         * strftime.c (my_strftime): Do not invoke mbrlen with a
9783         size of (size_t) -1; it's not portable.
9784
9785 2000-11-17  Akim Demaille  <akim@epita.fr>
9786
9787         * obstack.h: Formatting changes.
9788         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9789         prevent type checking.
9790         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9791         cast the value to (void *): assigning a `foo *' to a `void *'
9792         variable is valid.
9793         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9794
9795 2000-11-17  Jim Meyering  <meyering@lucent.com>
9796
9797         * strstr.c: Update from GNU libc.
9798
9799 2000-11-16  Jim Meyering  <meyering@lucent.com>
9800
9801         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9802
9803 2000-11-11  Jim Meyering  <meyering@lucent.com>
9804
9805         * error.c: Add a couple #includes, merging from GNU libc version.
9806
9807 2000-11-10  Jim Meyering  <meyering@lucent.com>
9808
9809         * obstack.h: Update from GNU libc.
9810         * obstack.c: Likewise.
9811
9812 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9813
9814         * getusershell.c (setusershell): Use rewind rather than
9815         fseek/fseeko, to avoid configuration hassles with fseeko.
9816         Don't bother opening SHELLS_FILE if shellstream is NULL;
9817         it's not necessary.
9818
9819 2000-11-05  Jim Meyering  <meyering@lucent.com>
9820
9821         * makepath.h (make_dir): Declare.
9822         * makepath.c (make_dir): Remove `static' attribute.
9823         Tweak a comment.
9824
9825 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9826
9827         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9828         last one in a bucket, advance to the next bucket.
9829
9830 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9831
9832         * fnmatch.c: Do not comment out all the code if we are using
9833         the GNU C library, because in some cases we are replacing buggy
9834         code in the GNU C library itself.
9835
9836 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9837
9838         * error.h, getline.h, modechange.h:
9839         Remove "2000" from Copyright line, as the file hasn't been
9840         changed this year other than in the copyright notice.
9841
9842         * xalloc.h: Add "2000" to Copyright line, as this file
9843         was changed this year.
9844
9845 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9846
9847         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9848         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9849         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9850
9851 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9852
9853         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9854         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9855         doesn't define __restrict_arr.
9856
9857 2000-10-29  Jim Meyering  <meyering@lucent.com>
9858
9859         * xstat.in: Fix grammar in comment.
9860
9861 2000-10-28  Jim Meyering  <meyering@lucent.com>
9862
9863         * memchr.c: Update from libc.
9864         Adjust for portability:
9865         [HAVE_STDLIB_H]: Include stdlib.h.
9866         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9867         Undef __memchr, too.
9868         [!weak_alias]: Define __memchr to memchr.
9869
9870         * regex.c: Update from libc.
9871         * regex.h: Likewise.
9872         * getopt1.c: Likewise.
9873         * memcmp.c: Likewise.
9874
9875         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9876         Avoid using fseek, when possible -- it's broken by design.
9877         Patch by Ulrich Drepper.
9878
9879 2000-10-26  Jim Meyering  <meyering@lucent.com>
9880
9881         * strftime.c: Update from libc.
9882
9883 2000-10-25  Jim Meyering  <meyering@lucent.com>
9884
9885         * obstack.c: Update from libc.
9886
9887 2000-10-23  Jim Meyering  <meyering@lucent.com>
9888
9889         * hard-locale.c (hard_locale): Revert last change -- it was simply
9890         wrong.  That set_locale call must not have any side effects.
9891         From Paul Eggert.
9892
9893 2000-10-22  Jim Meyering  <meyering@lucent.com>
9894
9895         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9896         [CYCLIC]: Remove now-unused definition.
9897
9898         * save-cwd.c (O_DIRECTORY): Define, if needed.
9899         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9900         Suggestion from Ulrich Drepper.
9901
9902 2000-10-21  Jim Meyering  <meyering@lucent.com>
9903
9904         * dirname.c (dir_name_r): New function, factored out of dir_name.
9905         (dir_name): Use dir_name_r.
9906         * dirname.h (dir_name_r): Declare it.
9907
9908 2000-10-21  Jim Meyering  <meyering@lucent.com>
9909
9910         * dirname.c (memrchr): Declare if necessary.
9911         (dir_name): Remove the restriction that there be no
9912         trailing slashes.  Now, this code skips past them, effectively
9913         ignoring them.
9914         [TEST_DIRNAME] (main): New unit tests.
9915
9916         * memrchr.c: New file from GNU libc.
9917         Undef __memrchr, too.
9918         [!weak_alias]: Define __memrchr to memrchr.
9919         Guard weak_alias use with `#ifdef weak_alias'.
9920
9921 2000-10-17  Jim Meyering  <meyering@lucent.com>
9922
9923         * quote.h (PARAMS): Define and use.
9924         Reported by Akim Demaille.
9925
9926         * getopt.c: Update from libc.
9927
9928 2000-10-16  Jim Meyering  <meyering@lucent.com>
9929
9930         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9931         From Jan Fedak.
9932
9933 2000-09-25  Jim Meyering  <meyering@lucent.com>
9934
9935         * md5.h (rol): Define (from GnuPG).
9936
9937         * sha.c: Give credit (GnuPG) where due.
9938         (M): Use rol rather than open-coding it.
9939         Add a FIXME comment.
9940
9941 2000-09-21  Jim Meyering  <meyering@lucent.com>
9942
9943         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9944         Reported by Michael Stone.
9945
9946 2000-09-20  Jim Meyering  <meyering@lucent.com>
9947
9948         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9949         (noinst_HEADERS): Add sha.h.
9950         Based on code from Scott G. Miller and from GnuPG.
9951
9952 2000-09-15  Jim Meyering  <meyering@lucent.com>
9953
9954         * regex.c: Update from libc.
9955
9956 2000-09-10  Jim Meyering  <meyering@lucent.com>
9957
9958         * getopt.c (_getopt_internal): Update from glibc.
9959
9960 2000-09-09  Jim Meyering  <meyering@lucent.com>
9961
9962         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9963         think it should be used as a general replacement for isascii.
9964         * fnmatch.c: Likewise.
9965         * mbswidth.c: Likewise
9966         * regex.c: Likewise.
9967
9968         Don't use atoi.
9969         * userspec.c: Include sys/param.h and limits.h.
9970         Include xstrtol.h.
9971         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9972         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9973         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9974         UID, GID.  Check range.
9975
9976 2000-09-06  Jim Meyering  <meyering@lucent.com>
9977
9978         * getopt.c (_getopt_internal): Update from glibc.
9979
9980 2000-08-30  Jim Meyering  <meyering@lucent.com>
9981
9982         * strftime.c: Merge in changes from GNU libc.
9983
9984 2000-08-26  Jim Meyering  <meyering@lucent.com>
9985
9986         * closeout.c: Include "__fpending.h".
9987         (close_stdout_status): Return right away if there's nothing to flush.
9988
9989         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9990         * __fpending.c: New file.
9991         * __fpending.h: New file.
9992
9993 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9994
9995         Standardize on "memory exhausted" instead of "Memory exhausted"
9996         or "virtual memory exhausted".
9997         * obstack.c (print_and_abort): Use "memory exhausted", not
9998         "virtual memory exhausted".
9999         * same.c (same_name): Invoke xalloc_die instead of printing
10000         our own message.
10001         * userspec.c (parse_user_spec): Likewise.
10002         * bumpalloc.h: comment fix
10003         * same.c, userspec.c: Include xalloc.h.
10004
10005         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10006         not char *const and pointing to a constant array.
10007         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10008         (xrealloc): Comment fix.
10009
10010         * userspec.c (parse_user_spec):
10011         Don't translate a message until just before returning,
10012         to avoid unnecessary translation.
10013
10014 2000-08-07  Jim Meyering  <meyering@lucent.com>
10015
10016         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10017         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10018         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10019         getgroups.c, gethostname.c, getopt.h, group-member.c,
10020         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10021         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10022         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10023         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10024         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10025         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10026         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10027         yesno.c: Back out Copyright date changes for each file with no change
10028         this year.  This eases coordination with other programs using the same
10029         source code modules.  From Paul Eggert.
10030
10031 2000-08-03  Greg McGary  <greg@mcgary.org>
10032
10033         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10034         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10035         (EXTEND_BUFFER): Use them.
10036
10037 2000-08-01  Jim Meyering  <meyering@lucent.com>
10038
10039         * dirname.c (ISSLASH): Define.
10040         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10041         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10042         both `\' and `/' may be use as path separators.
10043         Based on a patch from Prashant TR.
10044
10045 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10046
10047         * quotearg.c (quotearg_n_options): Don't make the initial
10048         slot vector a constant, since it might get modified.
10049
10050 2000-07-31  Jim Meyering  <meyering@lucent.com>
10051
10052         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10053         * obstack.c (print_and_abort): Likewise.
10054
10055 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10056
10057         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10058         buffer, so that the caller can always quote one small
10059         component of a "memory exhausted" message in slot 0.
10060         From a suggestion by Jim Meyering.
10061
10062 2000-07-30  Jim Meyering  <meyering@lucent.com>
10063
10064         * makepath.c (make_path): Quote the other instance, too.
10065
10066         * quotearg.c (N_STATIC_SLOTVECS): Define.
10067         (STATIC_BUF_SIZE): Define.
10068         (quotearg_n_options): Use only statically allocated storage when
10069         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10070         than STATIC_BUF_SIZE.
10071
10072 2000-07-29  Jim Meyering  <meyering@lucent.com>
10073
10074         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10075         * dirname.c (dir_name): Likewise.
10076
10077         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10078
10079         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10080         (dir_name): Assert that there are no trailing slashes.
10081
10082 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10083
10084         * mbswidth.h (mbswidth): Add a flags argument.
10085         (mbswidth): New declaration.
10086         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10087         * mbswidth.c (mbswidth): Add a flags argument.
10088         (mbsnwidth): New function.
10089
10090 2000-07-24  Jim Meyering  <meyering@lucent.com>
10091
10092         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10093
10094 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10095
10096         * mbswidth.c (_XOPEN_SOURCE):
10097         Don't define; this causes problems on Solaris 7.
10098         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10099
10100 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10101
10102         * quotearg.c:
10103         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10104         so that mbstate_t is always defined.
10105
10106         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10107         be 1 in at least one GCC installation, and this configuration
10108         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10109         performance on hosts that have mbrtowc but have only unibyte
10110         locales, but I assume these hosts are rare.
10111
10112 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10113
10114         * quotearg.c: Streamline by invoking multibyte code only if needed.
10115         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10116         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10117         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10118         invoke multibyte primitives.
10119
10120 2000-07-23  Jim Meyering  <meyering@lucent.com>
10121
10122         * basename.c (base_name): Add an assertion.
10123
10124 2000-07-15  Bruno Haible  <clisp.cons.org>
10125
10126         * quotearg.c: When the system forces us to redefine mbstate_t,
10127         shadow its mbsinit function.
10128
10129 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10130
10131         * mbswidth.h: New file.
10132         * mbswidth.c: New file.
10133         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10134         (noinst_HEADERS): Add mbswidth.h.
10135
10136 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10137
10138         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10139         and IRIX 6.
10140
10141 2000-07-15  Jim Meyering  <meyering@lucent.com>
10142
10143         * makepath.c: Include quote.h.
10144         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10145         corresponding argument in a `quote (...)' call.
10146         Give better diagnostics.
10147
10148         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10149         (noinst_HEADERS): Add quote.h.
10150
10151         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10152         from tar's src/misc.c.
10153         * quote.h: New file.  Prototypes for same.
10154
10155 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10156
10157         From a suggestion by Bruno Haible.
10158         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10159         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10160         to decide whether to define the BeOS workaround macro;
10161         this adjusts to the change to AC_MBSTATE_T.
10162
10163 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10164
10165         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10166
10167         * quotearg.c (quoting_style_args, quoting_style_vals,
10168         quotearg_buffer_restyled): Add support for
10169         clocale_quoting_style.  Undo previous change to
10170         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10171         and "{RIGHT QUOTATION MARK}" msgids.
10172
10173 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10174
10175         The old behavior of quoting `like this' doesn't look good with
10176         newer, ISO-style fonts.  See:
10177         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10178
10179         Instead, quote "like this" by default.  Let the translator
10180         tailor the locale-specific quoting behavior by providing
10181         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10182
10183         * quotearg.c (N_): New macro.
10184         (gettext_default): New function.
10185         (quotearg_buffer_restyled): Use
10186         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10187         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10188
10189 2000-07-09  Jim Meyering  <meyering@lucent.com>
10190
10191         * Most files: Update copyright dates to include 2000.
10192
10193 2000-07-08  Jim Meyering  <meyering@lucent.com>
10194
10195         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10196         if not defined.
10197         (xgethostname): Remove now-unnecessary #ifdef.
10198         Move declaration of `err' into loop where it's used.
10199
10200 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10201
10202         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10203         by allocating a larger buffer. Test the gethostname return value for
10204         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10205         returns an error and ENAMETOOLONG isn't defined.
10206
10207 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10208         and Bruno Haible  <haible@clisp.cons.org>
10209
10210         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10211
10212 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10213
10214         * quotearg.c (struct quoting_options): Simplify quote_these_too
10215         dimension.
10216
10217 2000-07-03  Jim Meyering  <meyering@lucent.com>
10218
10219         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10220         Reported by Bruno Haible.
10221
10222 2000-07-04  Jim Meyering  <meyering@lucent.com>
10223
10224         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10225         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10226         lacks mbrtowc.
10227
10228 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10229         and Bruno Haible  <haible@clisp.cons.org>
10230
10231         * quotearg.c (mbrtowc):
10232         Assign to *pwc, and return 1 only if result is nonzero.
10233         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10234
10235 2000-07-03  Jim Meyering  <meyering@lucent.com>
10236
10237         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10238         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10239         From Bob Proulx.
10240
10241 2000-07-02  Jim Meyering  <meyering@lucent.com>
10242
10243         * quotearg.c (mbstate_t): Don't define here.
10244
10245 2000-07-02  Jim Meyering  <meyering@lucent.com>
10246
10247         * nanosleep.c (SIGCONT): Define if not already defined.
10248
10249 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10250
10251         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10252         per change in ../m4/ls-mntd-fs.m4.
10253         (read_filesystem_list): Ignore symbolic links.
10254
10255 2000-06-29  Jim Meyering  <meyering@lucent.com>
10256
10257         * same.c: Include <string.h> or <strings.h>, as appropriate,
10258         for declaration of strcmp.
10259
10260         * long-options.c: Include <stdlib.h>, for declaration of exit.
10261
10262         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10263         Avoid warning by casting result to `char *' to remove `const'.
10264
10265 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10266
10267         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10268
10269 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10270
10271         savedir now sets errno on failure and invokes xmalloc to get memory.
10272         Fix a couple of other minor bugs while we're at it.
10273
10274         * savedir.c (<unistd.h>): Do not include; there's no need.
10275         (NAMLEN): Remove macro.
10276         (malloc, realloc): Remove decls.
10277         (stpcpy): Likewise.
10278         ("xalloc.h"): Include.
10279         (NAME_SIZE_DEFAULT): New macro.
10280         (savedir): Use xmalloc / xrealloc to allocate memory.
10281         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10282         Skip "" directory entries.
10283         Use strlen to calculate directory entry length, since the old method
10284         is rarely used these days and isn't worth supporting.
10285         Don't use a pointer after freeing it.
10286         Check for integer overflow when calculating allocation size.
10287         Use memcpy to copy entries, instead of stpcpy.
10288         Set errno properly when returning NULL.
10289         Check for readdir error.
10290
10291 2000-06-26  Jim Meyering  <meyering@lucent.com>
10292
10293         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10294
10295 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10296
10297         * getusershell.c (xmalloc, xrealloc): Remove functions.
10298         Include xalloc.h.
10299         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10300
10301 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10302
10303         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10304
10305 2000-06-24  Jim Meyering  <meyering@lucent.com>
10306
10307         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10308
10309 2000-06-21  Jim Meyering  <meyering@lucent.com>
10310
10311         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10312
10313 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10314
10315         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10316         (mbrtowc, mbstate_t): Define substitutes if
10317         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10318         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10319         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10320
10321 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10322
10323         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10324         than 1024, return a memory chunk of least possible size, instead
10325         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10326         Use free/xmalloc instead of xrealloc to avoid copying for very long
10327         paths.
10328
10329 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10330
10331         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10332         address, not strdup.  Include <stdlib.h> and don't declare free().
10333
10334 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10335
10336         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10337         the empty string.
10338
10339 2000-06-21  Jim Meyering  <meyering@lucent.com>
10340
10341         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10342         (noinst_HEADERS): Add getstr.h.
10343
10344         * getline.c (getstr): Move into a separate file.
10345         * getstr.c (getstr): New file, extracted from getline.c, with
10346         the following changes: new parameter, delim2; both delim[12]
10347         parameters have type `int', not `char'.  The latter would lose
10348         with 8-bit delimiters.
10349         * getstr.h: New file.
10350
10351 2000-06-19  Jim Meyering  <meyering@lucent.com>
10352
10353         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10354
10355 2000-06-18  Jim Meyering  <meyering@lucent.com>
10356
10357         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10358         Besides, these days every porting target provides a mkdir function.
10359
10360         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10361         (this snippet comes from src/system.h).
10362
10363 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10364
10365         * human.c (adjust_value): New function.
10366         (human_readable_inexact): Apply rounding style even when
10367         printing approximate values.
10368
10369 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10370
10371         * human.c (human_readable_inexact): Allow an input block
10372         size that is not a multiple of the output block size, and vice versa.
10373         Reported by Piergiorgio Sartor.
10374
10375 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10376
10377         * getdate.y (get_date): Apply relative times after time
10378         zone indicator, not before.  Reported by Todd A. Jacobs.
10379
10380 2000-06-13  Jim Meyering  <meyering@lucent.com>
10381
10382         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10383
10384         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10385
10386 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10387
10388         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10389
10390 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10391
10392         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10393
10394 2000-06-04  Jim Meyering  <meyering@lucent.com>
10395
10396         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10397         SunOS 4.1.4 for which gid_t is an unsigned type.
10398
10399 2000-06-03  Jim Meyering  <meyering@lucent.com>
10400
10401         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10402
10403 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10404
10405         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10406         newer, don't install charset.alias.
10407         * config.charset: Change the Linux/glibc rules so they become empty
10408         on glibc-2.1 or newer.
10409
10410 2000-06-02  Jim Meyering  <meyering@lucent.com>
10411
10412         * mountlist.c: Back out last change.  Instead, do this...
10413         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10414         member using the same `ignore'-testing code.
10415         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10416         fs_type strings.
10417         From Mark D. Roth.
10418
10419 2000-05-29  Jim Meyering  <meyering@lucent.com>
10420
10421         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10422         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10423
10424 2000-05-22  Jim Meyering  <meyering@lucent.com>
10425
10426         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10427
10428 2000-05-18  Jim Meyering  <meyering@lucent.com>
10429
10430         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10431         back, too, since it may have been modified by allocate_entry.
10432         (hash_delete): Rewrite to use neither the assignment operator
10433         nor the comma operator in an if-expression.
10434
10435 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10436
10437         * closeout.c:
10438         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10439         Remove; no longer needed.
10440         "quotearg.h": Add include.
10441         (file_name): Do not bother to explicitly initialize to NULL; it's less
10442         efficient on some hosts.
10443         (close_stdout_status): Remove test as to whether stdout was already
10444         closed; it breaks for the case "echo x | sort >&-".
10445         Quote file name colons.
10446         Do not assume that _("write error") lacks format strings.
10447
10448 2000-05-15  Jim Meyering  <meyering@lucent.com>
10449
10450         * version-etc.c (version_etc_copyright): Update the copyright string
10451         used in all --version output.
10452
10453 2000-05-14  Jim Meyering  <meyering@lucent.com>
10454
10455         * closeout.c (close_stdout_set_file_name): New function.
10456         (close_stdout_status): Use new file-scoped global.
10457         Return right away if fstat says the stdout file descriptor is invalid.
10458         * closeout.h (close_stdout_set_file_name): Declare.
10459
10460 2000-05-10  Jim Meyering  <meyering@lucent.com>
10461
10462         * closeout.c [default_exit_status]: New file-scoped variable.
10463         (close_stdout_set_status): New function.
10464         * closeout.h (close_stdout_set_status): Declare.
10465
10466 2000-05-08  Jim Meyering  <meyering@lucent.com>
10467
10468         * long-options.c: Don't include closeout.h.
10469         (parse_long_options): Don't call close_stdout for --version.
10470
10471 2000-05-06  Jim Meyering  <meyering@lucent.com>
10472
10473         * strnlen.c: Undefine __strnlen and strnlen.
10474         [!weak_alias]: Define __strnlen to strnlen.
10475
10476         * atexit.c: New file, from libiberty.
10477
10478 2000-05-06  Jim Meyering  <meyering@lucent.com>
10479
10480         * closeout.c (close_stdout_status): Also check for errors on the
10481         stderr stream.
10482
10483 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10484
10485         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10486         instead of xmalloc, xrealloc, path_concat.
10487         (locale_charset): Treat empty environment variables as absent.
10488         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10489
10490 2000-05-04  Jim Meyering  <meyering@lucent.com>
10491
10492         * getopt.c: Update from glibc.
10493         * obstack.c: Likewise.
10494         * obstack.h: Likewise.
10495         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10496
10497         * regex.h: Likewise.
10498         * strndup.c: Likewise.
10499         * strnlen.c: New file, from glibc.
10500
10501 2000-05-01  Jim Meyering  <meyering@lucent.com>
10502
10503         * full-write.c (full_write): Remove `FIXME' part of comment.
10504
10505 2000-04-29  Jim Meyering  <meyering@lucent.com>
10506
10507         * path-concat.c: Declare strdup only if it's not defined.
10508         * canon-host.c: Likewise.
10509
10510 2000-04-28  Jim Meyering  <meyering@lucent.com>
10511
10512         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10513         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10514         included first, then limits.h is included by locale.h by libintl.h.
10515         From John David Anglin.
10516
10517 2000-04-25  Jim Meyering  <meyering@lucent.com>
10518
10519         * makepath.c (S_IRWXUGO): Define.
10520         (make_path): Always perform explicit chmod if MODE specifies any
10521         of the `special' permission bits.  Prompted by a bug report against
10522         install from Mate Wierdl and Joost van Baal.
10523
10524 2000-04-18  Jim Meyering  <meyering@lucent.com>
10525
10526         * README: New file.
10527
10528         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10529         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10530
10531 2000-04-17  Jim Meyering  <meyering@lucent.com>
10532
10533         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10534         the definition of it to rpl_strftime also defined-away the system's
10535         declaration.
10536
10537 2000-04-15  Jim Meyering  <meyering@lucent.com>
10538
10539         Use `C' to denote so-called `contiguous' files, the same way
10540         that tar does.
10541         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10542         (ftypelet): Use S_ISCTG.
10543         From Michael Deutschmann.
10544
10545 2000-04-14  Jim Meyering  <meyering@lucent.com>
10546
10547         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10548
10549 2000-04-08  Jim Meyering  <meyering@lucent.com>
10550
10551         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10552         names don't conflict.  Reported by Eli Zaretskii.
10553
10554 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10555
10556         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10557         bug.  Deal with the different error behavior of Irix iconv.
10558
10559 2000-04-07  Jim Meyering  <meyering@lucent.com>
10560
10561         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10562         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10563
10564 2000-04-05  Jim Meyering  <meyering@lucent.com>
10565
10566         Portability tweaks required for ultrix4.3.
10567         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10568         * readutmp.c: Include sys/types.h before sys/stat.h.
10569         * canon-host.c: Declare strdup.
10570         * path-concat.c: Likewise.
10571         From John David Anglin.
10572
10573 2000-04-04  Jim Meyering  <meyering@lucent.com>
10574
10575         Be more DOS 8.3-friendly.
10576         * ref-add.sin: Renamed from ref-add.sed.in.
10577         * ref-del.sin: Renamed from ref-del.sed.in.
10578         * Makefile.am: Reflect renaming.
10579         Reported by Eli Zaretskii.
10580
10581         Use a temporary file name that won't clash with `charset.alias'
10582         in the DOS 8.3 name space.
10583         * Makefile.am (charset_tmp): Define.
10584         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10585         (uninstall-local): Likewise.
10586         Reported by Eli Zaretskii.
10587
10588 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10589
10590         * time/strftime.c (my_strftime): Make sure we call the system
10591         strftime, not ourselves, when invoking the underlying strftime.
10592
10593 2000-03-24  Jim Meyering  <meyering@lucent.com>
10594
10595         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10596         (charset_alias): Define.
10597         (install-exec-local): Factor out common code.
10598         (uninstall-local): Split lines longer than 80.
10599         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10600         (SUFFIXES): Define.
10601         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10602         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10603
10604 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10605
10606         * config.charset: Output a line containing "Packages using this file".
10607         * ref-add.sed.in, ref-del.sed.in: New files.
10608         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10609         ref-del.sed): New rules.
10610
10611 2000-03-17  Jim Meyering  <meyering@lucent.com>
10612
10613         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10614         Otherwise, include <strings.h>
10615
10616 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10617
10618         * unicodeio.c (utf8_wctomb): New function.
10619         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10620         format instead of in UCS-4 with platform dependent endianness.
10621
10622 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10623
10624         * savedir.c (savedir): Work even if directory size is
10625         negative; this can happen with some screwy NFS configurations.
10626
10627 2000-03-06  Jim Meyering  <meyering@lucent.com>
10628
10629         * localcharset.c (get_charset_aliases): Don't try to free file_name
10630         if it's NULL (because we ran out of memory).  From Bruno Haible.
10631
10632 2000-03-05  Jim Meyering  <meyering@lucent.com>
10633
10634         * localcharset.c ("path-concat.h"): Include.
10635         (get_charset_aliases): Use path_concat instead of ANSI string
10636         concatenation.
10637
10638         * unicodeio.h (PARAMS): Define.
10639         Use it to guard prototype.
10640
10641 2000-03-04  Jim Meyering  <meyering@lucent.com>
10642
10643         * Makefile.am (install-exec-local): Create $(libdir) before installing
10644         into it.
10645         (uninstall-local): Uncomment this rule so `make distcheck' works
10646         once again.
10647
10648         * unicodeio.c (<errno.h>): Include it.
10649         (errno): Declare if not defined.
10650
10651         * localcharset.c: Add Bruno's comment justifying use of volatile.
10652
10653         * config.charset: New version, incorporating remarks from a linux
10654         i18n mailing list.  From Bruno Haible.
10655
10656 2000-03-02  Jim Meyering  <meyering@lucent.com>
10657
10658         * Makefile.am (EXTRA_DIST): Add config.charset.
10659
10660 2000-03-01  Jim Meyering  <meyering@lucent.com>
10661
10662         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10663         * unicodeio.c: Likewise.
10664
10665 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10666
10667         * config.charset: New file.
10668         * localcharset.c: New file.
10669         * unicodeio.h, unicodeio.c: New files.
10670         * Makefile.am (DEFS): Add -DLIBDIR=...
10671         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10672         (noinst_HEADERS): Add unicodeio.h.
10673         (all-local, install-exec-local, charset.alias): New targets.
10674
10675 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10676
10677         * quotearg.c (ALERT_CHAR): New macro.
10678         (quotearg_buffer_restyled): Use it.
10679
10680 2000-02-27  Jim Meyering  <meyering@lucent.com>
10681
10682         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10683         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10684
10685         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10686         not `#if STDC_HEADERS'.
10687         Declare malloc if needed.
10688
10689         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10690         now that autoconf always defines the HAVE_DECL_ symbols.
10691         * human.c: Likewise.
10692         * same.c: Likewise.
10693         * strtoumax.c: Likewise.
10694
10695         * backupfile.c: Arrange for cpp to fail if the configure-time
10696         declaration check was not run.
10697         * hash.c: Likewise.
10698         * human.c: Likewise.
10699         * same.c: Likewise.
10700         * strtoumax.c: Likewise.
10701
10702         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10703         then first look up the entire `.'-containing string as a login name.
10704
10705 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10706
10707         * getdate.y: Handle two-digit years with leading zeros correctly.
10708         (textint): New typedef.
10709         (parser_control): Member year changed from int to textint.
10710         All uses changed.
10711         (YYSTYPE): Removed; replaced by %union with int and textint members.
10712         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10713         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10714         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10715         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10716         (date, number, to_year): Use width of number in digits, not its value,
10717         to determine whether it's a 2-digit year, or a 2-digit time.
10718         (yylex): Store number of digits of numeric tokens.
10719         Reported by John Kendall.
10720
10721         (parser_control): Changed from struct parser_control to typedef (for
10722         consistency).  All uses changed.
10723
10724         (tID): Removed; not used.
10725         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10726
10727 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10728
10729         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10730         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10731
10732 2000-02-12  Jim Meyering  <meyering@lucent.com>
10733
10734         * userspec.c (ISDIGIT): Define it.
10735         (isdigit): Remove definition.
10736         (is_number): Use ISDIGIT, not isdigit.
10737         <libintl.h>: Include.
10738         (_ and N_): Define.
10739         (parse_user_spec): Mark translatable strings.
10740
10741 2000-02-10  Jim Meyering  <meyering@lucent.com>
10742
10743         With these changes, nanosleep.[ch] are finally enough like the other
10744         lib/* replacement files to compile on a few more losing systems.
10745
10746         * nanosleep.h: Don't include config.h.
10747         Remove prototype from declaration of nanosleep.
10748         (PARAMS): Remove now-unneeded definition.
10749         * nanosleep.c: #undef nanosleep.
10750         (rpl_nanosleep): Rename from nanosleep.
10751
10752 2000-02-03  Jim Meyering  <meyering@lucent.com>
10753
10754         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10755         rather than with `#if HAVE_UTMPNAME'.
10756
10757 2000-02-01  Jim Meyering  <meyering@lucent.com>
10758
10759         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10760
10761 2000-01-31  Jim Meyering  <meyering@lucent.com>
10762
10763         * nanosleep.h (nanosleep): Guard declaration with
10764         `#if ! HAVE_DECL_NANOSLEEP'.
10765         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10766         the declaration in that vendor's sys/timers.h.
10767         Reported by Christian Krackowizer.
10768
10769         * quotearg.c (ISASCII): Add #undef and move definition to follow
10770         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10771         (ISPRINT): Likewise.
10772         Reported by Tom Tromey.
10773
10774 2000-01-30  Jim Meyering  <meyering@lucent.com>
10775
10776         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10777         uses of ->ut_name.  The latter doesn't work with new Linux header files
10778         where only utmpx.ut_user is declared.
10779
10780         * readutmp.h (UT_USER): Define.
10781
10782 2000-01-23  Jim Meyering  <meyering@lucent.com>
10783
10784         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10785         obstack.c.
10786
10787 2000-01-22  Jim Meyering  <meyering@lucent.com>
10788
10789         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10790         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10791         Required for some AIX systems.  Reported by Christian Krackowizer.
10792         [TESTING] (main): New function.
10793
10794         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10795         * dirname.c (dir_name): Support for DOS-style file names with drive
10796         letters.
10797
10798         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10799
10800         * strverscmp.c (ISDIGIT): Define.
10801         (strverscmp): Use ISDIGIT, not isdigit.
10802
10803 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10804
10805         * nanosleep.c (nanosleep):
10806         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10807         POSIX.1 doesn't require SA_INTERRUPT and some systems
10808         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10809         it's been part of POSIX.1 since day 1 (in 1988).
10810
10811 2000-01-17  Jim Meyering  <meyering@lucent.com>
10812
10813         * interlock: Remove unused file.  Reported by François Pinard.
10814
10815 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10816
10817         * quotearg.c (quotearg_buffer_restyled): Do not quote
10818         alert, backslash, formfeed, and vertical tab unnecessarily in
10819         shell quoting style.
10820
10821
10822 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10823 Free Software Foundation, Inc.
10824 Copying and distribution of this file, with or without modification,
10825 are permitted provided the copyright notice and this notice are preserved.