* mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
[gnulib.git] / lib / ChangeLog
1 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * mkstemp.h: New file, since some standard headers
4         #define mkstemp.
5         * mkstemp.c: Revamp to put the !_LIBC code together.
6         Include "mkstemp.h".
7         Make the _LIBC code resemble glibc original more,
8         e.g., use K&R style.
9         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
10         (mkstemp): Remove, since mkstemp.h does this for us.
11         * stdlib--.h: Include mkstemp.h.
12
13         Import this patch from libc:
14
15         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
16
17         * tempname.c (__gen_tempname): Change attempts_min
18         into a macro.  Use preprocessor to decide how to initialize
19         attempts [Coverity CID 67].
20
21 2006-09-18  Bruno Haible  <bruno@clisp.org>
22
23         * javaversion.c: Include configmake.h.
24
25 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
26
27         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
28         that prevented coreutils 6.1 from building.  Problem reported
29         by Petter Reinholdtsen.
30
31 2006-09-18  Jim Meyering  <jim@meyering.net>
32
33         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
34
35 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
36
37         * dirchownmod.c: Don't include fcntl.h; no longer needed.
38         (dirchownmod): New arg FD.  All callers changed.
39         Use FD rather than opening the directory ourself, as opening is
40         now the caller's responsibility.
41         * dirchownmod.h: Likewise.
42         * mkancesdirs.c: Include <sys/types.h>, for portability to older
43         hosts that require <sys/types.h> before <sys/stat.h>.  Include
44         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
45         (test_dir): Remove.
46         (mkancesdirs): Return length of prefix of FILE that has already
47         been made, or -2 if there is a child doing the work.  Redo
48         algorithm so that it is O(N) rather than O(N**2).  Optimize away
49         ".", and treat ".." specially since it might stray back into
50         already-created areas.  Use a subprocess if necessary.  New arg
51         WD; all users changed.  MAKE_DIR function should now return 1
52         if it creates a directory that is not readable.  Return -2 if
53         a child process is spun off.
54         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
55         Adjust signature to match code.
56         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
57         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
58         all users changed.
59         * savewd.c, savewd.h: New files.
60
61 2006-09-15  Jim Meyering  <jim@meyering.net>
62
63         * rename-dest-slash.c (has_trailing_slash): Use
64         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
65         (rpl_rename_dest_slash): Perform the cheaper trailing slash
66         test before testing whether SRC is a directory.
67         Suggestions from Bruno Haible.
68
69         Avoid a warning about an unused variable.
70         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
71         into the #ifdef block where it's used.
72
73         * rename-dest-slash.c: New file.
74
75 2006-09-14  Bruno Haible  <bruno@clisp.org>
76
77         * allocsa.c: Include <config.h> unconditionally.
78         * asnprintf.c: Likewise.
79         * asprintf.c: Likewise.
80         * c-strcasecmp.c: Likewise.
81         * c-strcasestr.c: Likewise.
82         * c-strncasecmp.c: Likewise.
83         * c-strstr.c: Likewise.
84         * classpath.c: Likewise.
85         * clean-temp.c: Likewise.
86         * concatpath.c: Likewise.
87         * copy-file.c: Likewise.
88         * csharpcomp.c: Likewise.
89         * csharpexec.c: Likewise.
90         * execute.c: Likewise.
91         * fatal-signal.c: Likewise.
92         * findprog.c: Likewise.
93         * fwriteerror.c: Likewise.
94         * gl_array_list.c: Likewise.
95         * gl_array_oset.c: Likewise.
96         * gl_avltree_list.c: Likewise.
97         * gl_avltree_oset.c: Likewise.
98         * gl_avltreehash_list.c: Likewise.
99         * gl_carray_list.c: Likewise.
100         * gl_linked_list.c: Likewise.
101         * gl_linkedhash_list.c: Likewise.
102         * gl_list.c: Likewise.
103         * gl_oset.c: Likewise.
104         * gl_rbtree_list.c: Likewise.
105         * gl_rbtree_oset.c: Likewise.
106         * gl_rbtreehash_list.c: Likewise.
107         * imaxabs.c: Likewise.
108         * imaxdiv.c: Likewise.
109         * javacomp.c: Likewise.
110         * javaexec.c: Likewise.
111         * javaversion.c: Likewise.
112         * linebreak.c: Likewise.
113         * localcharset.c: Likewise.
114         * lock.c: Likewise.
115         * mbchar.c: Likewise.
116         * mbswidth.c: Likewise.
117         * mkdtemp.c: Likewise.
118         * pipe.c: Likewise.
119         * printf-args.c: Likewise.
120         * printf-parse.c: Likewise.
121         * progname.c: Likewise.
122         * progreloc.c: Likewise.
123         * readlink.c: Likewise.
124         * sh-quote.c: Likewise.
125         * stpcpy.c: Likewise.
126         * stpncpy.c: Likewise.
127         * strcasecmp.c: Likewise.
128         * strcasestr.c: Likewise.
129         * strcspn.c: Likewise.
130         * striconv.c: Likewise.
131         * strncasecmp.c: Likewise.
132         * strnlen1.c: Likewise.
133         * strstr.c: Likewise.
134         * strtok_r.c: Likewise.
135         * tls.c: Likewise.
136         * tmpdir.c: Likewise.
137         * unicodeio.c: Likewise.
138         * unsetenv.c: Likewise.
139         * vasnprintf.c: Likewise.
140         * vasprintf.c: Likewise.
141         * wait-process.c: Likewise.
142         * xallocsa.c: Likewise.
143         * xsetenv.c: Likewise.
144         * xstriconv.c: Likewise.
145
146 2006-09-13  Eric Blake  <ebb9@byu.net>
147
148         * getopt.c: Fix typo in last commit.
149
150 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
151
152         * _fpending.c: Include <config.h> unconditionally, since we no
153         longer worry about uses that don't define HAVE_CONFIG_H.
154         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
155         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
156         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
157         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
158         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
159         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
160         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
161         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
162         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
163         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
164         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
165         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
166         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
167         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
168         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
169         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
170         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
171         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
172         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
173         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
174         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
175         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
176         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
177         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
178         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
179         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
180         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
181         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
182         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
183         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
184         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
185         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
186         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
187         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
188         Likewise.
189
190 2006-09-12  Jim Meyering  <jim@meyering.net>
191
192         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
193         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
194         Reported by Nelson H. F. Beebe.
195
196 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
197
198         * argp-help.c (argp_doc): Make sure NULL is not passed to
199         dgettext.
200
201 2006-09-10  Bruno Haible  <bruno@clisp.org>
202
203         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
204
205 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
206
207         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
208         program_invocation_name and program_invocation_short_name are
209         initialized.
210         * argp-namefrob.h: Move declarations of program_invocation_name
211         and program_invocation_short_name to argp.h, so they are visible
212         to user programs.
213         * argp.h: Likewise
214
215 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
216
217         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
218         convention.  Text proposed by Bruno Haible.
219         (struct argp_option): Document the use of N_() wrappers.
220
221         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
222         and translate the two parts separately, instead of feeding
223         the whole string to gettext.  This allows to exclude
224         '\v' from the strings visible to the translator by writing doc
225         strings as N_("..") "\v" N_("..").
226
227 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
228
229         * mktime.c (guess_time_tm): Fix bug where mktime
230         returned the maximum time_t value rather than (time_t) -1.
231         Problem originally reported by William Bardwell
232         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
233
234         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
235         Moved to here ...
236         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
237         ... from here.
238
239 2006-09-06  Bruno Haible  <bruno@clisp.org>
240
241         * striconv.h: New file.
242         * striconv.c: New file, merging iconvme.c with GNU gettext's
243         iconvstring.c.
244         * xstriconv.h: New file.
245         * xstriconv.c: New file.
246
247 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
248
249         * argz_.h: Sync from Libtool.
250
251         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
252                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
253
254         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
255
256 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
257
258         * trim.h: New file.
259         * trim.c: New file.
260
261 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
262
263         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
264         Problem reported by Ralf Wildenhues in
265         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
266
267         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
268         HAVE_STRUCT_STATFS_F_FSTYPENAME.
269
270 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
271
272         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
273         or stdbool.h, because they might not exist while configuring.
274
275         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
276         Don't include unistd.h or limits.h; not needed, since chdir-long.h
277         does that for us.
278         (O_DIRECTORY): Remove.
279
280 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
281
282         Work around a bug in both the Linux and SunOS 64-bit kernels:
283         nanosleep mishandles sleeps for longer than 2**31 seconds.
284         Problem reported by Frank v Waveren in
285         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
286         * nanosleep.c (BILLION): New constant.
287         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
288         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
289
290 2006-08-30  Jim Meyering  <jim@meyering.net>
291
292         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
293         the parameter.
294
295 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
296
297         * isapipe.c, isapipe.h: New files.
298
299 2006-08-29  Eric Blake  <ebb9@byu.net>
300
301         * error.c (error_at_line, print_errno_message): Match libc, after
302         resolution of upstream bug 3044.
303
304 2006-08-29  Bruno Haible  <bruno@clisp.org>
305
306         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
307
308 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
309
310         Sync from Libtool:
311
312         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
313
314         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
315         sharing with gnulib.  Report by Eric Blake.
316
317 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
318
319         * fcntl_.h: New file.
320         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
321         the fcntl module.
322         * dirchownmod.c: Likewise.
323         * fts.c: Likewise.
324
325         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
326         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
327         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
328         just before including <inttypes.h>, to avoid circular inclusion.
329
330 2006-08-28  Bruno Haible  <bruno@clisp.org>
331
332         * inttypes_.h (SCNX*): Remove definitions.
333         Reported by Eric Blake.
334
335 2006-08-26  Bruno Haible  <bruno@clisp.org>
336
337         * vasnprintf.c (EOVERFLOW): Remove definition.
338         (VASNPRINTF): Return a string of length > INT_MAX without failing.
339         * vasprintf.c: Include errno.h, limits.h.
340         (EOVERFLOW): New fallback definition.
341         (vasprintf): Test here whether the string length is > INT_MAX.
342         * vsnprintf.c: Include errno.h, limits.h.
343         (EOVERFLOW): New fallback definition.
344         (vsnprintf): Fix bug when generated string was too long for the buffer.
345         Test here whether the string length is > INT_MAX.
346
347 2006-08-26  Bruno Haible  <bruno@clisp.org>
348             Simon Josefsson  <jas@extundo.com>
349
350         BeOS portability.
351         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
352
353 2006-08-28  Bruno Haible  <bruno@clisp.org>
354
355         * c-strstr.h: New file, from GNU gettext.
356         * c-strstr.c: New file, from GNU gettext.
357
358 2006-08-26  Bruno Haible  <bruno@clisp.org>
359
360         * inttypes_.h: New file.
361         * inttypes.h: Remove file.
362         * stdint_.h: Include <inttypes.h> through its absolute filename.
363
364         * imaxabs.c: New file.
365
366         * imaxdiv.c: New file.
367
368 2006-08-22  Bruno Haible  <bruno@clisp.org>
369
370         * readutmp.h: Skip most definitions if neither <utmp.h> nor
371         <utmpx.h> exists.
372
373 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
374
375         BeOS portability.
376         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
377         Problem reported by Bruno Haible.
378
379 2006-08-21  Bruno Haible  <bruno@clisp.org>
380
381         BeOS portability.
382         * mbchar.h: Include <wctype.h> only if it exists.
383
384 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
385
386         * cycle-check.h: Include <stdint.h> unconditionally, since we
387         now assume the stdint module.  Do not include inttypes.h.
388         * fsusage.h: Likewise.
389         * getndelim2.c: Likewise.
390         * human.h: Likewise.
391         * inttostr.h: Likewise.
392         * obstack.c: Likewise.
393         * regex_internal.h: Likewise.
394         * tempname.c: Likewise.
395         * utimecmp.c: Likewise.
396         * xstrtol.h: Likewise.
397
398         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
399
400         * strtoimax.c: Adjust to macro name changes in Autoconf,
401         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
402         * xtime.h: Likewise.
403
404 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
405
406         * fchmodat.c: New file, from coreutils.  This was inadvertently
407         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
408
409 2006-08-18  Bruno Haible  <bruno@clisp.org>
410
411         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
412         (ME_DUMMY): Treat "kernfs" as a dummy.
413         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
414
415 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
416
417         Update from coreutils.
418
419         * __fpending.h: Add copyright notice.
420         * fprintftime.h: Likewise.
421         * savedir.c: Use (C) in copyright notice.
422         * savedir.h: Likewise.
423
424         2006-08-15  Jim Meyering  <jim@meyering.net>
425
426         * at-func.c: New file, with the logic of all emulated at-functions.
427         * openat-priv.h: Include <errno.h> and define ENOSYS,
428         in support of the EXPECTED_ERRNO macro.
429         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
430         Instead, define the appropriate symbols and include "at-func.c".
431         * mkdirat.c (mkdirat): Likewise.
432         * fchmodat.c (fchmodat): Likewise.
433         (ENOSYS): Remove definition.
434         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
435         Don't include "unistd--.h" -- it wasn't ever used.
436
437         2006-01-17  Jim Meyering  <jim@meyering.net>
438
439         Rewrite fts.c not to change the current working directory,
440         by using openat, fstatat, fdopendir, etc..
441
442         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
443         (HAVE_OPENAT_SUPPORT): Define.
444         [_LIBC] (fchdir): Don't undef or define; no longer used.
445         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
446         Now, this `function' always succeeds, and consumes its file descriptor
447         parameter -- so callers must not close such FDs.  Update callers.
448         (diropen_fd, opendirat, cwd_advance_fd): New functions.
449         (diropen): Add parameter, SP.  Adjust all callers.
450         Implement using diropen_fd, rather than open.
451         (fts_open): Initialize new member, fts_cwd_fd.
452         Remove fts_rft-setting code.
453         (fts_close): Close fts_cwd_fd, if necessary.
454         (__opendir2): Define in terms of opendir or opendirat,
455         depending on whether the FST_NOCHDIR flag is set.
456         (fts_build): Since fts_safe_changedir consumes its FD, and since
457         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
458         and close the dup'd file descriptor upon failure.
459         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
460         (fts_safe_changedir): Tweak semantics to reflect that this function
461         now calls cwd_advance_fd and hence consumes its FD argument.
462         * fts_.h [struct FTS] (fts_cwd_fd): New member.
463         [struct FTS] (fts_rft): Remove now-unused member.
464         [struct FTS] (fts_cycle.state): Improve comment.
465
466         * openat.c (openat_needs_fchdir): New function.
467         * openat.h (openat_needs_fchdir): Declare it.
468
469 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
470
471         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
472         Problem and fix reported by Pádraig Brady in
473         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
474
475 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
476
477         * memcoll.c (memcoll): Optimize for the common case where the
478         arguments are bytewise equal.
479
480 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
481
482         Change copyright notice from LGPL 2 to GPL 2, since that's the
483         standard form used in the gnulib repository.
484         * lock.c: LGPL -> GPL.
485         * lock.h: Likewise.
486         * strnlen1.c: Likewise.
487         * strnlen1.h: Likewise.
488         * tls.c: Likewise.
489         * tls.h: Likewise.
490         * tmpdir.c: Likewise.
491
492         * TODO: Remove; this belongs only in coreutils.
493
494 2006-08-14  Eric Blake  <ebb9@byu.net>
495
496         Import the following change from libc:
497
498         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
499
500         Upstream bug 2997.
501         * misc/error.c: Add space between program name and message if file
502         name is missing.
503
504 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
505
506         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
507         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
508
509         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
510         in wchar_t.  Problem reported by Eric Blake.
511
512         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
513         LEN is smaller than SIZE.  Suggested by Bruno Haible.
514         Also, help the compiler to keep LEN in a register.
515
516 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
517
518         * .cppi-disable: Add snprintf.h, socket_.h.
519         * snprintf.c: Include <errno.h> and <limits.h>.
520         (EOVERFLOW): Define if the system does not.
521         Do not include "minmax.h"; it wasn't used.
522         (snprintf): Don't assume size_t promotes to an unsigned type.
523         Fix bug when generated string was too long for the buffer: the
524         buffer's contents are supposed to be the initial prefix of the
525         output.  Don't assume vasnprintf returns EOVERFLOW if the size
526         exceeds INT_MAX; do the check ourselves.
527
528         Import the following changes from libc:
529
530         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
531
532         * posix/regex_internal.c (re_string_skip_chars): If no character has
533         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
534         to the byte which couldn't be converted.
535         (re_string_reconstruct): Don't clear valid_raw_len before calling
536         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
537         tip_context using re_string_context_at.
538
539         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
540
541         * posix/regex.h: g++ still cannot handled [restrict].
542
543         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
544
545         * posix/regex.h: Remove special handling for VMS.
546
547 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
548
549         Sync from coreutils.
550
551         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
552
553         * mountlist.c [ME_REMOTE]: Filter out cifs.
554         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
555
556 2006-08-08  Eric Blake  <ebb9@byu.net>
557
558         * verror.c (verror_at_line): Work around glibc bug 2997, so that
559         verror_at_line output complies with GNU Coding Standards even when
560         file is NULL.
561
562 2006-08-08  Eric Blake  <ebb9@byu.net>
563
564         * verror.h, verror.c: New files.
565
566 2006-08-07  Bruno Haible  <bruno@clisp.org>
567
568         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
569         versions of AIX.
570         Reported by Ralf Wildenhues.
571
572 2006-08-06  Eric Blake  <ebb9@byu.net>
573
574         * error.h: Fold in some upstream changes from glibc.
575         * error.c: Likewise.
576
577 2006-07-29  Bruno Haible  <bruno@clisp.org>
578
579         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
580
581 2006-07-29  Bruno Haible  <bruno@clisp.org>
582
583         * setenv.c: Undo unintended modification done on 2006-02-27.
584
585 2006-07-28  Eric Blake  <ebb9@byu.net>
586
587         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
588         macro expansion.
589
590 2006-07-28  Simon Josefsson  <jas@extundo.com>
591
592         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
593         #include's.
594
595 2006-07-28  Simon Josefsson  <jas@extundo.com>
596
597         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
598         #include's.
599
600 2006-07-28  Bruno Haible <bruno@clisp.org>
601
602         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
603
604 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
605
606         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
607         arpa/inet.h.
608
609 2006-07-28  Bruno Haible  <bruno@clisp.org>
610
611         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
612         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
613         fallbacks.
614         Avoids link error on FreeBSD 4.x.
615         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
616
617         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
618         encoding.
619         * mbswidth.c (iswcntrl): Likewise.
620
621 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
622
623         * modechange.c (mode_compile): Numeric modes now affect setuid and
624         setgid on directories only if they set these bits.
625         * modechange.h: Remove obsolete comment about masks.
626
627 2006-07-27  Bruno Haible  <bruno@clisp.org>
628
629         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
630         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
631         defined.
632
633 2006-07-26  Eric Blake  <ebb9@byu.net>
634
635         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
636         like mingw that lack mkstemp.
637         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
638         avoid compilation warning on mingw.
639
640 2006-07-25  Bruno Haible  <bruno@clisp.org>
641
642         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
643         <stdarg.h> or config.h.
644
645 2006-07-24  Bruno Haible  <bruno@clisp.org>
646
647         * clean-temp.h: New file, from GNU gettext.
648         * clean-temp.c: New file, from GNU gettext.
649
650 2006-07-24  Bruno Haible  <bruno@clisp.org>
651
652         * tmpdir.h: New file, from GNU gettext.
653         * tmpdir.c: New file, from GNU gettext.
654
655 2006-07-23  Bruno Haible  <bruno@clisp.org>
656
657         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
658         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
659         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
660         gl_linked_remove_at): Use it.
661
662 2006-07-23  Eric Blake  <ebb9@byu.net>
663
664         * tmpfile-safer.c: New file.
665         * stdio-safer.h (fopen_safer): Add prototype.
666         * stdio--.h (tmpfile): Make safer.
667
668 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
669
670         * close-stream.c, close-stream.h: New files.
671
672 2006-07-22  Bruno Haible  <bruno@clisp.org>
673
674         Merge from GNU gettext 0.15.
675
676         2005-07-05  Bruno Haible  <bruno@clisp.org>
677
678                 * printf-args.c (printf_fetchargs): Work around broken
679                 definition of wint_t on mingw.
680
681         2005-02-12  Bruno Haible  <bruno@clisp.org>
682
683                 * xallocsa.h: Add extern "C" for C++.
684
685         2006-05-17  Bruno Haible  <bruno@clisp.org>
686
687                 Cygwin portability.
688                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
689
690         2006-04-30  Bruno Haible  <bruno@clisp.org>
691
692                 * progreloc.c: Include <mach-o/dyld.h> if available.
693                 (find_executable): Use _NSGetExecutablePath when possible.
694
695         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
696
697                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
698                 function.
699
700         2005-12-29  Bruno Haible  <bruno@clisp.org>
701
702                 * progreloc.c (set_program_name_and_installdir): Fix
703                 compilation error.
704
705         2005-12-04  Bruno Haible  <bruno@clisp.org>
706
707                 Cygwin portability.
708                 * progreloc.c: Include <windows.h> also on Cygwin.
709                 (find_executable): Add support for Cygwin.
710                 (set_program_name_and_installdir): Handle also platforms with
711                 nonempty EXEEXT.
712
713         2006-07-11  Bruno Haible  <bruno@clisp.org>
714
715                 * javacomp.c: Fix a comment.
716                 Reported by Jim Meyering.
717
718         2006-04-30  Bruno Haible  <bruno@clisp.org>
719
720                 * javacomp.h (compile_java_class): Add source_version,
721                 target_version arguments.
722                 * javacomp.c: Rewritten to choose only a compiler that
723                 respects the specified source_version and target_version.
724
725         2006-06-27  Bruno Haible  <bruno@clisp.org>
726
727                 Assume correct S_ISDIR macro.
728                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
729
730         2006-07-22  Bruno Haible  <bruno@clisp.org>
731
732                 * javaversion.h: New file, from GNU gettext.
733                 * javaversion.c: New file, from GNU gettext.
734                 * javaversion.java: New file, from GNU gettext.
735                 * javaversion.class: New file, from GNU gettext.
736
737         2006-05-17  Bruno Haible  <bruno@clisp.org>
738
739                 Cygwin portability.
740                 * javaexec.c (execute_java_class): Test for jview program
741                 also on Cygwin.
742
743         2006-04-09  Bruno Haible  <bruno@clisp.org>
744
745                 * fatal-signal.c: Don't include string.h.
746                 (at_fatal_signal): Use a copying loop instead of memcpy.
747
748         2005-12-04  Bruno Haible  <bruno@clisp.org>
749
750                 * csharpexec.c: Add support for 'clix' launcher (untested).
751                 (execute_csharp_using_sscli): New function.
752                 (execute_csharp_program): Call it.
753
754         2006-06-21  Bruno Haible  <bruno@clisp.org>
755
756                 Avoid warnings from recent versions of mcs.
757                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
758                 -o, -L, -r any more. Use options documented since mcs-1.0
759                 instead. Similarly for -g.
760
761         2005-07-09  Bruno Haible  <bruno@clisp.org>
762
763                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
764                 add a .dll suffix.
765                 Reported by Mark Junker <mjscod@gmx.de>.
766
767         2006-06-17  Bruno Haible  <bruno@clisp.org>
768
769                 * config.charset: Update for NetBSD 3.0.
770
771         2006-05-17  Bruno Haible  <bruno@clisp.org>
772
773                 Cygwin portability.
774                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
775
776         2006-05-16  Bruno Haible  <bruno@clisp.org>
777
778                 * localcharset.c [CYGWIN]: Include <windows.h>.
779                 (get_charset_aliases): For Cygwin, return the same CPxxx
780                 aliases list as under WIN32.
781                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
782                 the environment variables. Fall back to GetACP().
783
784         2006-04-05  Bruno Haible  <bruno@clisp.org>
785
786                 * config.charset: Update Juan Manuel Guerrero's address.
787
788         2005-02-12  Bruno Haible  <bruno@clisp.org>
789
790                 * allocsa.h: Add extern "C" for C++.
791
792         2005-02-10  Bruno Haible  <bruno@clisp.org>
793
794                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
795                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
796
797         2006-07-22  Bruno Haible  <bruno@clisp.org>
798
799                 * gettext.h: Update to GNU gettext-0.15.
800
801 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
802         and Simon Josefsson <jas@extundo.com>
803
804         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
805
806         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
807
808 2006-07-21  Eric Blake  <ebb9@byu.net>
809
810         * stdlib-safer.h: New file from coreutils, required by
811         stdlib--.h.
812
813 2006-07-19  Derek R. Price  <derek@ximbiot.com>
814
815         * getaddrinfo.h: Don't define unimplemented AI_* flags.
816         Reindent and repaginate.
817
818 2006-07-17  Bruno Haible  <bruno@clisp.org>
819
820         * gl_list.h: New file.
821         * gl_list.c: New file.
822         * gl_array_list.h: New file.
823         * gl_array_list.c: New file.
824         * gl_carray_list.h: New file.
825         * gl_carray_list.c: New file.
826         * gl_linked_list.h: New file.
827         * gl_linked_list.c: New file.
828         * gl_anylinked_list1.h: New file.
829         * gl_anylinked_list2.h: New file.
830         * gl_avltree_list.h: New file.
831         * gl_avltree_list.c: New file.
832         * gl_anyavltree_list1.h: New file.
833         * gl_anyavltree_list2.h: New file.
834         * gl_rbtree_list.h: New file.
835         * gl_rbtree_list.c: New file.
836         * gl_anyrbtree_list1.h: New file.
837         * gl_anyrbtree_list2.h: New file.
838         * gl_anytree_list1.h: New file.
839         * gl_anytree_list2.h: New file.
840         * gl_linkedhash_list.h: New file.
841         * gl_linkedhash_list.c: New file.
842         * gl_anyhash_list1.h: New file.
843         * gl_anyhash_list2.h: New file.
844         * gl_avltreehash_list.h: New file.
845         * gl_avltreehash_list.c: New file.
846         * gl_rbtreehash_list.h: New file.
847         * gl_rbtreehash_list.c: New file.
848         * gl_anytreehash_list1.h: New file.
849         * gl_anytreehash_list2.h: New file.
850
851         * gl_oset.h: New file.
852         * gl_oset.c: New file.
853         * gl_array_oset.h: New file.
854         * gl_array_oset.c: New file.
855         * gl_avltree_oset.h: New file.
856         * gl_avltree_oset.c: New file.
857         * gl_rbtree_oset.h: New file.
858         * gl_rbtree_oset.c: New file.
859         * gl_anytree_oset.h: New file.
860
861 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
862
863         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
864         New files.
865         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
866         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
867         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
868         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
869         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
870         callers changed.  Revamp internals significantly, by not
871         attempting to create directories that are temporarily more
872         permissive than the final results.  Do not attempt to use
873         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
874         This removes some race conditions, fixes some bugs, and simplifies
875         things.  Use new dirchownmod function to do owner and mode changes.
876         * mkdir-p.h: Likewise.
877         * modechange.c (octal_to_mode): New function.
878         (struct mode_change): New member mentioned.
879         (make_node_op_equals): New arg mentioned.  All callers changed.
880         (mode_compile): Keep track of which mode bits the user has explicitly
881         mentioned.
882         (mode_adjust): New arg DIR, so that we implement the X op correctly.
883         New arg PMODE_BITS, to keep track of which mode bits the user
884         mentioned; it treats S_ISUID and S_ISGID speciall.
885         All callers changed.
886         * modechange.h: Likewise.
887
888 2006-07-11  Derek R. Price  <derek@ximbiot.com>
889
890         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
891
892 2006-07-10  Derek R. Price  <derek@ximbiot.com>
893
894         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
895         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
896         macros into the GNU _D_EXACT_NAMLEN.
897         * savedir.c:  Likewise.
898         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
899
900 2006-07-09  Jim Meyering  <jim@meyering.net>
901
902         * argp-pv.c: Remove a doubled word in a comment.
903         * check-version.c (check_version): Likewise.
904         * javacomp.c (compile_java_class): Likewise.
905
906 2006-07-08  Jim Meyering  <jim@meyering.net>
907
908         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
909
910 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
911
912         * getaddrinfo.c: Changes to compile under MSVC6: changed
913         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
914         brackets.  Other minor changes to suppress some compiler
915         warnings.
916
917 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
918
919         * getloadavg.c: Use __VMS, not VMS.
920         * getopt.c: Likewise.
921         * getpagesize.h: Likewise.
922         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
923         probably does not work.
924
925 2006-07-06  Derek R. Price  <derek@ximbiot.com>
926         and Paul Eggert  <eggert@cs.ucla.edu>
927
928         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
929         Don't worry about this obsolete case any more.
930         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
931         directories.
932         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
933         worry about this obsolete case any more.
934         * fts.c: Likewise.
935         * getcwd.c: Likewise.
936         * glob.h: Likewise.
937         * savedir.c: Likewise.
938
939 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
940
941         * .cppi-disable: Add wcwidth.
942         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
943         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
944         (ISGRAPH): Remove.  All uses changed to isgraph.
945         (FOLD) [!defined _LIBC]: Remove special case.
946         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
947         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
948         HAVE_ISBLANK.
949         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
950
951 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
952
953         * strtod.c (strtod): cast the argument of tolower to unsigned char.
954
955 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
956
957         * memcasecmp.c: Include <limits.h>.
958         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
959         * strtod.c (strtod): Don't assume isspace works on negative chars.
960         Don't assume isdigit succeeds only on '0' through '9'.
961
962 2006-07-05  Derek R. Price  <derek@ximbiot.com>
963
964         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
965         All uses of is_space replaced by isspace.
966         * exit.h: Don't talk about STDC_HEADERS.
967         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
968         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
969         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
970         replaced by isprint etc.
971         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
972         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
973         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
974         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
975         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
976         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
977
978 2006-07-05  Eric Blake  <ebb9@byu.net>
979
980         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
981         missing from netdb.h.
982         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
983
984 2006-06-27  Bruno Haible  <bruno@clisp.org>
985
986         Assume ANSI C header files and <ctype.h> functions.
987         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
988         (mbsnwidth): Use isprint, iscntrl instead.
989
990 2006-07-03  Jim Meyering  <jim@meyering.net>
991
992         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
993         macro is used before the first cycle_check call.
994
995 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
996
997         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
998         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
999         reported by Mark D. Baushke, one in
1000         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1001
1002         Merge from coreutils.
1003
1004         * .cppi-disable: Add stdint_.h.
1005         * .cvsignore: Add stdint.h.
1006
1007         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1008
1009         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1010         both double and long double versions.
1011         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1012         * xstrtold.c: New file.
1013         * xstrtod.h (xstrtold): New decl.
1014
1015         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1016
1017         * filemode.c (setst): Remove.
1018         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1019         (arguably) clearer, and the generated code is a bit smaller on my
1020         Debian GNU/Linux stable x86 host.
1021
1022         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1023
1024         * filemode.c: Include "filemode.h" first, to test the interface.
1025         Assume that filemode.h includes sys/types.h and sys/stat.h.
1026         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1027         (ftypelet): Reorder to put common cases first, for efficiency.
1028         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1029         to do 'M'.
1030         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1031         of 10, for compatibility with FreeBSD.  All callers changed.
1032         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1033         that can't be deduced solely from st_mode.  First arg is now a const
1034         pointer.
1035         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1036         (strmode): Renamed from mode_string.
1037         (filemodestring): New decl.
1038         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1039         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1040         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1041
1042         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1043
1044         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1045         fsusage.h now does that.  Include fsusage.h first, to test interface.
1046         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1047         at most one method (the old code could have generated decls that
1048         didn't conform to C89, not that this was ever exercised).
1049         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1050
1051         2006-03-19  Jim Meyering  <jim@meyering.net>
1052
1053         Work even in a chroot where d_ino values for entries in "/"
1054         don't match the stat.st_ino values for the same names.
1055         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1056         number, iterate through all entries again, using lstat instead.
1057         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1058         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1059
1060         * getcwd.c (__getcwd): Clarify a comment.
1061         Use memcpy in place of a call to strcpy.
1062
1063         2006-03-12  Jim Meyering  <jim@meyering.net>
1064
1065         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1066         that of the current directory (which we're about to chdir ".." out of),
1067         then save the dev-ino of the parent, instead.
1068
1069         * same-inode.h (SAME_INODE): New file/macro.
1070         * chdir-safer.c (SAME_INODE): Remove definition.
1071         Include "same-inode.h", instead.
1072         * same.c: Likewise.
1073         * cycle-check.h: Include "same-inode.h".
1074         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1075         * cycle-check.c (SAME_INODE): Remove definition.
1076         * root-dev-ino.h: Include "same-inode.h".
1077
1078         2006-03-11  Eric Blake  <ebb9@byu.net>
1079
1080         * same.c (same_name): s/base_name/last_component/
1081         * backupfile.c (check_extension, numbered_backup): Likewise.
1082         * filenamecat.c (file_name_concat): Likewise.
1083
1084         2006-03-11  Eric Blake  <ebb9@byu.net>,
1085                     Paul Eggert  <eggert@cs.ucla.edu>
1086
1087         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1088         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1089         drive prefix.
1090         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1091         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1092         (last_component): New method.
1093         * dirname.c (dir_len): Determine when drive letters need a
1094         subsequent slash.  Preserve // when it is special.
1095         (dir_name): Don't append dot when drive letter is absolute.
1096         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1097         * basename.c (base_name): New semantics - malloc the result.
1098         Preserve // when it is special.  Preserve relative files that look
1099         like drive letters.
1100         (base_len): Preserve // when it is special.
1101         (last_component): New method, similar to old base_name semantics.
1102         * stripslash.c (strip_trailing_slashes): Use last_component, not
1103         base_name.  Strip redundant slashes from ///.
1104
1105 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1106
1107         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1108         both are 64 bits, since this seems to be the tradition, and this
1109         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1110         we ever run into a host that prefers long long to long in this
1111         case, we'll need another configure-time test.  Problem reported by
1112         Jim Meyering.
1113
1114 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1115
1116         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1117         possible collision with system files.
1118         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1119         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1120         WCHAR_MIN and WCHAR_MAX in this case.
1121         (<stddef.h>): Do not include; no longer needed.
1122         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1123         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1124         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1125         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1126         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1127         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1128         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1129         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1130         !defined(__c99))]: Include in this case too, since it's harmless
1131         now.
1132         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1133         dangerous to do so.
1134         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1135         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1136         (_STDINT_MIN, _STDINT_MAX): New macros.
1137         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1138         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1139         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1140         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1141         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1142         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1143         macros, not typedefs; this simplifies things quite a bit.
1144         Use long int for all types narrower than int64_t.
1145         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1146         Define in terms of long long int or int64_t or long int,
1147         not int64_t or int32_t.  This saves some compile-time testing.
1148         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1149         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1150         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1151         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1152         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1153         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1154         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1155         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1156         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1157         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1158         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1159         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1160         undef any previous version and define our own version, for
1161         simplicity and consistency with the new macros for types.
1162         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1163         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1164         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1165         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1166         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1167         @WINT_T_SUFFIX@ to keep things simple here.
1168         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1169         Simplify by assuming typical 8/16/32/64 host, since we're
1170         already doing that elsewhere anyway.
1171         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1172         and assume long long int is 64 bits if available.  This
1173         speeds up 'configure'.
1174
1175 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1176
1177         * getaddrinfo.c: fixed typo
1178
1179 2006-06-29  Eric Blake  <ebb9@byu.net>
1180
1181         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1182         unused static function.
1183
1184 2006-06-29  Eric Blake  <ebb9@byu.net>
1185
1186         * stat_.h: New file.
1187
1188 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1189
1190         * strftime.c: Assume strftime() exists.
1191
1192 2006-06-28  Bruno Haible  <bruno@clisp.org>
1193
1194         * getaddrinfo.h: Fix POSIX URL.
1195         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1196         (use_win32_p): Make static.
1197         (getaddrinfo): Reject service name if it is empty or does not consist
1198         solely of decimal digits, or if its value is > 65535.
1199         (getnameinfo): Remove useless casts.
1200
1201 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1202
1203         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1204         Autoconf 2.60 says this stuff was obsolete.
1205
1206 2006-05-12  Bruno Haible  <bruno@clisp.org>
1207
1208         * mkdtemp.c [MINGW]: Include <io.h>.
1209         (mkdir): Define using _mkdir.
1210
1211 2006-06-28  Bruno Haible  <bruno@clisp.org>
1212
1213         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1214         declaration for wcwidth.
1215         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1216
1217 2006-06-28  Eric Blake  <ebb9@byu.net>
1218
1219         * xvasprintf.h: Fix comments.
1220
1221 2006-06-28  Eric Blake  <ebb9@byu.net>
1222
1223         * mbchar.h (wcwidth): Include wcwidth.h.
1224         * mbswidth.c (wcwidth): Move from here...
1225         * wcwidth.h: ...to this new file.
1226
1227 2006-06-28  Simon Josefsson  <jas@extundo.com>
1228
1229         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1230         functions there.  It will succeed on Windows XP, but on Windows
1231         2000 and (presumably) earlier, it will fail, and use the internal
1232         re-implementation.
1233         (use_win32_p): New function.
1234         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1235         Support AI_NUMERICSERV to disable getservbyname.
1236         (getnameinfo): New function, only supports
1237         NI_NUMERICHOST|NI_NUMERICSERV for now.
1238
1239         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1240         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1241         getnameinfo.
1242
1243 2006-06-27  Bruno Haible  <bruno@clisp.org>
1244
1245         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1246
1247 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1248
1249         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1250         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1251         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1252
1253 2006-06-26  Bruno Haible  <bruno@clisp.org>
1254
1255         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1256         WCHAR_MAX.
1257         Reported by Mark D. Baushke and Larry Jones.
1258
1259 2006-06-26  Bruno Haible  <bruno@clisp.org>
1260
1261         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1262         in pre-C99 mode.
1263         Suggested by Mark D. Baushke and Larry Jones.
1264
1265 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1266
1267         * stdint_.h: Treat BSD/OS like OpenBSD.
1268
1269 2006-06-23  Bruno Haible  <bruno@clisp.org>
1270
1271         * stdint_.h: Treat IRIX like OpenBSD.
1272
1273 2006-06-23  Bruno Haible  <bruno@clisp.org>
1274
1275         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1276         ISO C 99 Technical Corrigendum 1.
1277
1278 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1279
1280         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1281         Some compiler complained about some of them.  Problem reported by
1282         Larry Jones in
1283         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1284
1285 2006-06-21  Simon Josefsson  <jas@extundo.com>
1286
1287         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1288         variable.
1289
1290         * socket_.h: Don't define WINVER.
1291
1292         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1293         slightly modified to work in gnulib.
1294
1295 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1296
1297         * read-file.c (fread_file): Start with buffer allocation of
1298         0 bytes rather than 1 byte; this simplifies the code.
1299         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1300         code to free buffer and save/restore errno.
1301         (internal_read_file): Remove unused local.
1302
1303 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1304
1305         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1306         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1307         Problem reported by Denis Excoffier in
1308         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1309
1310 2006-06-19  Simon Josefsson  <jas@extundo.com>
1311
1312         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1313
1314 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1315
1316         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1317
1318 2006-06-17  Bruno Haible  <bruno@clisp.org>
1319
1320         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1321
1322 2006-06-17  Bruno Haible  <bruno@clisp.org>
1323
1324         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1325         problem on Solaris 2.5.1.
1326
1327 2006-06-16  Eric Blake  <ebb9@byu.net>
1328
1329         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1330         * unicodeio.c [!defined errno]: Likewise.
1331         * strtol.c [!defined errno]: Likewise.
1332         * strtod.c [!defined errno]: Likewise.
1333
1334 2006-06-15  Bruno Haible  <bruno@clisp.org>
1335
1336         * stdint_.h: Rewritten to be fully auto-configured.
1337         Fixes bug on HP-UX/IA64.
1338
1339 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1340
1341         * getdate.y (__attribute__): Don't define if already defined.
1342         Problem reported by Larry Jones.
1343         * utimens.c (__attribute__): Likewise.
1344
1345 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1346
1347         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1348         reported by Andreas Schwab.
1349
1350 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1351             Bruno Haible  <bruno@clisp.org>
1352
1353         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1354
1355 2006-05-26  Martin Lambers  <marlam@marlam.de>
1356
1357         * getpass.c: Updates the test for the native W32 API, and adds
1358         missing includes, thus fixing compilation warnings.
1359
1360 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1361
1362         * tempname.c (small_open, large_open): New macros.
1363         (__open, __open64) [!_LIBC]: Remove.
1364         (__gen_tempname): Use small_open and large_open instead of __open
1365         and __open64.  This fixes a portability bug on HP-UX 11.11i
1366         reported by Simon Wing-Tang in
1367         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1368
1369 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1370
1371         * exclude.c (exclude_fnmatch): New function.
1372         (excluded_file_name): Call exclude_fnmatch.
1373         * exclude.h (excluded_file_name): New prototype
1374
1375 2006-05-24  Bruno Haible  <bruno@clisp.org>
1376
1377         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1378         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1379         Reported by Thorsten Maerz <torte@netztorte.de> via
1380         Aaron Stone <aaron@serendipity.cx>.
1381
1382 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1383
1384         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1385         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1386         (my_usleep): Don't mishandle maximum value.
1387
1388 2006-05-19  Jim Meyering  <jim@meyering.net>
1389
1390         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1391
1392 2006-05-17  Bruno Haible  <bruno@clisp.org>
1393
1394         Cygwin portability.
1395         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1396
1397 2006-05-17  Bruno Haible  <bruno@clisp.org>
1398
1399         * stdint_.h: Fix recognition of Cygwin.
1400
1401 2006-05-11  Jim Meyering  <jim@meyering.net>
1402
1403         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1404
1405 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1406
1407         * crc.c (crc32_update): Remove unnecessary L suffix.
1408         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1409         unwanted sign propagation, e.g., on hosts with 64-bit int.
1410         There still are some problems with reeelly weird theoretical hosts
1411         (e.g., 33-bit int) but it's not worth worrying about now.
1412         * sha1.c (rol): Likewise.
1413         (K1, K2, K3, K4): Remove unnecessary L suffix.
1414
1415 2006-05-10  Bruno Haible  <bruno@clisp.org>
1416
1417         * des.c: Cast to avoid warnings.
1418
1419 2006-05-10  Simon Josefsson  <jas@extundo.com>
1420
1421         * md4.c: Typo fix, update copyright years.
1422         (K1, K2): Don't use L because it turn computations into 64-bit on
1423         64-bit platforms.
1424
1425 2006-05-09  Bruno Haible  <bruno@clisp.org>
1426
1427         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1428         (EOVERFLOW): Define fallback value.
1429         (xstrcat): New function.
1430         (xvasprintf): Recognize the special case of a string concatenation.
1431
1432 2006-05-01  Bruno Haible  <bruno@clisp.org>
1433
1434         * stdint_.h: Shorter URL.
1435         * inttypes.h: Likewise.
1436
1437 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1438
1439         * verify.h: Document the internals better.  Most of this change
1440         was written by Bruno Haible.
1441
1442 2006-04-29  Bruno Haible  <bruno@clisp.org>
1443
1444         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1445         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1446
1447 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1448
1449         * getdate.y (get_date): When adding relative date, start with the
1450         initial time, not with the result of the first mktime call.
1451
1452 2006-04-23  Bruno Haible  <bruno@clisp.org>
1453
1454         * copy-file.c: Include <unistd.h> unconditionally.
1455         * execute.c: Likewise.
1456         * fatal-signal.c: Likewise.
1457         * findprog.c: Likewise.
1458         * mkdtemp.c: Likewise.
1459         * pipe.h: Likewise.
1460         * pipe.c: Likewise.
1461         * wait-process.h: Likewise.
1462
1463 2006-04-23  Bruno Haible  <bruno@clisp.org>
1464
1465         * fwriteerror.c (fwriteerror): Call fclose also when an error
1466         condition was already detected.
1467         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1468
1469 2006-04-19  Derek Price  <derek@ximbiot.com>
1470             Eric Blake  <ebb9@byu.net>
1471
1472         * inttypes.h: Correct grammar in comment.
1473
1474 2006-04-18  Derek Price  <derek@ximbiot.com>
1475             Paul Eggert  <eggert@cs.ucla.edu>
1476
1477         * inttypes.h: New file.
1478         * strtoimax.c: Assume <inttypes.h>.
1479
1480 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1481
1482         * utimens.c (futimens): glibc futimesat messes up if /proc
1483         isn't mounted.  Problem reported by Kir Kolyshkin.
1484
1485 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1486
1487         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1488         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1489         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1490
1491 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1492
1493         Merge regex changes from libc, removing some of our
1494         POSIX-conformance changes that were rejected and redoing them in a
1495         less-intrusive way.
1496
1497         * regcomp.c (re_compile_internal, init_dfa):
1498         Length arg is now size_t, not Idx.  All uses changed.
1499         (peek_token): Forward decl now says internal_function.
1500         (__re_error_msgid, __re_error_msgid_idx):
1501         Now static rather than extern with attribute_hidden.
1502         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1503         For some reason libc prefers K&R style defns for external functions.
1504         (regerror) [!defined _LIBC]: Likewise.
1505         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1506         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1507         (build_range_exp, build_collating_symbol):
1508         Use K&R-style defn.
1509         (re_compile_fastmap): Use '\0' to memset, not 0.
1510         (utf8_sb_map): Make the calculations more obvious.
1511         (init_dfa, parse_bracket_exp, build_charclass_op):
1512         Call calloc and cast result, as glibc does.
1513         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1514         (build_range_exp, build_collating_symbol):
1515         Now internal functions.
1516
1517         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1518
1519         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1520         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1521         Don't depend on VMS; depend on __VMS instead, for POSIX
1522         namespace cleanness.
1523         (regoff_t): Define to ssize_t, not long int.
1524
1525         Remove the REG_ macros named below.  Instead, make the old names
1526         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1527         __USE_GNU_REGEX.
1528         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1529         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1530         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1531         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1532         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1533         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1534         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1535         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1536         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1537         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1538         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1539         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1540         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1541         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1542         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1543         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1544         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1545         (REG_NREGS):
1546         Remove.  All uses replaced by the old RE_* names.
1547         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1548         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1549         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1550         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1551         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1552         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1553         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1554         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1555         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1556         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1557         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1558         Don't bother having these macros be independent of each others'
1559         values, since they no longer exist in the POSIX name space.
1560
1561         Rename the following member names back to their old names,
1562         unless !__USE_GNU_REGEX.  All uses changed back.
1563         (buffer): Renamed from re_buffer.
1564         (allocated): Renamed from re_allocated.
1565         (used): Renamed from re_used.
1566         (syntax): Renamed from re_syntax.
1567         (fastmap): Renamed from re_fastmap.
1568         (translate): Renamed from re_translate.
1569         (can_be_null): Renamed from re_can_be_null.
1570         (regs_allocated): Renamed from re_regs_allocated.
1571         (fastmap_accurate): Renamed from re_fastmap_accurate.
1572         (no_sub): Renamed from re_no_sub.
1573         (not_bol): Renamed from re_not_bol.
1574         (not_eol): Renamed from re_not_eol.
1575         (newline_anchor): Renamed from re_newline_anchor.
1576         (num_regs): Renamed from rm_num_regs.
1577         (start): Renamed from rm_start.
1578         (end): Renamed from rm_end.
1579
1580         (free_state): Move up a bit.
1581
1582         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1583         #define to be empty.
1584         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1585         when that is what is intended.
1586         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1587         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1588         (MAX): New macro.
1589         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1590         All uses changed back to re_malloc, etc.  It's now the caller's
1591         responsibility to check for overflow; all callers changed.
1592         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1593         (re_x2nrealloc): Remove.
1594         (free_state): Remove decl.
1595
1596         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1597         (re_set_registers, re_exec):
1598         Use K&R-style defn.
1599
1600         2006-01-31  Roland McGrath  <roland@redhat.com>
1601
1602         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1603         Reported by Mike Frysinger <vapier@gentoo.org>.
1604
1605         2006-01-15  Andreas Jaeger  <aj@suse.de>
1606
1607         [BZ #1950]
1608         * regex_internal.c (re_string_reconstruct): Adjust for
1609         build_wcs_upper_buffer change.
1610         (build_wcs_upper_buffer): Change return type.
1611
1612         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1613
1614         * regex_internal.h: Include <stdint.h> if available.
1615
1616         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1617
1618         * regex_internal.h (SIZE_MAX): Provide a default definition.
1619
1620         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1621
1622         * regcomp.c: Adjust for changed secondary hash function.
1623
1624         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1625
1626         * regex.h: Pretty printing.
1627         Clean up namespace a bit.
1628
1629         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1630
1631         * regexec.c (update_cur_sifted_state, check_arrival,
1632         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1633
1634         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1635                     Ulrich Drepper  <drepper@redhat.com>
1636
1637         [BZ #1302]
1638         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1639         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1640
1641         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1642
1643         [BZ #281]
1644         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1645         * regcomp.c: Remove unnecessary uses of
1646         unsigned RE_TRANSLATE_TYPE.
1647         * regex_internal.h: Likewise.
1648         * regex_internal.c: Likewise.
1649         * regexec.c: Likewise.
1650         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1651
1652         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1653
1654         * regexec.c (find_recover_state): Remove unnecessary
1655         initialization.
1656         (transit_state_bkref): Make DFA a const pointer.
1657         (get_subexp): Likewise.
1658         (check_arrival): Likewise.
1659         (update_cur_sifted_state): Likewise.
1660         (re_search_internal): Likewise.
1661         (prune_impossible_nodes): Likewise.
1662         (acquire_init_state_context): Likewise.
1663         (proceed_next_node): Likewise.
1664         (set_regs): Likewise.
1665         (free_fail_stack_return): Likewise.
1666         (check_arrival_expand_ecl): Mark DFA parameter as const.
1667         (check_arrival_expand_ecl_sub): Likewise.
1668         (check_subexp_limits): Likewise.
1669         (sub_epsilon_src_nodes):  Likewise.
1670         (add_epsilon_src_nodes):  Likewise.
1671         (merge_state_array): Likewise.
1672         (update_regs): Likewise.
1673         (build_trtable): Likewise.
1674         (sift_states_backward): Mark MCTX parameter as const.
1675         (build_sifted_states): Likewise.
1676         (update_cur_sifted_state): Likewise.
1677         (sift_states_mkref): Likewise.
1678         (check_arrival_expand_ecl): Mark eclosure as const.
1679         (check_dst_limits_calc_pos_1): Likewise.
1680         * regex_internal.h (re_match_context_t): Make dfa a const
1681         pointer.
1682
1683         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1684
1685         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1686         (transit_state_sb): Likewise.
1687         (transit_state_mb): Likewise.
1688         (sift_states_iter_mb): Likewise.
1689         (check_arrival_add_next_nodes): Likewise.
1690         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1691         [_LIBC] (re_search_2_stub): Use mempcpy.
1692
1693         * regex_internal.c (re_string_reconstruct): Avoid calling
1694         mbrtowc for very simple UTF-8 case.
1695
1696         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1697         a pointer-to-const.
1698         (re_acquire_state_context): Likewise.
1699         * regex_internal.h: Adjust prototypes.
1700
1701         * regex.c: Prevent using C++ compilers.
1702
1703         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1704         (re_acquire_state_context): Likewise.
1705
1706 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1707             Bruno Haible  <bruno@clisp.org>
1708
1709         * stdint_.h: On OpenBSD, don't redefine types already included in
1710         <sys/types.h> and <inttypes.h>.
1711
1712 2006-03-24  Eric Blake  <ebb9@byu.net>
1713
1714         * time_r.c (copy_string_result): Remove, as it is no longer used.
1715
1716 2006-03-24  Simon Josefsson  <jas@extundo.com>
1717
1718         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1719         including some doc fixes.
1720         (base64_encode_alloc): Fix +1 bug on allocation failures.
1721
1722 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1723
1724         * base64.c (base64_encode): Do not read past end of array with
1725         unsanitized input on systems with CHAR_BIT > 8.
1726
1727 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1728
1729         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1730         Typedef to long int, not to off_, as POSIX will likely change
1731         in that direction.
1732
1733 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1734
1735         * argp-help.c (validate_uparams): Fix typo
1736         * argp-parse.c (argp_default_options): Consistently begin help
1737         messages with a lowercase letter.
1738
1739 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1740
1741         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1742         overrun buffers and shouldn't be used (much as gets shouldn't be
1743         used).
1744         * time_r.c (asctime_r, ctime_r): Likewise.
1745
1746 2006-03-08  Simon Josefsson  <jas@extundo.com>
1747
1748         * gc-gnulib.c (randomize): Don't open files called 'no', they
1749         signal that configure disabled the device.
1750
1751 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1752
1753         * c-stack.c: Include unistd.h unconditionally, since we now assume
1754         the unistd module.
1755         * getlogin_r.c: Likewise.
1756         * getlogin_r.h: Likewise.
1757         * glob.c: Likewise.
1758         * pagealign_alloc.c: Likewise.
1759         * unistd_.h: Remove; no longer needed.
1760
1761 2006-03-07  Simon Josefsson  <jas@extundo.com>
1762
1763         * unistd_.h: New file.
1764
1765 2006-03-07  Simon Josefsson  <jas@extundo.com>
1766
1767         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1768
1769 2006-03-01  Simon Josefsson  <jas@extundo.com>
1770
1771         * readline.c: Fix typo, tiny patch from Stepan Kasal
1772         <kasal@ucw.cz>.
1773
1774 2006-02-28  Simon Josefsson  <jas@extundo.com>
1775
1776         * getopt.c: Protect #include of unistd.h, for MSVS.
1777
1778 2006-02-27  Simon Josefsson  <jas@extundo.com>
1779
1780         * base64.h: Indent #define's.  From Jim Meyering
1781         <jim@meyering.net>.
1782
1783 2006-02-27  Jim Meyering  <jim@meyering.net>
1784
1785         Revert the change of 2006-02-24, so these files can continue
1786         to be sync'd from gettext.
1787         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1788         of `config.h'.
1789
1790 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1791
1792         * glob.c: Say "invalid" rather than "illegal" in comments.
1793
1794 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1795
1796         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1797
1798 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1799
1800         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1801         AT_FDCWD exceeds INT_MAX.
1802         * openat.h (AT_FDCWD): Likewise.
1803
1804 2006-02-14  Jim Meyering  <jim@meyering.net>
1805
1806         Sync from coreutils.
1807
1808         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1809         failure on deficient systems, and simplify gnulib lgpl dependencies.
1810         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1811         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1812
1813         * xalloc-die.c: Remove unused definition of N_.
1814
1815 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1816
1817         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1818
1819 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1820
1821         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1822         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1823
1824 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1825
1826         * argp-namefrob.h: Restore changes accidentally lost during the
1827         "autoupdate" on 2005-12-12.
1828
1829 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1830
1831         * fnmatch.c (L_): Renamed from L, to work around a bug in
1832         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1833         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1834         All uses changed.
1835
1836 2006-01-26  Simon Josefsson  <jas@extundo.com>
1837
1838         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1839         prototype is visible on mingw32.
1840
1841         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1842         for mingw32.
1843
1844         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1845         mingw32).
1846
1847 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1848
1849         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1850         attempt to open for write; this always fails, at least on POSIX
1851         hosts.  This reinstates the 2006-01-09 change, which was
1852         inadvertently removed.
1853
1854 2006-01-26  Bruno Haible  <bruno@clisp.org>
1855             Paul Eggert  <eggert@cs.ucla.edu>
1856
1857         * stdbool_.h (_Bool)
1858         [(! (defined __cplusplus || defined __BEOS__)
1859           && !defined __GNUC__
1860           && !(defined __HP_cc || defined __xlc__
1861                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1862                || defined __sgi))]:
1863         #define to signed char in these cases too; this simplifies
1864         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1865         etc., separately) and makes it more conservative.
1866
1867 2006-01-21  Jim Meyering  <jim@meyering.net>
1868
1869         Sync from the stable (b5) branch of coreutils:
1870
1871         * fts.c (fts_children): Don't let close() clobber errno from
1872         failed fchdir().
1873
1874         * fts.c (fts_stat): When following a symlink-to-directory,
1875         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1876         a dangling symlink.  That can also happen at least for ELOOP.
1877         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1878         FYI, this bug predates the inclusion of fts.c in coreutils.
1879
1880         * fts.c (fts_open): Put new maxarglen declaration and uses
1881         in their own block, so pre-c99 compilers don't object.
1882
1883         Avoid the double-free (first in fts_read, second in fts_close) that
1884         would occur when an `active' directory is made inaccessible (e.g.,
1885         via chmod a-x) during a traversal.
1886         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1887         before returning.  Reproduce this failure by
1888         mkdir -p a/b; cd a; chmod a-x . b
1889         Reported by Stavros Passas.
1890
1891 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1892
1893         * argp-namefrob.h: Bugfix. Remove stray #
1894
1895 2006-01-25  Bruno Haible  <bruno@clisp.org>
1896
1897         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1898         warnings.
1899         Reported by Paul Eggert.
1900
1901 2006-01-25  Jim Meyering  <jim@meyering.net>
1902
1903         * fileblocks.c: Remove more useless parentheses.
1904         * readutmp.h: Likewise.
1905
1906 2006-01-24  Bruno Haible  <bruno@clisp.org>
1907
1908         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1909         has it.
1910         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1911         2005-11-26.
1912
1913         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1914         to avoid problems with the built-in _Bool type.
1915         Reported by Paul Eggert on 2005-11-26.
1916
1917 2006-01-24  Jim Meyering  <jim@meyering.net>
1918
1919         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1920
1921 2006-01-24  Simon Josefsson  <jas@extundo.com>
1922
1923         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1924         Bruno.
1925
1926 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1927
1928         Work around porting bugs reported by Dieter in
1929         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1930         * getopt.c (_NOPROTO): Remove; no longer needed.
1931         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1932         Include "getopt.h" first, to check interface.
1933         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1934         !HAVE_DECL_GETENV.
1935         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1936         (__strndup): Revert to K&R-style function dfns, the glibc style.
1937         * strnlen.c: Don't claim it's taken from glibc; it's not.
1938         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1939         Include strnlen.h first, to get prototype properly.
1940         (strnlen): Renamed from __strnlen.
1941         Remove weak alias.
1942
1943 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1944
1945         These changes imported from libc.
1946         * getopt.c: Use __fxprintf instead of inline stream orientation
1947         test and two separate function calls.
1948         * strndup.c (__strndup): Add libc_hidden_def.
1949
1950 2006-01-22  Bruno Haible  <bruno@clisp.org>
1951
1952         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1953         temporary buffer for sprintf, take into account the precision also
1954         for 'd', 'i', 'u', 'o', 'x', 'X'.
1955
1956 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1957
1958         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1959         to pacify gcc -Wswitch-default.
1960
1961 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1962
1963         * argp-help.c (usage_long_opt): Do not print DOC options.
1964         (__argp_base_name): Removed
1965         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1966         typo.
1967         (__argp_base_name): Provide macro definition or extern declaration
1968         depending on the configuration
1969
1970 2006-01-20  Simon Josefsson  <jas@extundo.com>
1971
1972         * inet_ntop.h: Unconditionally include sys/socket.h.
1973
1974 2006-01-19  Simon Josefsson  <jas@extundo.com>
1975
1976         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1977
1978 2006-01-12  Simon Josefsson  <jas@extundo.com>
1979
1980         * base64.c: Fix warning, reported by Bruno Haible
1981         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1982
1983 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1984
1985         Sync from coreutils.
1986         * md5.c: Fix commentary typos.
1987         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1988         * md5.h (__attribute__): Remove; unused.
1989         * sha1.c: Fix commentary to match md5 better.
1990         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1991         so that we don't need to worry about alignment.  All uses changed.
1992         This merges the 2005-10-28 md5 change into sha1.
1993
1994 2006-01-11  Jim Meyering  <jim@meyering.net>
1995
1996         Sync from coreutils.
1997         * md5.c (OP): Fix spacing.
1998
1999 2006-01-11  Simon Josefsson  <jas@extundo.com>
2000
2001         * stdint_.h (SIZE_MAX): Add missing (.
2002
2003 2006-01-10  Bruno Haible  <bruno@clisp.org>
2004
2005         * argp.h (__const): Remove macro. Use const instead.
2006         * argp-fmtstream.h (__const): Likewise.
2007         * glob_.h (__const): Remove macro.
2008         * glob-libc.h: Use const instead of __const.
2009
2010 2006-01-10  Jim Meyering  <jim@meyering.net>
2011
2012         Avoid the double-free (first in fts_read, second in fts_close) that
2013         would occur when an `active' directory is made inaccessible (e.g.,
2014         via chmod a-x) during a traversal.
2015         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2016         before returning.  Reproduce this failure by
2017         mkdir -p a/b; cd a; chmod a-x . b
2018         Reported by Stavros Passas.
2019
2020         Sync from coreutils.
2021         * sha1.c: Tweak grammar in a comment.
2022
2023 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2024
2025         * regex_internal.h (BITSET_WORD_BITS):
2026         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2027         preprocessor mishandles large unsigned values as if they were signed.
2028         Problem reported by Claudio Fontana in
2029         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2030
2031 2006-01-10  Simon Josefsson  <jas@extundo.com>
2032
2033         * socket_.h: New file.
2034
2035 2006-01-10  Bruno Haible  <bruno@clisp.org>
2036
2037         * localcharset.c: Update from GNU gettext.
2038
2039 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2040
2041         Sync from coreutils.
2042         * chdir-long.c (cdb_free): Don't bother trying to open directory
2043         for write access: POSIX says that must fail.
2044         * fts.c (diropen): Likewise.
2045         * save-cwd.c (save_cwd): Likewise.
2046         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2047         well, for minor improvements on hosts that lack O_DIRECTORY.
2048         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2049         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2050         Fall back on chown if open failed with EACCES.
2051
2052         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2053         Report an error at compile-time if only a 1-second nominal clock
2054         resolution is found.
2055
2056         * lchmod.h: New file.
2057         * mkdir-p.c: Include lchmod.h, lchown.h.
2058         (make_dir_parents): Use lchown rather than chown, and
2059         lchmod rather than chmod.
2060
2061         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2062         too.  Problem with "none" reported by Bob Proulx.  Problem with
2063         "proc" reported by n0dalus.
2064
2065         * mountlist.c: Include <limits.h>.
2066         (dev_from_mount_options)
2067         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2068         New function.  It no longer assumes "dev=" has the System V meaning
2069         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2070         (read_file_system_list)
2071         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2072         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2073         dev= in that case.
2074
2075         * posixtm.h (PDS_PRE_2000): New macro.
2076         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2077         All usages changed.  Reject dates outside the range 1969-1999 if
2078         PDS_PRE_2000 is used.
2079
2080 2006-01-09  Jim Meyering  <jim@meyering.net>
2081
2082         Sync from coreutils.
2083
2084         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2085
2086         * chdir-safer.h, chdir-safer.c: New files.
2087
2088         * modechange.c (mode_compile): Reject an invalid mode string
2089         that starts with an octal digit.  From Andreas Gruenbacher.
2090
2091         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2092         and dup to open_safer and dup_safer, respectively.
2093         (openat_permissive): Fix typo in comment.
2094
2095         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2096         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2097         (_): Remove; no longer needed.
2098         (openat): Renamed from rpl_openat; no need for rpl_openat
2099         since openat.h renames openat for us.
2100         Replace most of the body with a call to openat_permissive,
2101         to avoid duplicate code.
2102         Port to (probably hypothetical) environments were mode_t is
2103         wider than int.
2104         (openat_permissive): Require mode arg, so that we can check
2105         types better.  Put it just after flags.  Change cwd failure
2106         indicator from pointer-to-bool to pointer-to-errno-value.
2107         All callers changed.
2108         Invoke openat_save_fail and/or openat_restore_fail if
2109         cwd_errno is null, so that openat can call us.
2110         (openat_permissive, fdopendir, fstatat, unlinkat):
2111         Simplify errno handling to avoid some duplicate code,
2112         as it's OK to set errno on success.
2113         * openat.h: Revamp code so that function macros depend on
2114         __OPENAT_PREFIX only, not also on AT_FDCWD.
2115         (openat_ro): Remove.  Caller changed to use openat_permissive.
2116         (openat_permissive): Now a macro, if not a function.
2117         (openat_restore_fail, openat_save_fail): Now always functions,
2118         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2119
2120         * openat-priv.h: New file, defining macros used by mkdirat.c
2121         and openat.c.
2122         * mkdirat.c: Include openat-priv.h.
2123         Remove definitions of macros defined therein.
2124         * openat.c: Likewise.
2125
2126         * mkdirat.c (mkdirat): New file and function.
2127         * openat.h (mkdirat): Declare.
2128
2129         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2130
2131         * openat.h (openat_permissive): Declare.
2132         (openat_ro): Define.
2133
2134         * openat.c (EXPECTED_ERRNO): New macro.
2135         (openat_permissive): New function -- used in remove.c rewrite.
2136         (all functions): Set errno just before returning, only if there
2137         was an actual failure.
2138         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2139
2140         Emulate openat-family functions using Linux's procfs, if possible.
2141         Idea and some code based on Ulrich Drepper's glibc changes.
2142
2143         * openat.c: (BUILD_PROC_NAME): New macro.
2144         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2145         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2146         before falling back on save_cwd and restore_cwd.
2147         (fdopendir, fstatat, unlinkat): Likewise.
2148
2149         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2150         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2151
2152         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2153         as second argument to va_arg.  Otherwise, some versions of gcc
2154         warn that `if this code is reached, the program will abort'.
2155
2156 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2157
2158         Sync from coreutils.
2159
2160         Add POSIX ACL support
2161         * acl.h (copy_acl, set_acl): Add declarations.
2162         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2163         systems other than Linux.
2164         (chmod_or_fchmod): New function: use fchmod when possible,
2165         and chmod otherwise.
2166         (file_has_acl): Add a POSIX ACL implementation, with a
2167         Linux-specific subcase.
2168         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2169         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2170         acls are unsupported.
2171         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2172         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2173         are unsupported.
2174
2175 2006-01-09  Bruno Haible  <bruno@clisp.org>
2176
2177         * sysexit_.h (EX_OK): New macro.
2178         Suggested by Martin Lambers <marlam@marlam.de>.
2179
2180 2006-01-09  Bruno Haible  <bruno@clisp.org>
2181
2182         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2183         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2184         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2185         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2186
2187 2006-01-09  Bruno Haible  <bruno@clisp.org>
2188
2189         * stdint_.h (SIZE_MAX): Write the value without involving negative
2190         numbers.
2191
2192 2005-10-16  Bruno Haible  <bruno@clisp.org>
2193
2194         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2195         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2196
2197 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2198
2199         * strftime.c (tzname): Don't declare if it is already #defined.
2200         Problem reported for Mingw by Mark Junker.
2201
2202 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2203
2204         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2205         long int, not int, for nanosecond counts, so that people who are
2206         used to POSIX struct timespec won't be surprised.  Reported by Jim
2207         Meyering.
2208
2209 2005-12-16  Jim Meyering  <jim@meyering.net>
2210
2211         * fprintftime.c, fprintftime.h: New files.
2212
2213 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2214
2215         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2216         * argp-help.c (fill_in_uparams): Check if the constructed
2217         struct uparams is valid. Fall back to the default values if it is
2218         not.
2219
2220 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2221
2222         * argp-help.c (__argp_base_name): New function
2223         (__argp_short_program_name): Rewrite using __argp_base_name
2224         * argp-namefrob.h: Define program_invocation_name and
2225         program_invocation_short_name if requested
2226         (__argp_base_name): Add prototype
2227         * argp-parse.c (argp_def): Use gettext wrappers
2228         (argp_default_parser): Use __argp_base_name
2229         * argp-pin.c: New file. Defines program_invocation_name and
2230         program_invocation_short_name on systems that lack them.
2231
2232 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2233
2234         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2235         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2236         porting problem reported by Georg Schwarz in
2237         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2238
2239 2005-07-09  Bruno Haible  <bruno@clisp.org>
2240
2241         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2242         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2243         Reported by Mark Junker <mjscod@gmx.de>.
2244
2245 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2246
2247         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2248         (uintmax_t) [defined uintmax_t]: Do not declare.
2249         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2250         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2251         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2252         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2253         sake of portability to weird hosts that C allows (though we don't
2254         know of any practical examples).
2255
2256         * savedir.h (fdsavedir): New decl.
2257         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2258         contains most of the former guts of savedir.
2259         (savedir): Use savedirstream.
2260         Include "openat.h".
2261
2262 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2263
2264         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2265         coreutils no longer futzes with rounding modes.
2266
2267 2005-11-14  Jim Meyering  <jim@meyering.net>
2268
2269         * mkstemp-safer.c: Include <config.h>, required for possible
2270         replacement of mkstemp.
2271
2272 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2273
2274         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2275         business.
2276         (gethrxtime) [! (HAVE_NANOUPTIME
2277         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2278         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2279         our own approximation.
2280
2281 2005-11-10  Simon Josefsson  <jas@extundo.com>
2282
2283         * readline.c: Remove EOL.
2284
2285 2005-11-08  Eric Blake  <ebb9@byu.net>
2286
2287         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2288
2289 2005-11-08  Eric Blake  <ebb9@byu.net>
2290
2291         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2292
2293 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2294
2295         Fix porting problem reported by Theodoros V. Kalamatianos.
2296         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2297         Don't assume that futimes failing means we must fail.
2298
2299 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2300
2301         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2302         leave errno alone.  Problem reported by Dmitry V. Levin.
2303
2304 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2305
2306         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2307         errno alone.  Problem reported by Frederic Jolliton.
2308
2309 2005-10-28  Simon Josefsson  <jas@extundo.com>
2310
2311         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2312         "restrict" keywords, as per POSIX.  Protect the function
2313         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2314         Don't use K&R prototypes.  Check the sprintf return values.
2315         Re-define EAFNOSUPPORT if not present.  Indent.
2316
2317         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2318         suggested by Bruno Haible <bruno@clisp.org>.
2319
2320         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2321
2322         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2323
2324         * gc-libgcrypt.c: Add MD2 (which is not available through
2325         libgcrypt).
2326
2327         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2328
2329         * md2.h, md2.c: New files.
2330
2331 2005-10-24  Simon Josefsson  <jas@extundo.com>
2332
2333         * md4.h: Shrink buffer size, now that we changed the type.
2334
2335 2005-10-22  Simon Josefsson  <jas@extundo.com>
2336
2337         * arcfour.h, arcfour.c: Use fixed size indices in the
2338         arcfour_context struct (simplify test vector testing in GNU
2339         Shishi).
2340
2341 2005-10-22  Simon Josefsson  <jas@extundo.com>
2342
2343         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2344         suggested by Bruno Haible <bruno@clisp.org>.
2345
2346 2005-10-22  Simon Josefsson  <jas@extundo.com>
2347
2348         * crc.h: Include stddef.h, for size_t.
2349
2350 2005-10-21  Simon Josefsson  <jas@extundo.com>
2351
2352         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2353         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2354
2355 2005-10-21  Simon Josefsson  <jas@extundo.com>
2356
2357         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2358         block.
2359
2360 2005-10-21  Simon Josefsson  <jas@extundo.com>
2361
2362         * gc-gnulib.c: Support ARCTWO in CBC mode.
2363
2364 2005-10-21  Simon Josefsson  <jas@extundo.com>
2365
2366         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2367         <bruno@clisp.org>.
2368
2369         * hmac-sha1.c (hmac_sha1): Likewise.
2370
2371         * crc.c (crc32_update): Actually use crc parameter, suggested by
2372         Bruno Haible <bruno@clisp.org>.
2373
2374         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2375         <bruno@clisp.org>.
2376
2377 2005-10-21  Simon Josefsson  <jas@extundo.com>
2378
2379         * des.h, des.c: New files.
2380
2381         * gc-gnulib.c: Support DES.c
2382
2383 2005-10-21  Simon Josefsson  <jas@extundo.com>
2384
2385         * arctwo.h, arctwo.c: New files.
2386
2387         * gc-gnulib.c: Support ARCTWO.
2388
2389 2005-10-21  Simon Josefsson  <jas@extundo.com>
2390
2391         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2392
2393 2005-10-19  Simon Josefsson  <jas@extundo.com>
2394
2395         * gc-gnulib.c: Support ARCFOUR.
2396
2397 2005-10-19  Simon Josefsson  <jas@extundo.com>
2398
2399         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2400         support.
2401
2402         * gc.h: Add ECB enum type.
2403
2404         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2405
2406 2005-10-19  Simon Josefsson  <jas@extundo.com>
2407
2408         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2409
2410 2005-10-18  Simon Josefsson  <jas@extundo.com>
2411
2412         * md4.h, md4.c: New files, based on md5.?.
2413
2414 2005-10-17  Simon Josefsson  <jas@extundo.com>
2415
2416         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2417
2418         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2419
2420 2005-10-17  Simon Josefsson  <jas@extundo.com>
2421
2422         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2423
2424 2005-10-17  Simon Josefsson  <jas@extundo.com>
2425
2426         * gc.h, gc-libgcrypt.c: Add ciphers.
2427
2428 2005-10-17  Simon Josefsson  <jas@extundo.com>
2429
2430         * sha1.c: Use uint32_t instead of md5_uint32.t
2431
2432         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2433         md5.h.
2434
2435         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2436
2437         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2438
2439 2005-10-15  Simon Josefsson  <jas@extundo.com>
2440
2441         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2442
2443         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2444
2445 2005-10-14  Simon Josefsson  <jas@extundo.com>
2446
2447         * arcfour.h, arcfour.c: New files.
2448
2449 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2450
2451         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2452         include <wchar.h>; no longer needed.
2453
2454 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2455         and  Ulrich Drepper  <drepper@redhat.com>
2456
2457         Import from libc.
2458         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2459         instead of inline stream orientation test and two separate
2460         function calls.  Pay no attention to USE_IN_LIBIO.
2461
2462 2005-10-14  Roland McGrath  <roland@redhat.com>
2463
2464         Import from libc.  [BZ #1331]
2465         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2466         macro argument.
2467         Reported by Matej Vela <vela@debian.org>.
2468
2469 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2470
2471         * mkdir-p.c (make_dir_parents): Don't report an error if an
2472         intermediate directory is in a read-only file system.  Problem
2473         reported by Eric Blake.
2474
2475 2005-10-13  Simon Josefsson  <jas@extundo.com>
2476
2477         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2478         Move memory allocation outside of loop.
2479
2480 2005-10-12  Simon Josefsson  <jas@extundo.com>
2481
2482         * gc-pbkdf2-sha1.c: New file.
2483
2484         * gc.h: Add gc_pbkdf2_sha1 prototype.
2485
2486 2005-10-12  Simon Josefsson  <jas@extundo.com>
2487
2488         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2489         suggested by Bruno Haible <bruno@clisp.org>.
2490
2491 2005-10-12  Simon Josefsson  <jas@extundo.com>
2492
2493         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2494
2495         * gc-gnulib.c (gc_hmac_sha1): New function.
2496
2497 2005-10-12  Simon Josefsson  <jas@extundo.com>
2498
2499         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2500
2501 2005-10-12  Simon Josefsson  <jas@extundo.com>
2502
2503         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2504         GC_USE_HMAC_MD5, respectively.
2505
2506         * gc-libgcrypt.c (gc_md5): Fix assert call.
2507         (gc_md5): Fix typo.
2508
2509         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2510
2511         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2512
2513         * gc-gnulib.c (gc_hash_buffer): Ditto.
2514
2515 2005-10-11  Bruno Haible  <bruno@clisp.org>
2516
2517         * c-strcasestr.h: New file, from GNU gettext.
2518         * c-strcasestr.c: New file, from GNU gettext.
2519
2520 2005-10-11  Bruno Haible  <bruno@clisp.org>
2521
2522         * c-strcase.h: New file, from GNU gettext.
2523         * c-strcasecmp.c: New file, from GNU gettext.
2524         * c-strncasecmp.c: New file, from GNU gettext.
2525
2526 2005-10-11  Simon Josefsson  <jas@extundo.com>
2527
2528         * crc.h, crc.c: New files.
2529
2530         * gc.h (gc_hash_buffer): Add doc.
2531
2532 2005-10-08  Simon Josefsson  <jas@extundo.com>
2533
2534         * gc.h: Add gc_hash and gc_hash_buffer.
2535
2536         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2537
2538         * gc-libgcrypt.c (gc_hash_buffer): Add.
2539
2540 2005-10-11  Bruno Haible  <bruno@clisp.org>
2541
2542         * strcasecmp.c: Include limits.h.
2543         (strcasecmp): Avoid integer overflow on exotic platforms.
2544         * strncasecmp.c: Include limits.h.
2545         (strncasecmp): Avoid integer overflow on exotic platforms.
2546         Reported by Paul Eggert.
2547
2548 2005-10-06  Simon Josefsson  <jas@extundo.com>
2549
2550         * hmac-md5.c: New file.
2551
2552         * hmac.h: New file.
2553
2554 2005-10-06  Simon Josefsson  <jas@extundo.com>
2555
2556         * memxor.c (memxor): Avoid casts and warnings.
2557
2558 2005-10-05  Derek Price  <derek@ximbiot.com>
2559
2560         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2561
2562 2005-10-05  Simon Josefsson  <jas@extundo.com>
2563
2564         * memxor.c (memxor): Fix compiler error.
2565
2566         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2567         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2568
2569         * memxor.h, memxor.c: New files.
2570
2571         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2572         we assume all systems have it, suggested by Jim Meyering
2573         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2574         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2575         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2576         same reasons.
2577
2578 2005-10-04  Bruno Haible  <bruno@clisp.org>
2579
2580         * verify.h (verify_true): Provide alternative definition for C++.
2581
2582 2005-10-04  Simon Josefsson  <jas@extundo.com>
2583
2584         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2585         D. Baushke" <mdb@gnu.org>.
2586
2587 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2588
2589         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2590         (SSIZE_MAX): New macro, if not already defined.
2591         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2592         than 2 GiB.
2593
2594 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2595
2596         * exclude.c: Include verify.h.
2597         (verify): Remove.  All callers changed to use verify.h's version.
2598         * strtoimax.c: Likewise.
2599         * utimecmp.c: Likewis.e
2600
2601         Sync from coreutils.
2602         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2603         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2604         * .cvsignore: Add fts.h, search.h, t-fpending.
2605         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2606         bother returning ENOSYS if settimeofday or stime fails; just let
2607         them return whatever errno they want to return.
2608         * utimens.c: Include unistd.h, for dup2.
2609         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2610         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2611
2612 2005-10-02  Jim Meyering  <jim@meyering.net>
2613
2614         Sync from coreutils.
2615         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2616         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2617         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2618         Remove AT_FDCWD test.
2619         Do not consume the fd unless successful.
2620         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2621         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2622         block, so that we don't even try to compile it if settimeofday is
2623         available.  This works around a compilation failure on OSF1 V5.1,
2624         due to stime requiring a `long int*' while tv_sec is `int'.
2625
2626 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2627
2628         * getdelim.c (getdelim): Remove unused variables.
2629
2630 2005-10-01  Simon Josefsson  <jas@extundo.com>
2631
2632         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2633         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2634         AI_* and EAI_* definitions.  Protect function declarations.
2635
2636 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2637
2638         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2639         so that the code works even with ancient cpp.  Portability problem
2640         with GCC 2.7.2.1 reported by Thomas M.Ott.
2641
2642 2005-09-27  Jim Meyering  <jim@meyering.net>
2643
2644         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2645
2646         * intprops.h (signed_type_or_expr__): Define.
2647         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2648         for unsigned types.
2649
2650 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2651
2652         * verify.h (verify_expr): Remove, replacing with:
2653         (verify_true): New macro that returns true instead of void.
2654         (verify_type__): Remove.
2655         (verify): Use verify_true rather than verify_type__.
2656
2657 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2658
2659         * utimens.c (ENOSYS): Define if not already defined.
2660         (futimens): Support having a null PATH if the file descriptor
2661         is nonnegative.
2662
2663         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2664         Remove.
2665         (__attribute): Define to empty unless GCC 3.1 or later.
2666         This works around a core dump on OpenBSD 3.4, which has GCC
2667         2.95.3, which dumps core when given __attribute__(()).  It also
2668         simplifies other tests, since we really don't want to bother with
2669         worrying about which ancient version of GCC supported what.
2670         Original problem reported by Yoann Vandoorselaere, with part of
2671         the fix suggested by Derek Price.
2672
2673 2005-09-24  Jim Meyering  <jim@meyering.net>
2674
2675         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2676         so we can once again use a positive bitfield width of 1 -- now we
2677         don't have to explain why we were using a bitfield width of 2.
2678
2679 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2680
2681         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2682         Problem reported by Eric Blake.
2683         (getaddrinfo): Initialize se so that it's not garbage.
2684         Redo internal storage allocation so that it doesn't make unportable
2685         assumptions about alignment.
2686         Fix a memory leak.
2687
2688         * utimens.c (futimens): Use futimesat if available.
2689         Prefer it to futimes since it doesn't have the futimes bug.
2690
2691         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2692         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2693         Instead, declare a function that returns a pointer to an array,
2694         and use verify_type__ to declare the size of the array.
2695         Problem and germ of a solution reported by Bruno Haible.
2696         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2697         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2698
2699 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2700
2701         Sync from coreutils.
2702
2703         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2704         stat-time.h.
2705         * argmatch.h: Include verify.h
2706         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2707         (ARGMATCH_ASSERT): Remove; unused.
2708         * canonicalize.c: Assume STDC_HEADERS.
2709         * exclude.c: Include "strcase.h".
2710         * regex_internal.h [!defined _LIBC]: Likewise.
2711         * getusershell.c: Include stdio--.h rather than stdio.h
2712         and stdio-safer.h.
2713         (getusershell): Call fopen, not fopen_safer.
2714         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2715         Do not include unistd-safer.h.
2716         (save_cwd): Don't call fd_safer; no longer needed
2717         now that we include fcntl--.h.
2718
2719         * getdate.y (relative_time): New type.
2720         (RELATIVE_TIME_0): New constant.
2721         (parser_control): Use relative_time instead of doing it ourselves.
2722         (%union): Add new relative_time rel member.
2723         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2724         Now typeless.
2725         (relunit, relunit_snumber): Now of type rel.
2726         (zone, rel, relunit, get_date): Adjust to above changes.
2727
2728         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2729         Do not include unistd-safer.h.
2730         (getloadavg): Don't call fd_safer; no longer needed
2731         now that we include fcntl--.h.
2732
2733         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2734         (make_dir_parents): Treat ENOSYS like EEXIST.
2735
2736         Improve quality of diagnostics on restore_cwd failure.
2737         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2738         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2739         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2740         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2741         each time through the loop.  Do not diagnose restore_cwd failure;
2742         that is the caller's job (and perhaps the caller does not care).
2743
2744         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2745         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2746         If the file already exists but is not a directory, don't bother
2747         to try to make its parents.
2748         Close potential file descriptor leak if we can't chdir("/") (!).
2749         Don't always return true if chdir($PWD) fails; return true only
2750         if the requested action was done successfully (except for the
2751         chdir($PWD)).
2752         Don't log final directory unless we actually made it.
2753         Refactor to avoid duplicate code to fix up permissions.
2754         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2755
2756         * strftime.c (my_strftime): Rewrite the previous change slightly,
2757         to make it a bit faster and (I hope) clearer.
2758         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2759         Fix bug in formats like %2N.
2760
2761         * verify.h: New file.
2762
2763 2005-09-22  Jim Meyering  <jim@meyering.net>
2764
2765         Sync from coreutils.
2766
2767         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2768
2769         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2770         the .tm_year member, since otherwise gcc-4.0 would now warn about
2771         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2772
2773         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2774         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2775
2776         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2777         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2778         when run in a time zone for which daylight savings time is in effect
2779         for the starting date.
2780
2781         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2782         stop us from restricting permissions of just-created absolute-named
2783         directories.
2784         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2785         to restore initial working directory.
2786         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2787         to tell caller if/when we change the working directory and are
2788         unable to return to the initial one.
2789         * mkdir-p.h (make_dir_parents): Update prototype.
2790         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2791         `return false'.  This fixes a bug introduced on 2004-07-30.
2792
2793         * openat.c (fdopendir): Be sure to close the supplied
2794         file descriptor before returning.  This makes our replacement
2795         implementation a little closer to Solaris's, where fdopendir
2796         ties the file descriptor to the returned DIR* pointer.
2797         * openat.c (unlinkat): New function.
2798         * openat.h (unlinkat): Add prototype.
2799         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2800         (openat_restore_fail): Rename from openat_restore_die.
2801         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2802
2803         Provide an alternative to exiting immediately upon save_cwd or
2804         restore_cwd failure.  Now, an application can arrange e.g.,
2805         to perform a longjump in that case.
2806         * openat.c: Include dirname.h.
2807         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2808         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2809         and openat_restore_die rather than calling error directly.
2810         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2811
2812         * openat-die.c (openat_save_die, openat_restore_die): New file.
2813         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2814
2815         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2816         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2817                             int utc, int nanoseconds);
2818         Background:
2819         date should not have to allocate a megabyte of virtual memory to
2820         handle a format argument like +%1048575T.  When implemented with
2821         strftime, it must allocate such a buffer, use strftime to fill it
2822         in, print it, then free it.
2823         With fprintftime, it simply prints everything and exits.
2824         With no need for memory allocation, that's one fewer way to fail.
2825         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2826         optional field width, not before, so we accept %9:z, not %:9z.
2827         (my_strftime): Be sure to use L_('x') for literals.
2828
2829         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2830         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2831         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2832         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2833         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2834         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2835         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2836         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2837         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2838
2839         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2840         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2841         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2842         and don't include <sys/file.h>).
2843
2844 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2845
2846         Sync from coreutils.
2847
2848         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2849         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2850         [!LDAV_DONE]: Avoid unused variable warning.
2851
2852 2005-09-21  Bruno Haible  <bruno@clisp.org>
2853
2854         * unicodeio.h (unicode_to_mb): New declaration.
2855
2856 2005-09-20  Derek Price  <derek@ximbiot.com>
2857
2858         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2859
2860 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2861
2862         Use a consistent style for including <config.h>.
2863         * __fpending.c, acl.c, argmatch.c,
2864         argp-help.c, argp-parse.c,
2865         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2866         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2867         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2868         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2869         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2870         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2871         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2872         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2873         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2874         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2875         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2876         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2877         modechange.c, mountlist.c, open-safer.c, physmem.c,
2878         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2879         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2880         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2881         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2882         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2883         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2884         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2885         userspec.c, utimecmp.c, version-etc-fsf.c,
2886         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2887         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2888         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2889         Standardize inclusion of config.h.
2890         * __fpending.h, dirfd.h, getdate.h, human.h,
2891         inttostr.h:  Removed inclusion of config.h from header files.
2892         * inttostr.c:  Adjusted in-tree users.
2893         * timespec.h: Remove superfluous warning to include config.h.
2894         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2895         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2896         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2897         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2898
2899 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2900
2901         * stat-time.h: New file.
2902         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2903         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2904         in a different way.
2905         (timespec_cmp): New function.
2906         * utimecmp.c: Include stat-time.h.
2907         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2908         members exist, not on the obsolescent ST_MTIM_NSEC.
2909         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2910
2911 2005-09-15  Derek Price  <derek@ximbiot.com>
2912             Paul Eggert  <eggert@cs.ucla.edu>
2913
2914         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2915         changes, consolidating in...
2916         * regex_internal.h: ...this file.
2917
2918 2005-09-15  Derek Price  <derek@ximbiot.com>
2919
2920         * regex_internal.h: Blank `pure' for GNUC < 3.
2921         * regex_internal.c: Ditto, using this...
2922         (__GNUC_PREREQ): ...new macro.
2923         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2924         (__GNUC_PREREQ): ...this new macro.
2925
2926         * strstr.h: Include string.h. Define strstr as a macro here.
2927
2928 2005-09-13  Derek Price  <derek@ximbiot.com>
2929
2930         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2931         failure.
2932         Reported by Jim Meyering  <jim@meyering.net>.
2933
2934 2005-09-13  Jim Meyering  <jim@meyering.net>
2935
2936         * canon-host.c: Filter through gnu indent and reword comments slightly.
2937         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2938
2939 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2940
2941         * base64.c: Typo.
2942         (base64_encode): Put b64str in initialized data section.
2943
2944 2005-09-12  Derek Price  <derek@ximbiot.com>
2945
2946         Return usable errors from canon-host.
2947         * canon-host.h: New file.
2948         * canon-host.c (canon_host): Wrap...
2949         (canon_host_r): ...this new function, which now relies exclusively on
2950         getaddrinfo.
2951         (ch_strerror): New function.
2952         (last_cherror): New global.
2953         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2954         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2955         void *.
2956         (freeaddrinfo): Free ai->ai_canonname when set.
2957
2958 2005-09-12  Derek Price  <derek@ximbiot.com>
2959             Paul Eggert  <eggert@cs.ucla.edu>
2960
2961         * glob-libc.h: Renamed from glob_.h.  The new version is
2962         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2963         protecting things that should be done only in gnulib contexts.
2964         * glob_.h: New file, containing only the glob things needed for
2965         gnulib.
2966         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2967         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2968         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2969         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2970         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2971         and to respect the namespace rules better.
2972
2973 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2974
2975         Merge glibc and coreutils changes into gnulib, plus a few
2976         extra fixes.
2977         * md5.c: Use #error rather than a string.
2978         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2979         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2980         (__attribute__): Define to empty for non recent-GCC.
2981         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2982         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2983         Renamed from their non-__ counterparts, with new macros replacing
2984         them if not _LIBC.  Add __THROW attribute.
2985         (rol): Remove.
2986         (struct md5_ctx): Align buffer if using GCC.
2987         * sha1.h (struct sha1_ctx): Likewise.
2988         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2989         The old name was backwards.
2990         (NOTSWAP): Remove; not used.
2991         (rol): New macro, moved here from md5.h.
2992         (sha1_process_block): Remove a FIXME that doesn't make sense.
2993
2994 2005-09-12  Derek Price  <derek@ximbiot.com>
2995
2996         * gai_strerror.c: Include config.h when available.  Include
2997         getaddrinfo.h before other headers to test interface.
2998         Reported by Larry Jones <lawrence.jones@ugs.com>.
2999
3000 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3001
3002         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3003         definitions, since that's the preferred style in glibc.
3004         Fix a minor spacing issue, and update copyright notice to match glibc's.
3005
3006 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3007
3008         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3009
3010 2005-09-06  Simon Josefsson  <jas@extundo.com>
3011
3012         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3013         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3014
3015 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3016
3017         Change bitset word type from unsigned int to unsigned long int,
3018         as this has better performance on typical 64-bit hosts.
3019         Port bitset code to hosts with unusual word sizes.
3020         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3021         (build_collating_symbol):
3022         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3023         argument is a bitset.  This is merely a style issue, but it makes
3024         it clearer that an entire array is expected.
3025         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3026         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3027         Port to the case where bitset_word is not the same as unsigned int.
3028         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3029         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3030         Likewise.
3031         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3032         (build_trtable, group_nodes_into_DFAstates):
3033         Likewise.
3034         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3035         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3036         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3037         * regexec.c (group_nodes_into_DFAstates): Likewise.
3038         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3039         * regcomp.c (optimize_subexps, lower_subexp):
3040         Work even if bitset_word has holes in its bitwise representation.
3041         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3042         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3043         Likewise.
3044         * regex_internal.c (re_string_reconstruct):
3045         Don't assume UCHAR_MAX == 255.
3046         * regex_internal.h (bitset_set_all): Likewise.
3047         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3048         All uses changed.
3049         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3050         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3051         All uses changed.
3052         (BITSET_WORD_MAX): New macro.
3053         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3054         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3055         (bitset_empty, bitset_copy):
3056         Prefer sizeof (bitset) to multiplying it out ourselves.
3057         (bitset_not_merge): Remove; unused.
3058         (bitset_contain): Return bool, not unsigned int with one bit on.
3059         All callers changed.
3060         * regexec.c (build_trtable): Don't assume bitset has no stricter
3061         alignment than re_node_set; do this by defining a new internal
3062         type struct dests_alloc and using it to allocate memory.
3063
3064 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3065
3066         Check for arithmetic overflow when calculating sizes, to prevent
3067         some buffer-overflow issues.  These patches are conservative, in the
3068         sense that when I couldn't determine whether an overflow was possible,
3069         I inserted a run-time check.
3070         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3071         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3072         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3073         (re_xnrealloc, re_x2nrealloc): New inline functions.
3074         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3075         (build_equiv_class, build_charclass): Check for arithmetic overflow
3076         in size expression calculations.
3077         * regex_internal.c (re_string_realloc_buffers):
3078         (build_wcs_upper_buffer, re_node_set_add_intersect):
3079         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3080         (re_dfa_add_node, register_state): Likewise.
3081         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3082         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3083         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3084         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3085
3086 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3087
3088         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3089         to avoid a collision with bits/local_lim.h in glibc.
3090         All uses changed.  Problem reported by Dmitry V. Levin in
3091         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3092
3093         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3094         bugs in int versus size_t comparisons.
3095         (re_string_context_at): Fix bug where the code assumed that
3096         Idx is signed.
3097
3098         Use bool where appropriate.
3099         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3100         All callers changed.
3101         (calc_eclosure_iter): Likewise, for ROOT arg.
3102         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3103         (build_charclass_op): Likewise, for NON_MATCH arg.
3104         * regex_internal.c (re_string_allocate, re_string_construct):
3105         (re_string_construct_common): Likewise, for ICASE arg.
3106         * regexec.c (re_search_2_stub, re_search_stub):
3107         Likewise, for RET_LEN arg.
3108         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3109         (set_regs): Likewise, for FL_BACKTRACK arg.
3110         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3111         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3112         (calc_eclosure_iter, parse_bracket_exp):
3113         Use bool for internal variables that are booleans.
3114         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3115         (set_regs, build_sifted_states, sift_states_bkref):
3116         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3117         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3118         (find_collation_sequence_value):
3119         Likewise.
3120         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3121         (re_node_set_compare):
3122         Return bool, not int. All callers changed.
3123         * regexec.c (check_halt_node_context, check_dst_limits):
3124         (build_trtable, check_node_accept): Likewise.
3125         * regex_internal.h: Include stdbool.h.
3126
3127         Fix bugs uncovered when converting to bool.
3128         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3129         failure instead of charging ahead blindly.
3130         * regex_internal.c (register_state): Likewise.
3131         * regexec.c (re_search_2_stub): Use simpler method than boolean
3132         for freeing internal storage.
3133         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3134         bitset pieces used as boolean, to avoid undefined behavior
3135         on hosts that do int overflow checking.
3136
3137 2005-08-31  Derek Price  <derek@ximbiot.com>
3138
3139         * getdelim.c (getdelim): Return EOF on EOF.
3140         Reported by Larry Jones <lawrence.jones@ugs.com>.
3141
3142 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3143
3144         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3145         lengths fit in regoff_t; this isn't true if regoff_t is the same
3146         width as size_t.
3147         * regex.c (re_search_internal): 5th arg is LAST_START
3148         (= START + RANGE) instead of RANGE.  This avoids overflow
3149         problems when regoff_t is the same width as size_t.
3150         All callers changed.
3151         (re_search_2_stub): Check for overflow when adding the
3152         sizes of the two strings.
3153         (re_search_stub): Check for overflow when adding START
3154         to RANGE; if it occurs, substitute the extreme value.
3155
3156 2005-08-31  Jim Meyering  <jim@meyering.net>
3157
3158         * regcomp.c (search_duplicated_node): Make first pointer arg
3159         a pointer-to-const.
3160         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3161         (register_state): Likewise.
3162         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3163         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3164         (group_nodes_into_DFAstates): Likewise.
3165
3166 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3167
3168         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3169         old glibc regex code mishandles strings longer than 2**31 bytes.
3170         This patch fixes this when the regex code is used in gnulib
3171         (i.e., outside glibc).
3172
3173         This patch should not affect the use of the regex code inside
3174         glibc.  No doubt this problem also needs to be handled for glibc
3175         as well, but the result will be an incompatible change to the
3176         glibc ABI, and the old ABI will have to be supported too.  That
3177         can be the the subject for another patch.
3178
3179         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3180         governing whether the rest of this patch is active.  By default,
3181         the macro is disabled and the patch has no effect.
3182         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3183         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3184         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3185         (re_match_2, re_set_registers): Use the new types.
3186         * regex_internal.h (Idx, re_hashval_t): New types.
3187         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3188         New macros.
3189         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3190         (re_string_context_at, bin_tree_t, re_dfastate_t):
3191         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3192         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3193         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3194         (re_string_char_size_at, re_string_wchar_at):
3195         (re_string_elem_size_at):
3196         Use the new types and macros to port to 64-bit hosts.
3197         Use unsigned types for internal values, so that the code
3198         mostly works even for arrays larger than SSIZE_MAX.
3199         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3200         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3201         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3202         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3203         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3204         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3205         (calc_inveclosure, parse_dup_op, build_range_exp):
3206         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3207         (fetch_number, create_token_tree, mark_opt_subexp):
3208         Likewise.
3209         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3210         (create_cd_newstate, re_string_allocate, re_string_construct):
3211         (re_string_realloc_buffers, build_wcs_upper_buffer):
3212         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3213         (re_string_reconstruct, re_string_peek_byte_case):
3214         (re_string_fetch_byte_case, re_string_context_at):
3215         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3216         (re_node_set_init_copy, re_node_set_add_intersect):
3217         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3218         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3219         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3220         (re_acquire_state, re_acquire_state_context, register_state):
3221         Likewise.
3222         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3223         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3224         (re_search_internal, re_search_2_stub, re_search_stub)
3225         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3226         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3227         (update_cur_sifted_state, check_dst_limits):
3228         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3229         (check_subexp_limits, sift_states_bkref, merge_state_array):
3230         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3231         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3232         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3233         (expand_bkref_cache, check_node_accept_bytes):
3234         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3235         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3236         (acquire_init_state_context, check_halt_node_context):
3237         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3238         (sift_states_backward, clean_state_log_if_needed):
3239         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3240         (find_recover_state, transit_state_sb, transit_state_mb):
3241         (transit_state_bkref, build_trtable, match_ctx_clean):
3242         Likewise.
3243         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3244         to work around an assumption that REG_MISSING is negative.
3245
3246         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3247         (seek_collating_symbol_entry) [defined _LIBC]:
3248         (lookup_collation_sequence_value) [defined _LIBC]:
3249         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3250         Use prototypes rather than old-style function definitions.
3251         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3252         (transit_state_sb) [0]:
3253         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3254
3255         * regexec.c (re_search_internal): Simplify update of rm_so and
3256         rm_eo.
3257
3258         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3259         (optimize_subexps, lower_subexp):
3260         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3261         since the signed shift might overflow.  Use 1u<<31 instead.
3262         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3263         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3264         Likewise.
3265
3266         * regcomp.c (optimize_subexps, lower_subexp):
3267         Use CHAR_BIT rather than 8, for clarity.
3268         * regexec.c (check_dst_limits_calc_pos_1):
3269         (check_subexp_matching_top): Likewise.
3270         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3271         have to worry about portability issues when shifting it left.
3272         Remove no-longer-needed test for table_size > 0.
3273         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3274         in a word, as the resulting behavior is undefined.
3275         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3276         in one case, a <= should have been an <, and in another case the
3277         whole test was missing.
3278         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3279         the standard name CHAR_BIT.
3280         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3281         this is not true on one's complement and signed-magnitude hosts.
3282
3283         * regex_internal.h (re_sub_match_top_t): Remove unused member
3284         next_last_offset.
3285         (struct re_dfa_t): Remove unused member states_alloc.
3286         * regcomp.c (init_dfa): Don't initialize unused members.
3287
3288 2005-08-31  Bruno Haible  <bruno@clisp.org>
3289
3290         * strstr.c: Include <stddef.h>, for NULL.
3291         * strcasestr.c: Likewise.
3292         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3293
3294 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3295
3296         * iconvme.h: Add prototype for iconv_alloc.
3297
3298 2005-08-29  Simon Josefsson  <jas@extundo.com>
3299
3300         * iconvme.c: Fix errno.
3301
3302 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3303
3304         * iconvme.c: Split iconv_string into iconv_alloc.
3305
3306 2005-08-27  Jim Meyering  <jim@meyering.net>
3307
3308         * fopen-safer.c: Merge minor changes from coreutils.
3309         * dup-safer.c: Likewise.
3310         * fd-safer.c: Likewise.
3311
3312         Merge from coreutils.
3313         * stdio--.h: New file.
3314         * stdlib--.h: New file.
3315         * mkstemp-safer.c: New file.
3316
3317         GNU tar needs these.
3318         * pipe-safer.c: New file.
3319         * creat-safer.c: New file.
3320         * fcntl--.h (creat): Define to creat_safer.
3321         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3322         * unistd--.h (pipe): Define to pipe_safer.
3323         * unistd-safer.h: Declare pipe_safer.
3324
3325 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3326
3327         * regex_internal.h: Remove all references to
3328         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3329         or better.
3330         (bitset_not, bitset_merge, bitset_not_merge):
3331         (bitset_mask, re_string_allocate, re_string_construct):
3332         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3333         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3334         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3335         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3336         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3337         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3338         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3339         (re_acquire_state_context):
3340         Remove unnecessary forward decls.
3341         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3342         Put __attribute at function definition,
3343         now that the function decl has been removed.
3344         * regex_internal.c (re_string_peek_byte_case):
3345         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3346         Likewise.
3347
3348 2005-08-26  Simon Josefsson  <jas@extundo.com>
3349
3350         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3351         Haible <bruno@clisp.org>.
3352
3353 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3354
3355         * regexec.c (set_regs): Don't alloca with an unbounded size.
3356
3357         alloca modernization/simplification for regex.
3358         * regex.c: Remove portability cruft for alloca.  This no longer
3359         needs to be at the start of the file, and can be moved into
3360         regex_internal.h and simplified.
3361         * regex_internal.h: Include <alloca.h>.
3362         (__libc_use_alloca) [!defined _LIBC]: New macro.
3363         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3364         now works outside glibc.
3365
3366 2005-08-24  Simon Josefsson  <jas@extundo.com>
3367
3368         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3369         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3370         GLIBC specific code.
3371
3372 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3373
3374         Make regex safe for g++.  This fixes one real bug (an "err"
3375         that should have been "*err").  g++ problem reported by
3376         Sam Steingold.
3377         * regex_internal.h (re_calloc): New macro, consistent with
3378         re_malloc etc.  All callers of calloc changed to use re_calloc.
3379         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3380         not int.  All callers changed.
3381         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3382         just use an array of size MB_LEN_MAX.
3383         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3384         (find_recover_state): Change "err" to "*err"; this fixes what
3385         appears to be a real bug.
3386         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3387         versus int.
3388
3389 2005-08-25  Jim Meyering  <jim@meyering.net>
3390
3391         * open-safer.c: Include <config.h>.
3392         Otherwise, we'd lose LARGEFILE support in any file using
3393         e.g. "fcntl--.h"
3394
3395 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3396
3397         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3398         * regex.h (regerror): Likewise.
3399
3400         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3401         requires this.  (The code never needed it.)
3402
3403         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3404         All uses of recently-renamed identifiers changed to use the new,
3405         POSIX-compliant names.  The code will build and run just fine
3406         without these changes, but it's better to eat our own dog food
3407         and use the standard-conforming names.
3408
3409         * regex.h: Fix a multitude of POSIX name space violations.
3410         These changes have an effect only for programs that define
3411         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3412         do not change anything for programs compiled in the normal way.
3413         Also, there is no effect on the ABI.
3414
3415         (_REGEX_SOURCE): New macro.
3416         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3417         defined and _GNU_SOURCE is not; this fixes a name space violation.
3418
3419         Rename the following macros to obey POSIX requirements.
3420         The old names are still visible as macros if _REGEX_SOURCE is defined.
3421         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3422         RE_BACKSLASH_ESCAPE_IN_LISTS.
3423         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3424         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3425         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3426         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3427         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3428         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3429         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3430         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3431         (REG_INTERVALS): renamed from RE_INTERVALS.
3432         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3433         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3434         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3435         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3436         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3437         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3438         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3439         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3440         RE_UNMATCHED_RIGHT_PAREN_ORD.
3441         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3442         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3443         (REG_DEBUG): renamed from RE_DEBUG.
3444         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3445         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3446         unusual, since we can't clash with the POSIX REG_ICASE.
3447         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3448         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3449         (REG_NO_SUB): renamed from RE_NO_SUB.
3450         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3451         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3452         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3453         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3454         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3455         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3456         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3457         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3458         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3459         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3460         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3461         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3462         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3463         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3464         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3465         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3466         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3467         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3468         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3469         (REG_FIXED): Renamed from REGS_FIXED.
3470         (REG_NREGS): Renamed from RE_NREGS.
3471
3472         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3473         of other REG_* macros, since POSIX says the user is allowed to
3474         #undef these macros selectively.
3475
3476         (reg_errcode_t): Update comment stating what other tables need
3477         to be consistent.
3478
3479         Rename the following enum values to obey POSIX requirements.
3480         The old names are still visible as macros.
3481         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3482         is not defined, since GNU is supposed to be a superset of POSIX as
3483         much as possible, and since we want reg_errcode_t to be a signed
3484         type for implementation consistency.
3485         (_REG_NOERROR): Renamed from REG_NOERROR.
3486         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3487         (_REG_BADPAT): Renamed from REG_BADPAT.
3488         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3489         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3490         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3491         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3492         (_REG_EBRACK): Renamed from REG_EBRACK.
3493         (_REG_EPAREN): Renamed from REG_EPAREN.
3494         (_REG_EBRACE): Renamed from REG_EBRACE.
3495         (_REG_BADBR): Renamed from REG_BADBR.
3496         (_REG_ERANGE): Renamed from REG_ERANGE.
3497         (_REG_ESPACE): Renamed from REG_ESPACE.
3498         (_REG_BADRPT): Renamed from REG_BADRPT.
3499         (_REG_EEND): Renamed from REG_EEND.
3500         (_REG_ESIZE): Renamed from REG_ESIZE.
3501         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3502         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3503         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3504         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3505         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3506
3507         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3508         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3509         changed.  But support the old name if the new one is not defined
3510         and if _REGEX_SOURCE.
3511
3512         Change the following member names in struct re_pattern_buffer.
3513         The old names are still supported if !_REGEX_SOURCE.
3514         The new names are always supported, regardless of _REGEX_SOURCE.
3515         (re_buffer): Renamed from buffer.
3516         (re_allocated): Renamed from allocated.
3517         (re_used): Renamed from used.
3518         (re_syntax): Renamed from syntax.
3519         (re_fastmap): Renamed from fastmap.
3520         (re_translate): Renamed from translate.
3521         (re_can_be_null): Renamed from can_be_null.
3522         (re_regs_allocated): Renamed from regs_allocated.
3523         (re_fastmap_accurate): Renamed from fastmap_accurate.
3524         (re_no_sub): Renamed from no_sub.
3525         (re_not_bol): Renamed from not_bol.
3526         (re_not_eol): Renamed from not_eol.
3527         (re_newline_anchor): Renamed from newline_anchor.
3528
3529         Change the following member names in struct re_registers.
3530         The old names are still supported if !_REGEX_SOURCE.
3531         The new names are always supported, regardless of _REGEX_SOURCE.
3532         (rm_num_regs): Renamed from num_regs.
3533         (rm_start): Renamed from start.
3534         (rm_end): Renamed from end.
3535
3536         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3537         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3538         Prepend __ to parameter names.
3539
3540         Undo yesterday's changes.
3541
3542 2005-08-24  Jim Meyering  <jim@meyering.net>
3543
3544         Sync from coreutils.
3545         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3546
3547 2005-08-21  Bruno Haible  <bruno@clisp.org>
3548
3549         * lock.h: Add multiple inclusion guard.
3550         * tls.h: Add multiple inclusion guard.
3551
3552 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3553
3554         * regex.h (REG_NOSYS)
3555         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3556         Define, since POSIX requires it as of 2001.
3557         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3558         New private symbol, used to keep the enum signed in all cases.
3559         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3560         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3561
3562         * regex_internal.c (re_string_skip_chars, register_state):
3563         (calc_state_hash):
3564         Remove forward decls; no longer needed now that we use prototypes.
3565         * regexec.c (acquire_init_state_context, check_halt_node_context):
3566         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3567         (clean_state_log_if_needed): Likewise.
3568
3569 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3570
3571         Fix problems reported by Sam Steingold in
3572         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3573         * regexec.c (sift_states_bkref): Fix portability bug: the code
3574         assumed that reg_errcode_t is a signed type, which is not
3575         necessarily true if _XOPEN_SOURCE is not defined.
3576         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3577         some compilers warn about it otherwise.
3578
3579 2005-08-20  Jim Meyering  <jim@meyering.net>
3580
3581         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3582         of unused local, dfa.
3583
3584 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3585
3586         * regcomp.c (create_initial_state): Remove duplicate decl.
3587         (init_word_char, create_initial_state, duplicate_node_closure):
3588         (fetch_token, peek_token_bracket, build_range_exp):
3589         (build_collating_symbol): Remove forward decls; no longer needed
3590         now that we use prototypes.
3591
3592         * regcomp.c:
3593         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3594         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3595         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3596         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3597         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3598         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3599         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3600         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3601         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3602         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3603         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3604         (build_charclass, build_charclass_op, fetch_number, create_tree):
3605         (create_token_tree, mark_opt_subexp, duplicate_tree):
3606         Use prototypes rather than old-style definitions.
3607
3608         * regex_internal.c:
3609         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3610         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3611         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3612         (re_string_reconstruct, re_string_peek_byte_case):
3613         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3614         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3615         (re_node_set_init_copy, re_node_set_add_intersect):
3616         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3617         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3618         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3619         (re_acquire_state, re_acquire_state_context, register_state):
3620         (create_ci_newstate, create_cd_newstate, free_state):
3621         Likewise.
3622         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3623         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3624         (re_search_internal, prune_impossible_nodes):
3625         (acquire_init_state_context, check_matching, static):
3626         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3627         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3628         (update_regs, sift_states_backward, build_sifted_states):
3629         (clean_state_log_if_needed, merge_state_array):
3630         (update_cur_sifted_state, add_epsilon_src_nodes):
3631         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3632         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3633         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3634         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3635         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3636         (check_arrival, check_arrival_add_next_nodes):
3637         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3638         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3639         (check_node_accept_bytes, check_node_accept, extend_buffers):
3640         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3641         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3642         (sift_ctx_init):
3643         Likewise.
3644
3645         * regex_internal.h:
3646         (re_string_allocate, re_string_construct, re_string_reconstruct):
3647         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3648         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3649         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3650         (re_string_context_at, re_string_peek_byte_case):
3651         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3652         is defined, since we now use prototypes always.
3653
3654         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3655         C89 or better.  All uses removed.
3656
3657 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3658
3659         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3660         [defined lint]: Suppress bogus uninitialized-variable warnings.
3661
3662         * regcomp.c (duplicate_node): Return new index, not an error code,
3663         and let the caller return REG_ESPACE if out of space.  This
3664         removes an uninitialied-variable warning with GCC 4.0.1, and also
3665         avoids taking the address of a local variable.  All callers
3666         changed.
3667
3668 2005-08-19  Jim Meyering  <jim@meyering.net>
3669
3670         * regexec.c (proceed_next_node): Redo local variables to
3671         avoid GCC shadowing warnings.
3672
3673 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3674
3675         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3676         (re_node_set_insert_last, re_dfa_add_node):
3677         Rename local variables to avoid GCC shadowing warnings.
3678
3679 2005-08-18  Bruno Haible  <bruno@clisp.org>
3680
3681         * strstr.c (strstr): Fix return value in multibyte case.
3682         * strcasestr.c (strcasestr): Likewise.
3683
3684 2005-08-17  Jim Meyering  <jim@meyering.net>
3685
3686         Make the %s format (seconds since the epoch) work for a negative
3687         number and when used with a zero-padded field width, e.g. %015s.
3688
3689         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3690         label so that it precedes the code to set `digits'.  Otherwise,
3691         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3692         print `00-22'.  Now, it prints `-0022', as it should.
3693
3694 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3695
3696         * regex.h: Remove useless space-before-tab.  From coreutils.
3697
3698 2005-08-17  Bruno Haible  <bruno@clisp.org>
3699
3700         * strcasestr.h: New file.
3701         * strcasestr.c: New file.
3702
3703 2005-08-17  Bruno Haible  <bruno@clisp.org>
3704
3705         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3706         * strstr.c: Completely rewritten, with multibyte locale support.
3707
3708 2005-08-17  Bruno Haible  <bruno@clisp.org>
3709
3710         * strcasecmp.c: Use mbuiter.h.
3711
3712 2005-08-17  Bruno Haible  <bruno@clisp.org>
3713
3714         * mbuiter.h: New file.
3715
3716 2005-08-16  Bruno Haible  <bruno@clisp.org>
3717
3718         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3719         (mbi_init): Update.
3720         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3721         NUL byte, not after it.
3722
3723 2005-08-16  Bruno Haible  <bruno@clisp.org>
3724
3725         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3726         the valid ones. Makes the comparison operations transitive:
3727         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3728         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3729
3730 2005-08-16  Bruno Haible  <bruno@clisp.org>
3731
3732         * strcase.h (strcasecmp): Add note in comments.
3733         * strncasecmp.c: Use code from strcasecmp.c.
3734         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3735         (strcasecmp): Work correctly in multibyte locales.
3736
3737 2005-08-16  Bruno Haible  <bruno@clisp.org>
3738
3739         * strnlen1.h: New file.
3740         * strnlen1.c: New file.
3741
3742 2005-08-16  Bruno Haible  <bruno@clisp.org>
3743
3744         * mbfile.h: New file.
3745
3746 2005-08-16  Bruno Haible  <bruno@clisp.org>
3747
3748         * mbiter.h: New file.
3749
3750 2005-08-16  Bruno Haible  <bruno@clisp.org>
3751
3752         * mbchar.h: New file.
3753         * mbchar.c: New file.
3754
3755 2005-08-16  Bruno Haible  <bruno@clisp.org>
3756
3757         * tls.h: New file, from GNU gettext.
3758         * tls.c: New file, from GNU gettext.
3759
3760 2005-08-15  Bruno Haible  <bruno@clisp.org>
3761
3762         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3763         is defined.
3764
3765 2005-08-14  Jim Meyering  <jim@meyering.net>
3766
3767         Sync from coreutils.
3768
3769         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3770         Use the hash-table-based cycle-detection code not just when
3771         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3772         Reported by James Youngman in
3773         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3774         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3775         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3776         This lets us compile with -DFTS_DEBUG, once again.
3777         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3778         * fts.c (fd_safer): Remove decl.
3779         Include fcntl--.h rather than unistd-safer.h
3780         (fts_safe_changedir): Don't call fd_safer; no longer needed
3781         now that we include fcntl--.h.
3782
3783 2005-08-11  Simon Josefsson  <jas@extundo.com>
3784
3785         * readline.h, readline.c: New file.
3786
3787 2005-08-11  Bruno Haible  <bruno@clisp.org>
3788
3789         * strnlen.h (strnlen): Change parameter name to match comment.
3790
3791 2005-08-10  Simon Josefsson  <jas@extundo.com>
3792
3793         * strndup.c: Use strnlen.h.
3794
3795         * strnlen.h: New file.
3796
3797 2005-08-02  Simon Josefsson  <jas@extundo.com>
3798
3799         * getline.h, getline.c: Rewrite.
3800
3801         * getdelim.h, getdelim.c: New files, ported from glibc.
3802
3803 2005-07-31  Bruno Haible  <bruno@clisp.org>
3804
3805         * lock.h (gl_lock_initializer): New macro.
3806         (gl_lock_define_initialized): Use it.
3807         (gl_rwlock_initializer): New macro.
3808         (gl_rwlock_define_initialized): Use it.
3809         (gl_recursive_lock_initializer): New macro.
3810         (gl_recursive_lock_define_initialized): Use it.
3811
3812 2005-07-26  Bruno Haible  <bruno@clisp.org>
3813
3814         * lock.h: Update from GNU gettext.
3815         * lock.c: Update from GNU gettext.
3816
3817 2005-07-18  Bruno Haible  <bruno@clisp.org>
3818
3819         * lock.h (gl_once_t): New type.
3820         (gl_once_define, gl_once): New macros.
3821         * lock.c (fresh_once): New variable.
3822         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3823         functions.
3824
3825 2005-07-18  Simon Josefsson  <jas@extundo.com>
3826
3827         * check-version.c (check_version): Accept identical versions too.
3828
3829 2005-07-18  Bruno Haible  <bruno@clisp.org>
3830
3831         * lock.h: New file, from GNU gettext.
3832         * lock.c: New file, from GNU gettext.
3833
3834 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3835
3836         * quotearg.c: Add translator comment suggested by Bruno Haible,
3837         with a minor change.
3838
3839 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3840
3841         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3842         copyright symbol and the year.
3843         * version-etc.c (COPYRIGHT_YEAR): New constant.
3844         (version_etc_va): Use parameterized copyright notice.
3845         Reword to conform to the current GNU coding standards.
3846
3847 2005-07-11  Simon Josefsson  <jas@extundo.com>
3848
3849         * size_max.h: New file.
3850
3851 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3852
3853         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3854         block of defines.
3855
3856 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3857        and  Paul Eggert  <eggert@cs.ucla.edu>
3858
3859         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3860         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3861
3862 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3863
3864         * regex.c, regex.h: Sync from libc.
3865         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3866         New files, synced from libc, except that regex_internal.h
3867         currently has a small porting fix.
3868
3869 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3870
3871         Remove the dependency of the strftime module on the tzset module.
3872         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3873         Copy the input structure, to work around some of the bug with
3874         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3875         Solaris releases, you should also use the tzset module, but we won't
3876         require it as a dependency any more since we don't want LGPLed code
3877         to depend on GPLed code.
3878
3879 2005-07-02  Jim Meyering  <jim@meyering.net>
3880
3881         * backupfile.c (backup_args): Change a `0' to NULL.
3882
3883 2005-07-01  Jim Meyering  <jim@meyering.net>
3884
3885         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3886         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3887         * save-cwd.c, tempname.c:
3888         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3889         and don't include <sys/file.h>).
3890
3891 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3892
3893         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3894         declares only 'struct timespec;' (!).
3895
3896 2005-06-29  Jim Meyering  <jim@meyering.net>
3897
3898         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3899         type name.  Use the variable name instead.
3900         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3901
3902 2005-06-28  Simon Josefsson  <jas@extundo.com>
3903
3904         * check-version.h, check-version.c: New files.
3905
3906 2005-06-28  Simon Josefsson  <jas@extundo.com>
3907
3908         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3909         collision with global variable.  Better indentation.  Don't
3910         increment buffer pointer beyond buffer end.  Based on comments
3911         from Paul Eggert <eggert@cs.ucla.edu>.
3912
3913         * base64.h: Indent.
3914
3915 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3916
3917         * canon-host.c (canon-host): Append trailing "," to 0 in
3918         initializer of struct addrinfo, as an indication that we don't
3919         care how many members the structure has.
3920
3921 2005-06-24  Derek Price  <derek@ximbiot.com>
3922         and Bruno Haible  <bruno@clisp.org>
3923
3924         Remove stat module & update lstat.
3925         * stat.c: Remove this file...
3926         (slash_aware_lstat): ...moving this content and its support...
3927         * lstat.c (rpl_lstat): ...into here.
3928         * lstat.h: New file.
3929
3930 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3931
3932         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3933         (ranged_convert): Don't save conversion in a temporary struct.
3934         This causes a warning with GCC 4.0.0, and anyway in the typical
3935         case it's not worth the extra 100 bytes or so of code.
3936         (ranged_convert, __mktime_internal): When calling a function via a
3937         pointer P, use P () rather than (*P) (), as we now assume C89 or
3938         better.
3939
3940 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3941
3942         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3943         "who -r" failed to give output.  Problem reported by Tim Waugh.
3944
3945         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3946         (xcalloc): Use it to avoid needless tests.
3947         Problem reported by Jim Meyering.
3948
3949 2005-06-16  Jim Meyering  <jim@meyering.net>
3950
3951         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3952         when either N or S is zero.
3953
3954 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3955
3956         * argp.h (__option_is_short): Check upper limit of
3957         __key. Isprint() requires its argument to have the value
3958         of an unsigned char or EOF.
3959
3960 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3961
3962         * fnmatch.c (fnmatch): If there is an encoding error in a
3963         multibyte string or pattern, fall back on unibyte matching.
3964         Problem reported by James Youngman.
3965
3966 2005-06-08  Bruno Haible  <bruno@clisp.org>
3967
3968         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3969         warning on mingw.
3970
3971 2005-06-08  Bruno Haible  <bruno@clisp.org>
3972
3973         * csharpcomp.h: New file, from GNU gettext.
3974         * csharpcomp.c: New file, from GNU gettext.
3975         * csharpcomp.sh.in: New file, from GNU gettext.
3976
3977 2005-06-07  Derek Price  <derek@ximbiot.com>
3978
3979         Sync from CVS.
3980         * glob_.h: Indent nested #ifdef.
3981
3982 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3983
3984         Sync from coreutils.
3985         Use "file name" when talking about file names, instead of "filename"
3986         or "path", as per the GNU coding standards.
3987         * mkdir-p.c: Renamed from makepath.c.
3988         (make_dir_parents): Renamed from make_path.  All callers changed.
3989         * mkdir-p.h: Likewise.  All includers changed.
3990         * filenamecat.c: Renamed from path-concat.c.
3991         (file_name_concat): Renamed from path_concat.  All callers changed.
3992         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3993         * filenamecat.h: Likewise.  All includers changed.
3994         * acl.c: Don't use "path" or "filename" to mean "file name"
3995         in comments or local variable names.
3996         * basename.c: Likewise.
3997         * canonicalize.c, canonicalize.h: Likewise.
3998         * dirname.c, dirname.h: Likewise.
3999         * euidaccess.c: Likewise.
4000         * exclude.c: Likewise
4001         * fnmatch_.h, fnmatch_loop.c: Likewise.
4002         * fsusage.c, fsuage.h: Likewise.
4003         * fts.c, fts_.h: Likewise.
4004         * getcwd.c: Likewise.
4005         * getloadavg.c: Likewise.
4006         * mkstemp.c: Likewise.
4007         * mountlist.c, mountlist.h: Likewise.
4008         * openat.c, openat.h: Likewise.
4009         * readlink-stub.c: Likewise.
4010         * readutmp.c, readutmp.h: Likewise.
4011         * rename.c: Likewise.
4012         * rmdir.c: Likewise.
4013         * same.c: Likewise.
4014         * savedir.c: Likewise.
4015         * stripslash.c: Likewise.
4016         * tempname.c: Likewise.
4017         * xreadlink.c: Likewise.
4018         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4019         All uses changed.
4020         * exclude.h: Likewise.
4021
4022         * euidaccess.c (getuid, getgid, getuid, getegid)
4023         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4024         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4025         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4026         * pathmax.h: Include <limits.h> unconditionally, since other
4027         files have been getting away with it for years (MORE/BSD 4.3
4028         is extinct now).
4029         * userspec.c (getpwnam, getgrnam, getgrgid)
4030         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4031
4032         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4033         Define to 256, not 255, as per modern POSIX.
4034
4035 2005-06-01  Bruno Haible  <bruno@clisp.org>
4036
4037         * csharpexec.h: New file, from GNU gettext.
4038         * csharpexec.c: New file, from GNU gettext.
4039         * csharpexec.sh.in: New file, from GNU gettext.
4040
4041 2005-05-31  Derek Price  <derek@ximbiot.com>
4042             Paul Eggert  <eggert@cs.ucla.edu>
4043
4044         Sync from cvs.
4045         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4046
4047 2005-05-29  Derek Price  <derek@ximbiot.com>
4048             Paul Eggert  <eggert@cs.ucla.edu>
4049
4050         * glob_.h, glob.c: New files.
4051
4052 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4053
4054         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4055
4056         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4057         the configuration hassle isn't worth it.
4058         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4059         (LONGEST_MODIFIER, PRIuMAX): Remove.
4060
4061 2005-05-27  Bruno Haible  <bruno@clisp.org>
4062
4063         * getlogin_r.h: Remove second include of <stddef.h>.
4064
4065 2005-05-25  Bruno Haible  <bruno@clisp.org>
4066             Derek Price  <derek@ximbiot.com>
4067
4068         * getlogin_r.h: Simplify API documentation.
4069
4070 2005-05-25  Derek Price  <derek@ximbiot.com>
4071             Paul Eggert  <eggert@cs.ucla.edu>
4072
4073         * getlogin_r.c, getlogin_r.h: New files.
4074
4075 2005-05-22  Bruno Haible  <bruno@clisp.org>
4076
4077         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4078         Also include <sys/param.h> if it defines MIN, MAX.
4079         Based on a patch by Derek Price <derek@ximbiot.com>.
4080
4081 2005-05-22  Bruno Haible  <bruno@clisp.org>
4082
4083         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4084         (INT64_MIN): Fix definition.
4085         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4086
4087         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4088         NEED_SIGNED_INT_TYPES.
4089
4090         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4091         HAVE_SYSTEM_INTTYPES.
4092
4093 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4094
4095         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4096         so that unistd-safer.h (GPL'ed code) need not be included.
4097
4098 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4099
4100         New fts module.
4101         * fts.c: Don't include "cycle-check.h" or "hash.h".
4102         (setup_dir, free_dir): New functions.
4103         (enter_dir, leave_dir): Define trivial
4104         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4105         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4106         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4107         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4108         Move to fts-cycle.c.
4109         (fts_open): Use setup_dir.
4110         (fts_close): Use free_dir.
4111         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4112         This adds a label and some gotos, but the alternatives were messier.
4113         Check for memory allocation failure when entering a dir.
4114         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4115         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4116         (FTS): New member fts_cycle, that is a union that contains the
4117         old active_dir_ht and cycle_state.  All uses changed to mention
4118         fts_cycle.ht and fts_cycle.state.
4119         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4120         fts.c, with the following changes:
4121         (setup_dir, free_dir): New functions.
4122         (enter_dir): Now returns bool.  Return true if successful, false
4123         if memory exhausted.  All callers changed.
4124         Do not bother partly cleaning up on
4125         memory allocation failure; that is free_dir's job.
4126         However, free ad if hash_insert fails, to avoid memory leak.
4127         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4128         fts->fts_options to see which union member to use.
4129
4130 2005-05-20  Jim Meyering  <jim@meyering.net>
4131
4132         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4133         Now a macro, to pacify GCC.
4134
4135 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4136
4137         * chown.c (rpl_chown): Return -1 on failure.
4138
4139 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4140
4141         * canonicalize.c: Include canonicalize.h first, to test interface.
4142         Include <stddef.h> unconditionally, since we assume C89 now.
4143         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4144         * fts.c: Include fts_.h first, to check interface.
4145         Do not include intprops.h; no longer needed.
4146         Include cycle-check.h and hash.h, since fts_.h no longer does.
4147         Remove unnecessary casts of closedir to void.
4148         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4149         decide whether to decrement nlinks.
4150         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4151         (FTS): Use struct hash_table * instead of Hash_table, so that
4152         we no longer need to include hash.h here.
4153
4154 2005-05-17  Jim Meyering  <jim@meyering.net>
4155
4156         * fts.c, fts_.h: New files, from coreutils.
4157
4158 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4159
4160         Sync from coreutils.
4161         * unlinkdir.c, unlinkdir.h: New files.
4162         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4163         regex.h, unlocked-io.h, xtime.h:
4164         White space changes only.
4165         * makepath.c (make_path): Port to hosts where leading "//" is special.
4166         * yesno.c: Include getline.h, not ctype.h.
4167         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4168         Use getline to remove arbitrary restriction on response length.
4169
4170 2005-05-13  Bruno Haible  <bruno@clisp.org>
4171
4172         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4173         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4174         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4175         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4176         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4177         Add support for 64-bit integers in the MSVC compiler.
4178
4179 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4180
4181         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4182         Change the initial comment to refer to GPL, not LGPL.
4183         gnulib-tool will change it to LGPL as needed.
4184
4185         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4186         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4187         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4188         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4189         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4190         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4191         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4192         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4193         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4194         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4195         concatpath.c, config.charset, copy-file.c, copy-file.h,
4196         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4197         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4198         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4199         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4200         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4201         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4202         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4203         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4204         full-read.c, full-read.h, full-write.c, full-write.h,
4205         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4206         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4207         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4208         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4209         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4210         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4211         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4212         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4213         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4214         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4215         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4216         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4217         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4218         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4219         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4220         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4221         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4222         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4223         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4224         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4225         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4226         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4227         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4228         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4229         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4230         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4231         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4232         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4233         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4234         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4235         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4236         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4237         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4238         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4239         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4240         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4241         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4242         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4243         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4244         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4245         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4246         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4247         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4248         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4249         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4250         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4251         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4252         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4253         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4254         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4255         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4256         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4257         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4258         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4259         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4260         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4261         Update FSF postal mail address.
4262
4263 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4264
4265         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4266         specified in ai_socktype. Fix invalid ai_protocol
4267         check. ai_protocol is usually set to 0 or depending on
4268         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4269         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4270         ai_socktype / ai_protocol in the returned addrinfo structure.
4271
4272 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4273             Bruno Haible  <bruno@clisp.org>
4274
4275         * inet_ntop.h: New file.
4276         * inet_ntop.c: New file, from glibc with modifications.
4277
4278 2005-05-08  Jim Meyering  <jim@meyering.net>
4279
4280         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4281
4282 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4283
4284         Merge from coreutils.  Among other things,
4285         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4286         * fd-safer.c: New file.
4287         * fcntl-safer.h, open-safer.c: Remove.
4288         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4289         * dup-safer.c: Include unistd-safer.h first.
4290         Don't include errno.h.
4291         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4292         * file-type.h: Don't assume invoker included sys/stat.h first.
4293         * file-type.c: Rely on file-type.h change.
4294         * getloadavg.c: Include unistd-safer.h.
4295         (getloadavg): Use safer open.
4296         * getusershell.c: Include "stdio-safer.h".
4297         (getusershell): Use safer fopen.
4298         * long-options.c (long_options): Use NULL rather than 0.
4299         * modechange.h (mode_free): Remove; all callers changed to invoke
4300         'free'.
4301         * modechange.c: Likewise.
4302         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4303         (MODE_DONE): New constant.
4304         (struct mode_change): Remove 'next' member.
4305         (make_node_op_equals): New function; like the old one of the
4306         same name, except it allocates an array.
4307         (mode_compile, mode_create_from_ref): Use it.
4308         (mode_compile): Allocate result as an array, not a linked list.
4309         Parse octal string ourself, so that we catch mistakes like "+0".
4310         (mode_adjust): Arg is an array, not a linked list.
4311         * modechange.c: Include stat-macros.h, xalloc.h.
4312         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4313         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4314         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4315         Remove.  This is now stat-macros.h's job.
4316         (talloc): Remove.  All callers replaced by xalloc, so that
4317         our invokers don't have to worry about reporting memory failures.
4318         (make_node_op_equals): Remove.
4319         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4320         New constants.
4321         (struct mode_change): Moved here from modechange.h.
4322         (mode_append_entry): Remove.
4323         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4324         apps to have incorrect behavior.  Use simpler algorithm for head
4325         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4326         Detect more invalid usages rather than having somewhat-random behavior.
4327         Don't insert an "a=" action, as that leads to incorrect behavior.
4328         (mode_compile, mode_create_from_ref): Return NULL on error instead
4329         of an enum, since now there's only one way to have an error.  All
4330         callers changed.
4331         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4332         at the correct time.  Simplify calculation of "+u" and its ilk.
4333         Don't mishandle "+X".
4334         (mode_free): Remove "register" and localize decls.
4335         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4336         (struct mode_change): Move to modechange.c; callers don't
4337         need to see this stuff.
4338         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4339         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4340         (mode_change, mode_adjust): Reflect the new signatures noted above.
4341         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4342         that might redefine system include files.
4343         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4344         (my_usleep): Use NULL rather than (void *) 0.
4345         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4346         Use siginterrupt to specify that system calls should be interrupted.
4347         (rpl_nanosleep): Move initialization of suspended closer to call of
4348         my_usleep.
4349         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4350         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4351         (desirable_utmp_entry): New function.
4352         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4353         using x2nrealloc, to simplify logic.
4354         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4355         size calculation.  Do not assume utmp file is a regular file.
4356         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4357         (READ_UTMP_CHECK_PIDS): New constant.
4358         * save-cwd.c: Include unistd-safer.h.
4359         (save_cwd): Use fd_safer.
4360         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4361         [!_LIBC] Include "stat-macros.h" instead.
4362         * unistd-safer.h (fd_safer): New decl.
4363
4364 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4365
4366         * byteswap_.h: New file.
4367
4368 2005-04-25  Albert Chin  <china@thewrittenword.com>
4369
4370         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4371         Toolkit C bug.
4372
4373 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4374
4375         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4376         that "UTC +1 second" continues to work.  Problem reported
4377         by Dmitry V. Levin.
4378         (relunit_snumber): New rule.
4379         (relunit): Use it.
4380
4381 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4382
4383         * getdate.y (universal_time_zone_table): New constant.
4384         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4385         universal_time_zone_table.
4386         (lookup_zone): Prefer universal_time_zone_table to
4387         local_time_zone_table, so that "GMT" time stamps are allowed in
4388         London during the summer.  Problem reported by Ian Abbott.
4389
4390 2005-04-12  Jim Meyering  <jim@meyering.net>
4391
4392         * human.c (humblock): Set *options even when returning due to
4393         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4394         warning from gcc-4.
4395
4396 2005-04-09  Jim Meyering  <jim@meyering.net>
4397
4398         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4399         -Wuninitialized: initialize tm0.tm_year.
4400
4401 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4402
4403         * getdate.y (parser_control): rels_seen is now a boolean, not a
4404         count, since there's no maximum.  All uses changed.
4405         Add member dsts_seen.
4406         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4407         not being INT_MAX.
4408         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4409         Use pc_rels_seen to decide whther a date is absolute.
4410
4411         * getdate.y (number): Don't overwrite year.
4412         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4413         check.
4414
4415 2005-04-02  Simon Josefsson  <jas@extundo.com>
4416
4417         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4418         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4419
4420 2005-03-27  Jim Meyering  <jim@meyering.net>
4421
4422         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4423
4424 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4425
4426         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4427         "one's complement" -> "ones' complement" in comment, as per Knuth.
4428         "value of type" -> "type or expression" in comment.
4429         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4430
4431 2005-03-26  Jim Meyering  <jim@meyering.net>
4432
4433         Comment nits.
4434         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4435         Correct typos: s/or/of/.
4436
4437 2005-03-23  Jim Meyering  <jim@meyering.net>
4438
4439         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4440
4441 2005-03-21  Jim Meyering  <jim@meyering.net>
4442
4443         Changes imported from coreutils.
4444
4445         * cycle-check.c: Don't include xalloc.h.
4446
4447         * path-concat.c: Don't include assert.h.
4448         (path_concat): Remove assertion that would have triggered
4449         for ABASE starting with more than one slash.
4450         Reported by Andreas Schwab.
4451
4452         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4453         properly when ABASE is an absolute file name.
4454         Correct the description of this function.
4455         Include <assert.h>.
4456         Add an assertion and a test driver.
4457         This fixes a bug introduced on 2004-07-02.
4458         Andreas Schwab reported the resulting failure of cp --parents:
4459         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4460
4461 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4462
4463         * strftime.c (my_strftime): If the underlying strftime returns 0
4464         (which shouldn't happen), generate nothing instead of returning 0
4465         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4466
4467 2005-03-16  Bruno Haible  <bruno@clisp.org>
4468
4469         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4470
4471 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4472
4473         * strftime.c (my_strftime): Prepend space to format so that we can
4474         reliably distinguish strftime failure from empty output on POSIX
4475         hosts.
4476
4477 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4478
4479         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4480         (iconv_string): Don't guess a size-zero buffer, as that might cause
4481         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4482         result would be 'too large', where 'too large' is (heuristically)
4483         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4484         overflow concerns.  This will prevent some unwanted malloc failures
4485         when the inputs are very large.
4486
4487 2005-03-15  Bruno Haible  <bruno@clisp.org>
4488
4489         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4490         'negate'.
4491
4492         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4493         variable.
4494
4495         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4496
4497 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4498
4499         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4500         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4501         intprops.h.
4502         * strtol.c: Likewise.
4503
4504 2005-03-14  Simon Josefsson  <jas@extundo.com>
4505
4506         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4507         <fx@gnu.org>.
4508
4509 2005-03-14  Jim Meyering  <jim@meyering.net>
4510
4511         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4512         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4513         to be nonzero so that we (and caller) can detect the difference
4514         between a valid zero-length expansion and an error return, even
4515         when the underlying strftime fails before writing anything into
4516         that location.
4517
4518 2005-03-10  Jim Meyering  <jim@meyering.net>
4519
4520         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4521         so that this module works on systems without fchdir.
4522
4523 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4524
4525         Factor int-properties macros into a single file, except for
4526         glibc-related files.
4527         * intprops.h: New file.
4528         * getloadavg.c: Include it instead of limits.h.
4529         (INT_STRLEN_BOUND): Remove.
4530         * human.c: Include intprops.h.
4531         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4532         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4533         * inttostr.h: Include intprops.h instead of limits.h.
4534         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4535         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4536         for consistency with intprops.h.
4537         (time_t_is_integer, twos_complement_arithmetic): Use them.
4538         * sig2str.h: Include <signal.h>, intprops.h.
4539         (INT_STRLEN_BOUND): Remove.
4540         * strftime.c (TYPE_SIGNED): Remove.
4541         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4542         * strtol.c: Adjust comments to match intprops.h.
4543         * userspec.c: Include intprops.h.
4544         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4545         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4546         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4547         instead of rolling our own expressions.
4548         * xstrtol.c: Include xstrtol.h first, to test interface.
4549
4550         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4551         instead of int.
4552         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4553         the right thing even if adding 1900 would overflow.  Similarly
4554         for tm_mon + 1 and tm_yday + 1.
4555         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4556         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4557         (DO_SIGNED_NUMBER): New macro.
4558         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4559
4560 2005-03-07  Bruno Haible  <bruno@clisp.org>
4561
4562         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4563
4564 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4565             Bruno Haible  <bruno@clisp.org>
4566
4567         * pagealign_alloc.h: New file.
4568         * pagealign_alloc.c: New file.
4569
4570 2005-01-28  Bruno Haible  <bruno@clisp.org>
4571
4572         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4573         stpncpy.c uses it.
4574
4575 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4576
4577         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4578         The workaround isn't strictly needed for POSIX conformance, and
4579         it's too much of a pain to configure and maintain.  We'll ask
4580         people to fix their kernels instead.
4581         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4582         (NANOSLEEP_BUG_WORKAROUND): Remove.
4583         (xnanosleep): Remove the workaround.
4584
4585 2005-02-12  Bruno Haible  <bruno@clisp.org>
4586
4587         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4588
4589 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4590
4591         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4592         * timespec.h (gettime): Return void, since it always
4593         succeeds now.  All uses changed.
4594         * gettime.c (gettime) Likewise.
4595         [HAVE_NANOTIME]: Prefer nanotime.
4596         Assume gettimeofday succeeds, as POSIX requires.
4597         Assime time () succeeds, since other code already does.
4598         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4599         (timespec_subtract): Remove.
4600         (NANOSLEEP_BUG_WORKAROUND): New constant.
4601         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4602         things considerably.  Use it only on GNU/Linux hosts, since the
4603         workaround shouldn't be needed elsewhere.
4604
4605 2005-02-24  Bruno Haible  <bruno@clisp.org>
4606
4607         * gettext.h: Update from GNU gettext 0.14.2.
4608
4609 2005-02-24  Bruno Haible  <bruno@clisp.org>
4610
4611         * localcharset.c: Update from GNU gettext 0.14.2.
4612         * config.charset: Update from GNU gettext 0.14.2.
4613
4614 2005-02-22  Simon Josefsson  <jas@extundo.com>
4615
4616         * iconvme.h, iconvme.c: New files, from libc.
4617
4618 2005-02-20  Neil Conway  <neilc@samurai.com>
4619
4620         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4621         returned by OSX/Darwin if the specified buffer is not large
4622         enough for the hostname.
4623
4624 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4625
4626         * memrchr.h: New file.
4627         * chdir-long.c: Include it.
4628         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4629         Don't bother including stddef.h.
4630
4631 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4632
4633         * argp-help.c (__argp_help): Create a fake struct argp_state and
4634         pass it to _help, otherwise the latter coredumps trying to
4635         dereference state.root_argp.
4636
4637 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4638
4639         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4640         inclusion.
4641         Include <sys/types.h>, for dev_t.
4642         (ME_DUMMY, ME_REMOTE): Move from here....
4643         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4644         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4645         Dmitry V. Levin.
4646         Include mountlist.h first, to test the interface.
4647
4648 2005-01-29  Bruno Haible  <bruno@clisp.org>
4649
4650         * progname.c (program_name): Initialize.
4651         Needed when linking statically on MacOS X.
4652
4653 2005-01-28  Bruno Haible  <bruno@clisp.org>
4654
4655         * javacomp.sh.in: New file, from GNU gettext.
4656         * javacomp.h: New file, from GNU gettext.
4657         * javacomp.c: New file, from GNU gettext.
4658
4659 2005-01-26  Bruno Haible  <bruno@clisp.org>
4660
4661         * javaexec.sh.in: New file, from GNU gettext.
4662         * javaexec.h: New file, from GNU gettext.
4663         * javaexec.c: New file, from GNU gettext.
4664
4665 2005-01-26  Simon Josefsson  <jas@extundo.com>
4666
4667         * gai_strerror.c: Use GPL in header.
4668
4669 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4670
4671         * argp-help.c (hol_entry_help): Avoid using non-constant
4672         initializers for struct pentry_state.
4673         (__argp_error): Check return value of __asprintf
4674         (__argp_failure): Translate error message
4675
4676         * argp-parse.c: Removed braces around the expansion of N_()
4677
4678 2005-01-21  Jim Meyering  <jim@meyering.net>
4679
4680         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4681         same value as for Solaris 9.
4682
4683         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4684         component length.  This included changing the parameter to be
4685         of type `char *' rather than `char const *'.
4686         * chdir-long.h (chdir_long): Update prototype.
4687
4688         * openat.c (fdopendir, fstatat): New functions.
4689         * openat.h: Include headers required for use of DIR and struct stat.
4690         [AT_SYMLINK_NOFOLLOW]: Define.
4691         (fdopendir, fstatat): Add prototypes.
4692
4693 2005-01-21  Bruno Haible  <bruno@clisp.org>
4694
4695         * classpath.h: New file, from GNU gettext.
4696         * classpath.c: New file, from GNU gettext.
4697
4698 2005-01-20  Simon Josefsson  <jas@extundo.com>
4699
4700         * version-etc-fsf.c: New file, with version_etc_copyright.
4701         * version-etc.c: Remove version_etc_copyright.
4702         * version-etc.h (version_etc_copyright): Use [] instead of * in
4703         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4704
4705 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4706
4707         * save-cwd.c (save_cwd): Remove code to support the case
4708         where fchdir is missing or flaky.
4709
4710 2005-01-20  Simon Josefsson  <jas@extundo.com>
4711
4712         * base64.h (isbase64): Add.
4713
4714         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4715         using a unsigned prototype, don't inline.
4716         (base64_decode): Use it.
4717
4718 2005-01-19  Bruno Haible  <bruno@clisp.org>
4719
4720         * sh-quote.h: New file, from GNU gettext.
4721         * sh-quote.c: New file, from GNU gettext.
4722
4723 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4724
4725         Merge changes from coreutils, as described below in several
4726         changelogs dated today.
4727
4728         * save-cwd.c: Include "save-cwd.h" before other include files.
4729         (O_DIRECTORY): Remove; not needed here, since "." must be
4730         a directory.  All uses removed.
4731         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4732         universal on Suns, and we also need to test for IRIX.
4733         Revamp code to use 'if' rather than '#if'.
4734         Avoid unnecessary comparison of cwd->desc to 0.
4735
4736         * utimens.c (futimens): Robustify the previous patch, by checking
4737         for known valid error numbers rather than observed invalid ones.
4738
4739 2005-01-18  Jim Meyering  <jim@meyering.net>
4740
4741         * version-etc.c (version_etc_copyright): Update copyright date.
4742
4743         * utimens.c (futimens): Account for the fact that futimes
4744         can also fail with errno == ENOSYS or errno == ENOENT.
4745         Patch from Dmitry V. Levin.
4746
4747         Change the name of the robust chdir function from chdir to chdir_long.
4748         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4749         (restore_cwd): Use chdir_long, not chdir.
4750         * chdir-long.c: Renamed from chdir.c.
4751         * chdir-long.h: Renamed from chdir.h.
4752         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4753         Hurd.
4754
4755 2005-01-18  Bob Proulx  <bob@proulx.com>
4756
4757         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4758         offsetof() macro construct to avoid compile failure with native HP-UX
4759         11.0 ANSI C compiler.
4760
4761 2005-01-06  Bruno Haible  <bruno@clisp.org>
4762
4763         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4764         because stpncpy.m4 takes care of it.
4765
4766 2004-01-24  Bruno Haible  <bruno@clisp.org>
4767
4768         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4769
4770 2003-10-09  Bruno Haible  <bruno@clisp.org>
4771
4772         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4773
4774 2005-01-06  Bruno Haible  <bruno@clisp.org>
4775
4776         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4777         * fwriteerror.c: Include <stdbool.h>.
4778         (fwriteerror): At the end, close the file stream. Record whether
4779         stdout was already closed.
4780
4781 2004-05-27  Bruno Haible  <bruno@clisp.org>
4782
4783         * execute.c (environ): Declare if needed.
4784         * pipe.c (environ): Likewise.
4785         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4786
4787 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4788
4789         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4790         definitions to be after all include files, to avoid collisions.
4791         Problem reported by Bob Proulx.
4792
4793 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4794
4795         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4796         not needed.  This removes a dependency on the gettext module.
4797         [defined _LIBC]: Do not include <libintl.h>; not needed.
4798
4799 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4800
4801         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4802         HAVE_DECL_STRTOLD.
4803
4804 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4805
4806         * argp-parse.c: Include <stddef.h>.
4807         (alignof, alignto): New macros.
4808         (parser_init): Don't assume that void * is aligned sufficiently
4809         for struct option.
4810
4811         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4812         need to extend the stack.
4813         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4814         large.
4815
4816 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4817
4818         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4819
4820 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4821
4822         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4823         Remove now-obsolete comment about AIX.
4824         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4825         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4826         (YYMAXDEPTH): New macro.
4827
4828 2004-12-18  Bruno Haible  <bruno@clisp.org>
4829
4830         * fatal-signal.c (fatal_signals): Make non-const.
4831         (init_fatal_signals): New function.
4832         (uninstall_handlers, install_handlers): Ignore signals that were set to
4833         SIG_IGN.
4834         (at_fatal_signal): Call init_fatal_signals.
4835         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4836         SIG_IGN.
4837         Reported by Paul Eggert.
4838
4839 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4840
4841         * getdate.y (textint): New member "negative".
4842         (time_zone_hhmm): New function.
4843         Expect 14 shift-reduce conflicts, not 13.
4844         (o_colon_minutes): New rule.
4845         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4846         (yylex): Set the "negative" member of signed numbers.
4847
4848 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4849
4850         Changes imported from coreutils.
4851         * hard-locale.c: Assume <locale.h> exists.
4852         Include "strdup.h".
4853         (GLIBC_VERSION): New macro.
4854         (hard_locale): Assume setlocale exists.
4855         Rewrite to avoid #ifdef.
4856         Use strdup rather than malloc + strcpy.
4857         * human.c: Assume <locale.h> exists.
4858         (human_readable): Assume localeconv exists.
4859
4860 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4861
4862         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4863         convert T2, not T.  (Imported from libc.)
4864
4865 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4866
4867         * getcwd.c (is_ENAMETOOLONG): New macro.
4868         (__getcwd.c): Don't restore errno; glibc doesn't.
4869         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4870         first, falling back to our code only if its results look suspicious.
4871         Ensure that the resulting buffer is only as large as necessary.
4872
4873         * readutmp.c: Include readutmp.h first.
4874         Include <errno.h>, since readutmp.h no longer does that.
4875         * readutmp.h: Don't include <errno.h>,
4876         <sys/param.h>, <time.h>; not needed to establish interface.
4877         (errno): Remove decl.
4878         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4879         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4880         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4881
4882 2004-11-28  Simon Josefsson  <jas@extundo.com>
4883
4884         * base64.h, base64.c: New file.
4885
4886 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4887
4888         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4889
4890 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4891
4892         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4893         HP's ANSI C compiler.
4894         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4895         Declaring int functions causes warnings on some modern systems and
4896         shouldn't be needed to compile on ancient ones.
4897         * same.c (MIN) [defined MIN]: Don't define, since it's already
4898         defined.
4899
4900         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4901         with the following changes.
4902         (__set_errno): Parenthesize properly.
4903         Include <stdbool.h>.
4904         (MIN, MAX, MATCHING_INO): New macros.
4905         (__getcwd): Define with prototype, not K&R form.
4906         Use heuristics to allocate default buffer on stack if possible.
4907         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4908         behavior, and to avoid the PATH_MAX limit when computing
4909         ../../../../...
4910         Use MATCHING_INO to compare inode number to file.
4911         Check for arithmetic overflow in size calculations.
4912         Fix bug in reallocation of dot array that caused getcwd to fail
4913         on directories nested deeper than 75.
4914         Be more careful about saving errno on error.
4915         Do not use realloc; use only free+malloc, as this is a bit
4916         more flexible and avoids a needless copy operation.
4917         Do not inspect st_dev and st_ino for symbolic links; POSIX
4918         doesn't specify the latter.
4919         Check for closedir errors.
4920         Avoid needless casts.
4921         Use "#ifdef weak_alias" around weak_alias, to be like other
4922         glibc code.
4923         The following changes to getcwd.c have effect only when used in
4924         gnulib; they have no effect inside glibc proper.
4925         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4926         as alloca isn't used.
4927         (alloca, __alloca): Likewise.
4928         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4929         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4930         unconditionally, as gnulib assumes C89 or better.
4931         Do not include <sys/param.h>.
4932         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4933         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4934         better.
4935         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4936         Include <dirent.h> in a way that is compatible with modern Autoconf.
4937         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4938         New macros, if not already defined.
4939         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4940         Use "_LIBC", not "defined _LIBC", for consistency.
4941         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4942         a mempcpy module.
4943         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4944         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4945         * xgetcwd.c: David MacKenzie's old code was removed, so give
4946         credit only to Jim Meyering and adjust the copyright dates.
4947         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4948         <stdlib.h>, <unistd.h>, "pathmax.h".
4949         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4950         (INITIAL_BUFFER_SIZE): Remove.
4951         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4952
4953 2004-11-23  Jim Meyering  <jim@meyering.net>
4954
4955         * getopt_.h: Remove trailing blanks.
4956
4957 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4958
4959         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4960         (futimens): New function, which uses futimes if available.
4961         (futimens, utimens): Support timespec==NULL, with same semantics
4962         as utime and utimens.
4963         * utimens.h (futimens): New decl.
4964
4965 2004-11-23  Jim Meyering  <jim@meyering.net>
4966
4967         * __fpending.c: Add comment.
4968
4969 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4970
4971         * getopt_.h: Re-addition of __getopt_argv_const caused
4972         redefinition warnings. To avoid them, include the defines
4973         in `#if !defined __need_getopt ... #endif'. The only place
4974         where __getopt_argv_const is used is in definitions
4975         of getopt_long and getopt_long_only below, which are as well
4976         protected by `#ifndef __need_getopt'.
4977         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4978         __need_getopt after including <stdio.h> and <unistd.h> These
4979         headers might have defined it.
4980
4981 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4982
4983         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4984         New macros.
4985         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4986         optopt): Use them instead of invoking ## directly; otherwise, the
4987         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4988
4989 2004-11-19  Bruno Haible  <bruno@clisp.org>
4990
4991         * strtok_r.c: Move comments from here...
4992         * strtok_r.h: ... to here.
4993
4994 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4995
4996         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4997         might fail.  Problem reported by Yoann Vandoorselaere.
4998         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4999         that mishandle size_t overflow.
5000
5001 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5002
5003         * canon-host.c: Include "strdup.h".
5004         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5005         Use strdup instead of malloc/strcpy to duplicate strings.
5006
5007         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5008         (human_space_before_unit): New constant.
5009         * human.c (human_readable): Support it.
5010
5011         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5012         (xgetcwd): Set errno correctly when failing.
5013         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5014         the failure is actually due to a PATH_MAX problem.
5015
5016         Further getopt changes to make it more likely that glibc will
5017         buy the changes back.
5018         * getopt.c (POSIXLY_CORRECT): New constant.
5019         (getopt): Use it, so to preserve glibc semantic
5020         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5021         when compiling for libc.
5022         * getopt_.h (__getopt_argv_const): Bring it back.
5023         (getopt_long, getopt_long_only): Use it.
5024
5025         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5026         New arg POSIXLY_CORRECT.  All callers changed.
5027         (getopt): Argv is now char * const *, as per standard.
5028         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5029         not char *__getopt_argv_const *.
5030         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5031         _getopt_long_only_r): Likewise.
5032         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5033         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5034         _getopt_long_r, _getopt_long_only_r): Likewise.
5035         * getopt_.h (__getopt_argv_const): Remove.
5036         (getopt): Argv is now char * const *, as per standard.
5037
5038         * getdate.y (tORDINAL): New token.
5039         (day, relunit): Allow it for relative times.
5040         (relative_time_table): Use tORDINAL for ordinals.
5041
5042 2004-11-15  Jim Meyering  <jim@meyering.net>
5043
5044         * closeout.c: Include "__fpending.h" once again.
5045         Include <stdbool.h>.
5046         (close_stdout): Don't fail just because stdout was closed initially,
5047         since some programs don't write to stdout in the normal course of
5048         operation (other than --version and --help), and we don't want this
5049         function to make e.g. `touch file >&-' fail.
5050         But do fail if it was closed and someone has tried to write to it.
5051         E.g., `printf foo >&-' must fail.
5052
5053 2004-11-11  Simon Josefsson  <jas@extundo.com>
5054
5055         * strtok_r.h, strtok_r.c: New file.
5056
5057 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5058
5059         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5060         we can stop lying to compilers about the constness of argv when we
5061         are compiled outside glibc.
5062         (getopt, getopt_long, getopt_long_only): Use it.
5063         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5064         getopt): Likewise.
5065         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5066         _getopt_long_only_r): Likewise.
5067         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5068         _getopt_long_only_r): Likewise.
5069
5070         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5071         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5072         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5073         the other external symbols.
5074         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5075         declaration, since the above renaming now works around collisions.
5076
5077 2004-11-11  Jim Meyering  <jim@meyering.net>
5078
5079         * linebreak.c: Remove trailing blanks.
5080         * alloca_.h: Likewise.
5081         * acosl.c: Likewise.
5082         * euidaccess.c: Likewise.
5083         * allocsa.h: Likewise.
5084
5085 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5086
5087         * mktime.c (SHR): New macro, which is a portable
5088         substitute for >> that should work even on Crays.
5089         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5090         Problem reported by Mark D. Baushke in
5091         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5092         * getdate.y (SHR): Likewise.
5093         (tm_diff): Use it.
5094         * strftime.c (SHR): Likewise.
5095         (tm_diff): Use it.
5096         * quotearg.c (struct quoting_options): Use unsigned int for
5097         quote_these_too, so that right shifts are well defined.  All uses
5098         changed.
5099
5100 2004-11-10  Simon Josefsson  <jas@extundo.com>
5101
5102         * getaddrinfo.h, getaddrinfo.c: New files.
5103
5104 2004-11-10  Jim Meyering  <jim@meyering.net>
5105
5106         Ensure that no close failure goes unreported.
5107         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5108         return early when it seems there's nothing to flush.
5109         Don't include __fpending.h.
5110
5111 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5112
5113         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5114
5115 2004-11-05  Bruno Haible  <bruno@clisp.org>
5116
5117         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5118         Reported by Mark D. Baushke <mdb@cvshome.org>.
5119
5120 2004-11-04  Bruno Haible  <bruno@clisp.org>
5121
5122         2004-09-11  Bruno Haible  <bruno@clisp.org>
5123                 * allocsa.valgrind: New file.
5124         2004-02-06  Bruno Haible  <bruno@clisp.org>
5125                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5126                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5127                 Reported by Christopher Seip <chris.seip@hp.com>.
5128
5129 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5130
5131         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5132         with errno == ERANGE if the buffer is too small.
5133         Problem reported by Mark D. Baushke.
5134
5135 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5136
5137         * xreadlink.c (MAXSIZE): New macro.
5138         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5139         size does not exceed MAXSIZE.  Avoid cast.
5140         As suggested by Mark D. Baushke in
5141         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5142         if readlink fails with buffer size just under MAXSIZE, try again
5143         with MAXSIZE.
5144
5145 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5146         and  Paul Eggert  <eggert@cs.ucla.edu>
5147
5148         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5149         (get_date): Overparenthesize to avoid GCC warning.
5150
5151 2004-11-02  Bruno Haible  <bruno@clisp.org>
5152
5153         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5154         function returns void.
5155
5156 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5157
5158         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5159         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5160         already declared.
5161
5162 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5163
5164         * getdate.y: Add support for TZ="foo" within a date string.
5165         Fix some bugs near time_t boundaries.  Reject dates with
5166         out-of-range components, e.g., "Sept 31".
5167         Include <stdlib.h>, "setenv.h", "xalloc.h".
5168         (ISDIGIT_LOCALE): Remove; unused.
5169         Note that the TZ and time functions used here are not reentrant.
5170         (mktime_ok, get_tz): New functions.
5171         (TZBUFSIZE): New constant.
5172         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5173         This requires that we sometimes generate our own TZ="XXX..." setting.
5174
5175 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5176
5177         * mktime.c (not_equal_tm): Remove redundant check.
5178
5179 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5180
5181         * getdate.y: Use Bison 1.875 features, and some minor
5182         code cleanups.  This change does not affect semantics.
5183         Don't include <stdlib.h>; no longer needed.
5184         Don't include unlocked-io.h; only the "#if TEST" code uses
5185         stdio, and performance isn't crucial there.
5186         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5187         Bison 1.875 features as described below.
5188         All uses of "PC." replaced by "pc->".
5189         (YYSTYPE): Add a forward declaration.
5190         (yylex, yyerror): Use full prototypes in forward decls.
5191         Use "%pure-parser" rather than obsolescent "%pure_parser".
5192         Use %parse-param and %lex-param instead of obsolescent
5193         YYPARSE_PARAM and YYLEX_PARAM.
5194         (meridian_table, month_and_day_table, time_units_table,
5195         relative_time_table, time_zone_table, military_table,
5196         lookup_zone, lookup_word, get_date):
5197         Use NULL instead of 0 where appropriate.
5198         (to_hour): Avoid abort (), to avoid a dependency on
5199         stdlib.h.
5200         (yyerror, yylex): Now accepts parser_control * arg.
5201         (main) [TEST]: Use '\0' rather than 0 for char.
5202
5203 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5204
5205         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5206         It's now the caller's responsibility to handle the case where
5207         !HAVE_GETPAGESIZE && !defined getpagesize.
5208
5209         * mktime.c (leapyear): Arg is long int, not int.
5210
5211 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5212
5213         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5214
5215 2004-10-12  Simon Josefsson  <jas@extundo.com>
5216
5217         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5218         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5219         to real functions.
5220
5221 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5222
5223         * vsnprintf.h: New file.
5224         * vsnprintf.c: New file.
5225
5226 2004-10-07  Bruno Haible  <bruno@clisp.org>
5227
5228         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5229         into the provided buffer.
5230
5231 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5232
5233         * diacrit.c, diacrit.h: Add GPL notice.
5234
5235         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5236         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5237         * logl.c (logl): Keep the code as similar to glibc as possible.
5238         This avoids a potential constant-folding bug.
5239
5240 2004-10-05  Bruno Haible  <bruno@clisp.org>
5241
5242         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5243
5244 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5245
5246         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5247         * xmalloc.c (xmemdup): Likewise.
5248         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5249         XFREE): Remove these long-obsolescent macros.
5250         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5251         * xstrdup.c: Remove.
5252
5253         * regex.c (re_comp): Cast gettext return value to char *,
5254         Problem reported by Martin Neitzel via Mark D. Baushke.
5255
5256 2004-10-04  Simon Josefsson  <jas@extundo.com>
5257
5258         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5259         '#ifdef USE_UNLOCKED_IO'.
5260
5261 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5262
5263         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5264         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5265         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5266         regex.c, sha1.c, version-etc.c, yesno.c:
5267         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5268         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5269         the includer's responsibility.
5270
5271         Sync from coreutils.
5272
5273         * modechange.c (mode_compile): Don't decrement a pointer that
5274         points to the start of a string, as the C Standard says the
5275         resulting behavior is undefined.
5276
5277         * backupfile.h (enum backuptype): Rename none -> no_backups,
5278         simple -> simple_backups, numbered_existing ->
5279         numbered_existing_backups, numbered -> numbered_backups
5280         to avoid shadowing problems.  All uses changed.
5281         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5282         * backupfile.c (check_extension, numbered_backup):
5283         Rename locals to avoid shadowing 'basename'.
5284         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5285         once.
5286
5287         * .cppi-disable: Add getopt_.h, getopt_int.h.
5288         * .cvsignore: Add getopt.h.
5289
5290 2004-10-04  Simon Josefsson  <jas@extundo.com>
5291
5292         * memmem.h: New file.
5293         * memmem.c: New file, taken from glibc.
5294
5295 2004-10-02  Jim Meyering  <jim@meyering.net>
5296
5297         * dirfd.h, getpagesize.h: Add copyright notice.
5298
5299 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5300
5301         * snprintf.c: Remove comments as to why each header is needed.
5302
5303 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5304
5305         * strsep.h: New file.
5306         * strsep.c: New file.
5307
5308 2004-10-01  Simon Josefsson  <jas@extundo.com>
5309
5310         * snprintf.c (snprintf): Handle size==0.
5311
5312 2004-10-01  Simon Josefsson  <jas@extundo.com>
5313             Bruno Haible  <bruno@clisp.org>
5314
5315         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5316         (snprintf): Declare 'args'.
5317
5318 2004-09-30  Simon Josefsson  <jas@extundo.com>
5319
5320         * snprintf.h, snprintf.c: New files.
5321
5322 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5323
5324         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5325         (hol_entry_help): Never translate an empty string.
5326         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5327         * argp.h (OPTION_NO_TRANS): New option.
5328
5329 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5330
5331         * xvasprintf.c: Include xalloc.h.
5332         (xvasprintf): Use xalloc_die, not xmalloc_die.
5333
5334 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5335
5336         * dummy.c: Change copyright notice to FSF, and license to GPL.
5337
5338 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5339
5340         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5341         Problem reported by Bruno Haible in:
5342         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5343
5344 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5345
5346         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5347         in case some system header has #define'd it.  Problem reported by
5348         Soeren D. Schulze in
5349         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5350
5351 2004-09-08  Bruno Haible  <bruno@clisp.org>
5352
5353         * stdint_.h: New file, taken from GNU clisp.
5354
5355 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5356
5357         * xvasprintf.h: New file.
5358         * xvasprintf.c: New file.
5359         * xasprintf.c: New file.
5360
5361 2004-09-08  Bruno Haible  <bruno@clisp.org>
5362
5363         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5364         is > INT_MAX.
5365         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5366
5367 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5368
5369         Import from coreutils.
5370         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5371         strings on unbounded length.  alloca's performance benefits aren't
5372         that important here.
5373         (V_STRDUP): Remove.
5374         (parse_with_separator): New function, with most of the internals
5375         of the old parse_user_spec.  Allow user to omit both user and group,
5376         for compatibility with FreeBSD.
5377         Clone only the user name, not the entire spec.
5378         Do not set *uid, *gid unless entirely successful.
5379         Avoid memory leak in some failing cases.
5380         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5381         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5382         (parse_user_spec): Rewrite to use parse_with_separator.
5383
5384 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5385
5386         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5387         its complicated substitute.
5388         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5389         and program_invocation_name.
5390         (__argp_basename) [!_LIBC]: Remove; the only use was
5391         replaced by its body.
5392         (__argp_short_program_name): Change condition from
5393         !defined __argp_short_program_name to
5394         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5395         to match argp-namefrob.h.
5396         (__argp_failure): Don't assume strerror_r returns char *.
5397         * argp-parse.c (N_): Define unconditionally.
5398         (argp_default_options): Fill out initializers with 0 to avoid
5399         gcc warnings.
5400
5401 2004-08-12  Simon Josefsson  <jas@extundo.com>
5402
5403         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5404         * getopt_.h: Renamed from getopt.h.
5405
5406 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5407
5408         Merge from coreutils.
5409
5410         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5411         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5412         for Reliant Unix 5.43.
5413
5414         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5415         (union fooround): Use uintmax_t, not long int.
5416         The rest is a merge from libc:
5417         [defined _LIBC]: Include <shlib-compat.h>.
5418         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5419
5420         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5421
5422         * strverscmp.c: Convert to UTF-8.
5423
5424 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5425
5426         * obstack.h (obstack_empty_p):
5427         Don't assume that chunk->contents is suitably aligned.
5428         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5429         Likewise. Problem reported by Benno in
5430         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5431
5432         * chown.c (rpl_chown): Work even if the file is writeable but not
5433         readable.  This could be improved further but it'd take some work.
5434
5435 2004-08-08  Simon Josefsson  <jas@extundo.com>
5436
5437         * xgethostname.c: Don't include error.h (not used).
5438
5439         * getpass.h: Add.
5440         * getpass.c: Include getpass.h first.
5441
5442 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5443
5444         * xalloc-die.c: New files.
5445         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5446         All uses removed.
5447         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5448         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5449         (_, N_, xalloc_die): Move to xalloc-die.c.
5450         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5451         so that we needn't mess with xalloc_msg_memory_exhausted.
5452
5453         * sha1.h: Renamed from sha.h.
5454         (SHA1_H): Renamed from _SHA_H.
5455         (sha1_ctx): Renamed from sha_ctx.
5456         (sha1_init_ctx): Renamed from sha_init_ctx.
5457         (sha1_process_block): Renamed from sha_process_block.
5458         (sha1_process_bytes): Renamed from sha_process_bytes.
5459         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5460         (sha1_read_ctx): Renamed from sha_read_ctx.
5461         (sha1_stream): Renamed from sha_stream.
5462         (sha1_buffer): Renamed from sha_buffer.
5463         * sha1.c: Likewise; renamed from sha.c.
5464         Do not include <sys/types.h>.
5465         Include <stddef.h> rather than <stdlib.h>.
5466
5467 2004-08-08  Bruno Haible  <bruno@clisp.org>
5468
5469         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5470         FILESYSTEM_PREFIX_LEN.
5471         * progreloc.c: Likewise.
5472         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5473
5474 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5475
5476         Merge from tar.
5477         * argp-help.c (make_hol, hol_append): Don't assume that
5478         SIZE_MAX is a valid preprocessor constant.
5479         (__argp_basename): Change from "#ifndef _LIBC"
5480         to "#ifndef __argp_short_program_name", so that
5481         we don't compile these functions for tar.
5482
5483         More merges from coreutils.
5484         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5485         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5486         yesno.h: New files.
5487         * addext.c: Remove; no longer needed.
5488         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5489         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5490         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5491         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5492         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5493         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5494         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5495         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5496         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5497         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5498         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5499         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5500         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5501         Import changes from coreutils.
5502
5503 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5504
5505         Merge from coreutils.
5506
5507         * .gdb-history: Remove; this doesn't belong here.
5508
5509         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5510         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5511         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5512
5513         * dirname.h: Include <stdbool.h>.
5514         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5515         for consistency with POSIX terminology.  All uses changed.
5516         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5517         (strip_trailing_slashes): Use bool for booleans.
5518         * stripslash.c (strip_trailing_slashes): Likewise.
5519
5520         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5521         sometimes returns a positive errno value even when it succeeds.
5522         (print_errno_message) [!LIBC]: Fall back on strerror if
5523         __strerror_r fails.
5524
5525         * path-concat.c (mempcpy): Don't define if a system header defines it.
5526         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5527         (longest_relative_suffix): New function.
5528         (path_concat): Use it.  Assume first argument is not NULL.
5529         Port to DOS.  Omit redundant separators.
5530         Report an error instead of returning NULL.
5531         Use mempcpy instead of memcpy.
5532         (xpath_concat): Remove: not declared or used.
5533
5534         * same.h: Include <stdbool.h>
5535         (same_name): Return bool, not int.
5536         * same.c (same_name): Likewise.
5537         (errno): Don't declare; we assume C89 or better now.
5538
5539         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5540         if not already defined.
5541
5542         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5543         * dup-safer.c (errno): Likewise.
5544
5545 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5546
5547         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5548         working.
5549
5550 2004-08-03  Simon Josefsson  <jas@extundo.com>
5551
5552         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5553         * progname.h: Don't include stdbool.h.
5554
5555 2004-08-02  Simon Josefsson  <jas@extundo.com>
5556
5557         * getsubopt.h: New file, with comments from Bruno Haible.
5558         * getsubopt.c: New file, from glibc, but slightly modified based on
5559         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5560
5561 2004-08-01  Simon Josefsson  <jas@extundo.com>
5562
5563         * xgetdomainname.c: Include stdlib.h, for free().
5564
5565 2004-07-16  Simon Josefsson  <jas@extundo.com>
5566
5567         * dummy.c: New file.
5568
5569 2004-07-16  Bruno Haible  <bruno@clisp.org>
5570
5571         * backupfile.h: Add extern "C" for C++.
5572         * closeout.h: Likewise.
5573         * copy-file.h: Likewise.
5574         * findprog.h: Likewise.
5575         * full-write.h: Likewise.
5576         * pathname.h: Likewise.
5577         * progname.h: Likewise.
5578         * stpcpy.h: Likewise.
5579         * stpncpy.h: Likewise.
5580         * strcase.h: Likewise.
5581         * strstr.h: Likewise.
5582         * xalloc.h: Likewise.
5583
5584         * mbswidth.h: Add extern "C" for C++.
5585         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5586
5587 2004-07-09  Simon Josefsson  <jas@extundo.com>
5588
5589         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5590         failed without this.)
5591
5592 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5593
5594         * fchown-stub.c: New file.
5595
5596 2004-06-24  Jim Meyering  <jim@meyering.net>
5597
5598         * obstack.h (obstack_base): Cast to (void *), per documentation.
5599
5600 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5601
5602         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5603
5604 2004-06-01  Jim Meyering  <jim@meyering.net>
5605
5606         * calloc.c: New file.
5607
5608 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5609
5610         * getdate.y (yylex): Allow space between sign and number.
5611         Problem reported by Dan Jacobson.
5612
5613 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5614         and  Jim Meyering  <jim@meyering.net>
5615
5616         Merge from coreutils CVS.
5617
5618         * stat-macros.h: New file, with contents from file-type.h
5619         and coreutils' system.h.
5620         * file-type.c: Include "stat-macros.h".
5621         * file-type.h (file_type): Move all macro definitions to new file,
5622         stat-macros.h.
5623
5624         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5625         Wrap old code with this conditional.
5626         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5627         function that does not dereference symlinks.
5628         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5629
5630         * xreadlink.c: Include xreadlink.h first, to catch .h file
5631         dependency problems.
5632         (xreadlink): Accept new arg SIZE, for efficiency.
5633         All decls and uses changed.
5634         * xreadlink.h: Include <stddef.h>, for size_t.
5635
5636         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5637         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5638
5639         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5640
5641 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5642
5643         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5644         macros to be defined.
5645         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5646         the allocator returns NULL because the requested size is zero.
5647
5648 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5649
5650         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5651         var.  Add comment explaining why libc still defines it.  This
5652         merges the following patch from glibc:
5653         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5654
5655 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5656
5657         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5658         present in glibc since revision 1.1 of this file.
5659         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5660         obstack_alignment_mask, obstack_alloc, obstack_base,
5661         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5662         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5663         obstack_grow0, obstack_init, obstack_int_grow,
5664         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5665         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5666         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5667         nonexistent functions.
5668
5669 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5670             Paul Eggert  <eggert@cs.ucla.edu>
5671
5672         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5673
5674 2004-05-14  Bruno Haible  <bruno@clisp.org>
5675
5676         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5677         that consists of a '.' followed by an empty digit string.
5678         Patch by Tor Lillqvist <tml@iki.fi>.
5679
5680 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5681
5682         Port obstack to the AS/400, where pointers are 16 bytes wide and
5683         you cannot cast an integer to a valid pointer.  This patch is
5684         currently waiting to be integrated into glibc; see
5685         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5686
5687         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5688         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5689         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5690         (struct obstack): temp member is now a union of a pointer and
5691         an integer, instead of an integer.  All integer uses changed.
5692         This does not affect the physical layout of struct obstack,
5693         except on hosts (like the AS/400) where the size or alignment of
5694         void * is greater than that of ptrdiff_t.
5695         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5696         __STDC__)]: Store temporary in pointer member of union, not
5697         integer member.
5698         * obstack.c: Include <stddef.h>, for offsetof.
5699         (struct fooalign): Remove; it doesn't need a name.
5700         (union fooround): Change double to long double, and add void *.
5701         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5702         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5703         not a macro.  Hence the values are always int; so remove all
5704         casts-to-int in uses.
5705
5706 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5707             Derek Price  <derek@ximbiot.com>
5708
5709         * alloca.c: Include <alloca.h>, to get our interface.
5710         * alloca_.h: Use __alloca on AIX, so that we don't have to
5711         include <alloca.h> first.  Use C89 prototype for alloca; this
5712         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5713         Use #elif for simplicity, since we can assume C89 now.
5714         Don't try to source the system alloca.h since it will not be found
5715         and to prevent recursively including its replacement.
5716         * fnmatch.c: Include <alloca.h> instead of opencoding.
5717         * regex.c: Likewise.
5718
5719 2004-05-16  Derek Price  <derek@ximbiot.com>
5720             Paul Eggert  <eggert@cs.ucla.edu>
5721
5722         getline cleanup.  This changes the getndelim2 API: both order of
5723         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5724         no delimiter).
5725
5726         * getline.c: Don't include stddef.h or stdio.h, since our
5727         interface does that.
5728         (getline): Always use getdelim, so that we don't have two
5729         copies of this code.
5730         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5731         if available.
5732         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5733         (GETNDELIM2_MAXIMUM): New macro.
5734         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5735         instead of the old practice of delim2==0.  All callers changed.
5736         Return -1 on overflow, instead of returning junk.
5737         Do not set *linesize unless allocation succeeds.
5738         * getndelim2.h: Do not include stddef.h; no longer needed, now
5739         that we include sys/types.h.
5740         * getnline.h: Likewise.
5741         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5742         (getndelim2): Reorder arguments.
5743         * getnline.c (getnline, getndelim):
5744         Don't discard the NMAX argument.
5745         (getnline): Invoke getndelim, to avoid code duplication.
5746         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5747         of (size_t) -1 by callers of the getnline family.
5748
5749 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5750
5751         * nanosleep.c (suspended): Change its type from int to
5752         sig_atomic_t volatile.
5753         (first_call): Make it private to rpl_nanosleep, and have it
5754         be zero initially as that's a bit faster.
5755         (my_usleep): Round up fractional times instead of truncating them,
5756         as this is the usual meaning for 'sleep'.
5757
5758         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5759         doesn't work.
5760         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5761         (ENOSYS): Define if not defined.
5762         (settime): Fall back on stime if it exists and settimeofday fails.
5763         But don't bother with fallbacks if a method fails with errno == EPERM.
5764
5765 2004-05-11  Jim Meyering  <jim@meyering.net>
5766
5767         Prior to this change, the save_cwd caller required read access to the
5768         current directory on most systems (ones with the fchdir function).
5769
5770         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5771         fails, try write-only, and finally, resort to using xgetcwd.
5772
5773 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5774
5775         * obstack.c, obstack.h: Import changes from libc.
5776
5777 2004-04-28  Bruno Haible  <bruno@clisp.org>
5778
5779         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5780         implicitly appends .exe to executables.
5781         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5782         accepts Windows pathnames.
5783         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5784         Cygwin like Windows, since it now accepts Windows pathnames.
5785         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5786         Cygwin like Windows, since it now accepts Windows pathnames.
5787         Reported by Derek Robert Price <derek@ximbiot.com>.
5788
5789 2004-04-20  Jim Meyering  <jim@meyering.net>
5790
5791         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5792
5793 2004-04-20  Jim Meyering  <jim@meyering.net>
5794             Bruno Haible  <bruno@clisp.org>
5795
5796         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5797         memory when realloc fails.
5798
5799 2004-04-18  Jim Meyering  <jim@meyering.net>
5800
5801         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5802         don't leak memory and do call END_UTMP_ENT.
5803
5804 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5805
5806         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5807         (CHAR_BIT): Remove, since we assume C89.
5808         Include <stdint.h> if available, as per current Autoconf CVS advice.
5809
5810 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5811
5812         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5813         not bool, to be more consistent with Unix conventions.
5814         Suggested by Bruno Haible.
5815
5816         Merge from coreutils.
5817
5818         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5819         New files.
5820
5821         * getdate.h: Include stdbool.h, and timespec.h instead of
5822         the usual <time.h> dance.
5823         (get_date): Change signature to support fractional time stamps.
5824         All callers changed.
5825         * getdate.y: Include "getdate.h" first, as we can now
5826         assume C89 and don't need to worry about 'const'.
5827         Similarly, include "unlocked-io.h" near start, not in middle.
5828         Include <limits.h>.
5829         (textint.value): Use long int rather than int.
5830         (textint.digits): Use size_t rather than int.
5831         (BILLION, LOG10_BILLION): New constants.
5832         (parser_control): New member rel_ns.  Members day_ordinal,
5833         time_zone, month, day, hour, minutes, rel_year, rel_month,
5834         rel_day, rel_hour, rel_minutes, rel_seconds
5835         are now long int, not int.  Member seconds is now struct timespec,
5836         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5837         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5838         not int.
5839         (%union.intval): Now long int, not int.
5840         New member timespec.
5841         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5842         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5843         (spec): Now is a timespec or an item list.
5844         (timespec, items): New nonterminals.
5845         (time, rel, relunit, number, get_date):
5846         Add support for fractional seconds.
5847         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5848         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5849         (to_hour): First arg is now long int, not int.
5850         (to_year): Returns long int, not int.
5851         Don't treat year -70 like 70.
5852         (tm_diff): Returns long int, not int.
5853         (lookup_word): Use bool instead of int when appropriate.
5854         (yylex): Use size_t for count, not int.
5855         Detect overflow when parsing large integer constants.
5856         Add support for fractions.
5857         (get_date): Make pointers 'const' if possible.
5858         Use more-portable code to detect integer overflow.
5859         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5860         Don't use ctime; it's not reliable if the year has >4 digits.
5861
5862         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5863         This is for compatibility with BSD.
5864
5865         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5866         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5867         From coreutils' system.h.
5868
5869         * userspec.c: Don't include "posixver.h".
5870         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5871         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5872         compatible extension.  Simplify code by removing a boolean int
5873         that was always nonzero if a string was nonnull.
5874
5875 2004-03-30  Jim Meyering  <jim@meyering.net>
5876
5877         Merge from coreutils.
5878
5879         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5880
5881         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5882         an empty input stream.
5883
5884         * readtokens.c: Include <stdbool.h>.
5885         (readtoken): Use `size_t' rather than int/long.
5886         All callers adjusted.
5887         Use `bool' rather than `int' where appropriate.
5888         Use memset rather than an explicit loop.
5889         Use x2nrealloc rather than xrealloc.
5890         Allow the use of `\0' as a delimiter.
5891         (readtokens): Likewise.
5892         * readtokens.h (readtoken, readtokens): Update prototypes.
5893
5894 2004-03-30  Bruno Haible  <bruno@clisp.org>
5895
5896         * getloadavg.c (getloadavg): Don't assume setlocale returns
5897         nonnull.
5898
5899 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5900
5901         Merge changes to getloadavg.c from coreutils and Emacs.
5902
5903         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5904         Define to an expression, not to the empty string.
5905         Include cloexec.h and xalloc.h.
5906         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5907         Use set_cloexec_flag rather than rolling our own.
5908         * cloexec.c, cloexec.h: New files.
5909
5910 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5911
5912         * getopt.h: Sync with libc CVS.
5913
5914 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5915             Bruno Haible  <bruno@clisp.org>
5916
5917         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5918         not on all platforms that have <wchar.h>.
5919         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5920
5921 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5922
5923         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5924         Sync with libc CVS.
5925         * getopt_int.h: New file, also synced from libc.
5926
5927 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5928
5929         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5930         '#if' expressions.  Unlike the code it replaces, it does not
5931         depend on (defined _SC_PAGESIZE).  However, it does depend on
5932         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5933         first reported by Jason Andrade in
5934         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5935
5936 2004-01-18  Simon Josefsson  <jas@extundo.com>
5937
5938         * strdup.h: New file.
5939         * strdup.c: Include it.
5940         * path-concat.c: Include strdup.h. Drop strdup declaration.
5941         * userspec.c: Include strdup.h. Drop strdup declaration.
5942
5943 2004-02-06  Karl Berry  <karl@gnu.org>
5944
5945         * config.charset: update from gettext 0.14.1.
5946
5947 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5948
5949         Add comments and code, prompted by suggestions from Bruno Haible
5950         for sh-quote.
5951         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5952         describing the enum quoting_style values.
5953         * quotearg.c (quotearg_alloc): New function.
5954         (quotearg_buffer_restyled): Treat lone { and } as special.
5955         Treat = as special.  Work around bug with older shells
5956         that "see" a '\' that is really the 2nd byte of a multibyte char.
5957         Quote empty string with shell_quoting_style.
5958
5959 2004-02-03  Bruno Haible  <bruno@clisp.org>
5960
5961         * pipe.h: New file, from GNU gettext.
5962         * pipe.c: New file, from GNU gettext.
5963
5964 2004-01-27  Bruno Haible  <bruno@clisp.org>
5965
5966         * execute.h: New file, from GNU gettext.
5967         * execute.c: New file, from GNU gettext.
5968         * w32spawn.h: New file, from GNU gettext.
5969
5970 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5971
5972         Exit-status fix from coreutils.
5973
5974         Use exit_failure consistently in place of EXIT_FAILURE,
5975         so that program exit statuses are consistent on failure.
5976
5977         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5978         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5979         * argmatch.h: Comment fix to match the above.
5980         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5981         Now a macro referring to exit_failure, instead of a separate
5982         variable.  Include "exitfail.h" to get it.
5983         * xstrtol.h: Include "exitfail.h".
5984         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5985
5986         * long-options.c (parse_long_options): Use prototype
5987         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5988         for clarity.
5989
5990 2004-01-21  Jim Meyering  <jim@meyering.net>
5991
5992         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5993         so as not to conflict with a different-sized __mktime_internal
5994         function in GNU libc.
5995         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5996         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5997
5998 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5999
6000         Merge from diffutils.
6001
6002         * file-type.c (file_type): Add typed memory objects.
6003         * file-type.h (S_TYPEISTMO): New macro.
6004
6005         * c-stack.h (c_stack_action): Remove argv argument.
6006         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6007         (die): Don't calculate message unless segv_action returns.
6008         (get_stack_location, min_address_from_argv, max_address_from_argv,
6009         volatile stack_base, volatile_stack_size): Remove.
6010         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6011         that every segmentation violation is a stack overflow.  (Ouch!)
6012         See Debian bug 136249 (still outstanding) for more info about why
6013         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6014
6015 2003-11-30  Bruno Haible  <bruno@clisp.org>
6016
6017         Safer stack allocation.
6018         * setenv.c: Include allocsa.h.
6019         (alloca): Remove fallback definition.
6020         (freea): Remove macro.
6021         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6022         instead of freea.
6023
6024 2003-10-17  Bruno Haible  <bruno@clisp.org>
6025
6026         * binary-io.h: Avoid warnings on Cygwin.
6027
6028 2003-12-28  Bruno Haible  <bruno@clisp.org>
6029
6030         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6031         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6032
6033 2003-11-28  Bruno Haible  <bruno@clisp.org>
6034
6035         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6036
6037 2003-11-27  Bruno Haible  <bruno@clisp.org>
6038
6039         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6040
6041 2003-11-17  Bruno Haible  <bruno@clisp.org>
6042
6043         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6044
6045 2003-11-24  Bruno Haible  <bruno@clisp.org>
6046
6047         * xallocsa.h: New file, from GNU gettext.
6048         * xallocsa.c: New file, from GNU gettext.
6049
6050 2003-11-24  Bruno Haible  <bruno@clisp.org>
6051
6052         * allocsa.h: New file, from GNU gettext.
6053         * allocsa.c: New file, from GNU gettext.
6054
6055 2003-11-24  Bruno Haible  <bruno@clisp.org>
6056
6057         * eealloc.h: New file.
6058
6059 2004-01-15  Jim Meyering  <jim@meyering.net>
6060
6061         Merge from coreutils.
6062
6063         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6064         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6065         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6066
6067         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6068         optional configure-time default.
6069
6070         * version-etc.c (version_etc_copyright): Update copyright date.
6071
6072         * xreadlink.c (xreadlink): Correct outdated comment.
6073
6074 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6075
6076         Merge from coreutils.
6077
6078         * posixver.c: Include posixver.h.
6079
6080         * same.c: Include <stdbool.h>, <limits.h>.
6081         (_POSIX_NAME_MAX): Define if not defined.
6082         (MIN): New macro.
6083         (same_name): If file names are silently truncated, report
6084         that the file names are the same if they are the same after
6085         the silent truncation.
6086
6087         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6088         conversion function.
6089         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6090         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6091         longer needed.
6092
6093 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6094
6095         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6096         with like-named macro in fnmatch.c.
6097         (EXT): Use an internal constant instead.
6098
6099         Merge fnmatch patches from glibc.
6100         * fnmatch.c (mbsinit): Remove define.
6101         Add libc_hidden_ver (__fnmatch, fnmatch).
6102         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6103         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6104
6105 2003-12-14  Karl Berry  <karl@gnu.org>
6106
6107         * config.charset: update from gettext-runtime.
6108
6109 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6110
6111         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6112         Bug reported by Alfred M. Szmidt.
6113
6114 2003-11-29  Karl Berry  <karl@gnu.org>
6115
6116         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6117
6118 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6119             Bruno Haible  <bruno@clisp.org>
6120
6121         * printf-parse.h: Don't include sys/types.h.
6122         (ARG_NONE): New macro.
6123         (char_directive): Change type of *arg_index fields to size_t.
6124         * printf-parse.c: Don't include sys/types.h.
6125         (SSIZE_MAX): Remove macro.
6126         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6127         Remove unnecessary overflow check.
6128         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6129         fields.
6130
6131 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6132
6133         * alloca.c: Remove dependency on xalloc module.
6134         (xalloc_die): Remove.
6135         (memory_full) [!defined emacs]: New macro.
6136         [!defined emacs]: Don't include xalloc.h.
6137         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6138         address arithmetic overflows.  Change datatypes a bit to avoid
6139         unnecessary casts.
6140
6141 2003-11-22  Jim Meyering  <jim@meyering.net>
6142
6143         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6144
6145 2003-11-17  Bruno Haible  <bruno@clisp.org>
6146
6147         * vasnprintf.c (alloca): Remove fallback definition.
6148         (freea): Remove definition.
6149         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6150         Reported by Paul Eggert.
6151
6152 2003-11-17  Jim Meyering  <jim@meyering.net>
6153
6154         On systems without utime and without a utimes function capable of
6155         dealing with a NULL struct utimbuf* argument, this utime replacement
6156         could -- in unusual circumstances -- leak a file descriptor.
6157         * utime.c: Include <unistd.h> and <errno.h>.
6158         (utime_null): Be sure to close `fd' and to preserve errno.
6159         Reported by Geoff Collyer via Arnold Robbins.
6160
6161 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6162             Bruno Haible  <bruno@clisp.org>
6163
6164         Protect against address arithmetic overflow.
6165         * printf-args.h: Include stddef.h.
6166         (arguments): Change type of field 'count' to size_t.
6167         * printf-args.c (printf_fetchargs): Use size_t instead of
6168         'unsigned int' where appropriate.
6169         * printf-parse.h: Include sys/types.h.
6170         (char_directive): Change type of *arg_index fields to ssize_t.
6171         (char_directives): Change type of fields 'count', max_*_length to
6172         size_t.
6173         * printf-parse.c: Include sys/types.h and xsize.h.
6174         (SSIZE_MAX): Define fallback value.
6175         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6176         instead of 'int' where appropriate. Check a_allocated, d_allocated
6177         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6178         * vasnprintf.c: Include xsize.h.
6179         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6180         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6181         overflow. Avoid wraparound when converting a width or precision from
6182         decimal to binary.
6183
6184 2003-11-16  Bruno Haible  <bruno@clisp.org>
6185
6186         Update from GNU gettext.
6187         * printf-parse.c: Generalize to it can be compiled for wide strings.
6188         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6189         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6190         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6191         SNPRINTF): New macros.
6192         Don't include <alloca.h> if the file is used inside libintl.
6193         (local_wcslen): New function, for Solaris 2.5.1.
6194         (VASNPRINTF): Use it instead of wcslen.
6195
6196 2003-11-16  Bruno Haible  <bruno@clisp.org>
6197
6198         * xsize.h (xmax): New function.
6199         (xsum, xsum3, xsum4): Declare as "pure" functions.
6200
6201 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6202
6203         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6204         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6205         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6206         heuristic is just as accurate as far as we know, and it removes a
6207         dependency on size_max.m4 and ptrdiff_max.m4.
6208
6209 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6210
6211         * xstrtol.c (__xstrtol): Remove "break" immediately after
6212         "return", to pacify some unknown compiler.  Problem reported
6213         by Joerg Schilling.
6214
6215 2003-11-11  Bruno Haible  <bruno@clisp.org>
6216
6217         * xsize.h (SIZE_MAX): Remove fallback definition.
6218         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6219         defined.
6220
6221 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6222
6223         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6224         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6225         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6226         From Bruno Haible.
6227         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6228         not (size_t) -1, since it's defined here.
6229
6230 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6231
6232         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6233         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6234         Reject sizes of exactly SIZE_MAX bytes.
6235         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6236         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6237
6238 2003-11-05  Bruno Haible  <bruno@clisp.org>
6239
6240         * xsize.h: Include limits.h, to avoid a possible collision with
6241         SIZE_MAX defined in <limits.h> on Solaris.
6242
6243 2003-11-04  Bruno Haible  <bruno@clisp.org>
6244
6245         * xsize.h: New file.
6246         * linebreak.c: Include xsize.h.
6247         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6248         argument for overflow.
6249         Suggested by Paul Eggert.
6250
6251 2003-10-31  Bruno Haible  <bruno@clisp.org>
6252
6253         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6254         to avoid (extremely rare) race condition.
6255         Suggested by Paul Eggert.
6256
6257 2003-11-03  Jim Meyering  <jim@meyering.net>
6258
6259         * userspec.c: Include "userspec.h".
6260         * userspec.h: New file.
6261
6262 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6263
6264         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6265         * mountlist.c (SIZE_MAX): Define if not defined already.
6266         (read_filesystem_list): Set and use me_type_malloced.
6267         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6268         whatever the type happens to be), for brevity and consistency.
6269         Check for size calculation overflow on Alphas running OSF/1.
6270
6271 2003-10-31  Jim Meyering  <jim@meyering.net>
6272
6273         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6274
6275         * linebuffer.c: Include <string.h> for declaration of memset.
6276
6277 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6278             Bruno Haible  <bruno@clisp.org>
6279
6280         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6281         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6282
6283 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6284
6285         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6286         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6287         no longer needed.
6288         * quotearg.c (quotearg_n_options): Use it.
6289         * group-member.c: Include <stdbool.h>.
6290         (free_group_info): Arg is now const *; don't free arg.
6291         (get_group_info): Now returns bool and accepts struct group_info *,
6292         rather than returning a malloc'ed struct group_info *.
6293         All uses changed.  Check for overflow in internal size calculation.
6294
6295         * getusershell.c (readname): Simplify the code by using x2nrealloc
6296         rather than xmalloc/xrealloc.
6297         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6298         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6299         conformance bug: the old code used a pointer after freeing the
6300         storage that it addressed.
6301         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6302         rather than doing it by hand.
6303         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6304         the buffer preserved.  Use free and xmalloc instead.
6305         * quotearg.c (quotearg_n_options): Likewise.
6306         Use a simpler test for size overflow.  Don't use xalloc_oversized
6307         because unsigned int might be wider than size_t (!); this suggests
6308         that we should switch from unsigned int to size_t for slot numbers.
6309
6310 2003-10-27  Bruno Haible  <bruno@clisp.org>
6311
6312         * stdbool_.h: Better support for BeOS.
6313
6314 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6315
6316         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6317         to allocate the returned structure.  Do not allocate a subarray,
6318         as x2nrealloc will do that.
6319         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6320         instead of xnrealloc.
6321         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6322
6323 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6324
6325         * xalloc.h (xalloc_oversized): New static inline function, for
6326         callers that want to do their own size-overflow checking.  Include
6327         <stdbool.h>, since xalloc_oversized returns bool.
6328         * xalloc.c (array_size_overflow): Remove.  All callers changed
6329         to use xalloc_oversized.
6330
6331         Add two functions x2realloc, x2nrealloc, for programs that grow
6332         arrays dynamically by doubling their sizes.
6333         * xalloc.h (x2realloc, x2nrealloc): New decls.
6334         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6335         New functions.
6336
6337         Port to C99 semantics for 'inline' of external functions.
6338         Bug reported by Bruno Haible.
6339         * xmalloc.c (xnmalloc_inline): New static inline function,
6340         with the old contents of xnmalloc.
6341         (xnmalloc, xmalloc): Use it.
6342         (xnrealloc_inline): New static inline function,
6343         with the old contents of xnrealloc.
6344         (xnrealloc, xrealloc): Use it.
6345
6346         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6347
6348 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6349
6350         Fix several address-calculation bugs in the hash modules,
6351         plus some minor code cleanup.
6352
6353         * hash.h: Include <stdbool.h>, for bool.
6354         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6355         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6356         hash_get_n_entries, hash_get_max_bucket_length,
6357         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6358         hash_rehash): Use size_t rather than unsigned.
6359         * hash.c (struct hash_table, hash_get_n_buckets,
6360         hash_get_n_buckets_used, hash_get_n_entries,
6361         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6362         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6363         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6364         Likewise.
6365         (SIZE_MAX): Define if not defined.
6366         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6367         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6368         hash_print):
6369         Use const * when possible.
6370         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6371         (check_tuning): Fix bug: if tuning parameters were very close to
6372         0 or 1, rounding errors could have caused subscript violations.
6373         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6374         (hash_initialize): Add 'fail:' label
6375         to free table and return NULL, and use it to simplify code.
6376         Use calloc rather than clearing the storage ourself.
6377         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6378         buffer size calculations.
6379         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6380         Include <stddef.h>, for size_t.
6381         * hash-pjw.c (hash_pjw): Likewise.
6382         Switch to method described by Bruno Haible.
6383         Include <limits.h>, for CHAR_BIT.
6384         (SIZE_BITS): New macro.
6385
6386 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6387
6388         * getndelim2.c (getndelim2): When size calculation overflows,
6389         ceiling the allocation at NMAX bytes rather than silently
6390         discarding input bytes before NMAX is reached.  This makes
6391         a difference only if NMAX exceeds SIZE_MAX / 2.
6392
6393         * obstack.c: Merge from glibc.
6394         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6395         Add libc_hidden_def (_obstack_newchunk).
6396         (_obstack_free) [! defined _LIBC]: Remove.
6397         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6398         a clone of the function body.
6399         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6400         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6401
6402         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6403         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6404         arg to memcpy.
6405
6406         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6407         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6408         Don't use lvalue casts, as GCC plans to remove support for them
6409         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6410         was also present in the non-GCC version, indicating that this
6411         code had always been buggy and had never been widely used.
6412         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6413         Use the fast variant of each macro, rather than copying the
6414         definiens of the fast variant; that way, we'll be more likely to
6415         catch future bugs in the fast variants.
6416
6417 2003-10-20  Bruno Haible  <bruno@clisp.org>
6418
6419         * wait-process.h: New file, from GNU gettext.
6420         * wait-process.c: New file, from GNU gettext.
6421
6422 2003-10-19  Jim Meyering  <jim@meyering.net>
6423
6424         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6425
6426 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6427
6428         * getgroups.c: Include <errno.h>, <stdlib.h>.
6429         (getgroups): First arg is int, not size_t.
6430         Don't let 'free' mangle errno.
6431
6432 2003-10-16  Jim Meyering  <jim@meyering.net>
6433
6434         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6435
6436 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6437
6438         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6439         (SIZE_MAX): Remove.
6440         (new_exclude, add_exclude_file): Initial size no longer needs to
6441         be a power of 2.
6442         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6443         our own address arithmetic overflow checking.
6444
6445         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6446         (fnmatch): Do not alloca more than 2000 wide characters;
6447         instead, use malloc for large buffers.
6448         Check for address arithmetic overflow, and return -1
6449         with errno set to ENOMEM in that case.
6450         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6451         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6452         instead, return -1.  Check for address arithmetic overflow.
6453
6454 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6455
6456         Handle invalid suffixes and overflow independently, so that
6457         callers can treat them independently as needed.  Fix some bugs in
6458         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6459         suffix for a human-readable blocksize.  The major caller-visible
6460         change is the addition of a new
6461         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6462         that both overflow and suffix chars were found.
6463
6464         * human.c (humblock): Don't check separately for invalid suffix
6465         char; that is xstrtoumax's job (now that its bug is fixed).
6466         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6467         INTMAX_MAX]: New macros.
6468         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6469         TYPE_MAXIMUM): New macros.
6470         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6471         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6472         if overflow occurs, as it's what __strtol does and it's more useful
6473         in practice.
6474         (__xstrtol): If __strtol reports some error other than ERANGE,
6475         reflect it to the caller as LONGINT_INVALID.  If it reports
6476         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6477         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6478         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6479         value.
6480         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6481         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6482         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6483         [defined UINTMAX_MAX]: New macros.
6484
6485 2003-10-14  Bruno Haible  <bruno@clisp.org>
6486
6487         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6488         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6489         Also use volatile where needed.
6490
6491 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6492
6493         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6494         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6495         and define in terms of the other primitives.
6496         * xmalloc.c: Include stdbool.h; do not include exit.h.
6497         (SIZE_MAX): Define if not already defined.
6498         (array_size_overflow): New function.
6499         (xalloc_die): Abort instead of exiting if 'error' returns.
6500         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6501         (xmalloc, xrealloc): Use them.
6502         (xcalloc): Check for address arithmetic overflow.
6503         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6504         a bit faster than strcpy.
6505
6506 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6507
6508         Merge getpass from libc, plus a few fixes.
6509
6510         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6511         Include <stdbool.h>.
6512         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6513         __fsetlocking to empty.
6514         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6515         do include <bits/libc-lock.h>.
6516         Do not include <fcntl.h>; not needed.
6517         [_LIBC]: Include <wchar.h>.
6518         (NOTCANCEL_MODE): New macro.
6519         (flockfile, funlockfile) [_LIBC]: New macros.
6520         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6521         [!_LIBC]: New macros.
6522         (call_fclose): New function.
6523         (getpass): Use it.  Save tty stream separately; this simplifies the
6524         code and makes it more reliable if stdin happens to equal stdout.
6525         Invoke __fsetlocking on tty.
6526         Handle thread cancellation if needed.
6527         Namespace cleanup (use __tcgetattr, __getline).
6528         Use bool for Booleans.
6529         [USE_IN_LIBIO]: Handle wide streams.
6530         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6531         stream might go where.
6532
6533         * unlocked-io.h: Include <stdio.h>, so that the caller
6534         doesn't have to include <stdio.h> before us.
6535         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6536         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6537         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6538         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6539         if not declared, so that we can use getpass.c code from libc without
6540         rewriting it.
6541         (flockfile, ftrylockfile, funlockfile): New macros.
6542
6543 2003-10-06  Bruno Haible  <bruno@clisp.org>
6544
6545         * version-etc-2.h: Remove file.
6546         * version-etc-2.c: Remove file.
6547
6548 2003-09-25  Jim Meyering  <jim@meyering.net>
6549             Bruno Haible  <bruno@clisp.org>
6550
6551         This lets translators provide better translations for the
6552         "Written by ..." part of --version output.
6553         * version-etc.h: Include stdarg.h.
6554         (version_etc_copyright): Declare as readonly.
6555         (version_etc): Make this function variadic with a NULL-terminated list
6556         of author name strings.
6557         (version_etc_va): New declaration.
6558         * version-etc.c: Include stdarg.h, stdlib.h.
6559         (version_etc_copyright): Declare as readonly.
6560         (version_etc_va): New function. Provide a different translatable string
6561         for each possible number of authors < 10. Abbreviate when there are 10
6562         authors or more.
6563         (version_etc): Make this function variadic. Call version_etc_va.
6564         Suggestion from Gary V. Vaughan.
6565
6566         * long-options.h (parse_long_options): Change prototype: the authors
6567         string is moved to the end and becomes variadic.
6568         * long-options.c: Include stdarg.h.
6569         (parse_long_options): Make this function variadic, too.
6570         Call version_etc_va, not version_etc.
6571
6572 2003-10-06  Bruno Haible  <bruno@clisp.org>
6573
6574         * fatal-signal.h: New file, from GNU gettext.
6575         * fatal-signal.c: New file, from GNU gettext.
6576
6577 2003-10-04  Karl Berry  <karl@gnu.org>
6578
6579         * argp*: update from libc.
6580
6581 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6582
6583         * getpass.c (getpass): Use a no-op fseek when switching from input to
6584         output mode on the same stream.
6585
6586 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6587
6588         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6589         Fix arg typo in previous patch.
6590
6591 2003-09-28  Jim Meyering  <jim@meyering.net>
6592
6593         * error.c: Correct cpp indentation.
6594
6595 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6596
6597         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6598         Omit the special code that used __typeof__, since we worry that
6599         it could be more trouble than it's worth.  See:
6600         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6601         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6602
6603         * free.c: New file.
6604
6605 2003-09-26  Jim Meyering  <jim@meyering.net>
6606
6607         * error.c (error_tail): Move some declarations
6608         into inner scope where the local variables are used.
6609
6610 2003-09-26  Bruno Haible  <bruno@clisp.org>
6611
6612         * stpncpy.h (gnu_stpncpy): New declaration.
6613         (stpncpy): Define as alias for gnu_stpncpy.
6614         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6615
6616 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6617
6618         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6619         (error_tail): Do not loop, reallocating temporary buffer, since
6620         the output cannot contain more wide characters than the input
6621         contains bytes, the size must be big enough already.  This avoids
6622         one potential size overflow calculation.  Check for size overflow
6623         when calculating temporary buffer size.  Free temporary buffer
6624         when done, if it was allocated with malloc; this plugs a memory
6625         leak.  Remove casts from void * to pointers, that are no longer
6626         needed now that we're assuming C89 or better.
6627
6628         Merge error changes from glibc.
6629
6630         * error.c, error.h: Update copyright notice header to match glibc.
6631         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6632         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6633         Disable cancellation while printing error.
6634         * error.h: Prepend __ to parameter names.
6635
6636 2003-09-25  Karl Berry  <karl@gnu.org>
6637
6638         * argp-fmtstream.c, argp-help.c: update from libc.
6639
6640 2003-09-25  Bruno Haible  <bruno@clisp.org>
6641
6642         * version-etc-2.h: New file, from version-etc.h with modifications.
6643         * version-etc-2.c: New file, from version-etc.c with modifications.
6644
6645 2003-09-25  Simon Josefsson  <jas@extundo.com>
6646
6647         * xgetdomainname.h: New file.
6648         * xgetdomainname.c: New file.
6649
6650 2003-09-25  Simon Josefsson  <jas@extundo.com>
6651             Bruno Haible  <bruno@clisp.org>
6652
6653         * getdomainname.h: New file.
6654         * getdomainname.c: New file.
6655
6656 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6657
6658         * linebuffer.c (freebuffer): Don't free the argument, just
6659         the buffer associated with the argument.  Bug reported by
6660         Simon Josefsson.
6661
6662 2003-09-19  Karl Berry  <karl@gnu.org>
6663
6664         * argp.h: update from libc.
6665
6666 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6667
6668         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6669         input error, instead of returning NULL the next time we are called
6670         (and therefore losing track of errno).
6671
6672 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6673
6674         * getndelim2.c (getndelim2): Don't trash errno when a read
6675         fails, so that the caller gets the proper errno.
6676
6677         * readutmp.c (read_utmp): Likewise.
6678         Check for fstat error.  Close stream and free storage
6679         when failing.
6680
6681 2003-09-14  Bruno Haible  <bruno@clisp.org>
6682
6683         * fwriteerror.h: New file.
6684         * fwriteerror.c: New file.
6685
6686 2003-09-14  Jim Meyering  <jim@meyering.net>
6687
6688         * getloadavg.c: Correct cpp indentation.
6689         * strdup.c: Likewise.
6690         * vasnprintf.c: Likewise.
6691
6692 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6693
6694         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6695         * obstack.c [!defined _LIBC]: Likewise.
6696         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6697         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6698         * exitfail.c: Don't include stdlib.h; no longer needed.
6699
6700         More changes to assume C89 or better.
6701
6702         * error.c (error_tail): Assume vprintf.
6703
6704         * argmatch.c (getenv): Remove decl.
6705         * progreloc.c (get_full_program_name): Define via prototype.
6706         * setenv.c (clearenv): Likewise.
6707         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6708         needed.
6709         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6710         (malloc, memcpy): Remove decls.
6711         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6712         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6713         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6714         (memcpy): Remove macro.
6715         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6716         (__P): Remove.  All uses removed.
6717         (PTR): Remove.  All uses changed to void *.
6718         (CHAR_BIT, NULL): Remove.
6719         (spaces, zeros, memset_space, memset_zero)
6720         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6721         Remove.
6722         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6723         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6724         Define with prototype.
6725         Remove now-unnecessary prototype decl.
6726         (extra_args_spec): Assume ANSI C.  All uses changed.
6727         (extra_args_spec_iso): Remove.
6728         (my_strftime, emacs_strftimeu): Define via prototype.
6729         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6730         unconditionally.
6731         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6732         * strtoimax.c: Include <stdlib.h> unconditionally.
6733         (strtoul, strtol): Remove decls.
6734         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6735         LONG_MAX): Remove.
6736         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6737         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6738         (LOCALE_PARAM_PROTO): New macro.
6739         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6740         (INTERNAL (strtol), strtol): Define with a prototype.
6741         (PARAMS): Remove.  All uses removed.
6742         * tempname.c: Include <string.h> unconditionally.
6743         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6744         * xgethostname.c (main): Define with a prototype.
6745         * xmalloc.c: Include "xalloc.h" first, to check interface.
6746         Include <stdlib.h> unconditionally.
6747         (calloc, malloc, realloc, free): Remove decls.
6748         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6749         Include <stdlib.h> unconditionally.  Sort include file names.
6750         (strtod): Remove.
6751         (xstrtod): Define with a prototype.
6752         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6753         (strtol, strtoul): Remove decls.
6754
6755 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6756
6757         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6758         Include <stdlib.h>, <string.h> unconditionally.
6759         Remove now-unnecessary cast to char *.
6760         * strnlen.c: Include <string.h> unconditionally.
6761         * yesno.c (yesno): Define with a prototype.
6762
6763 2003-09-10  Bruno Haible  <bruno@clisp.org>
6764
6765         * strcspn.c: Include <string.h> unconditionally.
6766         * strpbrk.c: Include <string.h> unconditionally.
6767         * strstr.c: Include <string.h> unconditionally.
6768         * unicodeio.c: Include <string.h> unconditionally.
6769         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6770         * unsetenv.c: Likewise.
6771         * xreadlink.c: Include <stdlib.h> unconditionally.
6772         * yesno.c: Include <stdlib.h> unconditionally.
6773         (rpmatch): Add prototype.
6774
6775 2003-09-10  Jim Meyering  <jim@meyering.net>
6776
6777         * error.c: Correct indentation of cpp directives.
6778
6779 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6780
6781         More K&R removal.
6782
6783         * acosl.c (main): Use a prototype.
6784         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6785         tanl.c: Likewise.
6786
6787         * getloadavg.c (getloadavg, main): Define via prototypes.
6788
6789         * getopt.h (struct option.name): Assume C89, and use 'const'.
6790         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6791         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6792         with a prototype.
6793         * getopt.c (const): Remove macro.
6794         Include <string.h> unconditionally.
6795         (my_index): Remove; all uses changed to strchr.
6796         (strlen): Remove decl.
6797         (exchange): Remove forward decl; no longer needed.
6798         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6799         Define with prototype.
6800         * getopt1.c (const): Remove macro.
6801         (getopt_long, getopt_long_only, main): Define with prototype.
6802
6803         * getugroups.c: Include <string.h> unconditionally.
6804
6805         * getusershell.c: Include <stdlib.h> unconditionally.
6806         (getusershell, setusershell, endusershell, readname, main):
6807         Define with prototypes.
6808
6809         * group-member.c: Include group-member.h first.
6810         Include <stdlib.h> unconditionally.
6811
6812         * hard-locale.c: Include hard-locale.h first.
6813         Include <stdlib.h>, <string.h> unconditionally.
6814
6815         * hash.c (free, malloc): Remove decls.
6816         Include <stdlib.h> unconditionally.
6817
6818         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6819         (getenv): Do not declare.
6820
6821         * idcache.c: Include <string.h> unconditionally.
6822
6823         * long-options.c: Include long-options.h first, to test interface.
6824         Include <stdlib.h> unconditionally.
6825
6826         * makepath.c: Include makepath.h first, to test interface.
6827         Include <stdlib.h> and <string.h> unconditionally.
6828
6829         * linebuffer.c: Include <stdlib.h>.
6830         (free): Remove decl.
6831
6832         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6833         rpl_malloc returns void *, not char *.
6834         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6835
6836         * md5.h: Include <limits.h> unconditionally.
6837         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6838         (__P): Remove; all uses removed.
6839         * md5.c: Include "md5.h" first.
6840         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6841         md5_buffer, md5_process_bytes, md5_process_block):
6842         Define with prototypes.
6843         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6844         * sha.c: Include "sha.h" first.
6845         Include <stdlib.h>, <string.h> unconditionally.
6846
6847         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6848         * memcmp.c (__ptr_t): Likewise.
6849         * memrchr.c (__ptr_t): Likewise.
6850         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6851         Include <string.h> unconditionally.
6852         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6853         * memchr.c: Include <stdlib.h> unconditionally.
6854         * memchr.c (LONG_MAX): Remove.
6855         * memrchr.c (LONG_MAX): Likewise.
6856         * memchr.c (__memchr): Define via a prototype.
6857         * memrchr.c (__memrchr): Likewise.
6858         * memcmp.c (__P): Remove, and remove all uses.
6859         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6860         Remove forward decls; no longer needed.
6861         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6862         Use types required by C89 in prototype.
6863
6864         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6865         * savedir.c: Likewise.
6866         * mkdir.c (free): Remove decl.
6867         * rmdir.c (rmdir): Define with a prototype.
6868         * savedir.c: Include savedir.h first, to test interface.
6869
6870         * mktime.c (STDC_HEADERS): Remove.
6871         Include <stdlib.h>, <string.h> unconditionally.
6872
6873         * modechange.c: Include <stdlib.h> unconditionally.
6874         (malloc): Remove decl.
6875
6876         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6877         (free): Remove decl.
6878
6879         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6880         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6881         (This type really should be intptr_t, but that's a C99ism.)
6882         (_obstack_memcpy): Remove: all uses changed to memcpy.
6883         Include <string.h> unconditionally.
6884         (struct obstack): Assume __STDC__ for types of members
6885         chunkfun, freefun, extra_arg.
6886         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6887         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6888         obstack_begin, obstack_specify_allocation,
6889         obstack_specify_allocation_with_arg, obstack_chunkfun,
6890         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6891         Remove unprototyped decls and the macros that use them.
6892         * obstack.c (POINTER): Remove.  All uses changed to void *.
6893         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6894         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6895         (defined __STDC__ && __STDC__)]:
6896         Remove nonprototyped code.
6897         Include <stdlib.h> unconditionally.
6898         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6899         _obstack_allocated_p, _obstack_free, obstack_free,
6900         _obstack_memory_used, print_and_abort):
6901         Define using prototypes.
6902         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6903         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6904         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6905         obstack_next_free, obstack_object_size, obstack_room) [0]:
6906         Remove unused, unprototyped code.
6907
6908         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6909
6910         * physmem.c (physmem_total, physmem_available, main): Define
6911         with prototypes.
6912
6913         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6914         (main): Define with a prototype.
6915
6916         * posixver.c (getenv): Remove decl.
6917
6918         * putenv.c (malloc): Returns void *, not char *.
6919         Include <string.h> unconditionally.
6920         (strchr, memcpy, NULL): Do not define.
6921
6922         * readtokens.c: Include readtokens.h first, to test interface.
6923         Include <stdlib.h>, <string.h> unconditionally.
6924         (init_tokenbuffer): Define with a prototype.
6925
6926         * regex.c (PARAMS): Remove.  All uses removed.
6927         All uses of _RE_ARGS removed, too.
6928         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6929         unconditionally.
6930         (bzero): Assume memset exists.
6931         (memcmp, memcpy, NULL): Remove.
6932         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6933         char, or assignments to local vars of type signed char.
6934         (init_syntax_once, PREFIX(extract_number_and_incr),
6935         PREFIX(print_partial_compiled_pattern),
6936         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6937         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6938         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6939         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6940         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6941         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6942         wcs_compile_range, byte_compile_range, truncate_wchar,
6943         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6944         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6945         count_mbs_length, wcs_re_match_2_internal,
6946         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6947         PREFIX(alt_match_null_string_p),
6948         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6949         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6950         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6951         now-unnecessary declaration, if any.
6952         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6953         regcomp, regexec):
6954         Remove now-unnecessary casts among pointer types.
6955         * regex.h (_RE_ARGS): Remove.  All uses removed.
6956
6957         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6958         (free): Remove decl.
6959
6960         * rpmatch.c: Include <stdlib.h> unconditionally.
6961
6962         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6963         (free): Remove decl.
6964
6965         * save-cwd.c: Include <stdlib.h> unconditionally.
6966         * xgetcwd.c: Likewise.
6967
6968         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6969         (free): Remove decl.
6970
6971         * strchrnul.c (strchrnul): Define with a prototype.
6972         Fix bug: c_in was not converted to char before searching.
6973
6974         The following changes are not K&R related:
6975
6976         * group-member.h: Include <sys/types.h>, so that this file is
6977         self-contained.
6978         * makepath.h: Likewise.
6979
6980         * getusershell.c (readname, default_index, line_size, readname):
6981         Use size_t, not int, for sizes.
6982         (readname): If the size overflows, report an error instead of
6983         looping forever.
6984
6985 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6986
6987         * getndelim2.c: Assume stdlib.h per the C89 spec.
6988
6989 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6990
6991         Assume C89 or better; remove K&R cruft.
6992         A few of these changes were first proposed by Derek Robert Price
6993         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6994
6995         * addext.c: Include <string.h> unconditionally.
6996         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6997         Don't declare getenv or malloc.
6998
6999         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7000         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7001         (NULL): Remove.
7002         (find_stack_direction, alloca): Use prototypes.
7003
7004         * atexit.c (atexit): Define using a prototype.
7005
7006         * basename.c, dirname.c, stripslash.c:
7007         Include <string.h> unconditionally.
7008
7009         * bcopy.c: Include <stddef.h>.
7010         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7011
7012         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7013
7014         * error.h (error, error_at_line, error_print_progname)
7015         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7016         * error.c: Include error.h first, to check interface.
7017         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7018         (VA_START): Remove; all uses changeed to va_start.
7019         (exit, strerror): Remove decls.
7020         (error_print_progname): Prototype uncondionally.
7021         Don't include <errno.h>; no longer needed.
7022         (private_strerror): Remove.
7023         (error_tail): Always define.
7024         (error, error_at_line): Assume C89 or better; always use prototypes.
7025         * fatal.c: Include "fatal.h" first, to test interface.
7026         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7027         (VA_START): Remove; all uses changed to va_start.
7028         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7029         this case.
7030         (exit): Remove decl.
7031         (fatal): Prototype unconditionally.  Assume va_start works.
7032         Abort at end, to pacify gcc.
7033
7034         * euidaccess.c (main): Define with a prototype.
7035
7036         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7037
7038         * exitfail.c: Include <stdlib.h> unconditionally.
7039
7040         * fnmatch_.h (__P): Remove.  All uses changed to assume
7041         prototypes.
7042         * fnmatch.c: Include fnmatch.h first, to test interface.
7043         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7044         (getenv): Remove decl.
7045         (fnmatch): Define using a prototype.
7046         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7047         (FCT): Define using a prototype.
7048
7049         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7050
7051         * gethostname.c: Include <stddef.h>.
7052         (gethostname): Define with prototype.  Length is size_t, not int.
7053
7054 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7055
7056         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7057         getversion.c should have been removed then, but was accidentally
7058         preserved.
7059
7060         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7061         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7062
7063 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7064
7065         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7066         copy_tm_result.  Bug reported by Simon Josefsson in
7067         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7068
7069 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7070
7071         * time_r.c, time_r.h: New files.
7072
7073         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7074         __localtime_r.
7075         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7076         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7077
7078         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7079         __gmtime_r.
7080         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7081         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7082         Include <time_r.h>.
7083
7084         * timegm.c: Switch to glibc implementation, with the following changes:
7085         [defined HAVE_CONFIG_H]: Include <config.h>.
7086         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7087         (__mktime_internal) [!defined _LIBC]: New decl.
7088         (__gmtime_r) [!defined _LIBC]: New macro and function.
7089         (timegm): Use a prototype, since gnulib assumes C89.
7090         Do not bother declaring tmp to be const, as it's not really usefu.
7091         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7092         (timegm): Declare only if HAVE_DECL_TIMEGM.
7093
7094 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7095
7096         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7097         Bug reported by Lute Kamstra in
7098         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7099
7100         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7101         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7102         course with correspondingly smaller numbers for tomorrow and
7103         yesterday.  From Tadayoshi Funaba.  Originally installed into
7104         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7105         coreutils merge?).
7106
7107 2003-08-31  Simon Josefsson  <jas@extundo.com>
7108
7109         * timegm.h: New file.
7110         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7111
7112 2003-08-31  Karl Berry  <karl@gnu.org>
7113
7114         * argp.h: update from libc.
7115
7116 2003-08-28  Bruno Haible  <bruno@clisp.org>
7117
7118         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7119         warning on QNX, which defines O_BINARY to 000000.
7120
7121 2003-08-24  Bruno Haible  <bruno@clisp.org>
7122
7123         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7124         MSVC7 <stdio.h> is included later.
7125
7126 2003-08-20  Bruno Haible  <bruno@clisp.org>
7127
7128         * progname.h: New file, from GNU gettext.
7129         * progname.c: New file, from GNU gettext.
7130         * progreloc.c: New file, from GNU gettext.
7131
7132 2003-08-19  Bruno Haible  <bruno@clisp.org>
7133
7134         * xstrdup.c: Assume <string.h> exists.
7135
7136 2003-08-18  Jim Meyering  <jim@meyering.net>
7137
7138         * setenv.h: Indent nested cpp directive.
7139         * vasnprintf.c: Remove trailing blanks.
7140
7141 2003-08-17  Simon Josefsson  <jas@extundo.com>
7142             Bruno Haible  <bruno@clisp.org>
7143
7144         * xstrndup.h: New file.
7145         * xstrndup.c: New file.
7146
7147 2003-08-17  Bruno Haible  <bruno@clisp.org>
7148
7149         * strndup.h: New file.
7150
7151 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7152
7153         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7154         space, undoing this 2003-08-12 change:
7155         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7156
7157 2003-08-16  Jim Meyering  <jim@meyering.net>
7158
7159         Merge from coreutils.
7160         * xstrtoimax.c: #else #if -> #elif.
7161         * xstrtoumax.c: Likewise.
7162
7163 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7164
7165         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7166         rather than tab, after '#' in shell-script copyright notices.
7167         Suggested by Bruno Haible.
7168
7169 2003-08-15  Jim Meyering  <jim@meyering.net>
7170         and Paul Eggert  <eggert@twinsun.com>
7171
7172         Merge from coreutils.
7173         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7174         member but strut utmpx does not.  Needed for AIX 4.3.3.
7175         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7176
7177 2003-08-15  Jim Meyering  <jim@meyering.net>
7178
7179         Merge from coreutils.
7180         * xgethostname.c: Include <stdlib.h>.
7181         (xghostname): Don't exit for anything other than memory-related
7182         failure; just return NULL.
7183         * userspec.c: Include "posixver.h".
7184         (parse_user_spec): Accept `.' as a separator only
7185         in pre-POSIX-200112 mode.
7186         * strtoimax.c: Use #elif rather than #else #if.
7187         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7188         Remove function, now that we can rely on a working tzset function.
7189         [!_LIBC]: Ensure that the required autoconf test has been run.
7190         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7191         Use underlying_strftime for %r.
7192         * sha.c: Merge in some clean-up and optimization changes from glibc.
7193         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7194         Ensure that it is a multiple of 64.
7195         Rearrange loop exit tests so as to avoid performing an
7196         additional fread after encountering an error or EOF.
7197         * realloc.c: Update copyright date.
7198
7199 2003-08-14  Jim Meyering  <jim@meyering.net>
7200
7201         Merge from coreutils.
7202         * obstack.h: Whitespace changes.
7203         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7204         and xcalloc return values.
7205         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7206         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7207         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7208         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7209         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7210         error from mntctl.
7211         Use mntctl's return value to drive the entry-processing loop, since
7212         we can't rely on the value of the vmt_length member in the last
7213         entry.  On some systems doing so could result in exhausting
7214         virtual memory.  Based in part on a patch from Mike Jetzer.
7215
7216 2003-08-14  Jim Meyering  <jim@meyering.net>
7217         and Paul Eggert  <eggert@twinsun.com>
7218
7219         Merges from coreutils, plus other fixes.
7220         * physmem.c: Merge in portability changes from gcc/libiberty
7221         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7222         for credits and details.  Thanks to Kaveh Ghazi for helping
7223         to keep these files in sync.
7224         (ARRAY_SIZE): Define it.
7225         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7226         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7227         (memcasecmp): Don't assume size_t fits in unsigned int.
7228         Remove casts and duplicate code.
7229         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7230         (memcpy): Remove definition.
7231         Merge in some clean-up and optimization changes from glibc.
7232         [BLOCKSIZE]: Move definition to top of file.
7233         Ensure that it is a multiple of 64.
7234         Rearrange loop exit tests so as to avoid performing an
7235         additional fread after encountering an error or EOF.
7236         * md5.h (md5_uintptr): Define.
7237         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7238         return to the initial working directory.  Preserve errno
7239         for caller.
7240         * idcache.c: Include "xalloc.h".
7241         (xmalloc, xrealloc): Remove decls.
7242         (getuser): Remove casts no longer required in C89.
7243         * human.c: Include stdio.h, for sprintf.
7244         * group-member.c: Include "xalloc.h".
7245         (xmalloc, xrealloc): Remove decls.
7246         (get_group_info): Remove casts no longer required in C89.
7247         * getusershell.c (readname): Remove casts no longer required in C89.
7248         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7249         * getline.c: Whitespace fix, from coreutils.
7250
7251 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7252
7253         * exclude.c: Include <ctype.h>
7254         (IN_CTYPE_DOMAIN): New macro.
7255         (is_space): New fn.
7256         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7257         and empty lines.
7258
7259         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7260         Undo previous (whitespace-only) change.
7261
7262 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7263
7264         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7265         Normalize leading white space and remove trailing white space.
7266         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7267         notice, as per ../config/srclist-update.
7268
7269         Merge from coreutils.
7270         * euidaccess.h: New file.
7271         * euidaccess.c: Include it.
7272         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7273         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7274         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7275
7276 2003-08-11  Bruno Haible  <bruno@clisp.org>
7277
7278         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7279         (vasnprintf): Use it instead of wcslen.
7280
7281 2003-08-11  Bruno Haible  <bruno@clisp.org>
7282
7283         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7284         value to ensure that _Bool promotes to int. Use #define for _Bool when
7285         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7286
7287 2003-08-10  Karl Berry  <karl@gnu.org>
7288
7289         * regex.h: update from libc (whitespace fix).
7290
7291 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7292
7293         Merge some files from coreutils.  These changes were
7294         originally made by Jim Meyering.
7295         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7296         many older Unixes require this.
7297         * alloca.c (alloca): Remove cast to argument of free;
7298         no longer needed in C89.
7299         * alloca_.h, regex.h: Fix white space to match
7300         what GNU indent does.
7301
7302 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7303
7304         * bumpalloc.h: Remove.
7305
7306 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7307
7308         * getloadavg.c: Change copyright notice and spacing to conform to
7309         GNU coding style.
7310
7311         Merge from coreutils.
7312         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7313         From glibc.
7314         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7315         from Karl Berry, implemented by Jim Meyering.
7316         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7317         from Dmitry V. Levin.
7318         Remove anachronistic cast of xrealloc.
7319         * fnmatch_.h (__const): Remove.  Use 'const'.
7320         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7321         type. Otherwise, it wouldn't compile with at least /bin/cc on
7322         ymp-cray-unicos9.0.2.X.
7323         Combine two mostly-identical uses of alloca into one.
7324         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7325
7326 2003-08-04  Dave Love <d.love@dl.ac.uk>
7327
7328         [From Emacs.]
7329
7330         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7331         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7332         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7333         obsolete NLIST_NAME_UNION.
7334         [__GNU__]: Undef BSD and FSCALE.
7335         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7336
7337 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7338
7339         * stdbool_.h (_Bool): Make it signed char, instead of
7340         an enum type, so that it's guaranteed to promote to int.  See:
7341         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7342
7343 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7344
7345         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7346         (strerror): Don't assume that a printable int fits in 14 bytes.
7347
7348 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7349             Bruno Haible  <bruno@clisp.org>
7350
7351         * getline.h (getline, getdelim): Change return type to ssize_t.
7352         * getline.c (getline, getdelim): Likewise.
7353         Remove _GNU_SOURCE define; now it's defined in config.h through
7354         m4/getline.m4.
7355
7356 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7357
7358         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7359         over-parenthesization in macros.
7360
7361         Sync with coreutils.
7362
7363         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7364         required by C99.
7365
7366         Use `exit_failure' for xalloc and xmemcoll instead of their own
7367         private exit-failure variables.
7368         * xalloc.h (xalloc_exit_failure): Remove.
7369         * xmalloc.c: Likewise.  Include exitfail.h.
7370         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7371         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7372         * xmemcoll.c: Likewise.  Include exitfail.h.
7373         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7374
7375 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7376
7377         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7378         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7379         to test that it can stand by itself.  Include "exitfail.h".
7380         Clients should set exit_failure instead.
7381         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7382
7383 2003-07-18  Andreas Schwab  <schwab@suse.de>
7384
7385         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7386
7387 2003-07-18  Bruno Haible  <bruno@clisp.org>
7388
7389         * getndelim2.h: New file.
7390         * getndelim2.c: Make into a module of its own. Include config.h,
7391         getndelim2.h.
7392         (getndelim2): Make non-static. Change return type to ssize_t.
7393         * getline.h: Change argument names.
7394         * getline.c: Include getndelim2.h instead of getndelim2.c.
7395         * getnline.c: Include getndelim2.h.
7396
7397 2003-07-17  Bruno Haible  <bruno@clisp.org>
7398
7399         * Makefile.am: Remove file.
7400         * Makefile.in: Remove file.
7401
7402 2003-07-17  Bruno Haible  <bruno@clisp.org>
7403
7404         * getnline.h: New file.
7405         * getnline.c: New file.
7406         * getndelim2.c: New file, extracted from getline.c.
7407         (getndelim2): Renamed from getdelim2, with added nmax argument.
7408         * getline.c: Include getndelim2.c.
7409         (getdelim2): Moved out to getndelim2.c.
7410         (getline, getdelim): Update.
7411
7412 2003-07-15    <karl@gnu.org>
7413
7414         * vasnprintf.c: update from gettext.
7415
7416 2003-07-15  Jim Meyering  <jim@meyering.net>
7417
7418         * makepath.c (make_path): Enclose diagnostic in _(...).
7419
7420 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7421
7422         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7423         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7424         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7425         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7426         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7427         updated automatically by ../config/srclist-update.  This changes
7428         their license from LPGL to GPL.
7429
7430 2003-07-14  Jim Meyering  <jim@meyering.net>
7431
7432         Don't emit diagnostics.  Let callers do that.
7433         * save-cwd.c: Don't include "error.h".
7434         (save_cwd): Don't call error.  Ensure that errno is valid
7435         when returning nonzero.
7436
7437         * save-cwd.h (restore_cwd): Update prototype.
7438         * save-cwd.c (restore_cwd): Remove two parameters.
7439         Simplify.  Don't call error upon failure.  Let callers do that.
7440         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7441         when auditing is enabled.  But don't bother updating the #if.
7442
7443 2003-07-14  Simon Josefsson  <jas@extundo.com>
7444
7445         * mempcpy.h: New file.
7446         * mempcpy.c: New file.
7447
7448 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7449
7450         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7451         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7452         unicodeio.c, unicodeio.h, unlocked-io.h:
7453         Switch from LGPL to GPL.
7454
7455 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7456
7457         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7458         it breaks C++ compilation.
7459         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7460
7461 2003-07-10  Jim Meyering  <jim@meyering.net>
7462
7463         * vasnprintf.c: Remove trailing blanks.
7464         Make cpp indentation consistent.
7465
7466 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7467
7468         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7469         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7470         Switch from LGPL to GPL.
7471
7472 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7473
7474         * mktime.c: Fix some boundary cases and remove need for floating point.
7475
7476         Issue a compile-time diagnostic if time_t is floating point, or if
7477         two's complement arithmetic is not in effect, or if arithmetic
7478         right shift does not propagate the sign.  These assumptions were
7479         all in the original code but they weren't checked.
7480
7481         (TIME_T_MIDPOINT, verify): New macros.
7482         (__isleap): Remove; it has integer overflow problems.
7483         (leapyear): New function, without those problems.
7484         (ydhms_tm_diff): Remove; splitting into two parts.
7485         (ydhms_diff): New function, containing the arithmetic part of
7486         the old ydhms_tm_diff function.  Issue a compile-time
7487         diagnostic if we are not using C99 integer division.
7488         Avoid casts when possible.
7489         (guess_time_tm): New function, containing the checking part of
7490         the old ydhms_tm_diff function.  Return the new value, rather than
7491         the difference between it and the old.  Accept a new argument T
7492         so that *T specifies the old value.  Check for overflow in the result.
7493
7494         (__mktime_internal): Use a time_t offset, not a long int offset.
7495         This undoes the 2003-06-04 change, which is no longer needed now
7496         that we have better overflow checking.
7497         (localtime_offset): Likewise.
7498
7499         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7500         and long are 64-bit but int is only 32-bit.
7501         (ydhms_diff): Use long int to store year1 and yday1.
7502         Issue a compile-time diagnostic if long int is not wide enough.
7503
7504         (__mktime_internal): Use long int to store adjusted year and yday.
7505         Use plain C rather than preprocessor commands, if that doesn't
7506         affect efficiency.
7507         Check for overflow (and try to repair) after each probe
7508         rather than checking only at the very end.  This avoids some bugs
7509         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7510         does not equal GMT offset at maximum time).
7511         Use integer to check for overflow rather than floating point; this
7512         is more portable to non-IEEE hosts, and is a tad faster.
7513         When we detect that we are oscillating between two values,
7514         don't check whether tm_isdst has the requested value, since
7515         we already know the answer.  When tm_isdst has the wrong value,
7516         use a different heuristic to find the right one, based on the
7517         extreme values actually observed in practice in tz2003a,
7518         rather than the (overly optimistic) "previous 3 calendar quarters".
7519
7520         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7521         "T const" to accommodate glibc style.
7522         (check_result): Use less-confusing report format.  "long" -> "long int.
7523         (main): Likewise.
7524         Don't loop if the iteration overflows time_t.
7525         Allow a negative step in the iteration.
7526
7527 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7528
7529         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7530         having it depend on HAVE_SYS_TYPES_H.
7531
7532 2003-06-25  Bruno Haible  <bruno@clisp.org>
7533
7534         * readlink.c: New file.
7535
7536 2003-06-20  Bruno Haible  <bruno@clisp.org>
7537
7538         Assume C89, so PARAMS isn't needed.
7539         * unicodeio.h (PARAMS): Remove.
7540         * unicodeio.c: Don't use PARAMS.
7541
7542 2003-06-18  Jim Meyering  <jim@meyering.net>
7543
7544         Merge changes from coreutils.
7545         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7546         Remove explicit declarations of xmalloc and realloc.
7547         Include xalloc.h.
7548         (read_utmp): Remove anachronistic cast of xmalloc.
7549
7550 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7551
7552         Assume C89, so PARAMS isn't needed.
7553         * backupfile.h (PARAMS): Remove.  All uses removed.
7554         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7555         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7556         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7557         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7558         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7559         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7560         xstrtol.h: Likewise.
7561         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7562         same.h, strverscmp.h: Do not include config.h; no longer needed.
7563         Anyway, config.h should always be included before any other file.
7564
7565 2003-06-11  Simon Josefsson  <jas@extundo.com>
7566
7567         * sysexit_.h: New file.
7568
7569 2003-05-20  Derek Price  <derek@ximbiot.com>
7570
7571         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7572
7573 2003-06-10  Simon Josefsson  <jas@extundo.com>
7574
7575         * strchrnul.h: New file.
7576         * strchrnul.c: New file.
7577
7578 2003-06-10  Simon Josefsson <jas@extundo.com>
7579
7580         * argp.h: New file, from glibc.
7581         * argp-ba.c: New file, from glibc.
7582         * argp-eexst.c: New file, from glibc.
7583         * argp-fmtstream.c: New file, from glibc.
7584         * argp-fmtstream.h: New file, from glibc.
7585         * argp-fs-xinl.c: New file, from glibc.
7586         * argp-help.c: New file, from glibc.
7587         * argp-namefrob.h: New file, from glibc.
7588         * argp-parse.c: New file, from glibc.
7589         * argp-pv.c: New file, from glibc.
7590         * argp-pvh.c: New file, from glibc.
7591         * argp-xinl.c: New file, from glibc.
7592
7593 2003-06-07  Jim Meyering  <jim@meyering.net>
7594
7595         * readtokens.h: Put `Free Software Foundation, Inc.'
7596         in place of my name in the copyright comment.
7597         Remove definition and uses of __P.
7598
7599         From coreutils.
7600         * stat.c: Don't declare xmalloc explicitly.
7601         Instead, include "xalloc.h".
7602         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7603         xrealloc, and xcalloc return values.
7604         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7605         Improve comment.
7606         * xgetcwd.h: Remove definition/uses of PARAMS.
7607
7608 2003-06-06  Jim Meyering  <jim@meyering.net>
7609
7610         * stdbool_.h: Renamed from stdbool.h.in.
7611
7612 2003-06-06  Jim Meyering  <jim@meyering.net>
7613
7614         Merge from coreutils.
7615         * same.c: (same_name): Declare *_basename locals to be `const'.
7616         Consolidate declarations and initializations of *_base* locals.
7617
7618         Merge from coreutils.
7619         This avoids a core dump on systems without GNU putenv,
7620         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7621         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7622         (unsetenv): New static function, from GNU libc.
7623         (rpl_putenv): Use it.
7624
7625         * modechange.c: Remove trailing blanks.
7626
7627         Merge from coreutils.
7628         * fsusage.c: Remove declaration of statfs.
7629         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7630
7631         * posixtm.c: Include <stdbool.h> unconditionally.
7632
7633 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7634
7635         * mktime.c (__mktime_internal): When resolving a tm_isdst
7636         mismatch, look in future quarters as well as past.  This fixes a
7637         bug when processing fall-backwards gaps immediately after a long
7638         period of daylight-saving time.
7639
7640         * mktime.c: Assume freestanding C89 or better.
7641         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7642         (__P): Remove; not used.
7643         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7644         (mktime, not_equal_tm, print_tm, check_result,
7645         main): Use prototypes.  Use const * where appropriate.
7646         (main): Fix typo in testing code that uncovered by above changes.
7647         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7648
7649 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7650
7651         * mktime.c: Fix Debian bug 177940
7652         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7653         (localtime_offset): Now long int, not time_t, because we want it
7654         to be guaranteed to be signed.  All uses changed.
7655         (__mktime_internal): If overflow would occur when adding offset,
7656         don't add it.
7657
7658         Merge 'human' changes from coreutils.  Rewrite to support
7659         locale-specific notations like thousands separators.
7660         * human.c: Simplify authorship notice.
7661         Include human.h immediately after config.h.
7662         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7663         <limits.h>: Do not include, since human.h does.
7664         (SIZE_MAX, UINTMAX_MAX): New macros.
7665         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7666         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7667         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7668         (power_letter): Renamed from suffixes.
7669         (generate_suffix_backwards): Remove.
7670         (adjust_value): Now takes int style (because of human.h changes)
7671         and long double value (for greater precision on some platforms).
7672         (group_number): New function.
7673         (human_readable): Use it.  Use integer options, not enum.
7674         Put the options before the sizes in the arg list.
7675         Support all the new options.
7676         The old human_readable function has been removed;
7677         use inttostr.h instead.
7678         (human_readable, default_block_size, humblock):
7679         Use uintmax_t, not int, for block sizes.
7680         (human_readable_inexact, block_size_types): Remove.
7681         (block_size_opts): New constant.
7682         (human_options): Renamed from human_block_size, with new signature
7683         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7684         * human.h: Add copyright and authorship notice.
7685         Include <limits.h> and <stdbool.h> unconditionally.
7686         (PARAMS): Remove.  All uses removed.
7687         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7688         (enum human_inexact_style): Remove tag; now a nameless enum.
7689         (human_floor, human_ceiling, human_round_to_even): Now have
7690         values 2, 0, 1 rather than -1, 1, 0.
7691         (human_group_digits, human_suppress_point_zero, human_autoscale,
7692         human_base_1024, human_SI, human_B): New constants.
7693         (human_readable_inexact, human_block_size): Remove.
7694         (human_readable): Size args are now uintmax_t, not int.
7695         (human_options): New decl.
7696
7697         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7698         unnecessary now that we assume C89 or better.  This change
7699         imported from coreutils.
7700
7701         * mktime.c (__mktime_internal): Do not reject negative timestamps
7702         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7703         in the 2003-05-30 sync from glibc.
7704
7705         .h files should stand alone, but we shouldn't include <sys/types.h>
7706         if we can get away with just <stddef.h>.
7707
7708         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7709         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7710         rather than <sys/types.h>, as we merely need size_t.
7711         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7712         to get size_t.
7713         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7714         Include <stdio.h>, to get FILE.
7715         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7716         memcasecmp.h has included <stddef.h> and all we need is size_t.
7717         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7718         our interface, instead of including <sys/types.h>
7719
7720 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7721
7722         [from coreutils]
7723         Fix some minor time-related bugs with POSIX time arguments.
7724         Some valid time stamps were being rejected (notably -1, and
7725         time stamps before 1900 on 64-bit hosts).  And some invalid
7726         time stamps were being accepted, e.g. September 31.
7727
7728         * posixtm.h (posixtime): Return bool instead of time_t, so
7729         that we can return (time_t) -1 successfully.
7730         * posixtm.c: Likewise.
7731         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7732         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7733         (t): Remove static var.
7734         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7735         of static var.  All uses changed.
7736         (year): Do not reject years before 1900; they can occur with
7737         64-bit time_t.
7738         (posix_time_parse): Do not check for out-of-range components;
7739         that is now the caller's responsibility, since our checks were
7740         only approximations.
7741         (posixtime): Use mktime to check for out-of-range components,
7742         since it knows them exactly.
7743         If mktime returns (time_t) -1, check whether an error actually occurred
7744         by invoking localtime on -1.
7745         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7746         posixtime failures better.
7747         Improve the test data (in comments only).
7748
7749 2003-05-30    <karl@gnu.org>
7750
7751         * mktime.c: update from libc.
7752
7753 2003-05-30  Bruno Haible  <bruno@clisp.org>
7754
7755         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7756         * localcharset.h: Likewise.
7757         * localcharset.c: Likewise.
7758
7759 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7760
7761         Assume the headers required for C89 freestanding compilers.
7762         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7763         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7764         without checking for HAVE_LIMITS_H.
7765         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7766         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7767         to do that.
7768         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7769         * exclude.c: Include <stdbool.h> unconditionally.
7770         * tempname.c: Include <stddef.h> unconditionally.
7771         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7772         * modechange.c, rpmatch.c (NULL): Don't define, since
7773         <stddef.h> does that.
7774         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7775         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7776         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7777         * xstrtol.c: Likewise.
7778         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7779         * savedir.c: Include <stddef.h> instead of defining NULL.
7780
7781         * addext.c (addext): Use assignment rather than cast, to avoid
7782         warnings on some platforms.
7783
7784         * mktime.c (__mktime_internal): Do not reject negative timestamps
7785         arbitrarily.
7786
7787 2003-05-10  Bruno Haible  <bruno@clisp.org>
7788
7789         * linebreak.c (iconv_string_length): Don't return -1 just because the
7790         string is longer than 4 KB.
7791
7792 2003-05-12  Jim Meyering  <jim@meyering.net>
7793
7794         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7795         the space-padded-by-default conversion specifiers, %e, %k, %l.
7796
7797 2003-05-03  Bruno Haible  <bruno@clisp.org>
7798
7799         Upgrade to Unicode-4.0.
7800         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7801         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7802         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7803         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7804         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7805         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7806         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7807         Change width of U+E0100..U+E01EF from 1 to 0.
7808
7809 2003-04-25  Bruno Haible  <bruno@clisp.org>
7810
7811         * copy-file.c: Include <stddef.h>, for size_t.
7812
7813 2003-04-25  Jim Meyering  <jim@meyering.net>
7814
7815         * copy-file.c (copy_file_preserving): Declare buf_size to be
7816         of type size_t, not int.
7817
7818 2003-04-11  Jim Meyering  <jim@meyering.net>
7819
7820         Merge changes from Coreutils.
7821
7822         2003-03-22  Jim Meyering  <jim@meyering.net>
7823
7824         * strftime.c (widen): Cast alloca return value to proper type.
7825
7826         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7827
7828         From GNU libc.
7829         * strftime.c (my_strftime): Handle very large width
7830         specifications for numeric values correctly.  Improve checks for
7831         overflow.
7832
7833         2003-01-19  Jim Meyering  <jim@meyering.net>
7834
7835         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7836         (nl_get_alt_digit) [! defined my_strftime]: Define.
7837         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7838         _nl_get_alt_digit and _nl_get_walt_digit.
7839
7840         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7841         These changes have no effect outside of _LIBC.
7842
7843 2003-04-10  Bruno Haible  <bruno@clisp.org>
7844
7845         * findprog.h: New file, from GNU gettext.
7846         * findprog.c: New file, from GNU gettext.
7847
7848 2003-04-05  Jim Meyering  <jim@meyering.net>
7849
7850         Merge changes from Coreutils.
7851
7852         * exclude.h (PARAMS): Remove definition and uses.
7853         * exclude.c: Remove uses of `PARAMS'.
7854
7855         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7856         Add test-cases for DOS filenames. Declare program_name.
7857         (main): Set up program_name.  Patch by Rich Dawe.
7858
7859         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7860         error from mntctl.
7861         Use mntctl's return value to drive the entry-processing loop, since
7862         we can't rely on the value of the vmt_length member in the last
7863         entry.  On some systems doing so could result in exhausting
7864         virtual memory.  Based in part on a patch from Mike Jetzer.
7865
7866 2003-04-04  Bruno Haible  <bruno@clisp.org>
7867
7868         * linebreak.h: New file, from GNU gettext.
7869         * linebreak.c: New file, from GNU gettext with slight modifications.
7870         * lbrkprop.h: New file, from GNU gettext.
7871
7872 2003-04-03  Bruno Haible  <bruno@clisp.org>
7873
7874         * utf8-ucs4.h: New file, from GNU gettext.
7875         * utf16-ucs4.h: New file, from GNU gettext.
7876         * ucs4-utf8.h: New file, from GNU gettext.
7877         * ucs4-utf16.h: New file, from GNU gettext.
7878
7879 2003-04-02  Bruno Haible  <bruno@clisp.org>
7880
7881         * binary-io.h: New file, from GNU gettext.
7882
7883 2003-04-01  Bruno Haible  <bruno@clisp.org>
7884
7885         * pathname.h: New file, from GNU gettext.
7886         * concatpath.c: New file, from GNU gettext.
7887
7888 2003-03-30  Bruno Haible  <bruno@clisp.org>
7889
7890         * copy-file.c (copy_file_preserving): Don't set owner if the function
7891         chown() doesn't exist.
7892
7893 2003-03-28  Bruno Haible  <bruno@clisp.org>
7894
7895         * copy-file.h: New file, from GNU gettext.
7896         * copy-file.c: New file, from GNU gettext.
7897
7898 2003-03-18  Jim Meyering  <jim@meyering.net>
7899
7900         * quote.c (quote_n): Fix typo in comment.
7901
7902 2003-03-14  Jim Meyering  <jim@meyering.net>
7903
7904         Merge changes from Coreutils.
7905         * obstack.h (obstack_object_size): Declare temporary, __o,
7906         to be const, in order to avoid warnings.
7907         (obstack_room): Likewise.
7908         (obstack_empty_p): Likewise.
7909
7910 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7911
7912         Merge changes from Bison.
7913         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7914         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7915         when compiling Bison 1.875's `bitset bset = obstack_alloc
7916         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7917         * hash.c: Include <stdbool.h> unconditionally.
7918
7919 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7920
7921         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7922         Reported by Bruce Becker; see:
7923         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7924
7925 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7926             Bruno Haible  <bruno@clisp.org>
7927
7928         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7929         Reported by John Hughes, see
7930         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7931
7932 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7933
7934         * poll_.h: New file.
7935         * poll.c: New file.
7936
7937 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7938
7939         * mathl.h: New file.
7940         * acosl.c: New file.
7941         * asinl.c: New file.
7942         * atanl.c: New file.
7943         * ceill.c: New file.
7944         * cosl.c: New file.
7945         * expl.c: New file.
7946         * floorl.c: New file.
7947         * frexpl.c: New file.
7948         * ldexpl.c: New file.
7949         * logl.c: New file.
7950         * sincosl.c: New file.
7951         * sinl.c: New file.
7952         * sqrtl.c: New file.
7953         * tanl.c: New file.
7954         * trigl.c: New file.
7955         * trigl.h: New file.
7956
7957 2003-02-17  Bruno Haible  <bruno@clisp.org>
7958
7959         * mkdtemp.h: New file, from GNU gettext.
7960         * mkdtemp.c: New file, from GNU gettext.
7961
7962 2003-01-31  Bruno Haible  <bruno@clisp.org>
7963
7964         * rename.c: #undef rename before defining rpl_rename.
7965         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7966
7967 2003-01-30  Bruno Haible  <bruno@clisp.org>
7968
7969         * printf-args.h: New file, from GNU gettext.
7970         * printf-args.c: New file, from GNU gettext.
7971         * printf-parse.h: New file, from GNU gettext.
7972         * printf-parse.c: New file, from GNU gettext.
7973         * vasnprintf.h: New file, from GNU gettext.
7974         * vasnprintf.c: New file, from GNU gettext.
7975         * asnprintf.c: New file, from GNU gettext.
7976         * vasprintf.h: New file, from GNU gettext with modifications.
7977         * vasprintf.c: New file, from GNU gettext.
7978         * asprintf.c: New file, from GNU gettext.
7979
7980 2003-01-29  Bruno Haible  <bruno@clisp.org>
7981
7982         * stpncpy.h: New file, from GNU gettext with modifications.
7983         * stpncpy.c: New file, from GNU gettext with modifications.
7984
7985 2003-01-28  Bruno Haible  <bruno@clisp.org>
7986
7987         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7988         Paul Eggert.
7989         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7990         Paul Eggert.
7991
7992 2003-01-27  Bruno Haible  <bruno@clisp.org>
7993
7994         * xsetenv.h: New file, from GNU gettext.
7995         * xsetenv.c: New file, from GNU gettext.
7996
7997 2003-01-23  Bruno Haible  <bruno@clisp.org>
7998
7999         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8000
8001 2003-01-22  Bruno Haible  <bruno@clisp.org>
8002
8003         * exit.h: New file, from GNU gettext.
8004
8005 2003-01-11  Bruno Haible  <bruno@clisp.org>
8006
8007         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8008         * strcase.h (strcasecmp, strncasecmp): Likewise.
8009
8010 2003-01-14  Jim Meyering  <jim@meyering.net>
8011
8012         * same.c (same_name): Tweak a comment.
8013
8014 2003-01-11  Bruno Haible  <bruno@clisp.org>
8015
8016         * same.c (same_name): Reorder tests so as to avoid calling stat()
8017         when a string comparison is sufficient.
8018
8019 2003-01-11  Bruno Haible  <bruno@clisp.org>
8020
8021         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8022         'unsigned int'.
8023
8024 2003-01-11  Bruno Haible  <bruno@clisp.org>
8025
8026         * hash-pjw.c: Add comment about low quality of this function.
8027
8028 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8029
8030         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8031         to avoid collisions with libcurses and libreadline.
8032
8033         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8034         * getstr.h, getstr.c: Remove.
8035         * getline.c: Include "getline.h", to check interface.
8036         Move body of old getstr.c here: this defines MIN_CHUNK and
8037         declares getdelim2, which is renamed from getstr.
8038         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8039
8040         * linebuffer.c (readlinebuffer): Renamed from readline.
8041         All uses changed.
8042         * linebuffer.h: Likewise.
8043         (readline): Remove backward-compatibility macro.
8044
8045 2003-01-12  Jim Meyering  <jim@meyering.net>
8046
8047         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8048
8049 2003-01-10  Bruno Haible  <bruno@clisp.org>
8050
8051         * alloca_.h: New file.
8052         * getdate.y: Unconditionally include alloca.h.
8053         * makepath.c: Likewise.
8054         * setenv.c: Likewise.
8055         * userspec.c: Likewise.
8056
8057 2003-01-09  Bruno Haible  <bruno@clisp.org>
8058
8059         * stdbool.h.in: New file.
8060
8061 2003-01-08  Bruno Haible  <bruno@clisp.org>
8062
8063         * safe-read.c: Include specification header first, to ensure its
8064         selfcontainedness.
8065         * full-write.c: Likewise.
8066
8067 2003-01-08  Jim Meyering  <jim@meyering.net>
8068
8069         * full-write.c: Undefine and define-away `const' after inclusion
8070         of errno.h, not before.  Suggestion from Bruno Haible.
8071
8072 2003-01-07  Jim Meyering  <jim@meyering.net>
8073
8074         * full-write.c: Rework so that it may serve to define full_read, too.
8075         * full-read.c: Simply #define FULL_READ and include full-write.c.
8076
8077 2003-01-06  Jim Meyering  <jim@meyering.net>
8078
8079         * version-etc.c: Update year in translatable copyright string.
8080
8081 2002-12-25  Bruno Haible  <bruno@clisp.org>
8082
8083         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8084         * xstrtol.h: Likewise.
8085         * xstrtoimax.c: Likewise.
8086         * xstrtoumax.c: Likewise.
8087         * human.h: Likewise.
8088
8089         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8090         on systems that have <inttypes.h> but not <stdint.h>.
8091
8092 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8093
8094         * memcoll.c (memcoll): Fall back on a simple algorithm using
8095         memcmp if strcoll doesn't work.
8096
8097 2002-12-23  Bruno Haible  <bruno@clisp.org>
8098
8099         * localcharset.h: New file.
8100         * localcharset.c: Include it.
8101         * unicodeio.c: Likewise.
8102
8103 2002-12-22  Bruno Haible  <bruno@clisp.org>
8104
8105         * utime.c (utime_null): No need to call ftruncate if the file was
8106         nonempty.
8107
8108 2002-12-23  Bruno Haible  <bruno@clisp.org>
8109
8110         * memcoll.c (STRCOLL): New macro.
8111         (memcoll): Use it.
8112
8113 2002-12-22  Bruno Haible  <bruno@clisp.org>
8114
8115         * getstr.h (getstr): Define, to avoid clash with libcurses.
8116         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8117
8118 2002-12-22  Bruno Haible  <bruno@clisp.org>
8119
8120         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8121
8122 2002-12-23  Bruno Haible  <bruno@clisp.org>
8123
8124         * getline.h: Include <stddef.h>, for size_t.
8125
8126         * unicodeio.h: Include <stddef.h>, for size_t.
8127         * unicodeio.c: Don't include <stddef.h>.
8128
8129 2002-12-17  Bruno Haible  <bruno@clisp.org>
8130
8131         * canon-host.c (strdup): Remove unused declaration.
8132
8133         * fsusage.c: Include full_read.h.
8134         (get_fs_usage): Use full_read instead of safe_read.
8135
8136         * utime.c (utime_null): Use SAFE_READ_ERROR.
8137
8138 2002-12-11  Bruno Haible  <bruno@clisp.org>
8139
8140         * setenv.h: Rewritten to cope with systems that have setenv() but not
8141         unsetenv().
8142         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8143         modifications:
8144
8145         2002-12-11  Bruno Haible  <bruno@clisp.org>
8146
8147                 * setenv.c (alloca): Fall back to malloc.
8148                 (freea): New macro.
8149                 (setenv): Use freea() to free memory allocated with alloca().
8150
8151         2002-11-13  Bruno Haible  <bruno@clisp.org>
8152
8153                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8154                 function declarations.
8155                 * unsetenv.c (unsetenv): Likewise.
8156
8157         2002-03-04  Bruno Haible  <bruno@clisp.org>
8158
8159                 Portability to AIX 4.3.3.
8160                 * unsetenv.c: New file, extracted from setenv.c.
8161                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8162
8163         2001-12-20  Bruno Haible  <bruno@clisp.org>
8164
8165                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8166                 use malloc instead. For SunOS 4.
8167
8168         2001-12-11  Bruno Haible  <bruno@clisp.org>
8169
8170                 * setenv.c: Declare alloca.
8171                 (compar_fn_t): New typedef.
8172                 (KNOWN_VALUE, STORE_VALUE): Use it.
8173
8174         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8175         setenv.h.
8176
8177 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8178
8179         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8180         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8181         Choose values that are less likely to collide with system fnmatch
8182         options.
8183         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8184         defined (e.g., a pure POSIX system).
8185         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8186         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8187
8188 2002-12-06  Jim Meyering  <jim@meyering.net>
8189
8190         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8191
8192         Merge in changes from libc's misc/error.c, in preparation
8193         for the merge of gnulib's changes back into libc.
8194
8195         * error.c (_): Define only if not already defined.
8196         Move definition to follow all #include directives.
8197         Include unlocked-io.h only if !_LIBC.
8198         [_LIBC]: Include <libio/libioP.h>.
8199         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8200         (fflush): Tweak definition to use INTUSE.
8201         (putc): Define.
8202
8203 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8204
8205         * alloca.c [defined emacs]: Include "lisp.h".
8206         (xalloc_die) [defined emacs]: New macro.
8207         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8208         [! defined emacs]: Include <xalloc.h>.
8209         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8210         (pointer): Typedef to POINTER_TYPE *.
8211         (malloc): Remove decl; we now always use xmalloc.
8212         (alloca): Use old-style definition, since Emacs needs this.
8213         Check for arithmetic overflow when computing combined size.
8214
8215 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8216
8217         Do not generate unlocked-io.h automatically, since it's easier to
8218         maintain it by hand.
8219
8220         * unlocked-io.h: New file, from GNU diffutils,
8221         but with proper copyright notice and attribution.
8222         * gen-uio: Remove.
8223         * Makefile.am: Add copyright notice.
8224         (libfetish_a_SOURCES): Add unlocked-io.h.
8225         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8226         (DISTCLEANFILES, io_functions): Remove macros.
8227         (EXTRA_DIST): Remove gen_uio.
8228         (unlocked-io.h): Remove rule.
8229
8230 2002-12-04  Jim Meyering  <jim@meyering.net>
8231
8232         Reflect the fact that stat.c and lstat.c are no longer generated.
8233         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8234         (DISTCLEANFILES): Likewise.
8235         (EXTRA_DIST): Likewise.
8236         (all_local): Don't depend on stat.c or lstat.c.
8237         (stat.c, lstat.c): Remove rules.
8238         (EXTRA_DIST): Remove xstat.in.
8239
8240         * xstat.in: Remove file.  Contents moved into stat.c.
8241         * stat.c: New file.  Contents mostly from xstat.in.
8242         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8243         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8244
8245         * safe-read.c: Rework so that it may serve to define safe_write, too.
8246         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8247
8248 2002-12-03  Jim Meyering  <jim@meyering.net>
8249
8250         * safe-read.c, safe-write.c: Change variable names and comments, but
8251         not semantics, to minimize the differences between these two files.
8252         (safe_read): Change comment to mention SAFE_READ_ERROR.
8253
8254         * safe-read.c (IS_EINTR): Define.
8255         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8256
8257 2002-12-02  Bruno Haible  <bruno@clisp.org>
8258
8259         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8260         Define, taken from safe-read.c.
8261         (INT_MAX): Provide fallback.
8262         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8263         * safe-write.h (SAFE_WRITE_ERROR): Define.
8264
8265         * safe-read.c (EINTR): Remove definition.
8266         (safe_read): Don't use EINTR if it is absent.
8267
8268 2002-12-02  Jim Meyering  <jim@meyering.net>
8269
8270         * safe-read.c (EINTR): Define.
8271         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8272         (INT_MAX): Provide fallback.
8273         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8274
8275         * safe-read.h (SAFE_READ_ERROR): Define.
8276
8277 2002-12-01  Jim Meyering  <jim@meyering.net>
8278
8279         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8280         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8281
8282 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8283
8284         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8285         hash_rehash): Replace `if (limit <= value) abort ();' with
8286         `if (! (value < limit)) abort ();', for readability.
8287
8288 2002-11-26    <karl@gnu.org>
8289
8290         * strdup.c: copy from libc again, with jim's ok.
8291         * .cppi-disable: re-add strdup.c
8292
8293 2002-11-25    <karl@gnu.org>
8294
8295         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8296         instead of "strtol.c".
8297
8298 2002-11-25  Jim Meyering  <jim@meyering.net>
8299
8300         * mktime.c: Sync from libc, now that it has the latest fix.
8301
8302 2002-11-24    <karl@gnu.org>
8303
8304         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8305         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8306
8307 2002-11-24  Jim Meyering  <jim@meyering.net>
8308
8309         Update from coreutils:
8310
8311         * mktime.c: Merge in changes from libc.
8312
8313         Avoid a link-time failure on some Linux systems.
8314         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8315         (__mon_yday): Declare with the STATIC attribute.
8316         (__mktime_internal): Likewise.
8317         Based on a report from Greg Schafer.
8318
8319 2002-11-23  Jim Meyering  <jim@meyering.net>
8320
8321         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8322         Use `unsigned', not `int', as type of index.
8323
8324         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8325
8326         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8327
8328 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8329
8330         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8331         hint that one should use `if (! x) abort ();' rather than `assert
8332         (x);', and anyway it's one less thing to worry about configuring.
8333         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8334         hash_rehash, hash_insert): Use abort rather than assert.
8335
8336 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8337
8338         * quotearg.h: Allow multiple inclusion by surrounding with
8339         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8340         so that we can be included first.
8341         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8342         * quotearg.c: Include quotearg.h immediately after config.h.
8343         No need to include stddef.h or sys/types.h any more.
8344         Surround local include files with "", not "<>".
8345         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8346         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8347         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8348         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8349         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8350         (ISPRINT): Remove; no longer needed now that we assume C89.
8351
8352         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8353         Preserve errno.
8354
8355         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8356         quotearg_char): Use SIZE_MAX rather than
8357         (size_t) -1 when we are talking about "infinity".
8358
8359         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8360
8361 2002-11-22  Bruno Haible  <bruno@clisp.org>
8362
8363         * safe-read.h: Assume C89. Add comments.
8364         (safe_read): Change return type to size_t.
8365         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8366         counts > SSIZE_MAX correctly.
8367         * safe-write.h: New file.
8368         * safe-write.c: New file.
8369         * full-read.h: New file.
8370         * full-read.c: New file.
8371         * full-write.h: Assume C89. Add comments.
8372         * full-write.c: Include safe-write.h.
8373         (full_write): Rewritten to use safe_write.
8374         Suggested by Jim Meyering and Paul Eggert.
8375
8376 2002-11-21  Bruno Haible  <bruno@clisp.org>
8377
8378         Remove case insensitive option matching.
8379         * argmatch.h (argcasematch): Remove declaration.
8380         (ARGCASEMATCH): Remove macro.
8381         (__xargmatch_internal): Remove case_sensitive argument.
8382         (XARGMATCH): Update.
8383         (XARGCASEMATCH): Remove macro.
8384         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8385         case_sensitive argument.
8386         (argcasematch): Remove function.
8387         (__xargmatch_internal): Remove case_sensitive argument.
8388         (main): Use XARGMATCH instead of XARGCASEMATCH.
8389
8390         * xmalloc.c: Change compile-time error message. Add comment about
8391         required autoconf version.
8392
8393 2002-11-21  Jim Meyering  <jim@meyering.net>
8394
8395         * strdup.c (strdup): Tweak comment and initial #if/#include.
8396
8397         Merge in changes from the coreutils.
8398
8399         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8400         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8401         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8402         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8403         int.  Work more efficiently if X is the same width as uintmax_t.
8404         Do not compare X to -1, to avoid bogus compiler warning.
8405         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8406         Don't assume that f_frsize and f_bsize are the same type.
8407
8408         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8409         on FreeBSD.
8410
8411         * makepath.c (make_path): Restore umask *before* creating the final
8412         component.
8413         (make_path): Minor reformatting.
8414
8415         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8416         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8417
8418         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8419         ones.  At least on GNU/Linux systems, `auto' means something else.
8420         From Michael Stone.
8421
8422 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8423
8424         Merge argmatch cleanups from Bison.  Assume C89.
8425
8426         * argmatch.c: Include config.h here, not in argmatch.h.
8427         Include stdlib.h, for EXIT_FAILURE.
8428         Always include <string.h>, since we assume C89.
8429         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8430         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8431         Include <stddef.h> instead, since it's all we need for size_t.
8432         (PARAMS): Remove.  All uses removed.
8433         (ARRAY_CARDINALITY): Do not bother to #undef.
8434         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8435         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8436         Remove unnecessary parentheses.
8437         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8438         Insert necessary parentheses.
8439         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8440         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8441
8442 2002-11-19  Bruno Haible  <bruno@clisp.org>
8443
8444         * mbswidth.c: Include mbswidth.h right at the beginning.
8445         * mbswidth.h: Include <stddef.h>, for size_t.
8446
8447         * mbswidth.h (PARAMS): Remove macro.
8448         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8449         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8450
8451         * gcd.h (PARAMS): Remove macro.
8452         (gcd): Use ANSI C function declarations.
8453         * gcd.c (gcd): Likewise.
8454
8455 2002-11-15  Bruno Haible  <bruno@clisp.org>
8456
8457         * strcspn.c: Include <stddef.h>.
8458         (strcspn): Use ANSI C function declaration. Change return type to
8459         size_t. Use NULL.
8460         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8461         (strpbrk): Use NULL.
8462         * strpbrk.h (PARAMS): Remove macro.
8463         (strpbrk): Use ANSI C function declaration.
8464         * strstr.c: Don't include <sys/types.h>.
8465         * strstr.h (PARAMS): Remove macro.
8466         (strstr): Use ANSI C function declarations.
8467
8468 2002-11-06  Bruno Haible  <bruno@clisp.org>
8469
8470         * gcd.h (gcd): Change argument type to 'unsigned long'.
8471         * gcd.c (gcd): Likewise.
8472
8473 2002-11-05  Bruno Haible  <bruno@clisp.org>
8474
8475         * gcd.h: New file, from gettext-0.11.5.
8476         * gcd.c: New file, from gettext-0.11.5.
8477
8478 2002-11-05  Bruno Haible  <bruno@clisp.org>
8479
8480         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8481         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8482         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8483         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8484
8485         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8486         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8487
8488         * closeout.c: Include gettext.h instead of <libintl.h>.
8489         * human.c: Include gettext.h instead of <libintl.h>.
8490         * quotearg.c: Include gettext.h instead of <libintl.h>.
8491         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8492         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8493         * userspec.c: Include gettext.h instead of <libintl.h>.
8494         * version-etc.c: Include gettext.h instead of <libintl.h>.
8495         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8496         (textdomain): Remove definition.
8497         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8498
8499         * long-options.c: Remove include of <libintl.h> and definition of _.
8500         * same.c: Remove include of <libintl.h> and definition of _.
8501
8502 2002-11-04  Bruno Haible  <bruno@clisp.org>
8503
8504         * stpcpy.h: New file, from GNU gettext-0.11.5.
8505         * strcase.h: New file, from GNU gettext-0.11.5.
8506         * strpbrk.h: New file, from GNU gettext-0.11.5.
8507         * strstr.h: New file, from GNU gettext-0.11.5.
8508         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8509
8510 2002-05-09  Bruno Haible  <bruno@clisp.org>
8511
8512         * config.charset: Update for newest glibc. Add canonical names
8513         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8514
8515 2002-05-09  Bruno Haible  <bruno@clisp.org>
8516
8517         * localcharset.c (get_charset_aliases): Add more Windows specific
8518         aliases.
8519
8520 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8521
8522         * config.charset: A few additions for Solaris.
8523
8524 2001-12-05  Bruno Haible  <bruno@clisp.org>
8525
8526         * localcharset.c (locale_charset): Don't return an empty string.
8527
8528 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8529
8530         * config.charset: msdos in uk_UA uses CP1125.
8531
8532 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8533
8534         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8535         * localcharset.c (locale_charset): Declare as extern "C".
8536
8537 2002-02-15  Bruno Haible  <bruno@clisp.org>
8538
8539         * config.charset [msdosdjgpp]: For Russian, use CP866.
8540
8541 2002-02-11  Bruno Haible  <bruno@clisp.org>
8542
8543         * config.charset: Add support for NetBSD.
8544
8545 2002-09-25    <karl@gnu.org>
8546
8547         * strdup.c: copy from libc/string (via ../config/srclist*).
8548         * getopt*: copy from libc/posix.
8549         * gettext.h: copy from gettext.
8550         * .cppi-disable: add strdup.c, gettext.h.
8551
8552 2002-07-01  Jim Meyering  <meyering@lucent.com>
8553
8554         * c-stack.c: Include sys/time.h.
8555         From Volker Borchert.
8556
8557 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8558
8559         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8560         New macro.  Use it uniformly instead of
8561         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8562         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8563         reported by Vin Shelton.
8564
8565 2002-06-22  Jim Meyering  <meyering@lucent.com>
8566
8567         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8568         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8569
8570 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8571
8572         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8573         Do not assume SA_SIGINFO behavior.
8574         Bug reported by Jim Meyering on NetBSD 1.5.2.
8575
8576 2002-06-22  Jim Meyering  <meyering@lucent.com>
8577
8578         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8579
8580         * exitfail.c, exitfail.h: Likewise.
8581         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8582
8583         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8584         of fnmatch.h.
8585         (EXTRA_DIST): Add fnmatch_loop.c.
8586         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8587
8588         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8589         * fnmatch.c: Update from diffutils-2.8.2.
8590         * fnmatch_.h: New file.  From diffutils-2.8.2.
8591         * fnmatch.h: Remove file.
8592
8593 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8594
8595         * file-type.h: Report an error if neither S_ISREG nor
8596         S_IFREG is defined, instead of using a test specific to glibc
8597         2.2.  This should be safe, since POSIX requires S_ISREG and
8598         Unix Version 7 had S_IFREG.  We don't need to check for
8599         <sys/types.h> since we don't use any symbols that it defines.
8600
8601 2002-06-15  Jim Meyering  <meyering@lucent.com>
8602
8603         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8604         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8605         have been included before this file.
8606
8607 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8608
8609         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8610         so that each temporary file name is unique and valid in the first
8611         8 characters, for operation under DOS.
8612
8613 2002-06-15  Jim Meyering  <meyering@lucent.com>
8614
8615         Work even with DJGPP 2.03, which lacks support for symlinks.
8616         From Richard Dawe.
8617         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8618         is defined.
8619         * lchown.c (S_ISLNK): Likewise.
8620
8621 2002-06-14  Jim Meyering  <meyering@lucent.com>
8622
8623         * file-type.h: Use the version from diffutils-2.8.2.
8624         * file-type.c: Likewise.
8625
8626 2002-05-27  Jim Meyering  <meyering@lucent.com>
8627
8628         Fix a problem seen only on nonconforming systems whereby ls.c's
8629         use of localtime, and then of gettimeofday would cause trouble:
8630         the localtime call used to initialize rpl_gettimeofday's save
8631         mechanism would clobber ls's current local time information so
8632         that in any long listing the first file would always be listed
8633         with date 1970-01-01.  Analysis by Volker Borchert.
8634
8635         * gettimeofday.c (localtime): Undefine.
8636         (rpl_localtime): New function.
8637
8638 2002-05-22  Jim Meyering  <meyering@lucent.com>
8639
8640         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8641         * file-type.h: New file.
8642         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8643
8644 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8645
8646         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8647
8648 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8649
8650         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8651         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8652         of 127, since 64 is the largest conceivable number for ancient
8653         nonstandard hosts.
8654         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8655
8656 2002-04-28  Jim Meyering  <meyering@lucent.com>
8657
8658         * sig2str.c (WTERMSIG): Remove definition (unused).
8659
8660 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8661
8662         * sig2str.h, sig2str.c: New files.
8663         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8664
8665 2002-04-24  Jim Meyering  <meyering@lucent.com>
8666
8667         * gettext.h: New file, from Gettext.
8668         * Makefile.am (INCLUDES): Remove -I../intl.
8669         (libfetish_a_SOURCES): Add gettext.h.
8670
8671 2002-04-16  Jim Meyering  <meyering@lucent.com>
8672
8673         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8674         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8675         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8676
8677 2002-04-12  Jim Meyering  <meyering@lucent.com>
8678
8679         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8680
8681 2002-03-10  Jim Meyering  <meyering@lucent.com>
8682
8683         * makepath.c (make_path): Remove a comma from a diagnostic.
8684         Suggestion from Santiago Vila.
8685
8686 2002-03-08  Jim Meyering  <meyering@lucent.com>
8687
8688         * rename.c: Mention that this wrapper is needed also on
8689         mips-dec-ultrix4.4 systems.
8690
8691 2002-03-02  Jim Meyering  <meyering@lucent.com>
8692
8693         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8694         not HAVE_CLOCK_SETTIME.
8695
8696 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8697
8698         * nanosleep.h: Rename to....
8699         * timespec.h: New name for nanosleep.h.  All uses changed.
8700
8701         * gettime.c: New file.
8702         * settime.c: New file.
8703         * stime.c: Remove.
8704
8705         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8706         timespec.h.  Remove nanosleep.h.
8707
8708 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8709
8710         * acl.c, acl.h: New files.
8711         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8712
8713 2002-02-24  Jim Meyering  <meyering@lucent.com>
8714
8715         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8716         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8717         cause trouble.  Reported by Nelson Beebe.
8718
8719 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8720
8721         * path-concat.c (xpath_concat): Reorder code to pacify
8722         compilers that don't know that xalloc_die never returns.
8723
8724 2002-02-20  Jim Meyering  <meyering@lucent.com>
8725
8726         * getdate.c: Regenerate using bison-1.33.
8727
8728 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8729
8730         * posixver.c, posixver.h: New files.
8731         * Makefile.am (libfetish_a_SOURCES): Add them.
8732
8733 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8734             Bruno Haible  <bruno@clisp.org>
8735
8736         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8737         (fwrite_success_callback): New declaration.
8738         * unicodeio.c (unicode_to_mb): New function, extracted from
8739         print_unicode_char. Call failure callback instead of error.
8740         (fwrite_success_callback): New function.
8741         (exit_failure_callback): New function.
8742         (fallback_failure_callback): New function.
8743         (print_unicode_char): Call unicode_to_mb.
8744
8745 2002-01-26  Jim Meyering  <meyering@lucent.com>
8746
8747         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8748
8749 2002-01-22  Jim Meyering  <meyering@lucent.com>
8750
8751         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8752         Otherwise, some versions of automake would omit the rule that makes
8753         Makefile from Makefile.in.
8754
8755 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8756
8757         * xmemcoll.h, xmemcoll.c: New files.
8758         * Makefile.am (libfetish_a_SOURCES): Add them.
8759         * memcoll.c: Include errno.h, and declare errno if not defined.
8760         (memcoll): Set errno to zero if there is no error.
8761
8762         * quotearg.c (quotearg_buffer_restyled):
8763         Fix bug with quoting buffers containing NUL when backslashing escapes.
8764         This bug was exposed by the other changes in this patch.
8765         (quotearg_n_options): New arg ARGSIZE.
8766         All callers changed.
8767         (quoting_options_from_style): New function.
8768         (quotearg_n_style): Use it.
8769         (quotearg_n_style_mem): New function.
8770
8771         * quotearg.h (quotearg_n_style_mem): New function.
8772
8773 2002-01-16  Jim Meyering  <meyering@lucent.com>
8774
8775         * getdate.y: Add three semicolons, each just before a closing brace.
8776         Bison (as of version 1.31) no longer papers over that mistake.
8777
8778 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8779
8780         * backupfile.c (ISDIGIT): Comment fix.
8781         * getdate.y (ISDIGIT): Likewise.
8782         * posixtm.c (ISDIGIT, year): Likewise.
8783         * strverscmp.c (ISDIGIT): Likewise.
8784         * userspec.c (ISDIGIT): Likewise.
8785
8786 2002-01-05  Jim Meyering  <meyering@lucent.com>
8787
8788         * version-etc.c (version_etc_copyright): Update copyright year.
8789
8790 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8791
8792         * closeout.c (close_stdout_status): If ferror (stdout), do
8793         not silently exit merely because the output buffer happens to
8794         have nothing pending.
8795
8796 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8797
8798         See the big note in ../ChangeLog.
8799         * human.c (suffixes): Prefer K to k for 1024.
8800         (generate_suffix_backwards): New function.
8801         (human_readable_inexact): Use it.
8802         * xstrtol.c (__xstrtol): If there is no number but there
8803         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8804         Accept 'K' as well as 'k'.
8805
8806 2001-12-15  Jim Meyering  <meyering@lucent.com>
8807
8808         * regex.h (__restrict_arr): Update from libc.
8809
8810         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8811         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8812         (STREQ): Define.
8813
8814 2001-12-10  Jim Meyering  <meyering@lucent.com>
8815
8816         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8817         Instead, include "xalloc.h".
8818         (initbuffer): Don't cast xmalloc return value to char*.
8819         (readline): Reword comment.
8820         Don't cast xrealloc return value to char*
8821         Return NULL, not 0.
8822
8823 2001-12-09  Jim Meyering  <meyering@lucent.com>
8824
8825         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8826         `signed and unsigned type in conditional expression'.
8827         * posixtm.c (posix_time_parse): Likewise.
8828
8829         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8830
8831         * readtokens.c (readtoken): Declare an index to be of type unsigned
8832         to avoid a pedantic warning.
8833
8834         * getstr.c: Don't include assert.h.
8835         (getstr): Remove warning-evoking assertions.
8836         Return -1 if offset parameter is out of bounds.
8837         Change the type of a local from int to size_t.
8838
8839         * strftime.c (my_strftime_localtime_r): Include this function
8840         definition in the `#if ! HAVE_TM_GMTOFF' block.
8841
8842         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8843         Include xalloc.h instead.
8844
8845 2001-12-02  Jim Meyering  <meyering@lucent.com>
8846
8847         * tempname.c: Don't declare getenv, thus reverting the change of
8848         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8849         included.
8850
8851         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8852         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8853
8854 2001-11-30  Akim Demaille  <akim@epita.fr>
8855
8856         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8857         before being defined.
8858
8859 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8860
8861         * quotearg.h (quotearg_n, quotearg_n_style):
8862         First arg is int, not unsigned.
8863         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8864         (SIZE_MAX, UINT_MAX): New macros.
8865         (quotearg_n_options): Abort if N is negative.
8866         Avoid overflow check on hosts where size_t is 64 bits and int
8867         is 32 bits, as overflow is impossible there.
8868         Fix off-by-one typo that caused unnecessary reallocation.
8869
8870 2001-11-27  Jim Meyering  <meyering@lucent.com>
8871
8872         * tempname.c: Merge with version from libc.
8873         * regex.c: Likewise.
8874
8875         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8876         for which STDC_HEADERS is 0, it was not included, resulting in a
8877         warning about an integer-to-pointer conversion problem with getenv.
8878         Reported by Volker Borchert.
8879
8880 2001-11-26  Jim Meyering  <meyering@lucent.com>
8881
8882         * gtod.h: Remove file.
8883         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8884         * gettimeofday.c: Don't include gtod.h.
8885         (GTOD_init): Remove function.
8886         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8887         Suggestion from Volker Borchert.
8888
8889 2001-11-23  Jim Meyering  <meyering@lucent.com>
8890
8891         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8892         * hash.c (struct hash_table): Define it here instead.
8893
8894 2001-11-22  Jim Meyering  <meyering@lucent.com>
8895
8896         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8897
8898 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8899
8900         * tempname.c (TMP_MAX): Remove; no longer needed.
8901         (TEMPORARIES): New macro.
8902         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8903         removes an artificial limitation (e.g. HP-UX 10.20, where
8904         TMP_MAX is 17576).
8905
8906 2001-11-18  Jim Meyering  <meyering@lucent.com>
8907
8908         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8909         on SunOS 4.
8910
8911         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8912         files will be created before anything else.
8913
8914 2001-11-17  Jim Meyering  <meyering@lucent.com>
8915
8916         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8917         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8918         rather than group writable.  Patch by Juan F. Codagnone.
8919
8920         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8921         Instead, include "xalloc.h".
8922
8923         * mountlist.c: Include unlocked-io.h after all system headers.
8924         Remove explicit declarations of xmalloc, xrealloc,
8925         and xstrdup.  Instead, include "xalloc.h".
8926
8927         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8928         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8929         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8930
8931         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8932         Reported by Padraig Brady.
8933
8934         * mkstemp.c: #undef mkstemp.
8935         Include config.h.
8936         (rpl_mkstemp): Rename from mkstemp.
8937         Protoize.
8938
8939 2001-11-16  Jim Meyering  <meyering@lucent.com>
8940
8941         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8942         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8943         determine the amount of total physical memory, use pstat_getstatic.
8944         HPUX-11 doesn't define _SC_PHYS_PAGES.
8945         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8946         If sysconf couldn't be used to determine the amount of available
8947         physical memory, use both pstat_getstatic and pstat_getdynamic.
8948         Based on a patch from Bob Proulx.
8949
8950 2001-11-05  Jim Meyering  <meyering@lucent.com>
8951
8952         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8953
8954 2001-11-03  Jim Meyering  <meyering@lucent.com>
8955
8956         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8957         in argmatch_to_argument call.
8958
8959         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8960         argument.
8961
8962         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8963         e.g., a fault due to an attempt to free a NULL pointer.
8964
8965 2001-11-01  Jim Meyering  <meyering@lucent.com>
8966
8967         * dirfd.c, dirfd.h: New files.
8968         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8969
8970         * hash.c (hash_print) [TESTING]: Clean up.
8971
8972 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8973
8974         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8975         to avoid a warning if -Wall.
8976
8977 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8978
8979         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8980
8981 2001-10-21  Jim Meyering  <meyering@lucent.com>
8982
8983         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8984         this code would end up calling gettext even in packages built
8985         with --disable-nls.
8986         * getopt.c (_): Likewise.
8987         * regex.c (_): Likewise.
8988
8989 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8990
8991         * error.c (strerror_r): Do not declare unless !_LIBC.
8992         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8993         Use strerror_r that is only a macro, even if it is not a function.
8994         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8995         (private_strerror): Use prototypes, not old-style function definition.
8996         (print_errno_message): New function.
8997         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8998         char*-flavored one.
8999         (error_tail, error, error_at_line): Use it.
9000
9001 2001-10-11  Jim Meyering  <meyering@lucent.com>
9002
9003         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9004         and quote_n (1, ... to avoid clobbering a buffer.
9005
9006 2001-10-05  Jim Meyering  <meyering@lucent.com>
9007
9008         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9009         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9010         * hash-pjw.h: New file.
9011
9012 2001-09-30  Jim Meyering  <meyering@lucent.com>
9013
9014         * mountlist.c [MOUNTED_GETFSSTAT]:
9015         Include <sys/ucred.h>, for Apple Darwin.
9016         Include sys/mount.h and sys/fs_types.h only if available.
9017         (FS_TYPE): Define.
9018         (read_filesystem_list): Use FS_TYPE.
9019
9020 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9021
9022         * exclude.c (excluded_filename): 0 -> false, since it's
9023         a boolean context.
9024
9025 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9026
9027         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9028         #defines strtoimax.  Also treat the other strto* functions
9029         like strtoimax.
9030
9031         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9032         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9033         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9034
9035 2001-09-26  Jim Meyering  <meyering@lucent.com>
9036
9037         Most macros in unlocked-io.h had the wrong number of arguments.
9038         * gen-uio: New script.
9039         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9040         * unlocked-io.hin: Remove file.
9041         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9042         rather than trying to embed it here.
9043         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9044         Reported by Padraig Brady.
9045
9046 2001-09-25  Volker Borchert  <bt@teknon.de>
9047
9048         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9049
9050 2001-09-23  Jim Meyering  <meyering@lucent.com>
9051
9052         * mountlist.c: Remove useless parentheses in #if directives.
9053         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9054         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9055
9056 2001-09-22  Jim Meyering  <meyering@lucent.com>
9057
9058         * localcharset.c: Update from latest gettext.
9059         * config.charset: Likewise.
9060
9061 2001-09-20  Jim Meyering  <meyering@lucent.com>
9062
9063         * xstrtol.c (strtoimax): Guard declaration with
9064         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9065         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9066         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9067         (strtoumax): Likewise, for completeness (it wasn't necessary).
9068
9069 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9070
9071         * strtoimax.c (HAVE_LONG_LONG):
9072         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9073         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9074         to work around bug in IBM C compiler.
9075
9076 2001-09-16  Jim Meyering  <meyering@lucent.com>
9077
9078         * mkdir.c: New file.
9079
9080 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9081
9082         * xgetcwd.c: Revert some of the previous change; intead,
9083         fix the HAVE_GETCWD_NULL code to behave more like the
9084         !HAVE_GETCWD_NULL code used to.
9085
9086         Include "xalloc.h".
9087         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9088         invoke xalloc_die.
9089
9090 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9091
9092         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9093         Use ssize_t, not int, to store result of readlink.
9094         Check for ssize_t overflow as well as size_t overflow,
9095         as POSIX says the result of readlink is implementation-defined
9096         when ssize_t overflows.
9097         Remove unnecessary cast to char*.
9098         Use free+malloc instead of realloc, as the storage doesn't need
9099         to be preserved and it's clearer and can be more efficient that way.
9100         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9101         * xreadlink.h (xreadlink): Update prototype.
9102
9103 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9104
9105         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9106         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9107         spotted by Jim Meyering.
9108
9109 2001-09-03  Jim Meyering  <meyering@lucent.com>
9110
9111         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9112
9113 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9114
9115         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9116         like the HAVE_GETCWD_NULL code.
9117         Include pathmax.h if not HAVE_GETCWD.
9118         Do not include xalloc.h.
9119         (INITIAL_BUFFER_SIZE): New symbol.
9120         Do not use xmalloc / xrealloc, since the caller is responsible for
9121         handling errors.  Preserve errno around `free' during failure.
9122         Do not overrun buffer when using getwd.
9123
9124 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9125
9126         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9127         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9128
9129 2001-09-02  Jim Meyering  <meyering@lucent.com>
9130
9131         * error.c: Update from GNU libc.
9132
9133 2001-09-01  Jim Meyering  <meyering@lucent.com>
9134
9135         * xreadlink.c: New file.
9136         * xreadlink.h: New file.
9137         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9138
9139         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9140         doesn't conflict with sparc Solaris 7's definition in
9141         /usr/include/sys/int_types.h.
9142
9143         * exclude.c: Use `""', not `<>' to #include non-system header files.
9144         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9145         and strncasecmp as r-values.  Unixware didn't have declarations.
9146
9147 2001-08-31  Jim Meyering  <meyering@lucent.com>
9148
9149         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9150         Use an initial, malloc'd, buffer of length 128 rather than
9151         a statically allocated one of length 1024.
9152
9153 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9154
9155         * xgetcwd.c: Don't include pathmax.h.
9156         Include stdlib.h and unistd.h if available.
9157         Include xalloc.h.
9158         (xmalloc, xstrdup, free): Remove decls.
9159         (xgetcwd): Don't assume sizes fit in unsigned.
9160         Check for overflow when computing sizes.
9161         Simplify reallocation code.
9162
9163 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9164
9165         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9166
9167         * strtoimax.c: Renamed from strtoxmax.c, removing the
9168         old strtoimax.c.
9169
9170         Also, make the following further changes to make this file's
9171         configuration more similar to that of strtol.c:
9172         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9173         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9174         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9175         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9176         changed to signed values.
9177
9178         And make the following changes as well:
9179         Fix copyright notice, as 1999 was missing.
9180         (verify): New macro.
9181         (strtoimax): Check sizes at compile-time, not run-time.
9182         Prefer strtol to strtoll if both work.
9183         (main): Remove; it was not that useful and was a pain to maintain.
9184
9185         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9186
9187 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9188
9189         * savedir.c (savedir): Remove size parameter, as POSIX says that
9190         a directory's st_size can have an arbitrary value, so the old
9191         usage could waste an arbitrary amount of memory.  All uses
9192         changed.
9193         * savedir.h: Update prototype.
9194
9195 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9196
9197         * xstrtol.c (strtoimax): New decl.
9198
9199 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9200
9201         * xstrtol.h: Add copyright notice.
9202         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9203         LONGINT_INVALID_SUFFIX_CHAR.
9204
9205 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9206
9207         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9208         tm to be declared.
9209
9210 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9211
9212         * hash.c: Remove '2001' from copyright notice.
9213
9214 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9215
9216         * full-write.h: New file.
9217         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9218         * full-write.c: Correct credits, as cccp.c no longer
9219         exists and anyway it was so heavily changed from the old cccp
9220         code as to be unrecognizable.  Include full-write.h.
9221         (full_write) Return size_t, with short writes meaning failure.
9222         All callers changed.  This fixes a bug with large buffers
9223         on 64-bit hosts.
9224         * utime.c: Include full-write.h.
9225
9226 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9227
9228         Merge 'exclude' changes from tar 1.13.22.
9229         This fixes one or two unlikely storage allocation overflow bugs,
9230         but doesn't change user-visible behavior otherwise.
9231
9232 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9233
9234         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9235         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9236         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9237         Include if available.
9238         (<xalloc.h>): Include
9239         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9240         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9241         collide with FNM macros.
9242         (struct patopts): New struct.
9243         (struct exclude): Use it, as exclude patterns now come with options.
9244         (new_exclude): Support above changes.
9245         (new_exclude, add_exclude_file):
9246         Initial size must now be a power of two to simplify overflow checking.
9247         (free_exclude, fnmatch_no_wildcards): New function.
9248         (excluded_filename): No longer requires options arg, as the options
9249         are determined by add_exclude.  Now returns bool, not int.
9250         (excluded_filename, add_exclude):
9251         Add support for the fancy new exclusion options.
9252         (add_exclude, add_exclude_file): Now takes int options arg.
9253         Check for arithmetic overflow when computing sizes.
9254         (add_exclude_file): xrealloc might modify errno, so don't
9255         realloc until after errno might be used.
9256
9257         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9258         New macros.
9259         (free_exclude): New decl.
9260         (add_exclude, add_exclude_file): Now takes int options arg.
9261         (excluded_filename): No longer requires options arg, as the options
9262         are determined by add_exclude.  Now returns bool, not int.
9263
9264 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9265
9266         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9267
9268 2001-08-27  Jim Meyering  <meyering@lucent.com>
9269
9270         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9271
9272         * version-etc.c (N_): Remove definition.
9273         Revert most of last change.
9274         Instead, simply don't mark the `Copyright...' string for translation.
9275         Based on advice from Paul Eggert.
9276
9277         * strtoxmax.c: Tweak comment.
9278
9279 2001-08-26  Jim Meyering  <meyering@lucent.com>
9280
9281         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9282         of copyright with `%s' so translators don't get an untranslated
9283         message in 2002.
9284         (COPYRIGHT_YEAR): Define.
9285         (version_etc): Use fprintf rather than fputs.
9286         Suggestion from Ulrich Drepper.
9287
9288         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9289
9290         * strtoll.c: New file, from GNU libc.
9291         * xstrtoimax.c: New file.
9292
9293         * xstrtol.h: Add xstrtoimax.
9294         * strtoumax.c: New file.  Simply include "strtoumax.c".
9295         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9296
9297         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9298         * strtoxmax.c: ... then renamed to this.
9299
9300 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9301
9302         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9303         Port to Solaris 8, where 'sed' requires a space after the 'r'
9304         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9305         Redirect output to $tmp just once.
9306
9307 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9308
9309         * addext.c (<errno.h>): Include.
9310         (errno): Declare if not defined.
9311         (addext): Work correctly when pathconf returns -1 and leaves
9312         errno alone because there is no limit.  Also, work even if
9313         pathconf returns a value greater than SIZE_MAX.
9314
9315 2001-08-12  Jim Meyering  <meyering@lucent.com>
9316
9317         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9318         Simply `return getcwd (NULL, 0);'.
9319         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9320         Use 1300 as initial value for length, not PATH_MAX.
9321
9322         * pathmax.h: Clean up cpp syntax.
9323
9324 2001-08-12  Jim Meyering  <meyering@lucent.com>
9325
9326         * gettimeofday.c: New file.
9327         * gtod.h: New file.
9328         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9329
9330 2001-08-04  Jim Meyering  <meyering@lucent.com>
9331
9332         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9333         to get in sync with glibc.
9334
9335 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9336
9337         The following changes are from gettext 0.10.39 as maintained by
9338         Bruno Haible.
9339
9340         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9341         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9342         with inverted sense.  All uses changed.
9343
9344         * mbswidth.c: Don't include <limits.h>.
9345         Include <stdlib.h> and <string.h> unconditionally.
9346         (iswcntrl, mbsinit, ISCNTRL): New macros.
9347         (mbsnwidth): Use K&R style function declarations.
9348         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9349         can optimize it when MB_CUR_MAX == 1.
9350         The width of control characters is zero, not 1.
9351
9352 2001-07-15  Jim Meyering  <meyering@lucent.com>
9353
9354         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9355         (BUILT_SOURCES): Add unlocked-io.h.
9356         (io_functions): Define.
9357         (unlocked-io.h): New rule.
9358         (DISTCLEANFILES): Add unlocked-io.h.
9359         (all-local): Depend on unlocked-io.h, to ensure it is created.
9360
9361         * unlocked-io.hin: New file
9362
9363         * regex.c: Update from glibc.
9364
9365 2001-07-05  Jim Meyering  <meyering@lucent.com>
9366
9367         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9368         recommendation.
9369         (libfetish_a_SOURCES): Put all .h files here instead.
9370         Remove a thus-exposed (better checks in automake) duplicate and
9371         two unnecessary .h files.
9372
9373 2001-06-11  Jim Meyering  <meyering@lucent.com>
9374
9375         * regex.c: Update from GNU libc.
9376
9377 2001-05-27  Jim Meyering  <meyering@lucent.com>
9378
9379         * readutmp.h (UT_TYPE): Define.
9380
9381 2001-05-24  Jim Meyering  <meyering@lucent.com>
9382
9383         * argmatch.c: Include "quote.h".
9384         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9385         quote function.  Reported by Göran Uddeborg.
9386
9387 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9388
9389         * dirname.c (dir_name): Compute append_dot using path, not newpath
9390         which is not yet declared.
9391
9392 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9393
9394         * Makefile.am (libfetish_a_SOURCES):
9395         Add strftime.c, since we now compile it on all hosts.
9396
9397         * strftime.c (my_strftime):
9398         Define to nstrftime if emacs, but only if my_strftime is not defined.
9399         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9400         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9401         Add one more extra argument: a nanoseconds value.
9402         All uses changed.
9403         (ns): New macro.
9404         (my_strftime function): Add %N format.
9405         (emacs_strftimeu): Renamed from emacs_strftime,
9406         with extra ut argument.
9407
9408 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9409
9410         dirname code cleanup.  base_name now behaves more compatibly
9411         with POSIX basename when given file names that have trailing
9412         slashes, and similarly for dir_name.  Add new primitives
9413         base_len and dir_len.  Put the directory-name-related decls
9414         into dirname.h.
9415
9416         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9417         * backupfile.c (base_name): Likewise.
9418         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9419         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9420         * makepath.c (strip_trailing_slashes): Likewise.
9421         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9422         Likewise.
9423         * rename.c (strip_trailing_slashes): Likewise.
9424         * same.c (base_name): Likewise.
9425         * stripslash.c (ISSLASH): Likewise.
9426
9427         * addext.c: Include <dirname.h> after size_t is defined.
9428         * backupfile.c: Likewise.
9429
9430         * addext.c (addext): Use base_len to trim redundant
9431         trailing slashes instead of doing it ourselves.
9432         But do not trim the last slash if it is not redundant.
9433
9434         * backupfile.c (find_backup_file_name,
9435         max_backup_version): Use base_len instead of rolling it ourselves.
9436         Handle the case of "" and (on DOS) "C:" correctly.
9437
9438         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9439         Include <string.h>, <dirname.h>.
9440         (base_name): Allow file names ending in slashes, other than names
9441         that are all slashes.  In this case, return the basename followed
9442         by the slashes.  This is more general, and can be used in places
9443         where the original base_name purposely had an assertion failure.
9444         (base_len): New function.
9445
9446         * dirname.c: Include <string.h> instead of <stdlib.h>.
9447         Do not include <assert.h>; no longer needed.
9448         Include xalloc.h.
9449         (memrchr): Remove decl.
9450         (dir_name_r): Remove.
9451         (dir_len): Renamed from dirlen.  All callers changed.
9452         Rewrite in terms of base_name, for simplicity and consistency.
9453         (dir_name): Never return NULL.  All callers changed.
9454         Do not include <stdlib.h> in test program; no longer needed.
9455         return 0; is fine for test program.
9456
9457         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9458         New macros.
9459         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9460
9461         * path-concat.c (path_concat): Use base_len to compute
9462         base length, not strlen; this means we cannot rely on memcpy
9463         to null-terminate.
9464
9465         * same.c (STREQ): Remove.
9466         (same_name): Handle the case where the basename ends in trailing '/'.
9467
9468         * stripslash.c (strip_trailing_slashes): Return nonzero if
9469         a slash was stripped.  Do not strip the last slash after a
9470         file system prefix.
9471
9472 2001-04-08  Jim Meyering  <meyering@lucent.com>
9473
9474         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9475         recomputed; that's necessary when the offset spans a DST transition.
9476         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9477
9478 2001-04-02  Jim Meyering  <meyering@lucent.com>
9479
9480         * regex.h, regex.c: Update from GNU libc.
9481
9482 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9483
9484         * version-etc.c (version_etc_copyright): Update to 2001.
9485
9486 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9487
9488         * tempname.c (uint64_t): Define to uintmax_t if
9489         not defined, and if UINT64_MAX is not defined.
9490         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9491         Reported by John David Anglin.
9492
9493 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9494
9495         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9496         alias if codeset is empty.
9497         * config.charset (BeOS): Use wildcard syntax.
9498
9499 2001-03-13  Jim Meyering  <meyering@lucent.com>
9500
9501         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9502         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9503         From Bruno Haible.
9504
9505 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9506
9507         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9508         Don't return NULL.
9509         * unicodeio.c (print_unicode_char): Simplify accordingly.
9510
9511 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9512
9513         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9514         support for DOS/DJGPP.
9515
9516 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9517
9518         * Makefile.am (libfetish_a_SOURCES):
9519         Add dup-safer.c, fopen-safer.c.
9520         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9521
9522         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9523
9524 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9525
9526         The mkstemp replacement is taken from glibc 2.2.2, with some
9527         portability fixes for use outside glibc, as follows:
9528
9529         * tempname.c (struct_stat64): New macro.
9530         (direxists, __gen_tempname): Use it.
9531         This avoids a portability problem with Solaris 8.
9532
9533         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9534         (<stddef.h>, <stdint.h>, <string.h>):
9535         Include only if STDC_HEADERS || _LIBC.
9536         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9537         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9538         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9539         (__set_errno): Define this macro if <errno.h> doesn't.
9540         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9541         Define these macros if <stdio.h> doesn't.
9542         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9543         Define these macros if <sys/stat.h>
9544         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9545         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9546         __xstat64): Define if not _LIBC.
9547         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9548         (__gen_tempname): Invoke gettimeofday only if
9549         HAVE_GETTIMEOFDAY || _LIBC;
9550         otherwise, fall back on plain "time".
9551         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9552
9553         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9554
9555         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9556
9557 2001-02-17  Jim Meyering  <meyering@lucent.com>
9558
9559         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9560         around included file name.
9561
9562         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9563
9564         * strftime.c: Update from GNU libc (the only changes were to comments).
9565
9566 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9567
9568         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9569
9570 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9571
9572         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9573         Remove workaround macros for hosts that have mbrtowc but not
9574         mbstate_t, as we now insist on proper declarations for both
9575         before using mbrtowc.
9576
9577 2001-02-17  Jim Meyering  <meyering@lucent.com>
9578
9579         * regex.c: Update from libc.
9580
9581 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9582
9583         * alloca.c (malloc): Undef before defining, since stdlib.h
9584         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9585         Reported by Mark Hounschell via Paul Eggert.
9586
9587 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9588
9589         * config.charset: Update for FreeBSD 4.2.
9590
9591 2001-01-26  Jim Meyering  <meyering@lucent.com>
9592
9593         * quotearg.c: Include stddef.h.
9594         * quote.c: Include stddef.h.
9595         Reported by Axel Kittenberger.
9596
9597         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9598         line in double quotes so that it evokes a better diagnostic.
9599         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9600         Reported by Axel Kittenberger.
9601
9602 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9603
9604         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9605         to avoid a warning.  Add back 'const' to inptr.
9606
9607 2001-01-16  Jim Meyering  <meyering@lucent.com>
9608
9609         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9610         From Bruno Haible.
9611
9612 2001-01-14  Jim Meyering  <meyering@lucent.com>
9613
9614         * rename.c: New file.  From Volker Borchert.
9615         Include stdlib.h, string.h or strings.h, and xalloc.h.
9616         Use strip_trailing_slashes rather than open-coding it.
9617
9618 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9619
9620         * strftime.c: Sync with glibc time/strftime.c 1.81.
9621
9622 2001-01-03  Jim Meyering  <meyering@lucent.com>
9623
9624         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9625         local `inptr' to avoid warning with some system declarations of iconv.
9626
9627 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9628
9629         * modechange.c: Do not assume that mode_t uses the
9630         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9631         the other-execute bit of FOO even if S_IXOTH != 1.
9632
9633         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9634         WOTH, XOTH, ALLM): New macros.
9635         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9636          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9637         Use them.
9638         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9639         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9640         (mode_compile):
9641         No need to use uintmax_t; unsigned long is long enough.
9642         Don't bother to get suffix since we don't use it.
9643
9644 2000-12-24  Jim Meyering  <meyering@lucent.com>
9645
9646         * hash.c (is_prime): Return explicit boolean values.
9647         (hash_get_first): Return NULL to appease Irix5.6's 89.
9648         Reported by Nelson Beebe.
9649
9650 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9651
9652         * localcharset.c (locale_charset): Add support for Win32.
9653
9654 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9655
9656         * physmem.h, physmem.c: New files.
9657
9658         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9659         (noinst_HEADERS): Add physmem.h.
9660
9661         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9662         't' for compatibility with Solaris 8 sort.
9663
9664 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9665
9666         * config.charset: Add support for BeOS.
9667
9668 2000-12-16  Jim Meyering  <meyering@lucent.com>
9669
9670         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9671         SHELLS_FILE to a file name that's useful on djgpp systems.
9672         Include stdlib.h.
9673         (ADDITIONAL_DEFAULT_SHELLS): Define.
9674         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9675         Based mostly on a patch from Prashant TR.
9676
9677 2000-12-16  Jim Meyering  <meyering@lucent.com>
9678
9679         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9680         N and M) would have treated it like `chown N:N FILE'.
9681
9682         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9683
9684 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9685
9686         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9687         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9688         to the list of canonical encodings. Rename EUC-CN to GB2312.
9689
9690 2000-12-08  Andreas Schwab  <schwab@suse.de>
9691
9692         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9693         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9694
9695 2000-12-07  Jim Meyering  <meyering@lucent.com>
9696
9697         * stripslash.c (ISSLASH): Define.
9698         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9699         From Prashant TR.
9700
9701         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9702         (dir_name_r): Declare this function as static.
9703         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9704         manifest itself on a name containing a mix of slashes and
9705         backslashes.
9706         Make this function work with names starting with a DOS-style
9707         drive letter and colon prefix.
9708         (dir_name): Append `.' if necessary.
9709         Based mostly on patches from Prashant TR and Eli Zaretskii.
9710
9711         * dirname.h (dir_name_r): Remove prototype.
9712
9713 2000-12-05  Jim Meyering  <meyering@lucent.com>
9714
9715         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9716
9717 2000-12-04  Jim Meyering  <meyering@lucent.com>
9718
9719         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9720         Also include memory.h, stdlib.h, unistd.h if appropriate.
9721         Reported by Andreas Jaeger (conflicting declaration of malloc).
9722
9723 2000-12-02  Jim Meyering  <meyering@lucent.com>
9724
9725         * closeout.h: Make idempotent, to avoid some obscure warnings.
9726
9727 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9728
9729         * memrchr.c: Include <config.h> before any system include file.
9730
9731 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9732
9733         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9734
9735 2000-11-26  Jim Meyering  <meyering@lucent.com>
9736
9737         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9738
9739 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9740
9741         * strftime.c (my_strftime): Do not invoke mbrlen with a
9742         size of (size_t) -1; it's not portable.
9743
9744 2000-11-17  Akim Demaille  <akim@epita.fr>
9745
9746         * obstack.h: Formatting changes.
9747         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9748         prevent type checking.
9749         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9750         cast the value to (void *): assigning a `foo *' to a `void *'
9751         variable is valid.
9752         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9753
9754 2000-11-17  Jim Meyering  <meyering@lucent.com>
9755
9756         * strstr.c: Update from GNU libc.
9757
9758 2000-11-16  Jim Meyering  <meyering@lucent.com>
9759
9760         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9761
9762 2000-11-11  Jim Meyering  <meyering@lucent.com>
9763
9764         * error.c: Add a couple #includes, merging from GNU libc version.
9765
9766 2000-11-10  Jim Meyering  <meyering@lucent.com>
9767
9768         * obstack.h: Update from GNU libc.
9769         * obstack.c: Likewise.
9770
9771 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9772
9773         * getusershell.c (setusershell): Use rewind rather than
9774         fseek/fseeko, to avoid configuration hassles with fseeko.
9775         Don't bother opening SHELLS_FILE if shellstream is NULL;
9776         it's not necessary.
9777
9778 2000-11-05  Jim Meyering  <meyering@lucent.com>
9779
9780         * makepath.h (make_dir): Declare.
9781         * makepath.c (make_dir): Remove `static' attribute.
9782         Tweak a comment.
9783
9784 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9785
9786         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9787         last one in a bucket, advance to the next bucket.
9788
9789 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9790
9791         * fnmatch.c: Do not comment out all the code if we are using
9792         the GNU C library, because in some cases we are replacing buggy
9793         code in the GNU C library itself.
9794
9795 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9796
9797         * error.h, getline.h, modechange.h:
9798         Remove "2000" from Copyright line, as the file hasn't been
9799         changed this year other than in the copyright notice.
9800
9801         * xalloc.h: Add "2000" to Copyright line, as this file
9802         was changed this year.
9803
9804 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9805
9806         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9807         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9808         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9809
9810 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9811
9812         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9813         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9814         doesn't define __restrict_arr.
9815
9816 2000-10-29  Jim Meyering  <meyering@lucent.com>
9817
9818         * xstat.in: Fix grammar in comment.
9819
9820 2000-10-28  Jim Meyering  <meyering@lucent.com>
9821
9822         * memchr.c: Update from libc.
9823         Adjust for portability:
9824         [HAVE_STDLIB_H]: Include stdlib.h.
9825         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9826         Undef __memchr, too.
9827         [!weak_alias]: Define __memchr to memchr.
9828
9829         * regex.c: Update from libc.
9830         * regex.h: Likewise.
9831         * getopt1.c: Likewise.
9832         * memcmp.c: Likewise.
9833
9834         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9835         Avoid using fseek, when possible -- it's broken by design.
9836         Patch by Ulrich Drepper.
9837
9838 2000-10-26  Jim Meyering  <meyering@lucent.com>
9839
9840         * strftime.c: Update from libc.
9841
9842 2000-10-25  Jim Meyering  <meyering@lucent.com>
9843
9844         * obstack.c: Update from libc.
9845
9846 2000-10-23  Jim Meyering  <meyering@lucent.com>
9847
9848         * hard-locale.c (hard_locale): Revert last change -- it was simply
9849         wrong.  That set_locale call must not have any side effects.
9850         From Paul Eggert.
9851
9852 2000-10-22  Jim Meyering  <meyering@lucent.com>
9853
9854         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9855         [CYCLIC]: Remove now-unused definition.
9856
9857         * save-cwd.c (O_DIRECTORY): Define, if needed.
9858         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9859         Suggestion from Ulrich Drepper.
9860
9861 2000-10-21  Jim Meyering  <meyering@lucent.com>
9862
9863         * dirname.c (dir_name_r): New function, factored out of dir_name.
9864         (dir_name): Use dir_name_r.
9865         * dirname.h (dir_name_r): Declare it.
9866
9867 2000-10-21  Jim Meyering  <meyering@lucent.com>
9868
9869         * dirname.c (memrchr): Declare if necessary.
9870         (dir_name): Remove the restriction that there be no
9871         trailing slashes.  Now, this code skips past them, effectively
9872         ignoring them.
9873         [TEST_DIRNAME] (main): New unit tests.
9874
9875         * memrchr.c: New file from GNU libc.
9876         Undef __memrchr, too.
9877         [!weak_alias]: Define __memrchr to memrchr.
9878         Guard weak_alias use with `#ifdef weak_alias'.
9879
9880 2000-10-17  Jim Meyering  <meyering@lucent.com>
9881
9882         * quote.h (PARAMS): Define and use.
9883         Reported by Akim Demaille.
9884
9885         * getopt.c: Update from libc.
9886
9887 2000-10-16  Jim Meyering  <meyering@lucent.com>
9888
9889         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9890         From Jan Fedak.
9891
9892 2000-09-25  Jim Meyering  <meyering@lucent.com>
9893
9894         * md5.h (rol): Define (from GnuPG).
9895
9896         * sha.c: Give credit (GnuPG) where due.
9897         (M): Use rol rather than open-coding it.
9898         Add a FIXME comment.
9899
9900 2000-09-21  Jim Meyering  <meyering@lucent.com>
9901
9902         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9903         Reported by Michael Stone.
9904
9905 2000-09-20  Jim Meyering  <meyering@lucent.com>
9906
9907         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9908         (noinst_HEADERS): Add sha.h.
9909         Based on code from Scott G. Miller and from GnuPG.
9910
9911 2000-09-15  Jim Meyering  <meyering@lucent.com>
9912
9913         * regex.c: Update from libc.
9914
9915 2000-09-10  Jim Meyering  <meyering@lucent.com>
9916
9917         * getopt.c (_getopt_internal): Update from glibc.
9918
9919 2000-09-09  Jim Meyering  <meyering@lucent.com>
9920
9921         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9922         think it should be used as a general replacement for isascii.
9923         * fnmatch.c: Likewise.
9924         * mbswidth.c: Likewise
9925         * regex.c: Likewise.
9926
9927         Don't use atoi.
9928         * userspec.c: Include sys/param.h and limits.h.
9929         Include xstrtol.h.
9930         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9931         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9932         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9933         UID, GID.  Check range.
9934
9935 2000-09-06  Jim Meyering  <meyering@lucent.com>
9936
9937         * getopt.c (_getopt_internal): Update from glibc.
9938
9939 2000-08-30  Jim Meyering  <meyering@lucent.com>
9940
9941         * strftime.c: Merge in changes from GNU libc.
9942
9943 2000-08-26  Jim Meyering  <meyering@lucent.com>
9944
9945         * closeout.c: Include "__fpending.h".
9946         (close_stdout_status): Return right away if there's nothing to flush.
9947
9948         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9949         * __fpending.c: New file.
9950         * __fpending.h: New file.
9951
9952 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9953
9954         Standardize on "memory exhausted" instead of "Memory exhausted"
9955         or "virtual memory exhausted".
9956         * obstack.c (print_and_abort): Use "memory exhausted", not
9957         "virtual memory exhausted".
9958         * same.c (same_name): Invoke xalloc_die instead of printing
9959         our own message.
9960         * userspec.c (parse_user_spec): Likewise.
9961         * bumpalloc.h: comment fix
9962         * same.c, userspec.c: Include xalloc.h.
9963
9964         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9965         not char *const and pointing to a constant array.
9966         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9967         (xrealloc): Comment fix.
9968
9969         * userspec.c (parse_user_spec):
9970         Don't translate a message until just before returning,
9971         to avoid unnecessary translation.
9972
9973 2000-08-07  Jim Meyering  <meyering@lucent.com>
9974
9975         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9976         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9977         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9978         getgroups.c, gethostname.c, getopt.h, group-member.c,
9979         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9980         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9981         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9982         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9983         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9984         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9985         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9986         yesno.c: Back out Copyright date changes for each file with no change
9987         this year.  This eases coordination with other programs using the same
9988         source code modules.  From Paul Eggert.
9989
9990 2000-08-03  Greg McGary  <greg@mcgary.org>
9991
9992         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9993         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9994         (EXTEND_BUFFER): Use them.
9995
9996 2000-08-01  Jim Meyering  <meyering@lucent.com>
9997
9998         * dirname.c (ISSLASH): Define.
9999         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10000         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10001         both `\' and `/' may be use as path separators.
10002         Based on a patch from Prashant TR.
10003
10004 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10005
10006         * quotearg.c (quotearg_n_options): Don't make the initial
10007         slot vector a constant, since it might get modified.
10008
10009 2000-07-31  Jim Meyering  <meyering@lucent.com>
10010
10011         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10012         * obstack.c (print_and_abort): Likewise.
10013
10014 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10015
10016         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10017         buffer, so that the caller can always quote one small
10018         component of a "memory exhausted" message in slot 0.
10019         From a suggestion by Jim Meyering.
10020
10021 2000-07-30  Jim Meyering  <meyering@lucent.com>
10022
10023         * makepath.c (make_path): Quote the other instance, too.
10024
10025         * quotearg.c (N_STATIC_SLOTVECS): Define.
10026         (STATIC_BUF_SIZE): Define.
10027         (quotearg_n_options): Use only statically allocated storage when
10028         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10029         than STATIC_BUF_SIZE.
10030
10031 2000-07-29  Jim Meyering  <meyering@lucent.com>
10032
10033         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10034         * dirname.c (dir_name): Likewise.
10035
10036         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10037
10038         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10039         (dir_name): Assert that there are no trailing slashes.
10040
10041 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10042
10043         * mbswidth.h (mbswidth): Add a flags argument.
10044         (mbswidth): New declaration.
10045         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10046         * mbswidth.c (mbswidth): Add a flags argument.
10047         (mbsnwidth): New function.
10048
10049 2000-07-24  Jim Meyering  <meyering@lucent.com>
10050
10051         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10052
10053 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10054
10055         * mbswidth.c (_XOPEN_SOURCE):
10056         Don't define; this causes problems on Solaris 7.
10057         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10058
10059 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10060
10061         * quotearg.c:
10062         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10063         so that mbstate_t is always defined.
10064
10065         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10066         be 1 in at least one GCC installation, and this configuration
10067         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10068         performance on hosts that have mbrtowc but have only unibyte
10069         locales, but I assume these hosts are rare.
10070
10071 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10072
10073         * quotearg.c: Streamline by invoking multibyte code only if needed.
10074         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10075         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10076         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10077         invoke multibyte primitives.
10078
10079 2000-07-23  Jim Meyering  <meyering@lucent.com>
10080
10081         * basename.c (base_name): Add an assertion.
10082
10083 2000-07-15  Bruno Haible  <clisp.cons.org>
10084
10085         * quotearg.c: When the system forces us to redefine mbstate_t,
10086         shadow its mbsinit function.
10087
10088 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10089
10090         * mbswidth.h: New file.
10091         * mbswidth.c: New file.
10092         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10093         (noinst_HEADERS): Add mbswidth.h.
10094
10095 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10096
10097         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10098         and IRIX 6.
10099
10100 2000-07-15  Jim Meyering  <meyering@lucent.com>
10101
10102         * makepath.c: Include quote.h.
10103         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10104         corresponding argument in a `quote (...)' call.
10105         Give better diagnostics.
10106
10107         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10108         (noinst_HEADERS): Add quote.h.
10109
10110         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10111         from tar's src/misc.c.
10112         * quote.h: New file.  Prototypes for same.
10113
10114 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10115
10116         From a suggestion by Bruno Haible.
10117         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10118         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10119         to decide whether to define the BeOS workaround macro;
10120         this adjusts to the change to AC_MBSTATE_T.
10121
10122 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10123
10124         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10125
10126         * quotearg.c (quoting_style_args, quoting_style_vals,
10127         quotearg_buffer_restyled): Add support for
10128         clocale_quoting_style.  Undo previous change to
10129         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10130         and "{RIGHT QUOTATION MARK}" msgids.
10131
10132 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10133
10134         The old behavior of quoting `like this' doesn't look good with
10135         newer, ISO-style fonts.  See:
10136         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10137
10138         Instead, quote "like this" by default.  Let the translator
10139         tailor the locale-specific quoting behavior by providing
10140         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10141
10142         * quotearg.c (N_): New macro.
10143         (gettext_default): New function.
10144         (quotearg_buffer_restyled): Use
10145         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10146         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10147
10148 2000-07-09  Jim Meyering  <meyering@lucent.com>
10149
10150         * Most files: Update copyright dates to include 2000.
10151
10152 2000-07-08  Jim Meyering  <meyering@lucent.com>
10153
10154         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10155         if not defined.
10156         (xgethostname): Remove now-unnecessary #ifdef.
10157         Move declaration of `err' into loop where it's used.
10158
10159 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10160
10161         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10162         by allocating a larger buffer. Test the gethostname return value for
10163         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10164         returns an error and ENAMETOOLONG isn't defined.
10165
10166 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10167         and Bruno Haible  <haible@clisp.cons.org>
10168
10169         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10170
10171 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10172
10173         * quotearg.c (struct quoting_options): Simplify quote_these_too
10174         dimension.
10175
10176 2000-07-03  Jim Meyering  <meyering@lucent.com>
10177
10178         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10179         Reported by Bruno Haible.
10180
10181 2000-07-04  Jim Meyering  <meyering@lucent.com>
10182
10183         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10184         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10185         lacks mbrtowc.
10186
10187 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10188         and Bruno Haible  <haible@clisp.cons.org>
10189
10190         * quotearg.c (mbrtowc):
10191         Assign to *pwc, and return 1 only if result is nonzero.
10192         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10193
10194 2000-07-03  Jim Meyering  <meyering@lucent.com>
10195
10196         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10197         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10198         From Bob Proulx.
10199
10200 2000-07-02  Jim Meyering  <meyering@lucent.com>
10201
10202         * quotearg.c (mbstate_t): Don't define here.
10203
10204 2000-07-02  Jim Meyering  <meyering@lucent.com>
10205
10206         * nanosleep.c (SIGCONT): Define if not already defined.
10207
10208 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10209
10210         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10211         per change in ../m4/ls-mntd-fs.m4.
10212         (read_filesystem_list): Ignore symbolic links.
10213
10214 2000-06-29  Jim Meyering  <meyering@lucent.com>
10215
10216         * same.c: Include <string.h> or <strings.h>, as appropriate,
10217         for declaration of strcmp.
10218
10219         * long-options.c: Include <stdlib.h>, for declaration of exit.
10220
10221         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10222         Avoid warning by casting result to `char *' to remove `const'.
10223
10224 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10225
10226         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10227
10228 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10229
10230         savedir now sets errno on failure and invokes xmalloc to get memory.
10231         Fix a couple of other minor bugs while we're at it.
10232
10233         * savedir.c (<unistd.h>): Do not include; there's no need.
10234         (NAMLEN): Remove macro.
10235         (malloc, realloc): Remove decls.
10236         (stpcpy): Likewise.
10237         ("xalloc.h"): Include.
10238         (NAME_SIZE_DEFAULT): New macro.
10239         (savedir): Use xmalloc / xrealloc to allocate memory.
10240         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10241         Skip "" directory entries.
10242         Use strlen to calculate directory entry length, since the old method
10243         is rarely used these days and isn't worth supporting.
10244         Don't use a pointer after freeing it.
10245         Check for integer overflow when calculating allocation size.
10246         Use memcpy to copy entries, instead of stpcpy.
10247         Set errno properly when returning NULL.
10248         Check for readdir error.
10249
10250 2000-06-26  Jim Meyering  <meyering@lucent.com>
10251
10252         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10253
10254 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10255
10256         * getusershell.c (xmalloc, xrealloc): Remove functions.
10257         Include xalloc.h.
10258         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10259
10260 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10261
10262         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10263
10264 2000-06-24  Jim Meyering  <meyering@lucent.com>
10265
10266         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10267
10268 2000-06-21  Jim Meyering  <meyering@lucent.com>
10269
10270         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10271
10272 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10273
10274         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10275         (mbrtowc, mbstate_t): Define substitutes if
10276         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10277         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10278         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10279
10280 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10281
10282         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10283         than 1024, return a memory chunk of least possible size, instead
10284         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10285         Use free/xmalloc instead of xrealloc to avoid copying for very long
10286         paths.
10287
10288 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10289
10290         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10291         address, not strdup.  Include <stdlib.h> and don't declare free().
10292
10293 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10294
10295         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10296         the empty string.
10297
10298 2000-06-21  Jim Meyering  <meyering@lucent.com>
10299
10300         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10301         (noinst_HEADERS): Add getstr.h.
10302
10303         * getline.c (getstr): Move into a separate file.
10304         * getstr.c (getstr): New file, extracted from getline.c, with
10305         the following changes: new parameter, delim2; both delim[12]
10306         parameters have type `int', not `char'.  The latter would lose
10307         with 8-bit delimiters.
10308         * getstr.h: New file.
10309
10310 2000-06-19  Jim Meyering  <meyering@lucent.com>
10311
10312         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10313
10314 2000-06-18  Jim Meyering  <meyering@lucent.com>
10315
10316         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10317         Besides, these days every porting target provides a mkdir function.
10318
10319         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10320         (this snippet comes from src/system.h).
10321
10322 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10323
10324         * human.c (adjust_value): New function.
10325         (human_readable_inexact): Apply rounding style even when
10326         printing approximate values.
10327
10328 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10329
10330         * human.c (human_readable_inexact): Allow an input block
10331         size that is not a multiple of the output block size, and vice versa.
10332         Reported by Piergiorgio Sartor.
10333
10334 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10335
10336         * getdate.y (get_date): Apply relative times after time
10337         zone indicator, not before.  Reported by Todd A. Jacobs.
10338
10339 2000-06-13  Jim Meyering  <meyering@lucent.com>
10340
10341         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10342
10343         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10344
10345 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10346
10347         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10348
10349 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10350
10351         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10352
10353 2000-06-04  Jim Meyering  <meyering@lucent.com>
10354
10355         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10356         SunOS 4.1.4 for which gid_t is an unsigned type.
10357
10358 2000-06-03  Jim Meyering  <meyering@lucent.com>
10359
10360         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10361
10362 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10363
10364         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10365         newer, don't install charset.alias.
10366         * config.charset: Change the Linux/glibc rules so they become empty
10367         on glibc-2.1 or newer.
10368
10369 2000-06-02  Jim Meyering  <meyering@lucent.com>
10370
10371         * mountlist.c: Back out last change.  Instead, do this...
10372         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10373         member using the same `ignore'-testing code.
10374         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10375         fs_type strings.
10376         From Mark D. Roth.
10377
10378 2000-05-29  Jim Meyering  <meyering@lucent.com>
10379
10380         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10381         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10382
10383 2000-05-22  Jim Meyering  <meyering@lucent.com>
10384
10385         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10386
10387 2000-05-18  Jim Meyering  <meyering@lucent.com>
10388
10389         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10390         back, too, since it may have been modified by allocate_entry.
10391         (hash_delete): Rewrite to use neither the assignment operator
10392         nor the comma operator in an if-expression.
10393
10394 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10395
10396         * closeout.c:
10397         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10398         Remove; no longer needed.
10399         "quotearg.h": Add include.
10400         (file_name): Do not bother to explicitly initialize to NULL; it's less
10401         efficient on some hosts.
10402         (close_stdout_status): Remove test as to whether stdout was already
10403         closed; it breaks for the case "echo x | sort >&-".
10404         Quote file name colons.
10405         Do not assume that _("write error") lacks format strings.
10406
10407 2000-05-15  Jim Meyering  <meyering@lucent.com>
10408
10409         * version-etc.c (version_etc_copyright): Update the copyright string
10410         used in all --version output.
10411
10412 2000-05-14  Jim Meyering  <meyering@lucent.com>
10413
10414         * closeout.c (close_stdout_set_file_name): New function.
10415         (close_stdout_status): Use new file-scoped global.
10416         Return right away if fstat says the stdout file descriptor is invalid.
10417         * closeout.h (close_stdout_set_file_name): Declare.
10418
10419 2000-05-10  Jim Meyering  <meyering@lucent.com>
10420
10421         * closeout.c [default_exit_status]: New file-scoped variable.
10422         (close_stdout_set_status): New function.
10423         * closeout.h (close_stdout_set_status): Declare.
10424
10425 2000-05-08  Jim Meyering  <meyering@lucent.com>
10426
10427         * long-options.c: Don't include closeout.h.
10428         (parse_long_options): Don't call close_stdout for --version.
10429
10430 2000-05-06  Jim Meyering  <meyering@lucent.com>
10431
10432         * strnlen.c: Undefine __strnlen and strnlen.
10433         [!weak_alias]: Define __strnlen to strnlen.
10434
10435         * atexit.c: New file, from libiberty.
10436
10437 2000-05-06  Jim Meyering  <meyering@lucent.com>
10438
10439         * closeout.c (close_stdout_status): Also check for errors on the
10440         stderr stream.
10441
10442 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10443
10444         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10445         instead of xmalloc, xrealloc, path_concat.
10446         (locale_charset): Treat empty environment variables as absent.
10447         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10448
10449 2000-05-04  Jim Meyering  <meyering@lucent.com>
10450
10451         * getopt.c: Update from glibc.
10452         * obstack.c: Likewise.
10453         * obstack.h: Likewise.
10454         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10455
10456         * regex.h: Likewise.
10457         * strndup.c: Likewise.
10458         * strnlen.c: New file, from glibc.
10459
10460 2000-05-01  Jim Meyering  <meyering@lucent.com>
10461
10462         * full-write.c (full_write): Remove `FIXME' part of comment.
10463
10464 2000-04-29  Jim Meyering  <meyering@lucent.com>
10465
10466         * path-concat.c: Declare strdup only if it's not defined.
10467         * canon-host.c: Likewise.
10468
10469 2000-04-28  Jim Meyering  <meyering@lucent.com>
10470
10471         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10472         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10473         included first, then limits.h is included by locale.h by libintl.h.
10474         From John David Anglin.
10475
10476 2000-04-25  Jim Meyering  <meyering@lucent.com>
10477
10478         * makepath.c (S_IRWXUGO): Define.
10479         (make_path): Always perform explicit chmod if MODE specifies any
10480         of the `special' permission bits.  Prompted by a bug report against
10481         install from Mate Wierdl and Joost van Baal.
10482
10483 2000-04-18  Jim Meyering  <meyering@lucent.com>
10484
10485         * README: New file.
10486
10487         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10488         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10489
10490 2000-04-17  Jim Meyering  <meyering@lucent.com>
10491
10492         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10493         the definition of it to rpl_strftime also defined-away the system's
10494         declaration.
10495
10496 2000-04-15  Jim Meyering  <meyering@lucent.com>
10497
10498         Use `C' to denote so-called `contiguous' files, the same way
10499         that tar does.
10500         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10501         (ftypelet): Use S_ISCTG.
10502         From Michael Deutschmann.
10503
10504 2000-04-14  Jim Meyering  <meyering@lucent.com>
10505
10506         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10507
10508 2000-04-08  Jim Meyering  <meyering@lucent.com>
10509
10510         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10511         names don't conflict.  Reported by Eli Zaretskii.
10512
10513 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10514
10515         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10516         bug.  Deal with the different error behavior of Irix iconv.
10517
10518 2000-04-07  Jim Meyering  <meyering@lucent.com>
10519
10520         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10521         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10522
10523 2000-04-05  Jim Meyering  <meyering@lucent.com>
10524
10525         Portability tweaks required for ultrix4.3.
10526         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10527         * readutmp.c: Include sys/types.h before sys/stat.h.
10528         * canon-host.c: Declare strdup.
10529         * path-concat.c: Likewise.
10530         From John David Anglin.
10531
10532 2000-04-04  Jim Meyering  <meyering@lucent.com>
10533
10534         Be more DOS 8.3-friendly.
10535         * ref-add.sin: Renamed from ref-add.sed.in.
10536         * ref-del.sin: Renamed from ref-del.sed.in.
10537         * Makefile.am: Reflect renaming.
10538         Reported by Eli Zaretskii.
10539
10540         Use a temporary file name that won't clash with `charset.alias'
10541         in the DOS 8.3 name space.
10542         * Makefile.am (charset_tmp): Define.
10543         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10544         (uninstall-local): Likewise.
10545         Reported by Eli Zaretskii.
10546
10547 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10548
10549         * time/strftime.c (my_strftime): Make sure we call the system
10550         strftime, not ourselves, when invoking the underlying strftime.
10551
10552 2000-03-24  Jim Meyering  <meyering@lucent.com>
10553
10554         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10555         (charset_alias): Define.
10556         (install-exec-local): Factor out common code.
10557         (uninstall-local): Split lines longer than 80.
10558         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10559         (SUFFIXES): Define.
10560         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10561         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10562
10563 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10564
10565         * config.charset: Output a line containing "Packages using this file".
10566         * ref-add.sed.in, ref-del.sed.in: New files.
10567         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10568         ref-del.sed): New rules.
10569
10570 2000-03-17  Jim Meyering  <meyering@lucent.com>
10571
10572         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10573         Otherwise, include <strings.h>
10574
10575 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10576
10577         * unicodeio.c (utf8_wctomb): New function.
10578         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10579         format instead of in UCS-4 with platform dependent endianness.
10580
10581 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10582
10583         * savedir.c (savedir): Work even if directory size is
10584         negative; this can happen with some screwy NFS configurations.
10585
10586 2000-03-06  Jim Meyering  <meyering@lucent.com>
10587
10588         * localcharset.c (get_charset_aliases): Don't try to free file_name
10589         if it's NULL (because we ran out of memory).  From Bruno Haible.
10590
10591 2000-03-05  Jim Meyering  <meyering@lucent.com>
10592
10593         * localcharset.c ("path-concat.h"): Include.
10594         (get_charset_aliases): Use path_concat instead of ANSI string
10595         concatenation.
10596
10597         * unicodeio.h (PARAMS): Define.
10598         Use it to guard prototype.
10599
10600 2000-03-04  Jim Meyering  <meyering@lucent.com>
10601
10602         * Makefile.am (install-exec-local): Create $(libdir) before installing
10603         into it.
10604         (uninstall-local): Uncomment this rule so `make distcheck' works
10605         once again.
10606
10607         * unicodeio.c (<errno.h>): Include it.
10608         (errno): Declare if not defined.
10609
10610         * localcharset.c: Add Bruno's comment justifying use of volatile.
10611
10612         * config.charset: New version, incorporating remarks from a linux
10613         i18n mailing list.  From Bruno Haible.
10614
10615 2000-03-02  Jim Meyering  <meyering@lucent.com>
10616
10617         * Makefile.am (EXTRA_DIST): Add config.charset.
10618
10619 2000-03-01  Jim Meyering  <meyering@lucent.com>
10620
10621         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10622         * unicodeio.c: Likewise.
10623
10624 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10625
10626         * config.charset: New file.
10627         * localcharset.c: New file.
10628         * unicodeio.h, unicodeio.c: New files.
10629         * Makefile.am (DEFS): Add -DLIBDIR=...
10630         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10631         (noinst_HEADERS): Add unicodeio.h.
10632         (all-local, install-exec-local, charset.alias): New targets.
10633
10634 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10635
10636         * quotearg.c (ALERT_CHAR): New macro.
10637         (quotearg_buffer_restyled): Use it.
10638
10639 2000-02-27  Jim Meyering  <meyering@lucent.com>
10640
10641         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10642         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10643
10644         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10645         not `#if STDC_HEADERS'.
10646         Declare malloc if needed.
10647
10648         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10649         now that autoconf always defines the HAVE_DECL_ symbols.
10650         * human.c: Likewise.
10651         * same.c: Likewise.
10652         * strtoumax.c: Likewise.
10653
10654         * backupfile.c: Arrange for cpp to fail if the configure-time
10655         declaration check was not run.
10656         * hash.c: Likewise.
10657         * human.c: Likewise.
10658         * same.c: Likewise.
10659         * strtoumax.c: Likewise.
10660
10661         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10662         then first look up the entire `.'-containing string as a login name.
10663
10664 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10665
10666         * getdate.y: Handle two-digit years with leading zeros correctly.
10667         (textint): New typedef.
10668         (parser_control): Member year changed from int to textint.
10669         All uses changed.
10670         (YYSTYPE): Removed; replaced by %union with int and textint members.
10671         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10672         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10673         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10674         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10675         (date, number, to_year): Use width of number in digits, not its value,
10676         to determine whether it's a 2-digit year, or a 2-digit time.
10677         (yylex): Store number of digits of numeric tokens.
10678         Reported by John Kendall.
10679
10680         (parser_control): Changed from struct parser_control to typedef (for
10681         consistency).  All uses changed.
10682
10683         (tID): Removed; not used.
10684         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10685
10686 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10687
10688         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10689         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10690
10691 2000-02-12  Jim Meyering  <meyering@lucent.com>
10692
10693         * userspec.c (ISDIGIT): Define it.
10694         (isdigit): Remove definition.
10695         (is_number): Use ISDIGIT, not isdigit.
10696         <libintl.h>: Include.
10697         (_ and N_): Define.
10698         (parse_user_spec): Mark translatable strings.
10699
10700 2000-02-10  Jim Meyering  <meyering@lucent.com>
10701
10702         With these changes, nanosleep.[ch] are finally enough like the other
10703         lib/* replacement files to compile on a few more losing systems.
10704
10705         * nanosleep.h: Don't include config.h.
10706         Remove prototype from declaration of nanosleep.
10707         (PARAMS): Remove now-unneeded definition.
10708         * nanosleep.c: #undef nanosleep.
10709         (rpl_nanosleep): Rename from nanosleep.
10710
10711 2000-02-03  Jim Meyering  <meyering@lucent.com>
10712
10713         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10714         rather than with `#if HAVE_UTMPNAME'.
10715
10716 2000-02-01  Jim Meyering  <meyering@lucent.com>
10717
10718         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10719
10720 2000-01-31  Jim Meyering  <meyering@lucent.com>
10721
10722         * nanosleep.h (nanosleep): Guard declaration with
10723         `#if ! HAVE_DECL_NANOSLEEP'.
10724         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10725         the declaration in that vendor's sys/timers.h.
10726         Reported by Christian Krackowizer.
10727
10728         * quotearg.c (ISASCII): Add #undef and move definition to follow
10729         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10730         (ISPRINT): Likewise.
10731         Reported by Tom Tromey.
10732
10733 2000-01-30  Jim Meyering  <meyering@lucent.com>
10734
10735         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10736         uses of ->ut_name.  The latter doesn't work with new Linux header files
10737         where only utmpx.ut_user is declared.
10738
10739         * readutmp.h (UT_USER): Define.
10740
10741 2000-01-23  Jim Meyering  <meyering@lucent.com>
10742
10743         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10744         obstack.c.
10745
10746 2000-01-22  Jim Meyering  <meyering@lucent.com>
10747
10748         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10749         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10750         Required for some AIX systems.  Reported by Christian Krackowizer.
10751         [TESTING] (main): New function.
10752
10753         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10754         * dirname.c (dir_name): Support for DOS-style file names with drive
10755         letters.
10756
10757         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10758
10759         * strverscmp.c (ISDIGIT): Define.
10760         (strverscmp): Use ISDIGIT, not isdigit.
10761
10762 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10763
10764         * nanosleep.c (nanosleep):
10765         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10766         POSIX.1 doesn't require SA_INTERRUPT and some systems
10767         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10768         it's been part of POSIX.1 since day 1 (in 1988).
10769
10770 2000-01-17  Jim Meyering  <meyering@lucent.com>
10771
10772         * interlock: Remove unused file.  Reported by François Pinard.
10773
10774 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10775
10776         * quotearg.c (quotearg_buffer_restyled): Do not quote
10777         alert, backslash, formfeed, and vertical tab unnecessarily in
10778         shell quoting style.
10779
10780
10781 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10782 Free Software Foundation, Inc.
10783 Copying and distribution of this file, with or without modification,
10784 are permitted provided the copyright notice and this notice are preserved.