Use configmake.
[gnulib.git] / lib / ChangeLog
1 2006-09-18  Bruno Haible  <bruno@clisp.org>
2
3         * javaversion.c: Include configmake.h.
4
5 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
6
7         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
8         that prevented coreutils 6.1 from building.  Problem reported
9         by Petter Reinholdtsen.
10
11 2006-09-18  Jim Meyering  <jim@meyering.net>
12
13         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
14
15 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
16
17         * dirchownmod.c: Don't include fcntl.h; no longer needed.
18         (dirchownmod): New arg FD.  All callers changed.
19         Use FD rather than opening the directory ourself, as opening is
20         now the caller's responsibility.
21         * dirchownmod.h: Likewise.
22         * mkancesdirs.c: Include <sys/types.h>, for portability to older
23         hosts that require <sys/types.h> before <sys/stat.h>.  Include
24         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
25         (test_dir): Remove.
26         (mkancesdirs): Return length of prefix of FILE that has already
27         been made, or -2 if there is a child doing the work.  Redo
28         algorithm so that it is O(N) rather than O(N**2).  Optimize away
29         ".", and treat ".." specially since it might stray back into
30         already-created areas.  Use a subprocess if necessary.  New arg
31         WD; all users changed.  MAKE_DIR function should now return 1
32         if it creates a directory that is not readable.  Return -2 if
33         a child process is spun off.
34         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
35         Adjust signature to match code.
36         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
37         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
38         all users changed.
39         * savewd.c, savewd.h: New files.
40
41 2006-09-15  Jim Meyering  <jim@meyering.net>
42
43         * rename-dest-slash.c (has_trailing_slash): Use
44         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
45         (rpl_rename_dest_slash): Perform the cheaper trailing slash
46         test before testing whether SRC is a directory.
47         Suggestions from Bruno Haible.
48
49         Avoid a warning about an unused variable.
50         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
51         into the #ifdef block where it's used.
52
53         * rename-dest-slash.c: New file.
54
55 2006-09-14  Bruno Haible  <bruno@clisp.org>
56
57         * allocsa.c: Include <config.h> unconditionally.
58         * asnprintf.c: Likewise.
59         * asprintf.c: Likewise.
60         * c-strcasecmp.c: Likewise.
61         * c-strcasestr.c: Likewise.
62         * c-strncasecmp.c: Likewise.
63         * c-strstr.c: Likewise.
64         * classpath.c: Likewise.
65         * clean-temp.c: Likewise.
66         * concatpath.c: Likewise.
67         * copy-file.c: Likewise.
68         * csharpcomp.c: Likewise.
69         * csharpexec.c: Likewise.
70         * execute.c: Likewise.
71         * fatal-signal.c: Likewise.
72         * findprog.c: Likewise.
73         * fwriteerror.c: Likewise.
74         * gl_array_list.c: Likewise.
75         * gl_array_oset.c: Likewise.
76         * gl_avltree_list.c: Likewise.
77         * gl_avltree_oset.c: Likewise.
78         * gl_avltreehash_list.c: Likewise.
79         * gl_carray_list.c: Likewise.
80         * gl_linked_list.c: Likewise.
81         * gl_linkedhash_list.c: Likewise.
82         * gl_list.c: Likewise.
83         * gl_oset.c: Likewise.
84         * gl_rbtree_list.c: Likewise.
85         * gl_rbtree_oset.c: Likewise.
86         * gl_rbtreehash_list.c: Likewise.
87         * imaxabs.c: Likewise.
88         * imaxdiv.c: Likewise.
89         * javacomp.c: Likewise.
90         * javaexec.c: Likewise.
91         * javaversion.c: Likewise.
92         * linebreak.c: Likewise.
93         * localcharset.c: Likewise.
94         * lock.c: Likewise.
95         * mbchar.c: Likewise.
96         * mbswidth.c: Likewise.
97         * mkdtemp.c: Likewise.
98         * pipe.c: Likewise.
99         * printf-args.c: Likewise.
100         * printf-parse.c: Likewise.
101         * progname.c: Likewise.
102         * progreloc.c: Likewise.
103         * readlink.c: Likewise.
104         * sh-quote.c: Likewise.
105         * stpcpy.c: Likewise.
106         * stpncpy.c: Likewise.
107         * strcasecmp.c: Likewise.
108         * strcasestr.c: Likewise.
109         * strcspn.c: Likewise.
110         * striconv.c: Likewise.
111         * strncasecmp.c: Likewise.
112         * strnlen1.c: Likewise.
113         * strstr.c: Likewise.
114         * strtok_r.c: Likewise.
115         * tls.c: Likewise.
116         * tmpdir.c: Likewise.
117         * unicodeio.c: Likewise.
118         * unsetenv.c: Likewise.
119         * vasnprintf.c: Likewise.
120         * vasprintf.c: Likewise.
121         * wait-process.c: Likewise.
122         * xallocsa.c: Likewise.
123         * xsetenv.c: Likewise.
124         * xstriconv.c: Likewise.
125
126 2006-09-13  Eric Blake  <ebb9@byu.net>
127
128         * getopt.c: Fix typo in last commit.
129
130 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
131
132         * _fpending.c: Include <config.h> unconditionally, since we no
133         longer worry about uses that don't define HAVE_CONFIG_H.
134         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
135         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
136         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
137         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
138         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
139         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
140         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
141         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
142         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
143         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
144         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
145         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
146         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
147         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
148         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
149         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
150         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
151         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
152         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
153         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
154         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
155         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
156         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
157         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
158         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
159         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
160         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
161         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
162         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
163         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
164         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
165         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
166         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
167         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
168         Likewise.
169
170 2006-09-12  Jim Meyering  <jim@meyering.net>
171
172         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
173         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
174         Reported by Nelson H. F. Beebe.
175
176 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
177
178         * argp-help.c (argp_doc): Make sure NULL is not passed to
179         dgettext.
180
181 2006-09-10  Bruno Haible  <bruno@clisp.org>
182
183         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
184
185 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
186
187         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
188         program_invocation_name and program_invocation_short_name are
189         initialized.
190         * argp-namefrob.h: Move declarations of program_invocation_name
191         and program_invocation_short_name to argp.h, so they are visible
192         to user programs.
193         * argp.h: Likewise
194
195 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
196
197         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
198         convention.  Text proposed by Bruno Haible.
199         (struct argp_option): Document the use of N_() wrappers.
200
201         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
202         and translate the two parts separately, instead of feeding
203         the whole string to gettext.  This allows to exclude
204         '\v' from the strings visible to the translator by writing doc
205         strings as N_("..") "\v" N_("..").
206
207 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
208
209         * mktime.c (guess_time_tm): Fix bug where mktime
210         returned the maximum time_t value rather than (time_t) -1.
211         Problem originally reported by William Bardwell
212         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
213
214         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
215         Moved to here ...
216         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
217         ... from here.
218
219 2006-09-06  Bruno Haible  <bruno@clisp.org>
220
221         * striconv.h: New file.
222         * striconv.c: New file, merging iconvme.c with GNU gettext's
223         iconvstring.c.
224         * xstriconv.h: New file.
225         * xstriconv.c: New file.
226
227 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
228
229         * argz_.h: Sync from Libtool.
230
231         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
232                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
233
234         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
235
236 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
237
238         * trim.h: New file.
239         * trim.c: New file.
240
241 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
242
243         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
244         Problem reported by Ralf Wildenhues in
245         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
246
247         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
248         HAVE_STRUCT_STATFS_F_FSTYPENAME.
249
250 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
251
252         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
253         or stdbool.h, because they might not exist while configuring.
254
255         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
256         Don't include unistd.h or limits.h; not needed, since chdir-long.h
257         does that for us.
258         (O_DIRECTORY): Remove.
259
260 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
261
262         Work around a bug in both the Linux and SunOS 64-bit kernels:
263         nanosleep mishandles sleeps for longer than 2**31 seconds.
264         Problem reported by Frank v Waveren in
265         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
266         * nanosleep.c (BILLION): New constant.
267         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
268         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
269
270 2006-08-30  Jim Meyering  <jim@meyering.net>
271
272         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
273         the parameter.
274
275 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
276
277         * isapipe.c, isapipe.h: New files.
278
279 2006-08-29  Eric Blake  <ebb9@byu.net>
280
281         * error.c (error_at_line, print_errno_message): Match libc, after
282         resolution of upstream bug 3044.
283
284 2006-08-29  Bruno Haible  <bruno@clisp.org>
285
286         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
287
288 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
289
290         Sync from Libtool:
291
292         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
293
294         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
295         sharing with gnulib.  Report by Eric Blake.
296
297 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
298
299         * fcntl_.h: New file.
300         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
301         the fcntl module.
302         * dirchownmod.c: Likewise.
303         * fts.c: Likewise.
304
305         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
306         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
307         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
308         just before including <inttypes.h>, to avoid circular inclusion.
309
310 2006-08-28  Bruno Haible  <bruno@clisp.org>
311
312         * inttypes_.h (SCNX*): Remove definitions.
313         Reported by Eric Blake.
314
315 2006-08-26  Bruno Haible  <bruno@clisp.org>
316
317         * vasnprintf.c (EOVERFLOW): Remove definition.
318         (VASNPRINTF): Return a string of length > INT_MAX without failing.
319         * vasprintf.c: Include errno.h, limits.h.
320         (EOVERFLOW): New fallback definition.
321         (vasprintf): Test here whether the string length is > INT_MAX.
322         * vsnprintf.c: Include errno.h, limits.h.
323         (EOVERFLOW): New fallback definition.
324         (vsnprintf): Fix bug when generated string was too long for the buffer.
325         Test here whether the string length is > INT_MAX.
326
327 2006-08-26  Bruno Haible  <bruno@clisp.org>
328             Simon Josefsson  <jas@extundo.com>
329
330         BeOS portability.
331         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
332
333 2006-08-28  Bruno Haible  <bruno@clisp.org>
334
335         * c-strstr.h: New file, from GNU gettext.
336         * c-strstr.c: New file, from GNU gettext.
337
338 2006-08-26  Bruno Haible  <bruno@clisp.org>
339
340         * inttypes_.h: New file.
341         * inttypes.h: Remove file.
342         * stdint_.h: Include <inttypes.h> through its absolute filename.
343
344         * imaxabs.c: New file.
345
346         * imaxdiv.c: New file.
347
348 2006-08-22  Bruno Haible  <bruno@clisp.org>
349
350         * readutmp.h: Skip most definitions if neither <utmp.h> nor
351         <utmpx.h> exists.
352
353 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
354
355         BeOS portability.
356         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
357         Problem reported by Bruno Haible.
358
359 2006-08-21  Bruno Haible  <bruno@clisp.org>
360
361         BeOS portability.
362         * mbchar.h: Include <wctype.h> only if it exists.
363
364 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
365
366         * cycle-check.h: Include <stdint.h> unconditionally, since we
367         now assume the stdint module.  Do not include inttypes.h.
368         * fsusage.h: Likewise.
369         * getndelim2.c: Likewise.
370         * human.h: Likewise.
371         * inttostr.h: Likewise.
372         * obstack.c: Likewise.
373         * regex_internal.h: Likewise.
374         * tempname.c: Likewise.
375         * utimecmp.c: Likewise.
376         * xstrtol.h: Likewise.
377
378         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
379
380         * strtoimax.c: Adjust to macro name changes in Autoconf,
381         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
382         * xtime.h: Likewise.
383
384 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
385
386         * fchmodat.c: New file, from coreutils.  This was inadvertently
387         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
388
389 2006-08-18  Bruno Haible  <bruno@clisp.org>
390
391         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
392         (ME_DUMMY): Treat "kernfs" as a dummy.
393         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
394
395 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
396
397         Update from coreutils.
398
399         * __fpending.h: Add copyright notice.
400         * fprintftime.h: Likewise.
401         * savedir.c: Use (C) in copyright notice.
402         * savedir.h: Likewise.
403
404         2006-08-15  Jim Meyering  <jim@meyering.net>
405
406         * at-func.c: New file, with the logic of all emulated at-functions.
407         * openat-priv.h: Include <errno.h> and define ENOSYS,
408         in support of the EXPECTED_ERRNO macro.
409         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
410         Instead, define the appropriate symbols and include "at-func.c".
411         * mkdirat.c (mkdirat): Likewise.
412         * fchmodat.c (fchmodat): Likewise.
413         (ENOSYS): Remove definition.
414         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
415         Don't include "unistd--.h" -- it wasn't ever used.
416
417         2006-01-17  Jim Meyering  <jim@meyering.net>
418
419         Rewrite fts.c not to change the current working directory,
420         by using openat, fstatat, fdopendir, etc..
421
422         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
423         (HAVE_OPENAT_SUPPORT): Define.
424         [_LIBC] (fchdir): Don't undef or define; no longer used.
425         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
426         Now, this `function' always succeeds, and consumes its file descriptor
427         parameter -- so callers must not close such FDs.  Update callers.
428         (diropen_fd, opendirat, cwd_advance_fd): New functions.
429         (diropen): Add parameter, SP.  Adjust all callers.
430         Implement using diropen_fd, rather than open.
431         (fts_open): Initialize new member, fts_cwd_fd.
432         Remove fts_rft-setting code.
433         (fts_close): Close fts_cwd_fd, if necessary.
434         (__opendir2): Define in terms of opendir or opendirat,
435         depending on whether the FST_NOCHDIR flag is set.
436         (fts_build): Since fts_safe_changedir consumes its FD, and since
437         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
438         and close the dup'd file descriptor upon failure.
439         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
440         (fts_safe_changedir): Tweak semantics to reflect that this function
441         now calls cwd_advance_fd and hence consumes its FD argument.
442         * fts_.h [struct FTS] (fts_cwd_fd): New member.
443         [struct FTS] (fts_rft): Remove now-unused member.
444         [struct FTS] (fts_cycle.state): Improve comment.
445
446         * openat.c (openat_needs_fchdir): New function.
447         * openat.h (openat_needs_fchdir): Declare it.
448
449 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
450
451         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
452         Problem and fix reported by Pádraig Brady in
453         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
454
455 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
456
457         * memcoll.c (memcoll): Optimize for the common case where the
458         arguments are bytewise equal.
459
460 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
461
462         Change copyright notice from LGPL 2 to GPL 2, since that's the
463         standard form used in the gnulib repository.
464         * lock.c: LGPL -> GPL.
465         * lock.h: Likewise.
466         * strnlen1.c: Likewise.
467         * strnlen1.h: Likewise.
468         * tls.c: Likewise.
469         * tls.h: Likewise.
470         * tmpdir.c: Likewise.
471
472         * TODO: Remove; this belongs only in coreutils.
473
474 2006-08-14  Eric Blake  <ebb9@byu.net>
475
476         Import the following change from libc:
477
478         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
479
480         Upstream bug 2997.
481         * misc/error.c: Add space between program name and message if file
482         name is missing.
483
484 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
485
486         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
487         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
488
489         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
490         in wchar_t.  Problem reported by Eric Blake.
491
492         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
493         LEN is smaller than SIZE.  Suggested by Bruno Haible.
494         Also, help the compiler to keep LEN in a register.
495
496 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
497
498         * .cppi-disable: Add snprintf.h, socket_.h.
499         * snprintf.c: Include <errno.h> and <limits.h>.
500         (EOVERFLOW): Define if the system does not.
501         Do not include "minmax.h"; it wasn't used.
502         (snprintf): Don't assume size_t promotes to an unsigned type.
503         Fix bug when generated string was too long for the buffer: the
504         buffer's contents are supposed to be the initial prefix of the
505         output.  Don't assume vasnprintf returns EOVERFLOW if the size
506         exceeds INT_MAX; do the check ourselves.
507
508         Import the following changes from libc:
509
510         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
511
512         * posix/regex_internal.c (re_string_skip_chars): If no character has
513         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
514         to the byte which couldn't be converted.
515         (re_string_reconstruct): Don't clear valid_raw_len before calling
516         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
517         tip_context using re_string_context_at.
518
519         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
520
521         * posix/regex.h: g++ still cannot handled [restrict].
522
523         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
524
525         * posix/regex.h: Remove special handling for VMS.
526
527 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
528
529         Sync from coreutils.
530
531         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
532
533         * mountlist.c [ME_REMOTE]: Filter out cifs.
534         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
535
536 2006-08-08  Eric Blake  <ebb9@byu.net>
537
538         * verror.c (verror_at_line): Work around glibc bug 2997, so that
539         verror_at_line output complies with GNU Coding Standards even when
540         file is NULL.
541
542 2006-08-08  Eric Blake  <ebb9@byu.net>
543
544         * verror.h, verror.c: New files.
545
546 2006-08-07  Bruno Haible  <bruno@clisp.org>
547
548         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
549         versions of AIX.
550         Reported by Ralf Wildenhues.
551
552 2006-08-06  Eric Blake  <ebb9@byu.net>
553
554         * error.h: Fold in some upstream changes from glibc.
555         * error.c: Likewise.
556
557 2006-07-29  Bruno Haible  <bruno@clisp.org>
558
559         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
560
561 2006-07-29  Bruno Haible  <bruno@clisp.org>
562
563         * setenv.c: Undo unintended modification done on 2006-02-27.
564
565 2006-07-28  Eric Blake  <ebb9@byu.net>
566
567         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
568         macro expansion.
569
570 2006-07-28  Simon Josefsson  <jas@extundo.com>
571
572         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
573         #include's.
574
575 2006-07-28  Simon Josefsson  <jas@extundo.com>
576
577         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
578         #include's.
579
580 2006-07-28  Bruno Haible <bruno@clisp.org>
581
582         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
583
584 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
585
586         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
587         arpa/inet.h.
588
589 2006-07-28  Bruno Haible  <bruno@clisp.org>
590
591         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
592         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
593         fallbacks.
594         Avoids link error on FreeBSD 4.x.
595         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
596
597         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
598         encoding.
599         * mbswidth.c (iswcntrl): Likewise.
600
601 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
602
603         * modechange.c (mode_compile): Numeric modes now affect setuid and
604         setgid on directories only if they set these bits.
605         * modechange.h: Remove obsolete comment about masks.
606
607 2006-07-27  Bruno Haible  <bruno@clisp.org>
608
609         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
610         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
611         defined.
612
613 2006-07-26  Eric Blake  <ebb9@byu.net>
614
615         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
616         like mingw that lack mkstemp.
617         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
618         avoid compilation warning on mingw.
619
620 2006-07-25  Bruno Haible  <bruno@clisp.org>
621
622         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
623         <stdarg.h> or config.h.
624
625 2006-07-24  Bruno Haible  <bruno@clisp.org>
626
627         * clean-temp.h: New file, from GNU gettext.
628         * clean-temp.c: New file, from GNU gettext.
629
630 2006-07-24  Bruno Haible  <bruno@clisp.org>
631
632         * tmpdir.h: New file, from GNU gettext.
633         * tmpdir.c: New file, from GNU gettext.
634
635 2006-07-23  Bruno Haible  <bruno@clisp.org>
636
637         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
638         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
639         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
640         gl_linked_remove_at): Use it.
641
642 2006-07-23  Eric Blake  <ebb9@byu.net>
643
644         * tmpfile-safer.c: New file.
645         * stdio-safer.h (fopen_safer): Add prototype.
646         * stdio--.h (tmpfile): Make safer.
647
648 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
649
650         * close-stream.c, close-stream.h: New files.
651
652 2006-07-22  Bruno Haible  <bruno@clisp.org>
653
654         Merge from GNU gettext 0.15.
655
656         2005-07-05  Bruno Haible  <bruno@clisp.org>
657
658                 * printf-args.c (printf_fetchargs): Work around broken
659                 definition of wint_t on mingw.
660
661         2005-02-12  Bruno Haible  <bruno@clisp.org>
662
663                 * xallocsa.h: Add extern "C" for C++.
664
665         2006-05-17  Bruno Haible  <bruno@clisp.org>
666
667                 Cygwin portability.
668                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
669
670         2006-04-30  Bruno Haible  <bruno@clisp.org>
671
672                 * progreloc.c: Include <mach-o/dyld.h> if available.
673                 (find_executable): Use _NSGetExecutablePath when possible.
674
675         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
676
677                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
678                 function.
679
680         2005-12-29  Bruno Haible  <bruno@clisp.org>
681
682                 * progreloc.c (set_program_name_and_installdir): Fix
683                 compilation error.
684
685         2005-12-04  Bruno Haible  <bruno@clisp.org>
686
687                 Cygwin portability.
688                 * progreloc.c: Include <windows.h> also on Cygwin.
689                 (find_executable): Add support for Cygwin.
690                 (set_program_name_and_installdir): Handle also platforms with
691                 nonempty EXEEXT.
692
693         2006-07-11  Bruno Haible  <bruno@clisp.org>
694
695                 * javacomp.c: Fix a comment.
696                 Reported by Jim Meyering.
697
698         2006-04-30  Bruno Haible  <bruno@clisp.org>
699
700                 * javacomp.h (compile_java_class): Add source_version,
701                 target_version arguments.
702                 * javacomp.c: Rewritten to choose only a compiler that
703                 respects the specified source_version and target_version.
704
705         2006-06-27  Bruno Haible  <bruno@clisp.org>
706
707                 Assume correct S_ISDIR macro.
708                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
709
710         2006-07-22  Bruno Haible  <bruno@clisp.org>
711
712                 * javaversion.h: New file, from GNU gettext.
713                 * javaversion.c: New file, from GNU gettext.
714                 * javaversion.java: New file, from GNU gettext.
715                 * javaversion.class: New file, from GNU gettext.
716
717         2006-05-17  Bruno Haible  <bruno@clisp.org>
718
719                 Cygwin portability.
720                 * javaexec.c (execute_java_class): Test for jview program
721                 also on Cygwin.
722
723         2006-04-09  Bruno Haible  <bruno@clisp.org>
724
725                 * fatal-signal.c: Don't include string.h.
726                 (at_fatal_signal): Use a copying loop instead of memcpy.
727
728         2005-12-04  Bruno Haible  <bruno@clisp.org>
729
730                 * csharpexec.c: Add support for 'clix' launcher (untested).
731                 (execute_csharp_using_sscli): New function.
732                 (execute_csharp_program): Call it.
733
734         2006-06-21  Bruno Haible  <bruno@clisp.org>
735
736                 Avoid warnings from recent versions of mcs.
737                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
738                 -o, -L, -r any more. Use options documented since mcs-1.0
739                 instead. Similarly for -g.
740
741         2005-07-09  Bruno Haible  <bruno@clisp.org>
742
743                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
744                 add a .dll suffix.
745                 Reported by Mark Junker <mjscod@gmx.de>.
746
747         2006-06-17  Bruno Haible  <bruno@clisp.org>
748
749                 * config.charset: Update for NetBSD 3.0.
750
751         2006-05-17  Bruno Haible  <bruno@clisp.org>
752
753                 Cygwin portability.
754                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
755
756         2006-05-16  Bruno Haible  <bruno@clisp.org>
757
758                 * localcharset.c [CYGWIN]: Include <windows.h>.
759                 (get_charset_aliases): For Cygwin, return the same CPxxx
760                 aliases list as under WIN32.
761                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
762                 the environment variables. Fall back to GetACP().
763
764         2006-04-05  Bruno Haible  <bruno@clisp.org>
765
766                 * config.charset: Update Juan Manuel Guerrero's address.
767
768         2005-02-12  Bruno Haible  <bruno@clisp.org>
769
770                 * allocsa.h: Add extern "C" for C++.
771
772         2005-02-10  Bruno Haible  <bruno@clisp.org>
773
774                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
775                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
776
777         2006-07-22  Bruno Haible  <bruno@clisp.org>
778
779                 * gettext.h: Update to GNU gettext-0.15.
780
781 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
782         and Simon Josefsson <jas@extundo.com>
783
784         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
785
786         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
787
788 2006-07-21  Eric Blake  <ebb9@byu.net>
789
790         * stdlib-safer.h: New file from coreutils, required by
791         stdlib--.h.
792
793 2006-07-19  Derek R. Price  <derek@ximbiot.com>
794
795         * getaddrinfo.h: Don't define unimplemented AI_* flags.
796         Reindent and repaginate.
797
798 2006-07-17  Bruno Haible  <bruno@clisp.org>
799
800         * gl_list.h: New file.
801         * gl_list.c: New file.
802         * gl_array_list.h: New file.
803         * gl_array_list.c: New file.
804         * gl_carray_list.h: New file.
805         * gl_carray_list.c: New file.
806         * gl_linked_list.h: New file.
807         * gl_linked_list.c: New file.
808         * gl_anylinked_list1.h: New file.
809         * gl_anylinked_list2.h: New file.
810         * gl_avltree_list.h: New file.
811         * gl_avltree_list.c: New file.
812         * gl_anyavltree_list1.h: New file.
813         * gl_anyavltree_list2.h: New file.
814         * gl_rbtree_list.h: New file.
815         * gl_rbtree_list.c: New file.
816         * gl_anyrbtree_list1.h: New file.
817         * gl_anyrbtree_list2.h: New file.
818         * gl_anytree_list1.h: New file.
819         * gl_anytree_list2.h: New file.
820         * gl_linkedhash_list.h: New file.
821         * gl_linkedhash_list.c: New file.
822         * gl_anyhash_list1.h: New file.
823         * gl_anyhash_list2.h: New file.
824         * gl_avltreehash_list.h: New file.
825         * gl_avltreehash_list.c: New file.
826         * gl_rbtreehash_list.h: New file.
827         * gl_rbtreehash_list.c: New file.
828         * gl_anytreehash_list1.h: New file.
829         * gl_anytreehash_list2.h: New file.
830
831         * gl_oset.h: New file.
832         * gl_oset.c: New file.
833         * gl_array_oset.h: New file.
834         * gl_array_oset.c: New file.
835         * gl_avltree_oset.h: New file.
836         * gl_avltree_oset.c: New file.
837         * gl_rbtree_oset.h: New file.
838         * gl_rbtree_oset.c: New file.
839         * gl_anytree_oset.h: New file.
840
841 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
842
843         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
844         New files.
845         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
846         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
847         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
848         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
849         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
850         callers changed.  Revamp internals significantly, by not
851         attempting to create directories that are temporarily more
852         permissive than the final results.  Do not attempt to use
853         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
854         This removes some race conditions, fixes some bugs, and simplifies
855         things.  Use new dirchownmod function to do owner and mode changes.
856         * mkdir-p.h: Likewise.
857         * modechange.c (octal_to_mode): New function.
858         (struct mode_change): New member mentioned.
859         (make_node_op_equals): New arg mentioned.  All callers changed.
860         (mode_compile): Keep track of which mode bits the user has explicitly
861         mentioned.
862         (mode_adjust): New arg DIR, so that we implement the X op correctly.
863         New arg PMODE_BITS, to keep track of which mode bits the user
864         mentioned; it treats S_ISUID and S_ISGID speciall.
865         All callers changed.
866         * modechange.h: Likewise.
867
868 2006-07-11  Derek R. Price  <derek@ximbiot.com>
869
870         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
871
872 2006-07-10  Derek R. Price  <derek@ximbiot.com>
873
874         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
875         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
876         macros into the GNU _D_EXACT_NAMLEN.
877         * savedir.c:  Likewise.
878         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
879
880 2006-07-09  Jim Meyering  <jim@meyering.net>
881
882         * argp-pv.c: Remove a doubled word in a comment.
883         * check-version.c (check_version): Likewise.
884         * javacomp.c (compile_java_class): Likewise.
885
886 2006-07-08  Jim Meyering  <jim@meyering.net>
887
888         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
889
890 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
891
892         * getaddrinfo.c: Changes to compile under MSVC6: changed
893         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
894         brackets.  Other minor changes to suppress some compiler
895         warnings.
896
897 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
898
899         * getloadavg.c: Use __VMS, not VMS.
900         * getopt.c: Likewise.
901         * getpagesize.h: Likewise.
902         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
903         probably does not work.
904
905 2006-07-06  Derek R. Price  <derek@ximbiot.com>
906         and Paul Eggert  <eggert@cs.ucla.edu>
907
908         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
909         Don't worry about this obsolete case any more.
910         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
911         directories.
912         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
913         worry about this obsolete case any more.
914         * fts.c: Likewise.
915         * getcwd.c: Likewise.
916         * glob.h: Likewise.
917         * savedir.c: Likewise.
918
919 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
920
921         * .cppi-disable: Add wcwidth.
922         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
923         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
924         (ISGRAPH): Remove.  All uses changed to isgraph.
925         (FOLD) [!defined _LIBC]: Remove special case.
926         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
927         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
928         HAVE_ISBLANK.
929         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
930
931 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
932
933         * strtod.c (strtod): cast the argument of tolower to unsigned char.
934
935 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
936
937         * memcasecmp.c: Include <limits.h>.
938         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
939         * strtod.c (strtod): Don't assume isspace works on negative chars.
940         Don't assume isdigit succeeds only on '0' through '9'.
941
942 2006-07-05  Derek R. Price  <derek@ximbiot.com>
943
944         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
945         All uses of is_space replaced by isspace.
946         * exit.h: Don't talk about STDC_HEADERS.
947         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
948         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
949         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
950         replaced by isprint etc.
951         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
952         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
953         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
954         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
955         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
956         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
957
958 2006-07-05  Eric Blake  <ebb9@byu.net>
959
960         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
961         missing from netdb.h.
962         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
963
964 2006-06-27  Bruno Haible  <bruno@clisp.org>
965
966         Assume ANSI C header files and <ctype.h> functions.
967         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
968         (mbsnwidth): Use isprint, iscntrl instead.
969
970 2006-07-03  Jim Meyering  <jim@meyering.net>
971
972         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
973         macro is used before the first cycle_check call.
974
975 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
976
977         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
978         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
979         reported by Mark D. Baushke, one in
980         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
981
982         Merge from coreutils.
983
984         * .cppi-disable: Add stdint_.h.
985         * .cvsignore: Add stdint.h.
986
987         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
988
989         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
990         both double and long double versions.
991         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
992         * xstrtold.c: New file.
993         * xstrtod.h (xstrtold): New decl.
994
995         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
996
997         * filemode.c (setst): Remove.
998         (strmode): Rewrite to avoid setst.  This makes the code shorter,
999         (arguably) clearer, and the generated code is a bit smaller on my
1000         Debian GNU/Linux stable x86 host.
1001
1002         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1003
1004         * filemode.c: Include "filemode.h" first, to test the interface.
1005         Assume that filemode.h includes sys/types.h and sys/stat.h.
1006         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1007         (ftypelet): Reorder to put common cases first, for efficiency.
1008         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1009         to do 'M'.
1010         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1011         of 10, for compatibility with FreeBSD.  All callers changed.
1012         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1013         that can't be deduced solely from st_mode.  First arg is now a const
1014         pointer.
1015         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1016         (strmode): Renamed from mode_string.
1017         (filemodestring): New decl.
1018         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1019         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1020         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1021
1022         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1023
1024         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1025         fsusage.h now does that.  Include fsusage.h first, to test interface.
1026         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1027         at most one method (the old code could have generated decls that
1028         didn't conform to C89, not that this was ever exercised).
1029         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1030
1031         2006-03-19  Jim Meyering  <jim@meyering.net>
1032
1033         Work even in a chroot where d_ino values for entries in "/"
1034         don't match the stat.st_ino values for the same names.
1035         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1036         number, iterate through all entries again, using lstat instead.
1037         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1038         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1039
1040         * getcwd.c (__getcwd): Clarify a comment.
1041         Use memcpy in place of a call to strcpy.
1042
1043         2006-03-12  Jim Meyering  <jim@meyering.net>
1044
1045         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1046         that of the current directory (which we're about to chdir ".." out of),
1047         then save the dev-ino of the parent, instead.
1048
1049         * same-inode.h (SAME_INODE): New file/macro.
1050         * chdir-safer.c (SAME_INODE): Remove definition.
1051         Include "same-inode.h", instead.
1052         * same.c: Likewise.
1053         * cycle-check.h: Include "same-inode.h".
1054         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1055         * cycle-check.c (SAME_INODE): Remove definition.
1056         * root-dev-ino.h: Include "same-inode.h".
1057
1058         2006-03-11  Eric Blake  <ebb9@byu.net>
1059
1060         * same.c (same_name): s/base_name/last_component/
1061         * backupfile.c (check_extension, numbered_backup): Likewise.
1062         * filenamecat.c (file_name_concat): Likewise.
1063
1064         2006-03-11  Eric Blake  <ebb9@byu.net>,
1065                     Paul Eggert  <eggert@cs.ucla.edu>
1066
1067         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1068         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1069         drive prefix.
1070         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1071         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1072         (last_component): New method.
1073         * dirname.c (dir_len): Determine when drive letters need a
1074         subsequent slash.  Preserve // when it is special.
1075         (dir_name): Don't append dot when drive letter is absolute.
1076         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1077         * basename.c (base_name): New semantics - malloc the result.
1078         Preserve // when it is special.  Preserve relative files that look
1079         like drive letters.
1080         (base_len): Preserve // when it is special.
1081         (last_component): New method, similar to old base_name semantics.
1082         * stripslash.c (strip_trailing_slashes): Use last_component, not
1083         base_name.  Strip redundant slashes from ///.
1084
1085 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1086
1087         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1088         both are 64 bits, since this seems to be the tradition, and this
1089         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1090         we ever run into a host that prefers long long to long in this
1091         case, we'll need another configure-time test.  Problem reported by
1092         Jim Meyering.
1093
1094 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1095
1096         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1097         possible collision with system files.
1098         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1099         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1100         WCHAR_MIN and WCHAR_MAX in this case.
1101         (<stddef.h>): Do not include; no longer needed.
1102         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1103         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1104         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1105         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1106         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1107         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1108         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1109         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1110         !defined(__c99))]: Include in this case too, since it's harmless
1111         now.
1112         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1113         dangerous to do so.
1114         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1115         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1116         (_STDINT_MIN, _STDINT_MAX): New macros.
1117         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1118         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1119         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1120         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1121         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1122         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1123         macros, not typedefs; this simplifies things quite a bit.
1124         Use long int for all types narrower than int64_t.
1125         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1126         Define in terms of long long int or int64_t or long int,
1127         not int64_t or int32_t.  This saves some compile-time testing.
1128         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1129         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1130         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1131         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1132         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1133         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1134         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1135         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1136         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1137         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1138         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1139         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1140         undef any previous version and define our own version, for
1141         simplicity and consistency with the new macros for types.
1142         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1143         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1144         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1145         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1146         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1147         @WINT_T_SUFFIX@ to keep things simple here.
1148         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1149         Simplify by assuming typical 8/16/32/64 host, since we're
1150         already doing that elsewhere anyway.
1151         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1152         and assume long long int is 64 bits if available.  This
1153         speeds up 'configure'.
1154
1155 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1156
1157         * getaddrinfo.c: fixed typo
1158
1159 2006-06-29  Eric Blake  <ebb9@byu.net>
1160
1161         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1162         unused static function.
1163
1164 2006-06-29  Eric Blake  <ebb9@byu.net>
1165
1166         * stat_.h: New file.
1167
1168 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1169
1170         * strftime.c: Assume strftime() exists.
1171
1172 2006-06-28  Bruno Haible  <bruno@clisp.org>
1173
1174         * getaddrinfo.h: Fix POSIX URL.
1175         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1176         (use_win32_p): Make static.
1177         (getaddrinfo): Reject service name if it is empty or does not consist
1178         solely of decimal digits, or if its value is > 65535.
1179         (getnameinfo): Remove useless casts.
1180
1181 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1182
1183         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1184         Autoconf 2.60 says this stuff was obsolete.
1185
1186 2006-05-12  Bruno Haible  <bruno@clisp.org>
1187
1188         * mkdtemp.c [MINGW]: Include <io.h>.
1189         (mkdir): Define using _mkdir.
1190
1191 2006-06-28  Bruno Haible  <bruno@clisp.org>
1192
1193         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1194         declaration for wcwidth.
1195         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1196
1197 2006-06-28  Eric Blake  <ebb9@byu.net>
1198
1199         * xvasprintf.h: Fix comments.
1200
1201 2006-06-28  Eric Blake  <ebb9@byu.net>
1202
1203         * mbchar.h (wcwidth): Include wcwidth.h.
1204         * mbswidth.c (wcwidth): Move from here...
1205         * wcwidth.h: ...to this new file.
1206
1207 2006-06-28  Simon Josefsson  <jas@extundo.com>
1208
1209         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1210         functions there.  It will succeed on Windows XP, but on Windows
1211         2000 and (presumably) earlier, it will fail, and use the internal
1212         re-implementation.
1213         (use_win32_p): New function.
1214         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1215         Support AI_NUMERICSERV to disable getservbyname.
1216         (getnameinfo): New function, only supports
1217         NI_NUMERICHOST|NI_NUMERICSERV for now.
1218
1219         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1220         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1221         getnameinfo.
1222
1223 2006-06-27  Bruno Haible  <bruno@clisp.org>
1224
1225         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1226
1227 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1228
1229         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1230         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1231         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1232
1233 2006-06-26  Bruno Haible  <bruno@clisp.org>
1234
1235         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1236         WCHAR_MAX.
1237         Reported by Mark D. Baushke and Larry Jones.
1238
1239 2006-06-26  Bruno Haible  <bruno@clisp.org>
1240
1241         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1242         in pre-C99 mode.
1243         Suggested by Mark D. Baushke and Larry Jones.
1244
1245 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1246
1247         * stdint_.h: Treat BSD/OS like OpenBSD.
1248
1249 2006-06-23  Bruno Haible  <bruno@clisp.org>
1250
1251         * stdint_.h: Treat IRIX like OpenBSD.
1252
1253 2006-06-23  Bruno Haible  <bruno@clisp.org>
1254
1255         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1256         ISO C 99 Technical Corrigendum 1.
1257
1258 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1259
1260         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1261         Some compiler complained about some of them.  Problem reported by
1262         Larry Jones in
1263         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1264
1265 2006-06-21  Simon Josefsson  <jas@extundo.com>
1266
1267         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1268         variable.
1269
1270         * socket_.h: Don't define WINVER.
1271
1272         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1273         slightly modified to work in gnulib.
1274
1275 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1276
1277         * read-file.c (fread_file): Start with buffer allocation of
1278         0 bytes rather than 1 byte; this simplifies the code.
1279         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1280         code to free buffer and save/restore errno.
1281         (internal_read_file): Remove unused local.
1282
1283 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1284
1285         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1286         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1287         Problem reported by Denis Excoffier in
1288         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1289
1290 2006-06-19  Simon Josefsson  <jas@extundo.com>
1291
1292         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1293
1294 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1295
1296         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1297
1298 2006-06-17  Bruno Haible  <bruno@clisp.org>
1299
1300         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1301
1302 2006-06-17  Bruno Haible  <bruno@clisp.org>
1303
1304         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1305         problem on Solaris 2.5.1.
1306
1307 2006-06-16  Eric Blake  <ebb9@byu.net>
1308
1309         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1310         * unicodeio.c [!defined errno]: Likewise.
1311         * strtol.c [!defined errno]: Likewise.
1312         * strtod.c [!defined errno]: Likewise.
1313
1314 2006-06-15  Bruno Haible  <bruno@clisp.org>
1315
1316         * stdint_.h: Rewritten to be fully auto-configured.
1317         Fixes bug on HP-UX/IA64.
1318
1319 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1320
1321         * getdate.y (__attribute__): Don't define if already defined.
1322         Problem reported by Larry Jones.
1323         * utimens.c (__attribute__): Likewise.
1324
1325 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1326
1327         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1328         reported by Andreas Schwab.
1329
1330 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1331             Bruno Haible  <bruno@clisp.org>
1332
1333         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1334
1335 2006-05-26  Martin Lambers  <marlam@marlam.de>
1336
1337         * getpass.c: Updates the test for the native W32 API, and adds
1338         missing includes, thus fixing compilation warnings.
1339
1340 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1341
1342         * tempname.c (small_open, large_open): New macros.
1343         (__open, __open64) [!_LIBC]: Remove.
1344         (__gen_tempname): Use small_open and large_open instead of __open
1345         and __open64.  This fixes a portability bug on HP-UX 11.11i
1346         reported by Simon Wing-Tang in
1347         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1348
1349 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1350
1351         * exclude.c (exclude_fnmatch): New function.
1352         (excluded_file_name): Call exclude_fnmatch.
1353         * exclude.h (excluded_file_name): New prototype
1354
1355 2006-05-24  Bruno Haible  <bruno@clisp.org>
1356
1357         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1358         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1359         Reported by Thorsten Maerz <torte@netztorte.de> via
1360         Aaron Stone <aaron@serendipity.cx>.
1361
1362 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1363
1364         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1365         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1366         (my_usleep): Don't mishandle maximum value.
1367
1368 2006-05-19  Jim Meyering  <jim@meyering.net>
1369
1370         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1371
1372 2006-05-17  Bruno Haible  <bruno@clisp.org>
1373
1374         Cygwin portability.
1375         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1376
1377 2006-05-17  Bruno Haible  <bruno@clisp.org>
1378
1379         * stdint_.h: Fix recognition of Cygwin.
1380
1381 2006-05-11  Jim Meyering  <jim@meyering.net>
1382
1383         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1384
1385 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1386
1387         * crc.c (crc32_update): Remove unnecessary L suffix.
1388         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1389         unwanted sign propagation, e.g., on hosts with 64-bit int.
1390         There still are some problems with reeelly weird theoretical hosts
1391         (e.g., 33-bit int) but it's not worth worrying about now.
1392         * sha1.c (rol): Likewise.
1393         (K1, K2, K3, K4): Remove unnecessary L suffix.
1394
1395 2006-05-10  Bruno Haible  <bruno@clisp.org>
1396
1397         * des.c: Cast to avoid warnings.
1398
1399 2006-05-10  Simon Josefsson  <jas@extundo.com>
1400
1401         * md4.c: Typo fix, update copyright years.
1402         (K1, K2): Don't use L because it turn computations into 64-bit on
1403         64-bit platforms.
1404
1405 2006-05-09  Bruno Haible  <bruno@clisp.org>
1406
1407         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1408         (EOVERFLOW): Define fallback value.
1409         (xstrcat): New function.
1410         (xvasprintf): Recognize the special case of a string concatenation.
1411
1412 2006-05-01  Bruno Haible  <bruno@clisp.org>
1413
1414         * stdint_.h: Shorter URL.
1415         * inttypes.h: Likewise.
1416
1417 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1418
1419         * verify.h: Document the internals better.  Most of this change
1420         was written by Bruno Haible.
1421
1422 2006-04-29  Bruno Haible  <bruno@clisp.org>
1423
1424         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1425         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1426
1427 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1428
1429         * getdate.y (get_date): When adding relative date, start with the
1430         initial time, not with the result of the first mktime call.
1431
1432 2006-04-23  Bruno Haible  <bruno@clisp.org>
1433
1434         * copy-file.c: Include <unistd.h> unconditionally.
1435         * execute.c: Likewise.
1436         * fatal-signal.c: Likewise.
1437         * findprog.c: Likewise.
1438         * mkdtemp.c: Likewise.
1439         * pipe.h: Likewise.
1440         * pipe.c: Likewise.
1441         * wait-process.h: Likewise.
1442
1443 2006-04-23  Bruno Haible  <bruno@clisp.org>
1444
1445         * fwriteerror.c (fwriteerror): Call fclose also when an error
1446         condition was already detected.
1447         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1448
1449 2006-04-19  Derek Price  <derek@ximbiot.com>
1450             Eric Blake  <ebb9@byu.net>
1451
1452         * inttypes.h: Correct grammar in comment.
1453
1454 2006-04-18  Derek Price  <derek@ximbiot.com>
1455             Paul Eggert  <eggert@cs.ucla.edu>
1456
1457         * inttypes.h: New file.
1458         * strtoimax.c: Assume <inttypes.h>.
1459
1460 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1461
1462         * utimens.c (futimens): glibc futimesat messes up if /proc
1463         isn't mounted.  Problem reported by Kir Kolyshkin.
1464
1465 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1466
1467         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1468         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1469         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1470
1471 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1472
1473         Merge regex changes from libc, removing some of our
1474         POSIX-conformance changes that were rejected and redoing them in a
1475         less-intrusive way.
1476
1477         * regcomp.c (re_compile_internal, init_dfa):
1478         Length arg is now size_t, not Idx.  All uses changed.
1479         (peek_token): Forward decl now says internal_function.
1480         (__re_error_msgid, __re_error_msgid_idx):
1481         Now static rather than extern with attribute_hidden.
1482         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1483         For some reason libc prefers K&R style defns for external functions.
1484         (regerror) [!defined _LIBC]: Likewise.
1485         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1486         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1487         (build_range_exp, build_collating_symbol):
1488         Use K&R-style defn.
1489         (re_compile_fastmap): Use '\0' to memset, not 0.
1490         (utf8_sb_map): Make the calculations more obvious.
1491         (init_dfa, parse_bracket_exp, build_charclass_op):
1492         Call calloc and cast result, as glibc does.
1493         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1494         (build_range_exp, build_collating_symbol):
1495         Now internal functions.
1496
1497         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1498
1499         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1500         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1501         Don't depend on VMS; depend on __VMS instead, for POSIX
1502         namespace cleanness.
1503         (regoff_t): Define to ssize_t, not long int.
1504
1505         Remove the REG_ macros named below.  Instead, make the old names
1506         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1507         __USE_GNU_REGEX.
1508         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1509         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1510         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1511         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1512         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1513         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1514         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1515         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1516         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1517         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1518         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1519         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1520         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1521         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1522         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1523         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1524         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1525         (REG_NREGS):
1526         Remove.  All uses replaced by the old RE_* names.
1527         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1528         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1529         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1530         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1531         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1532         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1533         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1534         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1535         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1536         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1537         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1538         Don't bother having these macros be independent of each others'
1539         values, since they no longer exist in the POSIX name space.
1540
1541         Rename the following member names back to their old names,
1542         unless !__USE_GNU_REGEX.  All uses changed back.
1543         (buffer): Renamed from re_buffer.
1544         (allocated): Renamed from re_allocated.
1545         (used): Renamed from re_used.
1546         (syntax): Renamed from re_syntax.
1547         (fastmap): Renamed from re_fastmap.
1548         (translate): Renamed from re_translate.
1549         (can_be_null): Renamed from re_can_be_null.
1550         (regs_allocated): Renamed from re_regs_allocated.
1551         (fastmap_accurate): Renamed from re_fastmap_accurate.
1552         (no_sub): Renamed from re_no_sub.
1553         (not_bol): Renamed from re_not_bol.
1554         (not_eol): Renamed from re_not_eol.
1555         (newline_anchor): Renamed from re_newline_anchor.
1556         (num_regs): Renamed from rm_num_regs.
1557         (start): Renamed from rm_start.
1558         (end): Renamed from rm_end.
1559
1560         (free_state): Move up a bit.
1561
1562         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1563         #define to be empty.
1564         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1565         when that is what is intended.
1566         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1567         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1568         (MAX): New macro.
1569         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1570         All uses changed back to re_malloc, etc.  It's now the caller's
1571         responsibility to check for overflow; all callers changed.
1572         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1573         (re_x2nrealloc): Remove.
1574         (free_state): Remove decl.
1575
1576         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1577         (re_set_registers, re_exec):
1578         Use K&R-style defn.
1579
1580         2006-01-31  Roland McGrath  <roland@redhat.com>
1581
1582         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1583         Reported by Mike Frysinger <vapier@gentoo.org>.
1584
1585         2006-01-15  Andreas Jaeger  <aj@suse.de>
1586
1587         [BZ #1950]
1588         * regex_internal.c (re_string_reconstruct): Adjust for
1589         build_wcs_upper_buffer change.
1590         (build_wcs_upper_buffer): Change return type.
1591
1592         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1593
1594         * regex_internal.h: Include <stdint.h> if available.
1595
1596         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1597
1598         * regex_internal.h (SIZE_MAX): Provide a default definition.
1599
1600         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1601
1602         * regcomp.c: Adjust for changed secondary hash function.
1603
1604         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1605
1606         * regex.h: Pretty printing.
1607         Clean up namespace a bit.
1608
1609         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1610
1611         * regexec.c (update_cur_sifted_state, check_arrival,
1612         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1613
1614         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1615                     Ulrich Drepper  <drepper@redhat.com>
1616
1617         [BZ #1302]
1618         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1619         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1620
1621         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1622
1623         [BZ #281]
1624         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1625         * regcomp.c: Remove unnecessary uses of
1626         unsigned RE_TRANSLATE_TYPE.
1627         * regex_internal.h: Likewise.
1628         * regex_internal.c: Likewise.
1629         * regexec.c: Likewise.
1630         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1631
1632         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1633
1634         * regexec.c (find_recover_state): Remove unnecessary
1635         initialization.
1636         (transit_state_bkref): Make DFA a const pointer.
1637         (get_subexp): Likewise.
1638         (check_arrival): Likewise.
1639         (update_cur_sifted_state): Likewise.
1640         (re_search_internal): Likewise.
1641         (prune_impossible_nodes): Likewise.
1642         (acquire_init_state_context): Likewise.
1643         (proceed_next_node): Likewise.
1644         (set_regs): Likewise.
1645         (free_fail_stack_return): Likewise.
1646         (check_arrival_expand_ecl): Mark DFA parameter as const.
1647         (check_arrival_expand_ecl_sub): Likewise.
1648         (check_subexp_limits): Likewise.
1649         (sub_epsilon_src_nodes):  Likewise.
1650         (add_epsilon_src_nodes):  Likewise.
1651         (merge_state_array): Likewise.
1652         (update_regs): Likewise.
1653         (build_trtable): Likewise.
1654         (sift_states_backward): Mark MCTX parameter as const.
1655         (build_sifted_states): Likewise.
1656         (update_cur_sifted_state): Likewise.
1657         (sift_states_mkref): Likewise.
1658         (check_arrival_expand_ecl): Mark eclosure as const.
1659         (check_dst_limits_calc_pos_1): Likewise.
1660         * regex_internal.h (re_match_context_t): Make dfa a const
1661         pointer.
1662
1663         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1664
1665         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1666         (transit_state_sb): Likewise.
1667         (transit_state_mb): Likewise.
1668         (sift_states_iter_mb): Likewise.
1669         (check_arrival_add_next_nodes): Likewise.
1670         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1671         [_LIBC] (re_search_2_stub): Use mempcpy.
1672
1673         * regex_internal.c (re_string_reconstruct): Avoid calling
1674         mbrtowc for very simple UTF-8 case.
1675
1676         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1677         a pointer-to-const.
1678         (re_acquire_state_context): Likewise.
1679         * regex_internal.h: Adjust prototypes.
1680
1681         * regex.c: Prevent using C++ compilers.
1682
1683         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1684         (re_acquire_state_context): Likewise.
1685
1686 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1687             Bruno Haible  <bruno@clisp.org>
1688
1689         * stdint_.h: On OpenBSD, don't redefine types already included in
1690         <sys/types.h> and <inttypes.h>.
1691
1692 2006-03-24  Eric Blake  <ebb9@byu.net>
1693
1694         * time_r.c (copy_string_result): Remove, as it is no longer used.
1695
1696 2006-03-24  Simon Josefsson  <jas@extundo.com>
1697
1698         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1699         including some doc fixes.
1700         (base64_encode_alloc): Fix +1 bug on allocation failures.
1701
1702 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1703
1704         * base64.c (base64_encode): Do not read past end of array with
1705         unsanitized input on systems with CHAR_BIT > 8.
1706
1707 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1708
1709         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1710         Typedef to long int, not to off_, as POSIX will likely change
1711         in that direction.
1712
1713 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1714
1715         * argp-help.c (validate_uparams): Fix typo
1716         * argp-parse.c (argp_default_options): Consistently begin help
1717         messages with a lowercase letter.
1718
1719 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1720
1721         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1722         overrun buffers and shouldn't be used (much as gets shouldn't be
1723         used).
1724         * time_r.c (asctime_r, ctime_r): Likewise.
1725
1726 2006-03-08  Simon Josefsson  <jas@extundo.com>
1727
1728         * gc-gnulib.c (randomize): Don't open files called 'no', they
1729         signal that configure disabled the device.
1730
1731 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1732
1733         * c-stack.c: Include unistd.h unconditionally, since we now assume
1734         the unistd module.
1735         * getlogin_r.c: Likewise.
1736         * getlogin_r.h: Likewise.
1737         * glob.c: Likewise.
1738         * pagealign_alloc.c: Likewise.
1739         * unistd_.h: Remove; no longer needed.
1740
1741 2006-03-07  Simon Josefsson  <jas@extundo.com>
1742
1743         * unistd_.h: New file.
1744
1745 2006-03-07  Simon Josefsson  <jas@extundo.com>
1746
1747         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1748
1749 2006-03-01  Simon Josefsson  <jas@extundo.com>
1750
1751         * readline.c: Fix typo, tiny patch from Stepan Kasal
1752         <kasal@ucw.cz>.
1753
1754 2006-02-28  Simon Josefsson  <jas@extundo.com>
1755
1756         * getopt.c: Protect #include of unistd.h, for MSVS.
1757
1758 2006-02-27  Simon Josefsson  <jas@extundo.com>
1759
1760         * base64.h: Indent #define's.  From Jim Meyering
1761         <jim@meyering.net>.
1762
1763 2006-02-27  Jim Meyering  <jim@meyering.net>
1764
1765         Revert the change of 2006-02-24, so these files can continue
1766         to be sync'd from gettext.
1767         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1768         of `config.h'.
1769
1770 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1771
1772         * glob.c: Say "invalid" rather than "illegal" in comments.
1773
1774 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1775
1776         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1777
1778 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1779
1780         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1781         AT_FDCWD exceeds INT_MAX.
1782         * openat.h (AT_FDCWD): Likewise.
1783
1784 2006-02-14  Jim Meyering  <jim@meyering.net>
1785
1786         Sync from coreutils.
1787
1788         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1789         failure on deficient systems, and simplify gnulib lgpl dependencies.
1790         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1791         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1792
1793         * xalloc-die.c: Remove unused definition of N_.
1794
1795 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1796
1797         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1798
1799 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1800
1801         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1802         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1803
1804 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1805
1806         * argp-namefrob.h: Restore changes accidentally lost during the
1807         "autoupdate" on 2005-12-12.
1808
1809 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1810
1811         * fnmatch.c (L_): Renamed from L, to work around a bug in
1812         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1813         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1814         All uses changed.
1815
1816 2006-01-26  Simon Josefsson  <jas@extundo.com>
1817
1818         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1819         prototype is visible on mingw32.
1820
1821         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1822         for mingw32.
1823
1824         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1825         mingw32).
1826
1827 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1828
1829         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1830         attempt to open for write; this always fails, at least on POSIX
1831         hosts.  This reinstates the 2006-01-09 change, which was
1832         inadvertently removed.
1833
1834 2006-01-26  Bruno Haible  <bruno@clisp.org>
1835             Paul Eggert  <eggert@cs.ucla.edu>
1836
1837         * stdbool_.h (_Bool)
1838         [(! (defined __cplusplus || defined __BEOS__)
1839           && !defined __GNUC__
1840           && !(defined __HP_cc || defined __xlc__
1841                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1842                || defined __sgi))]:
1843         #define to signed char in these cases too; this simplifies
1844         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1845         etc., separately) and makes it more conservative.
1846
1847 2006-01-21  Jim Meyering  <jim@meyering.net>
1848
1849         Sync from the stable (b5) branch of coreutils:
1850
1851         * fts.c (fts_children): Don't let close() clobber errno from
1852         failed fchdir().
1853
1854         * fts.c (fts_stat): When following a symlink-to-directory,
1855         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1856         a dangling symlink.  That can also happen at least for ELOOP.
1857         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1858         FYI, this bug predates the inclusion of fts.c in coreutils.
1859
1860         * fts.c (fts_open): Put new maxarglen declaration and uses
1861         in their own block, so pre-c99 compilers don't object.
1862
1863         Avoid the double-free (first in fts_read, second in fts_close) that
1864         would occur when an `active' directory is made inaccessible (e.g.,
1865         via chmod a-x) during a traversal.
1866         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1867         before returning.  Reproduce this failure by
1868         mkdir -p a/b; cd a; chmod a-x . b
1869         Reported by Stavros Passas.
1870
1871 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1872
1873         * argp-namefrob.h: Bugfix. Remove stray #
1874
1875 2006-01-25  Bruno Haible  <bruno@clisp.org>
1876
1877         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1878         warnings.
1879         Reported by Paul Eggert.
1880
1881 2006-01-25  Jim Meyering  <jim@meyering.net>
1882
1883         * fileblocks.c: Remove more useless parentheses.
1884         * readutmp.h: Likewise.
1885
1886 2006-01-24  Bruno Haible  <bruno@clisp.org>
1887
1888         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1889         has it.
1890         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1891         2005-11-26.
1892
1893         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1894         to avoid problems with the built-in _Bool type.
1895         Reported by Paul Eggert on 2005-11-26.
1896
1897 2006-01-24  Jim Meyering  <jim@meyering.net>
1898
1899         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1900
1901 2006-01-24  Simon Josefsson  <jas@extundo.com>
1902
1903         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1904         Bruno.
1905
1906 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1907
1908         Work around porting bugs reported by Dieter in
1909         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1910         * getopt.c (_NOPROTO): Remove; no longer needed.
1911         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1912         Include "getopt.h" first, to check interface.
1913         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1914         !HAVE_DECL_GETENV.
1915         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1916         (__strndup): Revert to K&R-style function dfns, the glibc style.
1917         * strnlen.c: Don't claim it's taken from glibc; it's not.
1918         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1919         Include strnlen.h first, to get prototype properly.
1920         (strnlen): Renamed from __strnlen.
1921         Remove weak alias.
1922
1923 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1924
1925         These changes imported from libc.
1926         * getopt.c: Use __fxprintf instead of inline stream orientation
1927         test and two separate function calls.
1928         * strndup.c (__strndup): Add libc_hidden_def.
1929
1930 2006-01-22  Bruno Haible  <bruno@clisp.org>
1931
1932         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1933         temporary buffer for sprintf, take into account the precision also
1934         for 'd', 'i', 'u', 'o', 'x', 'X'.
1935
1936 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1937
1938         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1939         to pacify gcc -Wswitch-default.
1940
1941 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1942
1943         * argp-help.c (usage_long_opt): Do not print DOC options.
1944         (__argp_base_name): Removed
1945         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1946         typo.
1947         (__argp_base_name): Provide macro definition or extern declaration
1948         depending on the configuration
1949
1950 2006-01-20  Simon Josefsson  <jas@extundo.com>
1951
1952         * inet_ntop.h: Unconditionally include sys/socket.h.
1953
1954 2006-01-19  Simon Josefsson  <jas@extundo.com>
1955
1956         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1957
1958 2006-01-12  Simon Josefsson  <jas@extundo.com>
1959
1960         * base64.c: Fix warning, reported by Bruno Haible
1961         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1962
1963 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1964
1965         Sync from coreutils.
1966         * md5.c: Fix commentary typos.
1967         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1968         * md5.h (__attribute__): Remove; unused.
1969         * sha1.c: Fix commentary to match md5 better.
1970         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1971         so that we don't need to worry about alignment.  All uses changed.
1972         This merges the 2005-10-28 md5 change into sha1.
1973
1974 2006-01-11  Jim Meyering  <jim@meyering.net>
1975
1976         Sync from coreutils.
1977         * md5.c (OP): Fix spacing.
1978
1979 2006-01-11  Simon Josefsson  <jas@extundo.com>
1980
1981         * stdint_.h (SIZE_MAX): Add missing (.
1982
1983 2006-01-10  Bruno Haible  <bruno@clisp.org>
1984
1985         * argp.h (__const): Remove macro. Use const instead.
1986         * argp-fmtstream.h (__const): Likewise.
1987         * glob_.h (__const): Remove macro.
1988         * glob-libc.h: Use const instead of __const.
1989
1990 2006-01-10  Jim Meyering  <jim@meyering.net>
1991
1992         Avoid the double-free (first in fts_read, second in fts_close) that
1993         would occur when an `active' directory is made inaccessible (e.g.,
1994         via chmod a-x) during a traversal.
1995         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1996         before returning.  Reproduce this failure by
1997         mkdir -p a/b; cd a; chmod a-x . b
1998         Reported by Stavros Passas.
1999
2000         Sync from coreutils.
2001         * sha1.c: Tweak grammar in a comment.
2002
2003 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2004
2005         * regex_internal.h (BITSET_WORD_BITS):
2006         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2007         preprocessor mishandles large unsigned values as if they were signed.
2008         Problem reported by Claudio Fontana in
2009         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2010
2011 2006-01-10  Simon Josefsson  <jas@extundo.com>
2012
2013         * socket_.h: New file.
2014
2015 2006-01-10  Bruno Haible  <bruno@clisp.org>
2016
2017         * localcharset.c: Update from GNU gettext.
2018
2019 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2020
2021         Sync from coreutils.
2022         * chdir-long.c (cdb_free): Don't bother trying to open directory
2023         for write access: POSIX says that must fail.
2024         * fts.c (diropen): Likewise.
2025         * save-cwd.c (save_cwd): Likewise.
2026         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2027         well, for minor improvements on hosts that lack O_DIRECTORY.
2028         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2029         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2030         Fall back on chown if open failed with EACCES.
2031
2032         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2033         Report an error at compile-time if only a 1-second nominal clock
2034         resolution is found.
2035
2036         * lchmod.h: New file.
2037         * mkdir-p.c: Include lchmod.h, lchown.h.
2038         (make_dir_parents): Use lchown rather than chown, and
2039         lchmod rather than chmod.
2040
2041         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2042         too.  Problem with "none" reported by Bob Proulx.  Problem with
2043         "proc" reported by n0dalus.
2044
2045         * mountlist.c: Include <limits.h>.
2046         (dev_from_mount_options)
2047         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2048         New function.  It no longer assumes "dev=" has the System V meaning
2049         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2050         (read_file_system_list)
2051         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2052         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2053         dev= in that case.
2054
2055         * posixtm.h (PDS_PRE_2000): New macro.
2056         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2057         All usages changed.  Reject dates outside the range 1969-1999 if
2058         PDS_PRE_2000 is used.
2059
2060 2006-01-09  Jim Meyering  <jim@meyering.net>
2061
2062         Sync from coreutils.
2063
2064         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2065
2066         * chdir-safer.h, chdir-safer.c: New files.
2067
2068         * modechange.c (mode_compile): Reject an invalid mode string
2069         that starts with an octal digit.  From Andreas Gruenbacher.
2070
2071         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2072         and dup to open_safer and dup_safer, respectively.
2073         (openat_permissive): Fix typo in comment.
2074
2075         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2076         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2077         (_): Remove; no longer needed.
2078         (openat): Renamed from rpl_openat; no need for rpl_openat
2079         since openat.h renames openat for us.
2080         Replace most of the body with a call to openat_permissive,
2081         to avoid duplicate code.
2082         Port to (probably hypothetical) environments were mode_t is
2083         wider than int.
2084         (openat_permissive): Require mode arg, so that we can check
2085         types better.  Put it just after flags.  Change cwd failure
2086         indicator from pointer-to-bool to pointer-to-errno-value.
2087         All callers changed.
2088         Invoke openat_save_fail and/or openat_restore_fail if
2089         cwd_errno is null, so that openat can call us.
2090         (openat_permissive, fdopendir, fstatat, unlinkat):
2091         Simplify errno handling to avoid some duplicate code,
2092         as it's OK to set errno on success.
2093         * openat.h: Revamp code so that function macros depend on
2094         __OPENAT_PREFIX only, not also on AT_FDCWD.
2095         (openat_ro): Remove.  Caller changed to use openat_permissive.
2096         (openat_permissive): Now a macro, if not a function.
2097         (openat_restore_fail, openat_save_fail): Now always functions,
2098         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2099
2100         * openat-priv.h: New file, defining macros used by mkdirat.c
2101         and openat.c.
2102         * mkdirat.c: Include openat-priv.h.
2103         Remove definitions of macros defined therein.
2104         * openat.c: Likewise.
2105
2106         * mkdirat.c (mkdirat): New file and function.
2107         * openat.h (mkdirat): Declare.
2108
2109         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2110
2111         * openat.h (openat_permissive): Declare.
2112         (openat_ro): Define.
2113
2114         * openat.c (EXPECTED_ERRNO): New macro.
2115         (openat_permissive): New function -- used in remove.c rewrite.
2116         (all functions): Set errno just before returning, only if there
2117         was an actual failure.
2118         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2119
2120         Emulate openat-family functions using Linux's procfs, if possible.
2121         Idea and some code based on Ulrich Drepper's glibc changes.
2122
2123         * openat.c: (BUILD_PROC_NAME): New macro.
2124         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2125         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2126         before falling back on save_cwd and restore_cwd.
2127         (fdopendir, fstatat, unlinkat): Likewise.
2128
2129         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2130         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2131
2132         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2133         as second argument to va_arg.  Otherwise, some versions of gcc
2134         warn that `if this code is reached, the program will abort'.
2135
2136 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2137
2138         Sync from coreutils.
2139
2140         Add POSIX ACL support
2141         * acl.h (copy_acl, set_acl): Add declarations.
2142         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2143         systems other than Linux.
2144         (chmod_or_fchmod): New function: use fchmod when possible,
2145         and chmod otherwise.
2146         (file_has_acl): Add a POSIX ACL implementation, with a
2147         Linux-specific subcase.
2148         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2149         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2150         acls are unsupported.
2151         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2152         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2153         are unsupported.
2154
2155 2006-01-09  Bruno Haible  <bruno@clisp.org>
2156
2157         * sysexit_.h (EX_OK): New macro.
2158         Suggested by Martin Lambers <marlam@marlam.de>.
2159
2160 2006-01-09  Bruno Haible  <bruno@clisp.org>
2161
2162         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2163         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2164         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2165         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2166
2167 2006-01-09  Bruno Haible  <bruno@clisp.org>
2168
2169         * stdint_.h (SIZE_MAX): Write the value without involving negative
2170         numbers.
2171
2172 2005-10-16  Bruno Haible  <bruno@clisp.org>
2173
2174         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2175         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2176
2177 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2178
2179         * strftime.c (tzname): Don't declare if it is already #defined.
2180         Problem reported for Mingw by Mark Junker.
2181
2182 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2183
2184         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2185         long int, not int, for nanosecond counts, so that people who are
2186         used to POSIX struct timespec won't be surprised.  Reported by Jim
2187         Meyering.
2188
2189 2005-12-16  Jim Meyering  <jim@meyering.net>
2190
2191         * fprintftime.c, fprintftime.h: New files.
2192
2193 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2194
2195         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2196         * argp-help.c (fill_in_uparams): Check if the constructed
2197         struct uparams is valid. Fall back to the default values if it is
2198         not.
2199
2200 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2201
2202         * argp-help.c (__argp_base_name): New function
2203         (__argp_short_program_name): Rewrite using __argp_base_name
2204         * argp-namefrob.h: Define program_invocation_name and
2205         program_invocation_short_name if requested
2206         (__argp_base_name): Add prototype
2207         * argp-parse.c (argp_def): Use gettext wrappers
2208         (argp_default_parser): Use __argp_base_name
2209         * argp-pin.c: New file. Defines program_invocation_name and
2210         program_invocation_short_name on systems that lack them.
2211
2212 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2213
2214         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2215         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2216         porting problem reported by Georg Schwarz in
2217         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2218
2219 2005-07-09  Bruno Haible  <bruno@clisp.org>
2220
2221         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2222         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2223         Reported by Mark Junker <mjscod@gmx.de>.
2224
2225 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2226
2227         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2228         (uintmax_t) [defined uintmax_t]: Do not declare.
2229         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2230         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2231         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2232         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2233         sake of portability to weird hosts that C allows (though we don't
2234         know of any practical examples).
2235
2236         * savedir.h (fdsavedir): New decl.
2237         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2238         contains most of the former guts of savedir.
2239         (savedir): Use savedirstream.
2240         Include "openat.h".
2241
2242 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2243
2244         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2245         coreutils no longer futzes with rounding modes.
2246
2247 2005-11-14  Jim Meyering  <jim@meyering.net>
2248
2249         * mkstemp-safer.c: Include <config.h>, required for possible
2250         replacement of mkstemp.
2251
2252 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2253
2254         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2255         business.
2256         (gethrxtime) [! (HAVE_NANOUPTIME
2257         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2258         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2259         our own approximation.
2260
2261 2005-11-10  Simon Josefsson  <jas@extundo.com>
2262
2263         * readline.c: Remove EOL.
2264
2265 2005-11-08  Eric Blake  <ebb9@byu.net>
2266
2267         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2268
2269 2005-11-08  Eric Blake  <ebb9@byu.net>
2270
2271         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2272
2273 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2274
2275         Fix porting problem reported by Theodoros V. Kalamatianos.
2276         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2277         Don't assume that futimes failing means we must fail.
2278
2279 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2280
2281         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2282         leave errno alone.  Problem reported by Dmitry V. Levin.
2283
2284 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2285
2286         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2287         errno alone.  Problem reported by Frederic Jolliton.
2288
2289 2005-10-28  Simon Josefsson  <jas@extundo.com>
2290
2291         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2292         "restrict" keywords, as per POSIX.  Protect the function
2293         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2294         Don't use K&R prototypes.  Check the sprintf return values.
2295         Re-define EAFNOSUPPORT if not present.  Indent.
2296
2297         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2298         suggested by Bruno Haible <bruno@clisp.org>.
2299
2300         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2301
2302         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2303
2304         * gc-libgcrypt.c: Add MD2 (which is not available through
2305         libgcrypt).
2306
2307         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2308
2309         * md2.h, md2.c: New files.
2310
2311 2005-10-24  Simon Josefsson  <jas@extundo.com>
2312
2313         * md4.h: Shrink buffer size, now that we changed the type.
2314
2315 2005-10-22  Simon Josefsson  <jas@extundo.com>
2316
2317         * arcfour.h, arcfour.c: Use fixed size indices in the
2318         arcfour_context struct (simplify test vector testing in GNU
2319         Shishi).
2320
2321 2005-10-22  Simon Josefsson  <jas@extundo.com>
2322
2323         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2324         suggested by Bruno Haible <bruno@clisp.org>.
2325
2326 2005-10-22  Simon Josefsson  <jas@extundo.com>
2327
2328         * crc.h: Include stddef.h, for size_t.
2329
2330 2005-10-21  Simon Josefsson  <jas@extundo.com>
2331
2332         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2333         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2334
2335 2005-10-21  Simon Josefsson  <jas@extundo.com>
2336
2337         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2338         block.
2339
2340 2005-10-21  Simon Josefsson  <jas@extundo.com>
2341
2342         * gc-gnulib.c: Support ARCTWO in CBC mode.
2343
2344 2005-10-21  Simon Josefsson  <jas@extundo.com>
2345
2346         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2347         <bruno@clisp.org>.
2348
2349         * hmac-sha1.c (hmac_sha1): Likewise.
2350
2351         * crc.c (crc32_update): Actually use crc parameter, suggested by
2352         Bruno Haible <bruno@clisp.org>.
2353
2354         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2355         <bruno@clisp.org>.
2356
2357 2005-10-21  Simon Josefsson  <jas@extundo.com>
2358
2359         * des.h, des.c: New files.
2360
2361         * gc-gnulib.c: Support DES.c
2362
2363 2005-10-21  Simon Josefsson  <jas@extundo.com>
2364
2365         * arctwo.h, arctwo.c: New files.
2366
2367         * gc-gnulib.c: Support ARCTWO.
2368
2369 2005-10-21  Simon Josefsson  <jas@extundo.com>
2370
2371         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2372
2373 2005-10-19  Simon Josefsson  <jas@extundo.com>
2374
2375         * gc-gnulib.c: Support ARCFOUR.
2376
2377 2005-10-19  Simon Josefsson  <jas@extundo.com>
2378
2379         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2380         support.
2381
2382         * gc.h: Add ECB enum type.
2383
2384         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2385
2386 2005-10-19  Simon Josefsson  <jas@extundo.com>
2387
2388         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2389
2390 2005-10-18  Simon Josefsson  <jas@extundo.com>
2391
2392         * md4.h, md4.c: New files, based on md5.?.
2393
2394 2005-10-17  Simon Josefsson  <jas@extundo.com>
2395
2396         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2397
2398         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2399
2400 2005-10-17  Simon Josefsson  <jas@extundo.com>
2401
2402         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2403
2404 2005-10-17  Simon Josefsson  <jas@extundo.com>
2405
2406         * gc.h, gc-libgcrypt.c: Add ciphers.
2407
2408 2005-10-17  Simon Josefsson  <jas@extundo.com>
2409
2410         * sha1.c: Use uint32_t instead of md5_uint32.t
2411
2412         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2413         md5.h.
2414
2415         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2416
2417         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2418
2419 2005-10-15  Simon Josefsson  <jas@extundo.com>
2420
2421         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2422
2423         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2424
2425 2005-10-14  Simon Josefsson  <jas@extundo.com>
2426
2427         * arcfour.h, arcfour.c: New files.
2428
2429 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2430
2431         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2432         include <wchar.h>; no longer needed.
2433
2434 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2435         and  Ulrich Drepper  <drepper@redhat.com>
2436
2437         Import from libc.
2438         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2439         instead of inline stream orientation test and two separate
2440         function calls.  Pay no attention to USE_IN_LIBIO.
2441
2442 2005-10-14  Roland McGrath  <roland@redhat.com>
2443
2444         Import from libc.  [BZ #1331]
2445         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2446         macro argument.
2447         Reported by Matej Vela <vela@debian.org>.
2448
2449 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2450
2451         * mkdir-p.c (make_dir_parents): Don't report an error if an
2452         intermediate directory is in a read-only file system.  Problem
2453         reported by Eric Blake.
2454
2455 2005-10-13  Simon Josefsson  <jas@extundo.com>
2456
2457         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2458         Move memory allocation outside of loop.
2459
2460 2005-10-12  Simon Josefsson  <jas@extundo.com>
2461
2462         * gc-pbkdf2-sha1.c: New file.
2463
2464         * gc.h: Add gc_pbkdf2_sha1 prototype.
2465
2466 2005-10-12  Simon Josefsson  <jas@extundo.com>
2467
2468         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2469         suggested by Bruno Haible <bruno@clisp.org>.
2470
2471 2005-10-12  Simon Josefsson  <jas@extundo.com>
2472
2473         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2474
2475         * gc-gnulib.c (gc_hmac_sha1): New function.
2476
2477 2005-10-12  Simon Josefsson  <jas@extundo.com>
2478
2479         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2480
2481 2005-10-12  Simon Josefsson  <jas@extundo.com>
2482
2483         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2484         GC_USE_HMAC_MD5, respectively.
2485
2486         * gc-libgcrypt.c (gc_md5): Fix assert call.
2487         (gc_md5): Fix typo.
2488
2489         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2490
2491         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2492
2493         * gc-gnulib.c (gc_hash_buffer): Ditto.
2494
2495 2005-10-11  Bruno Haible  <bruno@clisp.org>
2496
2497         * c-strcasestr.h: New file, from GNU gettext.
2498         * c-strcasestr.c: New file, from GNU gettext.
2499
2500 2005-10-11  Bruno Haible  <bruno@clisp.org>
2501
2502         * c-strcase.h: New file, from GNU gettext.
2503         * c-strcasecmp.c: New file, from GNU gettext.
2504         * c-strncasecmp.c: New file, from GNU gettext.
2505
2506 2005-10-11  Simon Josefsson  <jas@extundo.com>
2507
2508         * crc.h, crc.c: New files.
2509
2510         * gc.h (gc_hash_buffer): Add doc.
2511
2512 2005-10-08  Simon Josefsson  <jas@extundo.com>
2513
2514         * gc.h: Add gc_hash and gc_hash_buffer.
2515
2516         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2517
2518         * gc-libgcrypt.c (gc_hash_buffer): Add.
2519
2520 2005-10-11  Bruno Haible  <bruno@clisp.org>
2521
2522         * strcasecmp.c: Include limits.h.
2523         (strcasecmp): Avoid integer overflow on exotic platforms.
2524         * strncasecmp.c: Include limits.h.
2525         (strncasecmp): Avoid integer overflow on exotic platforms.
2526         Reported by Paul Eggert.
2527
2528 2005-10-06  Simon Josefsson  <jas@extundo.com>
2529
2530         * hmac-md5.c: New file.
2531
2532         * hmac.h: New file.
2533
2534 2005-10-06  Simon Josefsson  <jas@extundo.com>
2535
2536         * memxor.c (memxor): Avoid casts and warnings.
2537
2538 2005-10-05  Derek Price  <derek@ximbiot.com>
2539
2540         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2541
2542 2005-10-05  Simon Josefsson  <jas@extundo.com>
2543
2544         * memxor.c (memxor): Fix compiler error.
2545
2546         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2547         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2548
2549         * memxor.h, memxor.c: New files.
2550
2551         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2552         we assume all systems have it, suggested by Jim Meyering
2553         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2554         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2555         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2556         same reasons.
2557
2558 2005-10-04  Bruno Haible  <bruno@clisp.org>
2559
2560         * verify.h (verify_true): Provide alternative definition for C++.
2561
2562 2005-10-04  Simon Josefsson  <jas@extundo.com>
2563
2564         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2565         D. Baushke" <mdb@gnu.org>.
2566
2567 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2568
2569         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2570         (SSIZE_MAX): New macro, if not already defined.
2571         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2572         than 2 GiB.
2573
2574 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2575
2576         * exclude.c: Include verify.h.
2577         (verify): Remove.  All callers changed to use verify.h's version.
2578         * strtoimax.c: Likewise.
2579         * utimecmp.c: Likewis.e
2580
2581         Sync from coreutils.
2582         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2583         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2584         * .cvsignore: Add fts.h, search.h, t-fpending.
2585         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2586         bother returning ENOSYS if settimeofday or stime fails; just let
2587         them return whatever errno they want to return.
2588         * utimens.c: Include unistd.h, for dup2.
2589         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2590         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2591
2592 2005-10-02  Jim Meyering  <jim@meyering.net>
2593
2594         Sync from coreutils.
2595         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2596         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2597         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2598         Remove AT_FDCWD test.
2599         Do not consume the fd unless successful.
2600         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2601         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2602         block, so that we don't even try to compile it if settimeofday is
2603         available.  This works around a compilation failure on OSF1 V5.1,
2604         due to stime requiring a `long int*' while tv_sec is `int'.
2605
2606 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2607
2608         * getdelim.c (getdelim): Remove unused variables.
2609
2610 2005-10-01  Simon Josefsson  <jas@extundo.com>
2611
2612         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2613         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2614         AI_* and EAI_* definitions.  Protect function declarations.
2615
2616 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2617
2618         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2619         so that the code works even with ancient cpp.  Portability problem
2620         with GCC 2.7.2.1 reported by Thomas M.Ott.
2621
2622 2005-09-27  Jim Meyering  <jim@meyering.net>
2623
2624         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2625
2626         * intprops.h (signed_type_or_expr__): Define.
2627         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2628         for unsigned types.
2629
2630 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2631
2632         * verify.h (verify_expr): Remove, replacing with:
2633         (verify_true): New macro that returns true instead of void.
2634         (verify_type__): Remove.
2635         (verify): Use verify_true rather than verify_type__.
2636
2637 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2638
2639         * utimens.c (ENOSYS): Define if not already defined.
2640         (futimens): Support having a null PATH if the file descriptor
2641         is nonnegative.
2642
2643         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2644         Remove.
2645         (__attribute): Define to empty unless GCC 3.1 or later.
2646         This works around a core dump on OpenBSD 3.4, which has GCC
2647         2.95.3, which dumps core when given __attribute__(()).  It also
2648         simplifies other tests, since we really don't want to bother with
2649         worrying about which ancient version of GCC supported what.
2650         Original problem reported by Yoann Vandoorselaere, with part of
2651         the fix suggested by Derek Price.
2652
2653 2005-09-24  Jim Meyering  <jim@meyering.net>
2654
2655         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2656         so we can once again use a positive bitfield width of 1 -- now we
2657         don't have to explain why we were using a bitfield width of 2.
2658
2659 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2660
2661         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2662         Problem reported by Eric Blake.
2663         (getaddrinfo): Initialize se so that it's not garbage.
2664         Redo internal storage allocation so that it doesn't make unportable
2665         assumptions about alignment.
2666         Fix a memory leak.
2667
2668         * utimens.c (futimens): Use futimesat if available.
2669         Prefer it to futimes since it doesn't have the futimes bug.
2670
2671         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2672         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2673         Instead, declare a function that returns a pointer to an array,
2674         and use verify_type__ to declare the size of the array.
2675         Problem and germ of a solution reported by Bruno Haible.
2676         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2677         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2678
2679 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2680
2681         Sync from coreutils.
2682
2683         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2684         stat-time.h.
2685         * argmatch.h: Include verify.h
2686         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2687         (ARGMATCH_ASSERT): Remove; unused.
2688         * canonicalize.c: Assume STDC_HEADERS.
2689         * exclude.c: Include "strcase.h".
2690         * regex_internal.h [!defined _LIBC]: Likewise.
2691         * getusershell.c: Include stdio--.h rather than stdio.h
2692         and stdio-safer.h.
2693         (getusershell): Call fopen, not fopen_safer.
2694         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2695         Do not include unistd-safer.h.
2696         (save_cwd): Don't call fd_safer; no longer needed
2697         now that we include fcntl--.h.
2698
2699         * getdate.y (relative_time): New type.
2700         (RELATIVE_TIME_0): New constant.
2701         (parser_control): Use relative_time instead of doing it ourselves.
2702         (%union): Add new relative_time rel member.
2703         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2704         Now typeless.
2705         (relunit, relunit_snumber): Now of type rel.
2706         (zone, rel, relunit, get_date): Adjust to above changes.
2707
2708         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2709         Do not include unistd-safer.h.
2710         (getloadavg): Don't call fd_safer; no longer needed
2711         now that we include fcntl--.h.
2712
2713         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2714         (make_dir_parents): Treat ENOSYS like EEXIST.
2715
2716         Improve quality of diagnostics on restore_cwd failure.
2717         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2718         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2719         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2720         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2721         each time through the loop.  Do not diagnose restore_cwd failure;
2722         that is the caller's job (and perhaps the caller does not care).
2723
2724         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2725         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2726         If the file already exists but is not a directory, don't bother
2727         to try to make its parents.
2728         Close potential file descriptor leak if we can't chdir("/") (!).
2729         Don't always return true if chdir($PWD) fails; return true only
2730         if the requested action was done successfully (except for the
2731         chdir($PWD)).
2732         Don't log final directory unless we actually made it.
2733         Refactor to avoid duplicate code to fix up permissions.
2734         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2735
2736         * strftime.c (my_strftime): Rewrite the previous change slightly,
2737         to make it a bit faster and (I hope) clearer.
2738         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2739         Fix bug in formats like %2N.
2740
2741         * verify.h: New file.
2742
2743 2005-09-22  Jim Meyering  <jim@meyering.net>
2744
2745         Sync from coreutils.
2746
2747         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2748
2749         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2750         the .tm_year member, since otherwise gcc-4.0 would now warn about
2751         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2752
2753         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2754         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2755
2756         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2757         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2758         when run in a time zone for which daylight savings time is in effect
2759         for the starting date.
2760
2761         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2762         stop us from restricting permissions of just-created absolute-named
2763         directories.
2764         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2765         to restore initial working directory.
2766         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2767         to tell caller if/when we change the working directory and are
2768         unable to return to the initial one.
2769         * mkdir-p.h (make_dir_parents): Update prototype.
2770         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2771         `return false'.  This fixes a bug introduced on 2004-07-30.
2772
2773         * openat.c (fdopendir): Be sure to close the supplied
2774         file descriptor before returning.  This makes our replacement
2775         implementation a little closer to Solaris's, where fdopendir
2776         ties the file descriptor to the returned DIR* pointer.
2777         * openat.c (unlinkat): New function.
2778         * openat.h (unlinkat): Add prototype.
2779         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2780         (openat_restore_fail): Rename from openat_restore_die.
2781         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2782
2783         Provide an alternative to exiting immediately upon save_cwd or
2784         restore_cwd failure.  Now, an application can arrange e.g.,
2785         to perform a longjump in that case.
2786         * openat.c: Include dirname.h.
2787         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2788         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2789         and openat_restore_die rather than calling error directly.
2790         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2791
2792         * openat-die.c (openat_save_die, openat_restore_die): New file.
2793         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2794
2795         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2796         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2797                             int utc, int nanoseconds);
2798         Background:
2799         date should not have to allocate a megabyte of virtual memory to
2800         handle a format argument like +%1048575T.  When implemented with
2801         strftime, it must allocate such a buffer, use strftime to fill it
2802         in, print it, then free it.
2803         With fprintftime, it simply prints everything and exits.
2804         With no need for memory allocation, that's one fewer way to fail.
2805         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2806         optional field width, not before, so we accept %9:z, not %:9z.
2807         (my_strftime): Be sure to use L_('x') for literals.
2808
2809         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2810         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2811         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2812         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2813         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2814         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2815         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2816         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2817         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2818
2819         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2820         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2821         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2822         and don't include <sys/file.h>).
2823
2824 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2825
2826         Sync from coreutils.
2827
2828         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2829         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2830         [!LDAV_DONE]: Avoid unused variable warning.
2831
2832 2005-09-21  Bruno Haible  <bruno@clisp.org>
2833
2834         * unicodeio.h (unicode_to_mb): New declaration.
2835
2836 2005-09-20  Derek Price  <derek@ximbiot.com>
2837
2838         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2839
2840 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2841
2842         Use a consistent style for including <config.h>.
2843         * __fpending.c, acl.c, argmatch.c,
2844         argp-help.c, argp-parse.c,
2845         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2846         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2847         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2848         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2849         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2850         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2851         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2852         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2853         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2854         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2855         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2856         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2857         modechange.c, mountlist.c, open-safer.c, physmem.c,
2858         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2859         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2860         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2861         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2862         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2863         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2864         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2865         userspec.c, utimecmp.c, version-etc-fsf.c,
2866         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2867         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2868         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2869         Standardize inclusion of config.h.
2870         * __fpending.h, dirfd.h, getdate.h, human.h,
2871         inttostr.h:  Removed inclusion of config.h from header files.
2872         * inttostr.c:  Adjusted in-tree users.
2873         * timespec.h: Remove superfluous warning to include config.h.
2874         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2875         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2876         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2877         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2878
2879 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2880
2881         * stat-time.h: New file.
2882         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2883         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2884         in a different way.
2885         (timespec_cmp): New function.
2886         * utimecmp.c: Include stat-time.h.
2887         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2888         members exist, not on the obsolescent ST_MTIM_NSEC.
2889         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2890
2891 2005-09-15  Derek Price  <derek@ximbiot.com>
2892             Paul Eggert  <eggert@cs.ucla.edu>
2893
2894         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2895         changes, consolidating in...
2896         * regex_internal.h: ...this file.
2897
2898 2005-09-15  Derek Price  <derek@ximbiot.com>
2899
2900         * regex_internal.h: Blank `pure' for GNUC < 3.
2901         * regex_internal.c: Ditto, using this...
2902         (__GNUC_PREREQ): ...new macro.
2903         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2904         (__GNUC_PREREQ): ...this new macro.
2905
2906         * strstr.h: Include string.h. Define strstr as a macro here.
2907
2908 2005-09-13  Derek Price  <derek@ximbiot.com>
2909
2910         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2911         failure.
2912         Reported by Jim Meyering  <jim@meyering.net>.
2913
2914 2005-09-13  Jim Meyering  <jim@meyering.net>
2915
2916         * canon-host.c: Filter through gnu indent and reword comments slightly.
2917         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2918
2919 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2920
2921         * base64.c: Typo.
2922         (base64_encode): Put b64str in initialized data section.
2923
2924 2005-09-12  Derek Price  <derek@ximbiot.com>
2925
2926         Return usable errors from canon-host.
2927         * canon-host.h: New file.
2928         * canon-host.c (canon_host): Wrap...
2929         (canon_host_r): ...this new function, which now relies exclusively on
2930         getaddrinfo.
2931         (ch_strerror): New function.
2932         (last_cherror): New global.
2933         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2934         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2935         void *.
2936         (freeaddrinfo): Free ai->ai_canonname when set.
2937
2938 2005-09-12  Derek Price  <derek@ximbiot.com>
2939             Paul Eggert  <eggert@cs.ucla.edu>
2940
2941         * glob-libc.h: Renamed from glob_.h.  The new version is
2942         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2943         protecting things that should be done only in gnulib contexts.
2944         * glob_.h: New file, containing only the glob things needed for
2945         gnulib.
2946         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2947         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2948         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2949         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2950         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2951         and to respect the namespace rules better.
2952
2953 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2954
2955         Merge glibc and coreutils changes into gnulib, plus a few
2956         extra fixes.
2957         * md5.c: Use #error rather than a string.
2958         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2959         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2960         (__attribute__): Define to empty for non recent-GCC.
2961         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2962         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2963         Renamed from their non-__ counterparts, with new macros replacing
2964         them if not _LIBC.  Add __THROW attribute.
2965         (rol): Remove.
2966         (struct md5_ctx): Align buffer if using GCC.
2967         * sha1.h (struct sha1_ctx): Likewise.
2968         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2969         The old name was backwards.
2970         (NOTSWAP): Remove; not used.
2971         (rol): New macro, moved here from md5.h.
2972         (sha1_process_block): Remove a FIXME that doesn't make sense.
2973
2974 2005-09-12  Derek Price  <derek@ximbiot.com>
2975
2976         * gai_strerror.c: Include config.h when available.  Include
2977         getaddrinfo.h before other headers to test interface.
2978         Reported by Larry Jones <lawrence.jones@ugs.com>.
2979
2980 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2981
2982         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2983         definitions, since that's the preferred style in glibc.
2984         Fix a minor spacing issue, and update copyright notice to match glibc's.
2985
2986 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2987
2988         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2989
2990 2005-09-06  Simon Josefsson  <jas@extundo.com>
2991
2992         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2993         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2994
2995 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2996
2997         Change bitset word type from unsigned int to unsigned long int,
2998         as this has better performance on typical 64-bit hosts.
2999         Port bitset code to hosts with unusual word sizes.
3000         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3001         (build_collating_symbol):
3002         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3003         argument is a bitset.  This is merely a style issue, but it makes
3004         it clearer that an entire array is expected.
3005         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3006         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3007         Port to the case where bitset_word is not the same as unsigned int.
3008         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3009         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3010         Likewise.
3011         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3012         (build_trtable, group_nodes_into_DFAstates):
3013         Likewise.
3014         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3015         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3016         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3017         * regexec.c (group_nodes_into_DFAstates): Likewise.
3018         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3019         * regcomp.c (optimize_subexps, lower_subexp):
3020         Work even if bitset_word has holes in its bitwise representation.
3021         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3022         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3023         Likewise.
3024         * regex_internal.c (re_string_reconstruct):
3025         Don't assume UCHAR_MAX == 255.
3026         * regex_internal.h (bitset_set_all): Likewise.
3027         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3028         All uses changed.
3029         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3030         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3031         All uses changed.
3032         (BITSET_WORD_MAX): New macro.
3033         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3034         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3035         (bitset_empty, bitset_copy):
3036         Prefer sizeof (bitset) to multiplying it out ourselves.
3037         (bitset_not_merge): Remove; unused.
3038         (bitset_contain): Return bool, not unsigned int with one bit on.
3039         All callers changed.
3040         * regexec.c (build_trtable): Don't assume bitset has no stricter
3041         alignment than re_node_set; do this by defining a new internal
3042         type struct dests_alloc and using it to allocate memory.
3043
3044 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3045
3046         Check for arithmetic overflow when calculating sizes, to prevent
3047         some buffer-overflow issues.  These patches are conservative, in the
3048         sense that when I couldn't determine whether an overflow was possible,
3049         I inserted a run-time check.
3050         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3051         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3052         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3053         (re_xnrealloc, re_x2nrealloc): New inline functions.
3054         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3055         (build_equiv_class, build_charclass): Check for arithmetic overflow
3056         in size expression calculations.
3057         * regex_internal.c (re_string_realloc_buffers):
3058         (build_wcs_upper_buffer, re_node_set_add_intersect):
3059         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3060         (re_dfa_add_node, register_state): Likewise.
3061         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3062         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3063         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3064         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3065
3066 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3067
3068         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3069         to avoid a collision with bits/local_lim.h in glibc.
3070         All uses changed.  Problem reported by Dmitry V. Levin in
3071         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3072
3073         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3074         bugs in int versus size_t comparisons.
3075         (re_string_context_at): Fix bug where the code assumed that
3076         Idx is signed.
3077
3078         Use bool where appropriate.
3079         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3080         All callers changed.
3081         (calc_eclosure_iter): Likewise, for ROOT arg.
3082         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3083         (build_charclass_op): Likewise, for NON_MATCH arg.
3084         * regex_internal.c (re_string_allocate, re_string_construct):
3085         (re_string_construct_common): Likewise, for ICASE arg.
3086         * regexec.c (re_search_2_stub, re_search_stub):
3087         Likewise, for RET_LEN arg.
3088         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3089         (set_regs): Likewise, for FL_BACKTRACK arg.
3090         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3091         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3092         (calc_eclosure_iter, parse_bracket_exp):
3093         Use bool for internal variables that are booleans.
3094         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3095         (set_regs, build_sifted_states, sift_states_bkref):
3096         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3097         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3098         (find_collation_sequence_value):
3099         Likewise.
3100         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3101         (re_node_set_compare):
3102         Return bool, not int. All callers changed.
3103         * regexec.c (check_halt_node_context, check_dst_limits):
3104         (build_trtable, check_node_accept): Likewise.
3105         * regex_internal.h: Include stdbool.h.
3106
3107         Fix bugs uncovered when converting to bool.
3108         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3109         failure instead of charging ahead blindly.
3110         * regex_internal.c (register_state): Likewise.
3111         * regexec.c (re_search_2_stub): Use simpler method than boolean
3112         for freeing internal storage.
3113         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3114         bitset pieces used as boolean, to avoid undefined behavior
3115         on hosts that do int overflow checking.
3116
3117 2005-08-31  Derek Price  <derek@ximbiot.com>
3118
3119         * getdelim.c (getdelim): Return EOF on EOF.
3120         Reported by Larry Jones <lawrence.jones@ugs.com>.
3121
3122 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3123
3124         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3125         lengths fit in regoff_t; this isn't true if regoff_t is the same
3126         width as size_t.
3127         * regex.c (re_search_internal): 5th arg is LAST_START
3128         (= START + RANGE) instead of RANGE.  This avoids overflow
3129         problems when regoff_t is the same width as size_t.
3130         All callers changed.
3131         (re_search_2_stub): Check for overflow when adding the
3132         sizes of the two strings.
3133         (re_search_stub): Check for overflow when adding START
3134         to RANGE; if it occurs, substitute the extreme value.
3135
3136 2005-08-31  Jim Meyering  <jim@meyering.net>
3137
3138         * regcomp.c (search_duplicated_node): Make first pointer arg
3139         a pointer-to-const.
3140         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3141         (register_state): Likewise.
3142         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3143         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3144         (group_nodes_into_DFAstates): Likewise.
3145
3146 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3147
3148         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3149         old glibc regex code mishandles strings longer than 2**31 bytes.
3150         This patch fixes this when the regex code is used in gnulib
3151         (i.e., outside glibc).
3152
3153         This patch should not affect the use of the regex code inside
3154         glibc.  No doubt this problem also needs to be handled for glibc
3155         as well, but the result will be an incompatible change to the
3156         glibc ABI, and the old ABI will have to be supported too.  That
3157         can be the the subject for another patch.
3158
3159         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3160         governing whether the rest of this patch is active.  By default,
3161         the macro is disabled and the patch has no effect.
3162         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3163         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3164         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3165         (re_match_2, re_set_registers): Use the new types.
3166         * regex_internal.h (Idx, re_hashval_t): New types.
3167         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3168         New macros.
3169         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3170         (re_string_context_at, bin_tree_t, re_dfastate_t):
3171         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3172         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3173         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3174         (re_string_char_size_at, re_string_wchar_at):
3175         (re_string_elem_size_at):
3176         Use the new types and macros to port to 64-bit hosts.
3177         Use unsigned types for internal values, so that the code
3178         mostly works even for arrays larger than SSIZE_MAX.
3179         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3180         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3181         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3182         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3183         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3184         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3185         (calc_inveclosure, parse_dup_op, build_range_exp):
3186         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3187         (fetch_number, create_token_tree, mark_opt_subexp):
3188         Likewise.
3189         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3190         (create_cd_newstate, re_string_allocate, re_string_construct):
3191         (re_string_realloc_buffers, build_wcs_upper_buffer):
3192         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3193         (re_string_reconstruct, re_string_peek_byte_case):
3194         (re_string_fetch_byte_case, re_string_context_at):
3195         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3196         (re_node_set_init_copy, re_node_set_add_intersect):
3197         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3198         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3199         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3200         (re_acquire_state, re_acquire_state_context, register_state):
3201         Likewise.
3202         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3203         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3204         (re_search_internal, re_search_2_stub, re_search_stub)
3205         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3206         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3207         (update_cur_sifted_state, check_dst_limits):
3208         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3209         (check_subexp_limits, sift_states_bkref, merge_state_array):
3210         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3211         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3212         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3213         (expand_bkref_cache, check_node_accept_bytes):
3214         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3215         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3216         (acquire_init_state_context, check_halt_node_context):
3217         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3218         (sift_states_backward, clean_state_log_if_needed):
3219         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3220         (find_recover_state, transit_state_sb, transit_state_mb):
3221         (transit_state_bkref, build_trtable, match_ctx_clean):
3222         Likewise.
3223         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3224         to work around an assumption that REG_MISSING is negative.
3225
3226         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3227         (seek_collating_symbol_entry) [defined _LIBC]:
3228         (lookup_collation_sequence_value) [defined _LIBC]:
3229         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3230         Use prototypes rather than old-style function definitions.
3231         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3232         (transit_state_sb) [0]:
3233         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3234
3235         * regexec.c (re_search_internal): Simplify update of rm_so and
3236         rm_eo.
3237
3238         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3239         (optimize_subexps, lower_subexp):
3240         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3241         since the signed shift might overflow.  Use 1u<<31 instead.
3242         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3243         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3244         Likewise.
3245
3246         * regcomp.c (optimize_subexps, lower_subexp):
3247         Use CHAR_BIT rather than 8, for clarity.
3248         * regexec.c (check_dst_limits_calc_pos_1):
3249         (check_subexp_matching_top): Likewise.
3250         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3251         have to worry about portability issues when shifting it left.
3252         Remove no-longer-needed test for table_size > 0.
3253         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3254         in a word, as the resulting behavior is undefined.
3255         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3256         in one case, a <= should have been an <, and in another case the
3257         whole test was missing.
3258         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3259         the standard name CHAR_BIT.
3260         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3261         this is not true on one's complement and signed-magnitude hosts.
3262
3263         * regex_internal.h (re_sub_match_top_t): Remove unused member
3264         next_last_offset.
3265         (struct re_dfa_t): Remove unused member states_alloc.
3266         * regcomp.c (init_dfa): Don't initialize unused members.
3267
3268 2005-08-31  Bruno Haible  <bruno@clisp.org>
3269
3270         * strstr.c: Include <stddef.h>, for NULL.
3271         * strcasestr.c: Likewise.
3272         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3273
3274 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3275
3276         * iconvme.h: Add prototype for iconv_alloc.
3277
3278 2005-08-29  Simon Josefsson  <jas@extundo.com>
3279
3280         * iconvme.c: Fix errno.
3281
3282 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3283
3284         * iconvme.c: Split iconv_string into iconv_alloc.
3285
3286 2005-08-27  Jim Meyering  <jim@meyering.net>
3287
3288         * fopen-safer.c: Merge minor changes from coreutils.
3289         * dup-safer.c: Likewise.
3290         * fd-safer.c: Likewise.
3291
3292         Merge from coreutils.
3293         * stdio--.h: New file.
3294         * stdlib--.h: New file.
3295         * mkstemp-safer.c: New file.
3296
3297         GNU tar needs these.
3298         * pipe-safer.c: New file.
3299         * creat-safer.c: New file.
3300         * fcntl--.h (creat): Define to creat_safer.
3301         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3302         * unistd--.h (pipe): Define to pipe_safer.
3303         * unistd-safer.h: Declare pipe_safer.
3304
3305 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3306
3307         * regex_internal.h: Remove all references to
3308         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3309         or better.
3310         (bitset_not, bitset_merge, bitset_not_merge):
3311         (bitset_mask, re_string_allocate, re_string_construct):
3312         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3313         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3314         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3315         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3316         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3317         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3318         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3319         (re_acquire_state_context):
3320         Remove unnecessary forward decls.
3321         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3322         Put __attribute at function definition,
3323         now that the function decl has been removed.
3324         * regex_internal.c (re_string_peek_byte_case):
3325         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3326         Likewise.
3327
3328 2005-08-26  Simon Josefsson  <jas@extundo.com>
3329
3330         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3331         Haible <bruno@clisp.org>.
3332
3333 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3334
3335         * regexec.c (set_regs): Don't alloca with an unbounded size.
3336
3337         alloca modernization/simplification for regex.
3338         * regex.c: Remove portability cruft for alloca.  This no longer
3339         needs to be at the start of the file, and can be moved into
3340         regex_internal.h and simplified.
3341         * regex_internal.h: Include <alloca.h>.
3342         (__libc_use_alloca) [!defined _LIBC]: New macro.
3343         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3344         now works outside glibc.
3345
3346 2005-08-24  Simon Josefsson  <jas@extundo.com>
3347
3348         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3349         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3350         GLIBC specific code.
3351
3352 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3353
3354         Make regex safe for g++.  This fixes one real bug (an "err"
3355         that should have been "*err").  g++ problem reported by
3356         Sam Steingold.
3357         * regex_internal.h (re_calloc): New macro, consistent with
3358         re_malloc etc.  All callers of calloc changed to use re_calloc.
3359         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3360         not int.  All callers changed.
3361         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3362         just use an array of size MB_LEN_MAX.
3363         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3364         (find_recover_state): Change "err" to "*err"; this fixes what
3365         appears to be a real bug.
3366         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3367         versus int.
3368
3369 2005-08-25  Jim Meyering  <jim@meyering.net>
3370
3371         * open-safer.c: Include <config.h>.
3372         Otherwise, we'd lose LARGEFILE support in any file using
3373         e.g. "fcntl--.h"
3374
3375 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3376
3377         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3378         * regex.h (regerror): Likewise.
3379
3380         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3381         requires this.  (The code never needed it.)
3382
3383         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3384         All uses of recently-renamed identifiers changed to use the new,
3385         POSIX-compliant names.  The code will build and run just fine
3386         without these changes, but it's better to eat our own dog food
3387         and use the standard-conforming names.
3388
3389         * regex.h: Fix a multitude of POSIX name space violations.
3390         These changes have an effect only for programs that define
3391         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3392         do not change anything for programs compiled in the normal way.
3393         Also, there is no effect on the ABI.
3394
3395         (_REGEX_SOURCE): New macro.
3396         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3397         defined and _GNU_SOURCE is not; this fixes a name space violation.
3398
3399         Rename the following macros to obey POSIX requirements.
3400         The old names are still visible as macros if _REGEX_SOURCE is defined.
3401         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3402         RE_BACKSLASH_ESCAPE_IN_LISTS.
3403         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3404         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3405         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3406         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3407         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3408         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3409         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3410         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3411         (REG_INTERVALS): renamed from RE_INTERVALS.
3412         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3413         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3414         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3415         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3416         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3417         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3418         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3419         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3420         RE_UNMATCHED_RIGHT_PAREN_ORD.
3421         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3422         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3423         (REG_DEBUG): renamed from RE_DEBUG.
3424         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3425         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3426         unusual, since we can't clash with the POSIX REG_ICASE.
3427         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3428         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3429         (REG_NO_SUB): renamed from RE_NO_SUB.
3430         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3431         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3432         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3433         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3434         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3435         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3436         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3437         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3438         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3439         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3440         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3441         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3442         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3443         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3444         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3445         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3446         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3447         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3448         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3449         (REG_FIXED): Renamed from REGS_FIXED.
3450         (REG_NREGS): Renamed from RE_NREGS.
3451
3452         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3453         of other REG_* macros, since POSIX says the user is allowed to
3454         #undef these macros selectively.
3455
3456         (reg_errcode_t): Update comment stating what other tables need
3457         to be consistent.
3458
3459         Rename the following enum values to obey POSIX requirements.
3460         The old names are still visible as macros.
3461         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3462         is not defined, since GNU is supposed to be a superset of POSIX as
3463         much as possible, and since we want reg_errcode_t to be a signed
3464         type for implementation consistency.
3465         (_REG_NOERROR): Renamed from REG_NOERROR.
3466         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3467         (_REG_BADPAT): Renamed from REG_BADPAT.
3468         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3469         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3470         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3471         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3472         (_REG_EBRACK): Renamed from REG_EBRACK.
3473         (_REG_EPAREN): Renamed from REG_EPAREN.
3474         (_REG_EBRACE): Renamed from REG_EBRACE.
3475         (_REG_BADBR): Renamed from REG_BADBR.
3476         (_REG_ERANGE): Renamed from REG_ERANGE.
3477         (_REG_ESPACE): Renamed from REG_ESPACE.
3478         (_REG_BADRPT): Renamed from REG_BADRPT.
3479         (_REG_EEND): Renamed from REG_EEND.
3480         (_REG_ESIZE): Renamed from REG_ESIZE.
3481         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3482         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3483         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3484         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3485         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3486
3487         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3488         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3489         changed.  But support the old name if the new one is not defined
3490         and if _REGEX_SOURCE.
3491
3492         Change the following member names in struct re_pattern_buffer.
3493         The old names are still supported if !_REGEX_SOURCE.
3494         The new names are always supported, regardless of _REGEX_SOURCE.
3495         (re_buffer): Renamed from buffer.
3496         (re_allocated): Renamed from allocated.
3497         (re_used): Renamed from used.
3498         (re_syntax): Renamed from syntax.
3499         (re_fastmap): Renamed from fastmap.
3500         (re_translate): Renamed from translate.
3501         (re_can_be_null): Renamed from can_be_null.
3502         (re_regs_allocated): Renamed from regs_allocated.
3503         (re_fastmap_accurate): Renamed from fastmap_accurate.
3504         (re_no_sub): Renamed from no_sub.
3505         (re_not_bol): Renamed from not_bol.
3506         (re_not_eol): Renamed from not_eol.
3507         (re_newline_anchor): Renamed from newline_anchor.
3508
3509         Change the following member names in struct re_registers.
3510         The old names are still supported if !_REGEX_SOURCE.
3511         The new names are always supported, regardless of _REGEX_SOURCE.
3512         (rm_num_regs): Renamed from num_regs.
3513         (rm_start): Renamed from start.
3514         (rm_end): Renamed from end.
3515
3516         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3517         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3518         Prepend __ to parameter names.
3519
3520         Undo yesterday's changes.
3521
3522 2005-08-24  Jim Meyering  <jim@meyering.net>
3523
3524         Sync from coreutils.
3525         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3526
3527 2005-08-21  Bruno Haible  <bruno@clisp.org>
3528
3529         * lock.h: Add multiple inclusion guard.
3530         * tls.h: Add multiple inclusion guard.
3531
3532 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3533
3534         * regex.h (REG_NOSYS)
3535         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3536         Define, since POSIX requires it as of 2001.
3537         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3538         New private symbol, used to keep the enum signed in all cases.
3539         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3540         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3541
3542         * regex_internal.c (re_string_skip_chars, register_state):
3543         (calc_state_hash):
3544         Remove forward decls; no longer needed now that we use prototypes.
3545         * regexec.c (acquire_init_state_context, check_halt_node_context):
3546         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3547         (clean_state_log_if_needed): Likewise.
3548
3549 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3550
3551         Fix problems reported by Sam Steingold in
3552         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3553         * regexec.c (sift_states_bkref): Fix portability bug: the code
3554         assumed that reg_errcode_t is a signed type, which is not
3555         necessarily true if _XOPEN_SOURCE is not defined.
3556         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3557         some compilers warn about it otherwise.
3558
3559 2005-08-20  Jim Meyering  <jim@meyering.net>
3560
3561         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3562         of unused local, dfa.
3563
3564 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3565
3566         * regcomp.c (create_initial_state): Remove duplicate decl.
3567         (init_word_char, create_initial_state, duplicate_node_closure):
3568         (fetch_token, peek_token_bracket, build_range_exp):
3569         (build_collating_symbol): Remove forward decls; no longer needed
3570         now that we use prototypes.
3571
3572         * regcomp.c:
3573         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3574         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3575         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3576         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3577         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3578         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3579         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3580         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3581         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3582         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3583         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3584         (build_charclass, build_charclass_op, fetch_number, create_tree):
3585         (create_token_tree, mark_opt_subexp, duplicate_tree):
3586         Use prototypes rather than old-style definitions.
3587
3588         * regex_internal.c:
3589         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3590         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3591         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3592         (re_string_reconstruct, re_string_peek_byte_case):
3593         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3594         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3595         (re_node_set_init_copy, re_node_set_add_intersect):
3596         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3597         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3598         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3599         (re_acquire_state, re_acquire_state_context, register_state):
3600         (create_ci_newstate, create_cd_newstate, free_state):
3601         Likewise.
3602         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3603         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3604         (re_search_internal, prune_impossible_nodes):
3605         (acquire_init_state_context, check_matching, static):
3606         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3607         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3608         (update_regs, sift_states_backward, build_sifted_states):
3609         (clean_state_log_if_needed, merge_state_array):
3610         (update_cur_sifted_state, add_epsilon_src_nodes):
3611         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3612         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3613         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3614         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3615         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3616         (check_arrival, check_arrival_add_next_nodes):
3617         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3618         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3619         (check_node_accept_bytes, check_node_accept, extend_buffers):
3620         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3621         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3622         (sift_ctx_init):
3623         Likewise.
3624
3625         * regex_internal.h:
3626         (re_string_allocate, re_string_construct, re_string_reconstruct):
3627         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3628         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3629         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3630         (re_string_context_at, re_string_peek_byte_case):
3631         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3632         is defined, since we now use prototypes always.
3633
3634         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3635         C89 or better.  All uses removed.
3636
3637 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3638
3639         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3640         [defined lint]: Suppress bogus uninitialized-variable warnings.
3641
3642         * regcomp.c (duplicate_node): Return new index, not an error code,
3643         and let the caller return REG_ESPACE if out of space.  This
3644         removes an uninitialied-variable warning with GCC 4.0.1, and also
3645         avoids taking the address of a local variable.  All callers
3646         changed.
3647
3648 2005-08-19  Jim Meyering  <jim@meyering.net>
3649
3650         * regexec.c (proceed_next_node): Redo local variables to
3651         avoid GCC shadowing warnings.
3652
3653 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3654
3655         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3656         (re_node_set_insert_last, re_dfa_add_node):
3657         Rename local variables to avoid GCC shadowing warnings.
3658
3659 2005-08-18  Bruno Haible  <bruno@clisp.org>
3660
3661         * strstr.c (strstr): Fix return value in multibyte case.
3662         * strcasestr.c (strcasestr): Likewise.
3663
3664 2005-08-17  Jim Meyering  <jim@meyering.net>
3665
3666         Make the %s format (seconds since the epoch) work for a negative
3667         number and when used with a zero-padded field width, e.g. %015s.
3668
3669         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3670         label so that it precedes the code to set `digits'.  Otherwise,
3671         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3672         print `00-22'.  Now, it prints `-0022', as it should.
3673
3674 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3675
3676         * regex.h: Remove useless space-before-tab.  From coreutils.
3677
3678 2005-08-17  Bruno Haible  <bruno@clisp.org>
3679
3680         * strcasestr.h: New file.
3681         * strcasestr.c: New file.
3682
3683 2005-08-17  Bruno Haible  <bruno@clisp.org>
3684
3685         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3686         * strstr.c: Completely rewritten, with multibyte locale support.
3687
3688 2005-08-17  Bruno Haible  <bruno@clisp.org>
3689
3690         * strcasecmp.c: Use mbuiter.h.
3691
3692 2005-08-17  Bruno Haible  <bruno@clisp.org>
3693
3694         * mbuiter.h: New file.
3695
3696 2005-08-16  Bruno Haible  <bruno@clisp.org>
3697
3698         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3699         (mbi_init): Update.
3700         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3701         NUL byte, not after it.
3702
3703 2005-08-16  Bruno Haible  <bruno@clisp.org>
3704
3705         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3706         the valid ones. Makes the comparison operations transitive:
3707         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3708         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3709
3710 2005-08-16  Bruno Haible  <bruno@clisp.org>
3711
3712         * strcase.h (strcasecmp): Add note in comments.
3713         * strncasecmp.c: Use code from strcasecmp.c.
3714         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3715         (strcasecmp): Work correctly in multibyte locales.
3716
3717 2005-08-16  Bruno Haible  <bruno@clisp.org>
3718
3719         * strnlen1.h: New file.
3720         * strnlen1.c: New file.
3721
3722 2005-08-16  Bruno Haible  <bruno@clisp.org>
3723
3724         * mbfile.h: New file.
3725
3726 2005-08-16  Bruno Haible  <bruno@clisp.org>
3727
3728         * mbiter.h: New file.
3729
3730 2005-08-16  Bruno Haible  <bruno@clisp.org>
3731
3732         * mbchar.h: New file.
3733         * mbchar.c: New file.
3734
3735 2005-08-16  Bruno Haible  <bruno@clisp.org>
3736
3737         * tls.h: New file, from GNU gettext.
3738         * tls.c: New file, from GNU gettext.
3739
3740 2005-08-15  Bruno Haible  <bruno@clisp.org>
3741
3742         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3743         is defined.
3744
3745 2005-08-14  Jim Meyering  <jim@meyering.net>
3746
3747         Sync from coreutils.
3748
3749         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3750         Use the hash-table-based cycle-detection code not just when
3751         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3752         Reported by James Youngman in
3753         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3754         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3755         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3756         This lets us compile with -DFTS_DEBUG, once again.
3757         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3758         * fts.c (fd_safer): Remove decl.
3759         Include fcntl--.h rather than unistd-safer.h
3760         (fts_safe_changedir): Don't call fd_safer; no longer needed
3761         now that we include fcntl--.h.
3762
3763 2005-08-11  Simon Josefsson  <jas@extundo.com>
3764
3765         * readline.h, readline.c: New file.
3766
3767 2005-08-11  Bruno Haible  <bruno@clisp.org>
3768
3769         * strnlen.h (strnlen): Change parameter name to match comment.
3770
3771 2005-08-10  Simon Josefsson  <jas@extundo.com>
3772
3773         * strndup.c: Use strnlen.h.
3774
3775         * strnlen.h: New file.
3776
3777 2005-08-02  Simon Josefsson  <jas@extundo.com>
3778
3779         * getline.h, getline.c: Rewrite.
3780
3781         * getdelim.h, getdelim.c: New files, ported from glibc.
3782
3783 2005-07-31  Bruno Haible  <bruno@clisp.org>
3784
3785         * lock.h (gl_lock_initializer): New macro.
3786         (gl_lock_define_initialized): Use it.
3787         (gl_rwlock_initializer): New macro.
3788         (gl_rwlock_define_initialized): Use it.
3789         (gl_recursive_lock_initializer): New macro.
3790         (gl_recursive_lock_define_initialized): Use it.
3791
3792 2005-07-26  Bruno Haible  <bruno@clisp.org>
3793
3794         * lock.h: Update from GNU gettext.
3795         * lock.c: Update from GNU gettext.
3796
3797 2005-07-18  Bruno Haible  <bruno@clisp.org>
3798
3799         * lock.h (gl_once_t): New type.
3800         (gl_once_define, gl_once): New macros.
3801         * lock.c (fresh_once): New variable.
3802         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3803         functions.
3804
3805 2005-07-18  Simon Josefsson  <jas@extundo.com>
3806
3807         * check-version.c (check_version): Accept identical versions too.
3808
3809 2005-07-18  Bruno Haible  <bruno@clisp.org>
3810
3811         * lock.h: New file, from GNU gettext.
3812         * lock.c: New file, from GNU gettext.
3813
3814 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3815
3816         * quotearg.c: Add translator comment suggested by Bruno Haible,
3817         with a minor change.
3818
3819 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3820
3821         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3822         copyright symbol and the year.
3823         * version-etc.c (COPYRIGHT_YEAR): New constant.
3824         (version_etc_va): Use parameterized copyright notice.
3825         Reword to conform to the current GNU coding standards.
3826
3827 2005-07-11  Simon Josefsson  <jas@extundo.com>
3828
3829         * size_max.h: New file.
3830
3831 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3832
3833         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3834         block of defines.
3835
3836 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3837        and  Paul Eggert  <eggert@cs.ucla.edu>
3838
3839         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3840         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3841
3842 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3843
3844         * regex.c, regex.h: Sync from libc.
3845         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3846         New files, synced from libc, except that regex_internal.h
3847         currently has a small porting fix.
3848
3849 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3850
3851         Remove the dependency of the strftime module on the tzset module.
3852         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3853         Copy the input structure, to work around some of the bug with
3854         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3855         Solaris releases, you should also use the tzset module, but we won't
3856         require it as a dependency any more since we don't want LGPLed code
3857         to depend on GPLed code.
3858
3859 2005-07-02  Jim Meyering  <jim@meyering.net>
3860
3861         * backupfile.c (backup_args): Change a `0' to NULL.
3862
3863 2005-07-01  Jim Meyering  <jim@meyering.net>
3864
3865         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3866         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3867         * save-cwd.c, tempname.c:
3868         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3869         and don't include <sys/file.h>).
3870
3871 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3872
3873         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3874         declares only 'struct timespec;' (!).
3875
3876 2005-06-29  Jim Meyering  <jim@meyering.net>
3877
3878         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3879         type name.  Use the variable name instead.
3880         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3881
3882 2005-06-28  Simon Josefsson  <jas@extundo.com>
3883
3884         * check-version.h, check-version.c: New files.
3885
3886 2005-06-28  Simon Josefsson  <jas@extundo.com>
3887
3888         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3889         collision with global variable.  Better indentation.  Don't
3890         increment buffer pointer beyond buffer end.  Based on comments
3891         from Paul Eggert <eggert@cs.ucla.edu>.
3892
3893         * base64.h: Indent.
3894
3895 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3896
3897         * canon-host.c (canon-host): Append trailing "," to 0 in
3898         initializer of struct addrinfo, as an indication that we don't
3899         care how many members the structure has.
3900
3901 2005-06-24  Derek Price  <derek@ximbiot.com>
3902         and Bruno Haible  <bruno@clisp.org>
3903
3904         Remove stat module & update lstat.
3905         * stat.c: Remove this file...
3906         (slash_aware_lstat): ...moving this content and its support...
3907         * lstat.c (rpl_lstat): ...into here.
3908         * lstat.h: New file.
3909
3910 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3911
3912         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3913         (ranged_convert): Don't save conversion in a temporary struct.
3914         This causes a warning with GCC 4.0.0, and anyway in the typical
3915         case it's not worth the extra 100 bytes or so of code.
3916         (ranged_convert, __mktime_internal): When calling a function via a
3917         pointer P, use P () rather than (*P) (), as we now assume C89 or
3918         better.
3919
3920 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3921
3922         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3923         "who -r" failed to give output.  Problem reported by Tim Waugh.
3924
3925         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3926         (xcalloc): Use it to avoid needless tests.
3927         Problem reported by Jim Meyering.
3928
3929 2005-06-16  Jim Meyering  <jim@meyering.net>
3930
3931         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3932         when either N or S is zero.
3933
3934 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3935
3936         * argp.h (__option_is_short): Check upper limit of
3937         __key. Isprint() requires its argument to have the value
3938         of an unsigned char or EOF.
3939
3940 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3941
3942         * fnmatch.c (fnmatch): If there is an encoding error in a
3943         multibyte string or pattern, fall back on unibyte matching.
3944         Problem reported by James Youngman.
3945
3946 2005-06-08  Bruno Haible  <bruno@clisp.org>
3947
3948         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3949         warning on mingw.
3950
3951 2005-06-08  Bruno Haible  <bruno@clisp.org>
3952
3953         * csharpcomp.h: New file, from GNU gettext.
3954         * csharpcomp.c: New file, from GNU gettext.
3955         * csharpcomp.sh.in: New file, from GNU gettext.
3956
3957 2005-06-07  Derek Price  <derek@ximbiot.com>
3958
3959         Sync from CVS.
3960         * glob_.h: Indent nested #ifdef.
3961
3962 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3963
3964         Sync from coreutils.
3965         Use "file name" when talking about file names, instead of "filename"
3966         or "path", as per the GNU coding standards.
3967         * mkdir-p.c: Renamed from makepath.c.
3968         (make_dir_parents): Renamed from make_path.  All callers changed.
3969         * mkdir-p.h: Likewise.  All includers changed.
3970         * filenamecat.c: Renamed from path-concat.c.
3971         (file_name_concat): Renamed from path_concat.  All callers changed.
3972         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3973         * filenamecat.h: Likewise.  All includers changed.
3974         * acl.c: Don't use "path" or "filename" to mean "file name"
3975         in comments or local variable names.
3976         * basename.c: Likewise.
3977         * canonicalize.c, canonicalize.h: Likewise.
3978         * dirname.c, dirname.h: Likewise.
3979         * euidaccess.c: Likewise.
3980         * exclude.c: Likewise
3981         * fnmatch_.h, fnmatch_loop.c: Likewise.
3982         * fsusage.c, fsuage.h: Likewise.
3983         * fts.c, fts_.h: Likewise.
3984         * getcwd.c: Likewise.
3985         * getloadavg.c: Likewise.
3986         * mkstemp.c: Likewise.
3987         * mountlist.c, mountlist.h: Likewise.
3988         * openat.c, openat.h: Likewise.
3989         * readlink-stub.c: Likewise.
3990         * readutmp.c, readutmp.h: Likewise.
3991         * rename.c: Likewise.
3992         * rmdir.c: Likewise.
3993         * same.c: Likewise.
3994         * savedir.c: Likewise.
3995         * stripslash.c: Likewise.
3996         * tempname.c: Likewise.
3997         * xreadlink.c: Likewise.
3998         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3999         All uses changed.
4000         * exclude.h: Likewise.
4001
4002         * euidaccess.c (getuid, getgid, getuid, getegid)
4003         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4004         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4005         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4006         * pathmax.h: Include <limits.h> unconditionally, since other
4007         files have been getting away with it for years (MORE/BSD 4.3
4008         is extinct now).
4009         * userspec.c (getpwnam, getgrnam, getgrgid)
4010         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4011
4012         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4013         Define to 256, not 255, as per modern POSIX.
4014
4015 2005-06-01  Bruno Haible  <bruno@clisp.org>
4016
4017         * csharpexec.h: New file, from GNU gettext.
4018         * csharpexec.c: New file, from GNU gettext.
4019         * csharpexec.sh.in: New file, from GNU gettext.
4020
4021 2005-05-31  Derek Price  <derek@ximbiot.com>
4022             Paul Eggert  <eggert@cs.ucla.edu>
4023
4024         Sync from cvs.
4025         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4026
4027 2005-05-29  Derek Price  <derek@ximbiot.com>
4028             Paul Eggert  <eggert@cs.ucla.edu>
4029
4030         * glob_.h, glob.c: New files.
4031
4032 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4033
4034         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4035
4036         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4037         the configuration hassle isn't worth it.
4038         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4039         (LONGEST_MODIFIER, PRIuMAX): Remove.
4040
4041 2005-05-27  Bruno Haible  <bruno@clisp.org>
4042
4043         * getlogin_r.h: Remove second include of <stddef.h>.
4044
4045 2005-05-25  Bruno Haible  <bruno@clisp.org>
4046             Derek Price  <derek@ximbiot.com>
4047
4048         * getlogin_r.h: Simplify API documentation.
4049
4050 2005-05-25  Derek Price  <derek@ximbiot.com>
4051             Paul Eggert  <eggert@cs.ucla.edu>
4052
4053         * getlogin_r.c, getlogin_r.h: New files.
4054
4055 2005-05-22  Bruno Haible  <bruno@clisp.org>
4056
4057         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4058         Also include <sys/param.h> if it defines MIN, MAX.
4059         Based on a patch by Derek Price <derek@ximbiot.com>.
4060
4061 2005-05-22  Bruno Haible  <bruno@clisp.org>
4062
4063         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4064         (INT64_MIN): Fix definition.
4065         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4066
4067         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4068         NEED_SIGNED_INT_TYPES.
4069
4070         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4071         HAVE_SYSTEM_INTTYPES.
4072
4073 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4074
4075         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4076         so that unistd-safer.h (GPL'ed code) need not be included.
4077
4078 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4079
4080         New fts module.
4081         * fts.c: Don't include "cycle-check.h" or "hash.h".
4082         (setup_dir, free_dir): New functions.
4083         (enter_dir, leave_dir): Define trivial
4084         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4085         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4086         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4087         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4088         Move to fts-cycle.c.
4089         (fts_open): Use setup_dir.
4090         (fts_close): Use free_dir.
4091         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4092         This adds a label and some gotos, but the alternatives were messier.
4093         Check for memory allocation failure when entering a dir.
4094         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4095         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4096         (FTS): New member fts_cycle, that is a union that contains the
4097         old active_dir_ht and cycle_state.  All uses changed to mention
4098         fts_cycle.ht and fts_cycle.state.
4099         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4100         fts.c, with the following changes:
4101         (setup_dir, free_dir): New functions.
4102         (enter_dir): Now returns bool.  Return true if successful, false
4103         if memory exhausted.  All callers changed.
4104         Do not bother partly cleaning up on
4105         memory allocation failure; that is free_dir's job.
4106         However, free ad if hash_insert fails, to avoid memory leak.
4107         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4108         fts->fts_options to see which union member to use.
4109
4110 2005-05-20  Jim Meyering  <jim@meyering.net>
4111
4112         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4113         Now a macro, to pacify GCC.
4114
4115 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4116
4117         * chown.c (rpl_chown): Return -1 on failure.
4118
4119 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4120
4121         * canonicalize.c: Include canonicalize.h first, to test interface.
4122         Include <stddef.h> unconditionally, since we assume C89 now.
4123         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4124         * fts.c: Include fts_.h first, to check interface.
4125         Do not include intprops.h; no longer needed.
4126         Include cycle-check.h and hash.h, since fts_.h no longer does.
4127         Remove unnecessary casts of closedir to void.
4128         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4129         decide whether to decrement nlinks.
4130         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4131         (FTS): Use struct hash_table * instead of Hash_table, so that
4132         we no longer need to include hash.h here.
4133
4134 2005-05-17  Jim Meyering  <jim@meyering.net>
4135
4136         * fts.c, fts_.h: New files, from coreutils.
4137
4138 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4139
4140         Sync from coreutils.
4141         * unlinkdir.c, unlinkdir.h: New files.
4142         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4143         regex.h, unlocked-io.h, xtime.h:
4144         White space changes only.
4145         * makepath.c (make_path): Port to hosts where leading "//" is special.
4146         * yesno.c: Include getline.h, not ctype.h.
4147         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4148         Use getline to remove arbitrary restriction on response length.
4149
4150 2005-05-13  Bruno Haible  <bruno@clisp.org>
4151
4152         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4153         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4154         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4155         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4156         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4157         Add support for 64-bit integers in the MSVC compiler.
4158
4159 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4160
4161         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4162         Change the initial comment to refer to GPL, not LGPL.
4163         gnulib-tool will change it to LGPL as needed.
4164
4165         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4166         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4167         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4168         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4169         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4170         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4171         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4172         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4173         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4174         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4175         concatpath.c, config.charset, copy-file.c, copy-file.h,
4176         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4177         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4178         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4179         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4180         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4181         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4182         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4183         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4184         full-read.c, full-read.h, full-write.c, full-write.h,
4185         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4186         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4187         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4188         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4189         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4190         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4191         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4192         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4193         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4194         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4195         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4196         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4197         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4198         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4199         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4200         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4201         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4202         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4203         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4204         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4205         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4206         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4207         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4208         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4209         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4210         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4211         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4212         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4213         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4214         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4215         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4216         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4217         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4218         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4219         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4220         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4221         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4222         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4223         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4224         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4225         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4226         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4227         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4228         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4229         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4230         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4231         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4232         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4233         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4234         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4235         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4236         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4237         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4238         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4239         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4240         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4241         Update FSF postal mail address.
4242
4243 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4244
4245         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4246         specified in ai_socktype. Fix invalid ai_protocol
4247         check. ai_protocol is usually set to 0 or depending on
4248         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4249         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4250         ai_socktype / ai_protocol in the returned addrinfo structure.
4251
4252 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4253             Bruno Haible  <bruno@clisp.org>
4254
4255         * inet_ntop.h: New file.
4256         * inet_ntop.c: New file, from glibc with modifications.
4257
4258 2005-05-08  Jim Meyering  <jim@meyering.net>
4259
4260         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4261
4262 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4263
4264         Merge from coreutils.  Among other things,
4265         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4266         * fd-safer.c: New file.
4267         * fcntl-safer.h, open-safer.c: Remove.
4268         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4269         * dup-safer.c: Include unistd-safer.h first.
4270         Don't include errno.h.
4271         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4272         * file-type.h: Don't assume invoker included sys/stat.h first.
4273         * file-type.c: Rely on file-type.h change.
4274         * getloadavg.c: Include unistd-safer.h.
4275         (getloadavg): Use safer open.
4276         * getusershell.c: Include "stdio-safer.h".
4277         (getusershell): Use safer fopen.
4278         * long-options.c (long_options): Use NULL rather than 0.
4279         * modechange.h (mode_free): Remove; all callers changed to invoke
4280         'free'.
4281         * modechange.c: Likewise.
4282         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4283         (MODE_DONE): New constant.
4284         (struct mode_change): Remove 'next' member.
4285         (make_node_op_equals): New function; like the old one of the
4286         same name, except it allocates an array.
4287         (mode_compile, mode_create_from_ref): Use it.
4288         (mode_compile): Allocate result as an array, not a linked list.
4289         Parse octal string ourself, so that we catch mistakes like "+0".
4290         (mode_adjust): Arg is an array, not a linked list.
4291         * modechange.c: Include stat-macros.h, xalloc.h.
4292         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4293         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4294         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4295         Remove.  This is now stat-macros.h's job.
4296         (talloc): Remove.  All callers replaced by xalloc, so that
4297         our invokers don't have to worry about reporting memory failures.
4298         (make_node_op_equals): Remove.
4299         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4300         New constants.
4301         (struct mode_change): Moved here from modechange.h.
4302         (mode_append_entry): Remove.
4303         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4304         apps to have incorrect behavior.  Use simpler algorithm for head
4305         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4306         Detect more invalid usages rather than having somewhat-random behavior.
4307         Don't insert an "a=" action, as that leads to incorrect behavior.
4308         (mode_compile, mode_create_from_ref): Return NULL on error instead
4309         of an enum, since now there's only one way to have an error.  All
4310         callers changed.
4311         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4312         at the correct time.  Simplify calculation of "+u" and its ilk.
4313         Don't mishandle "+X".
4314         (mode_free): Remove "register" and localize decls.
4315         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4316         (struct mode_change): Move to modechange.c; callers don't
4317         need to see this stuff.
4318         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4319         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4320         (mode_change, mode_adjust): Reflect the new signatures noted above.
4321         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4322         that might redefine system include files.
4323         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4324         (my_usleep): Use NULL rather than (void *) 0.
4325         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4326         Use siginterrupt to specify that system calls should be interrupted.
4327         (rpl_nanosleep): Move initialization of suspended closer to call of
4328         my_usleep.
4329         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4330         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4331         (desirable_utmp_entry): New function.
4332         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4333         using x2nrealloc, to simplify logic.
4334         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4335         size calculation.  Do not assume utmp file is a regular file.
4336         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4337         (READ_UTMP_CHECK_PIDS): New constant.
4338         * save-cwd.c: Include unistd-safer.h.
4339         (save_cwd): Use fd_safer.
4340         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4341         [!_LIBC] Include "stat-macros.h" instead.
4342         * unistd-safer.h (fd_safer): New decl.
4343
4344 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4345
4346         * byteswap_.h: New file.
4347
4348 2005-04-25  Albert Chin  <china@thewrittenword.com>
4349
4350         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4351         Toolkit C bug.
4352
4353 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4354
4355         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4356         that "UTC +1 second" continues to work.  Problem reported
4357         by Dmitry V. Levin.
4358         (relunit_snumber): New rule.
4359         (relunit): Use it.
4360
4361 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4362
4363         * getdate.y (universal_time_zone_table): New constant.
4364         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4365         universal_time_zone_table.
4366         (lookup_zone): Prefer universal_time_zone_table to
4367         local_time_zone_table, so that "GMT" time stamps are allowed in
4368         London during the summer.  Problem reported by Ian Abbott.
4369
4370 2005-04-12  Jim Meyering  <jim@meyering.net>
4371
4372         * human.c (humblock): Set *options even when returning due to
4373         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4374         warning from gcc-4.
4375
4376 2005-04-09  Jim Meyering  <jim@meyering.net>
4377
4378         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4379         -Wuninitialized: initialize tm0.tm_year.
4380
4381 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4382
4383         * getdate.y (parser_control): rels_seen is now a boolean, not a
4384         count, since there's no maximum.  All uses changed.
4385         Add member dsts_seen.
4386         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4387         not being INT_MAX.
4388         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4389         Use pc_rels_seen to decide whther a date is absolute.
4390
4391         * getdate.y (number): Don't overwrite year.
4392         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4393         check.
4394
4395 2005-04-02  Simon Josefsson  <jas@extundo.com>
4396
4397         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4398         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4399
4400 2005-03-27  Jim Meyering  <jim@meyering.net>
4401
4402         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4403
4404 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4405
4406         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4407         "one's complement" -> "ones' complement" in comment, as per Knuth.
4408         "value of type" -> "type or expression" in comment.
4409         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4410
4411 2005-03-26  Jim Meyering  <jim@meyering.net>
4412
4413         Comment nits.
4414         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4415         Correct typos: s/or/of/.
4416
4417 2005-03-23  Jim Meyering  <jim@meyering.net>
4418
4419         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4420
4421 2005-03-21  Jim Meyering  <jim@meyering.net>
4422
4423         Changes imported from coreutils.
4424
4425         * cycle-check.c: Don't include xalloc.h.
4426
4427         * path-concat.c: Don't include assert.h.
4428         (path_concat): Remove assertion that would have triggered
4429         for ABASE starting with more than one slash.
4430         Reported by Andreas Schwab.
4431
4432         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4433         properly when ABASE is an absolute file name.
4434         Correct the description of this function.
4435         Include <assert.h>.
4436         Add an assertion and a test driver.
4437         This fixes a bug introduced on 2004-07-02.
4438         Andreas Schwab reported the resulting failure of cp --parents:
4439         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4440
4441 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4442
4443         * strftime.c (my_strftime): If the underlying strftime returns 0
4444         (which shouldn't happen), generate nothing instead of returning 0
4445         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4446
4447 2005-03-16  Bruno Haible  <bruno@clisp.org>
4448
4449         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4450
4451 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4452
4453         * strftime.c (my_strftime): Prepend space to format so that we can
4454         reliably distinguish strftime failure from empty output on POSIX
4455         hosts.
4456
4457 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4458
4459         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4460         (iconv_string): Don't guess a size-zero buffer, as that might cause
4461         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4462         result would be 'too large', where 'too large' is (heuristically)
4463         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4464         overflow concerns.  This will prevent some unwanted malloc failures
4465         when the inputs are very large.
4466
4467 2005-03-15  Bruno Haible  <bruno@clisp.org>
4468
4469         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4470         'negate'.
4471
4472         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4473         variable.
4474
4475         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4476
4477 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4478
4479         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4480         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4481         intprops.h.
4482         * strtol.c: Likewise.
4483
4484 2005-03-14  Simon Josefsson  <jas@extundo.com>
4485
4486         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4487         <fx@gnu.org>.
4488
4489 2005-03-14  Jim Meyering  <jim@meyering.net>
4490
4491         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4492         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4493         to be nonzero so that we (and caller) can detect the difference
4494         between a valid zero-length expansion and an error return, even
4495         when the underlying strftime fails before writing anything into
4496         that location.
4497
4498 2005-03-10  Jim Meyering  <jim@meyering.net>
4499
4500         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4501         so that this module works on systems without fchdir.
4502
4503 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4504
4505         Factor int-properties macros into a single file, except for
4506         glibc-related files.
4507         * intprops.h: New file.
4508         * getloadavg.c: Include it instead of limits.h.
4509         (INT_STRLEN_BOUND): Remove.
4510         * human.c: Include intprops.h.
4511         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4512         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4513         * inttostr.h: Include intprops.h instead of limits.h.
4514         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4515         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4516         for consistency with intprops.h.
4517         (time_t_is_integer, twos_complement_arithmetic): Use them.
4518         * sig2str.h: Include <signal.h>, intprops.h.
4519         (INT_STRLEN_BOUND): Remove.
4520         * strftime.c (TYPE_SIGNED): Remove.
4521         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4522         * strtol.c: Adjust comments to match intprops.h.
4523         * userspec.c: Include intprops.h.
4524         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4525         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4526         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4527         instead of rolling our own expressions.
4528         * xstrtol.c: Include xstrtol.h first, to test interface.
4529
4530         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4531         instead of int.
4532         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4533         the right thing even if adding 1900 would overflow.  Similarly
4534         for tm_mon + 1 and tm_yday + 1.
4535         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4536         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4537         (DO_SIGNED_NUMBER): New macro.
4538         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4539
4540 2005-03-07  Bruno Haible  <bruno@clisp.org>
4541
4542         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4543
4544 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4545             Bruno Haible  <bruno@clisp.org>
4546
4547         * pagealign_alloc.h: New file.
4548         * pagealign_alloc.c: New file.
4549
4550 2005-01-28  Bruno Haible  <bruno@clisp.org>
4551
4552         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4553         stpncpy.c uses it.
4554
4555 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4556
4557         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4558         The workaround isn't strictly needed for POSIX conformance, and
4559         it's too much of a pain to configure and maintain.  We'll ask
4560         people to fix their kernels instead.
4561         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4562         (NANOSLEEP_BUG_WORKAROUND): Remove.
4563         (xnanosleep): Remove the workaround.
4564
4565 2005-02-12  Bruno Haible  <bruno@clisp.org>
4566
4567         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4568
4569 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4570
4571         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4572         * timespec.h (gettime): Return void, since it always
4573         succeeds now.  All uses changed.
4574         * gettime.c (gettime) Likewise.
4575         [HAVE_NANOTIME]: Prefer nanotime.
4576         Assume gettimeofday succeeds, as POSIX requires.
4577         Assime time () succeeds, since other code already does.
4578         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4579         (timespec_subtract): Remove.
4580         (NANOSLEEP_BUG_WORKAROUND): New constant.
4581         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4582         things considerably.  Use it only on GNU/Linux hosts, since the
4583         workaround shouldn't be needed elsewhere.
4584
4585 2005-02-24  Bruno Haible  <bruno@clisp.org>
4586
4587         * gettext.h: Update from GNU gettext 0.14.2.
4588
4589 2005-02-24  Bruno Haible  <bruno@clisp.org>
4590
4591         * localcharset.c: Update from GNU gettext 0.14.2.
4592         * config.charset: Update from GNU gettext 0.14.2.
4593
4594 2005-02-22  Simon Josefsson  <jas@extundo.com>
4595
4596         * iconvme.h, iconvme.c: New files, from libc.
4597
4598 2005-02-20  Neil Conway  <neilc@samurai.com>
4599
4600         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4601         returned by OSX/Darwin if the specified buffer is not large
4602         enough for the hostname.
4603
4604 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4605
4606         * memrchr.h: New file.
4607         * chdir-long.c: Include it.
4608         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4609         Don't bother including stddef.h.
4610
4611 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4612
4613         * argp-help.c (__argp_help): Create a fake struct argp_state and
4614         pass it to _help, otherwise the latter coredumps trying to
4615         dereference state.root_argp.
4616
4617 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4618
4619         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4620         inclusion.
4621         Include <sys/types.h>, for dev_t.
4622         (ME_DUMMY, ME_REMOTE): Move from here....
4623         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4624         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4625         Dmitry V. Levin.
4626         Include mountlist.h first, to test the interface.
4627
4628 2005-01-29  Bruno Haible  <bruno@clisp.org>
4629
4630         * progname.c (program_name): Initialize.
4631         Needed when linking statically on MacOS X.
4632
4633 2005-01-28  Bruno Haible  <bruno@clisp.org>
4634
4635         * javacomp.sh.in: New file, from GNU gettext.
4636         * javacomp.h: New file, from GNU gettext.
4637         * javacomp.c: New file, from GNU gettext.
4638
4639 2005-01-26  Bruno Haible  <bruno@clisp.org>
4640
4641         * javaexec.sh.in: New file, from GNU gettext.
4642         * javaexec.h: New file, from GNU gettext.
4643         * javaexec.c: New file, from GNU gettext.
4644
4645 2005-01-26  Simon Josefsson  <jas@extundo.com>
4646
4647         * gai_strerror.c: Use GPL in header.
4648
4649 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4650
4651         * argp-help.c (hol_entry_help): Avoid using non-constant
4652         initializers for struct pentry_state.
4653         (__argp_error): Check return value of __asprintf
4654         (__argp_failure): Translate error message
4655
4656         * argp-parse.c: Removed braces around the expansion of N_()
4657
4658 2005-01-21  Jim Meyering  <jim@meyering.net>
4659
4660         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4661         same value as for Solaris 9.
4662
4663         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4664         component length.  This included changing the parameter to be
4665         of type `char *' rather than `char const *'.
4666         * chdir-long.h (chdir_long): Update prototype.
4667
4668         * openat.c (fdopendir, fstatat): New functions.
4669         * openat.h: Include headers required for use of DIR and struct stat.
4670         [AT_SYMLINK_NOFOLLOW]: Define.
4671         (fdopendir, fstatat): Add prototypes.
4672
4673 2005-01-21  Bruno Haible  <bruno@clisp.org>
4674
4675         * classpath.h: New file, from GNU gettext.
4676         * classpath.c: New file, from GNU gettext.
4677
4678 2005-01-20  Simon Josefsson  <jas@extundo.com>
4679
4680         * version-etc-fsf.c: New file, with version_etc_copyright.
4681         * version-etc.c: Remove version_etc_copyright.
4682         * version-etc.h (version_etc_copyright): Use [] instead of * in
4683         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4684
4685 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4686
4687         * save-cwd.c (save_cwd): Remove code to support the case
4688         where fchdir is missing or flaky.
4689
4690 2005-01-20  Simon Josefsson  <jas@extundo.com>
4691
4692         * base64.h (isbase64): Add.
4693
4694         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4695         using a unsigned prototype, don't inline.
4696         (base64_decode): Use it.
4697
4698 2005-01-19  Bruno Haible  <bruno@clisp.org>
4699
4700         * sh-quote.h: New file, from GNU gettext.
4701         * sh-quote.c: New file, from GNU gettext.
4702
4703 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4704
4705         Merge changes from coreutils, as described below in several
4706         changelogs dated today.
4707
4708         * save-cwd.c: Include "save-cwd.h" before other include files.
4709         (O_DIRECTORY): Remove; not needed here, since "." must be
4710         a directory.  All uses removed.
4711         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4712         universal on Suns, and we also need to test for IRIX.
4713         Revamp code to use 'if' rather than '#if'.
4714         Avoid unnecessary comparison of cwd->desc to 0.
4715
4716         * utimens.c (futimens): Robustify the previous patch, by checking
4717         for known valid error numbers rather than observed invalid ones.
4718
4719 2005-01-18  Jim Meyering  <jim@meyering.net>
4720
4721         * version-etc.c (version_etc_copyright): Update copyright date.
4722
4723         * utimens.c (futimens): Account for the fact that futimes
4724         can also fail with errno == ENOSYS or errno == ENOENT.
4725         Patch from Dmitry V. Levin.
4726
4727         Change the name of the robust chdir function from chdir to chdir_long.
4728         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4729         (restore_cwd): Use chdir_long, not chdir.
4730         * chdir-long.c: Renamed from chdir.c.
4731         * chdir-long.h: Renamed from chdir.h.
4732         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4733         Hurd.
4734
4735 2005-01-18  Bob Proulx  <bob@proulx.com>
4736
4737         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4738         offsetof() macro construct to avoid compile failure with native HP-UX
4739         11.0 ANSI C compiler.
4740
4741 2005-01-06  Bruno Haible  <bruno@clisp.org>
4742
4743         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4744         because stpncpy.m4 takes care of it.
4745
4746 2004-01-24  Bruno Haible  <bruno@clisp.org>
4747
4748         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4749
4750 2003-10-09  Bruno Haible  <bruno@clisp.org>
4751
4752         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4753
4754 2005-01-06  Bruno Haible  <bruno@clisp.org>
4755
4756         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4757         * fwriteerror.c: Include <stdbool.h>.
4758         (fwriteerror): At the end, close the file stream. Record whether
4759         stdout was already closed.
4760
4761 2004-05-27  Bruno Haible  <bruno@clisp.org>
4762
4763         * execute.c (environ): Declare if needed.
4764         * pipe.c (environ): Likewise.
4765         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4766
4767 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4768
4769         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4770         definitions to be after all include files, to avoid collisions.
4771         Problem reported by Bob Proulx.
4772
4773 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4774
4775         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4776         not needed.  This removes a dependency on the gettext module.
4777         [defined _LIBC]: Do not include <libintl.h>; not needed.
4778
4779 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4780
4781         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4782         HAVE_DECL_STRTOLD.
4783
4784 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4785
4786         * argp-parse.c: Include <stddef.h>.
4787         (alignof, alignto): New macros.
4788         (parser_init): Don't assume that void * is aligned sufficiently
4789         for struct option.
4790
4791         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4792         need to extend the stack.
4793         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4794         large.
4795
4796 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4797
4798         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4799
4800 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4801
4802         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4803         Remove now-obsolete comment about AIX.
4804         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4805         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4806         (YYMAXDEPTH): New macro.
4807
4808 2004-12-18  Bruno Haible  <bruno@clisp.org>
4809
4810         * fatal-signal.c (fatal_signals): Make non-const.
4811         (init_fatal_signals): New function.
4812         (uninstall_handlers, install_handlers): Ignore signals that were set to
4813         SIG_IGN.
4814         (at_fatal_signal): Call init_fatal_signals.
4815         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4816         SIG_IGN.
4817         Reported by Paul Eggert.
4818
4819 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4820
4821         * getdate.y (textint): New member "negative".
4822         (time_zone_hhmm): New function.
4823         Expect 14 shift-reduce conflicts, not 13.
4824         (o_colon_minutes): New rule.
4825         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4826         (yylex): Set the "negative" member of signed numbers.
4827
4828 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4829
4830         Changes imported from coreutils.
4831         * hard-locale.c: Assume <locale.h> exists.
4832         Include "strdup.h".
4833         (GLIBC_VERSION): New macro.
4834         (hard_locale): Assume setlocale exists.
4835         Rewrite to avoid #ifdef.
4836         Use strdup rather than malloc + strcpy.
4837         * human.c: Assume <locale.h> exists.
4838         (human_readable): Assume localeconv exists.
4839
4840 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4841
4842         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4843         convert T2, not T.  (Imported from libc.)
4844
4845 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4846
4847         * getcwd.c (is_ENAMETOOLONG): New macro.
4848         (__getcwd.c): Don't restore errno; glibc doesn't.
4849         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4850         first, falling back to our code only if its results look suspicious.
4851         Ensure that the resulting buffer is only as large as necessary.
4852
4853         * readutmp.c: Include readutmp.h first.
4854         Include <errno.h>, since readutmp.h no longer does that.
4855         * readutmp.h: Don't include <errno.h>,
4856         <sys/param.h>, <time.h>; not needed to establish interface.
4857         (errno): Remove decl.
4858         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4859         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4860         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4861
4862 2004-11-28  Simon Josefsson  <jas@extundo.com>
4863
4864         * base64.h, base64.c: New file.
4865
4866 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4867
4868         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4869
4870 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4871
4872         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4873         HP's ANSI C compiler.
4874         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4875         Declaring int functions causes warnings on some modern systems and
4876         shouldn't be needed to compile on ancient ones.
4877         * same.c (MIN) [defined MIN]: Don't define, since it's already
4878         defined.
4879
4880         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4881         with the following changes.
4882         (__set_errno): Parenthesize properly.
4883         Include <stdbool.h>.
4884         (MIN, MAX, MATCHING_INO): New macros.
4885         (__getcwd): Define with prototype, not K&R form.
4886         Use heuristics to allocate default buffer on stack if possible.
4887         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4888         behavior, and to avoid the PATH_MAX limit when computing
4889         ../../../../...
4890         Use MATCHING_INO to compare inode number to file.
4891         Check for arithmetic overflow in size calculations.
4892         Fix bug in reallocation of dot array that caused getcwd to fail
4893         on directories nested deeper than 75.
4894         Be more careful about saving errno on error.
4895         Do not use realloc; use only free+malloc, as this is a bit
4896         more flexible and avoids a needless copy operation.
4897         Do not inspect st_dev and st_ino for symbolic links; POSIX
4898         doesn't specify the latter.
4899         Check for closedir errors.
4900         Avoid needless casts.
4901         Use "#ifdef weak_alias" around weak_alias, to be like other
4902         glibc code.
4903         The following changes to getcwd.c have effect only when used in
4904         gnulib; they have no effect inside glibc proper.
4905         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4906         as alloca isn't used.
4907         (alloca, __alloca): Likewise.
4908         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4909         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4910         unconditionally, as gnulib assumes C89 or better.
4911         Do not include <sys/param.h>.
4912         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4913         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4914         better.
4915         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4916         Include <dirent.h> in a way that is compatible with modern Autoconf.
4917         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4918         New macros, if not already defined.
4919         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4920         Use "_LIBC", not "defined _LIBC", for consistency.
4921         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4922         a mempcpy module.
4923         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4924         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4925         * xgetcwd.c: David MacKenzie's old code was removed, so give
4926         credit only to Jim Meyering and adjust the copyright dates.
4927         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4928         <stdlib.h>, <unistd.h>, "pathmax.h".
4929         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4930         (INITIAL_BUFFER_SIZE): Remove.
4931         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4932
4933 2004-11-23  Jim Meyering  <jim@meyering.net>
4934
4935         * getopt_.h: Remove trailing blanks.
4936
4937 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4938
4939         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4940         (futimens): New function, which uses futimes if available.
4941         (futimens, utimens): Support timespec==NULL, with same semantics
4942         as utime and utimens.
4943         * utimens.h (futimens): New decl.
4944
4945 2004-11-23  Jim Meyering  <jim@meyering.net>
4946
4947         * __fpending.c: Add comment.
4948
4949 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4950
4951         * getopt_.h: Re-addition of __getopt_argv_const caused
4952         redefinition warnings. To avoid them, include the defines
4953         in `#if !defined __need_getopt ... #endif'. The only place
4954         where __getopt_argv_const is used is in definitions
4955         of getopt_long and getopt_long_only below, which are as well
4956         protected by `#ifndef __need_getopt'.
4957         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4958         __need_getopt after including <stdio.h> and <unistd.h> These
4959         headers might have defined it.
4960
4961 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4962
4963         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4964         New macros.
4965         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4966         optopt): Use them instead of invoking ## directly; otherwise, the
4967         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4968
4969 2004-11-19  Bruno Haible  <bruno@clisp.org>
4970
4971         * strtok_r.c: Move comments from here...
4972         * strtok_r.h: ... to here.
4973
4974 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4975
4976         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4977         might fail.  Problem reported by Yoann Vandoorselaere.
4978         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4979         that mishandle size_t overflow.
4980
4981 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4982
4983         * canon-host.c: Include "strdup.h".
4984         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4985         Use strdup instead of malloc/strcpy to duplicate strings.
4986
4987         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4988         (human_space_before_unit): New constant.
4989         * human.c (human_readable): Support it.
4990
4991         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4992         (xgetcwd): Set errno correctly when failing.
4993         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4994         the failure is actually due to a PATH_MAX problem.
4995
4996         Further getopt changes to make it more likely that glibc will
4997         buy the changes back.
4998         * getopt.c (POSIXLY_CORRECT): New constant.
4999         (getopt): Use it, so to preserve glibc semantic
5000         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5001         when compiling for libc.
5002         * getopt_.h (__getopt_argv_const): Bring it back.
5003         (getopt_long, getopt_long_only): Use it.
5004
5005         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5006         New arg POSIXLY_CORRECT.  All callers changed.
5007         (getopt): Argv is now char * const *, as per standard.
5008         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5009         not char *__getopt_argv_const *.
5010         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5011         _getopt_long_only_r): Likewise.
5012         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5013         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5014         _getopt_long_r, _getopt_long_only_r): Likewise.
5015         * getopt_.h (__getopt_argv_const): Remove.
5016         (getopt): Argv is now char * const *, as per standard.
5017
5018         * getdate.y (tORDINAL): New token.
5019         (day, relunit): Allow it for relative times.
5020         (relative_time_table): Use tORDINAL for ordinals.
5021
5022 2004-11-15  Jim Meyering  <jim@meyering.net>
5023
5024         * closeout.c: Include "__fpending.h" once again.
5025         Include <stdbool.h>.
5026         (close_stdout): Don't fail just because stdout was closed initially,
5027         since some programs don't write to stdout in the normal course of
5028         operation (other than --version and --help), and we don't want this
5029         function to make e.g. `touch file >&-' fail.
5030         But do fail if it was closed and someone has tried to write to it.
5031         E.g., `printf foo >&-' must fail.
5032
5033 2004-11-11  Simon Josefsson  <jas@extundo.com>
5034
5035         * strtok_r.h, strtok_r.c: New file.
5036
5037 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5038
5039         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5040         we can stop lying to compilers about the constness of argv when we
5041         are compiled outside glibc.
5042         (getopt, getopt_long, getopt_long_only): Use it.
5043         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5044         getopt): Likewise.
5045         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5046         _getopt_long_only_r): Likewise.
5047         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5048         _getopt_long_only_r): Likewise.
5049
5050         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5051         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5052         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5053         the other external symbols.
5054         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5055         declaration, since the above renaming now works around collisions.
5056
5057 2004-11-11  Jim Meyering  <jim@meyering.net>
5058
5059         * linebreak.c: Remove trailing blanks.
5060         * alloca_.h: Likewise.
5061         * acosl.c: Likewise.
5062         * euidaccess.c: Likewise.
5063         * allocsa.h: Likewise.
5064
5065 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5066
5067         * mktime.c (SHR): New macro, which is a portable
5068         substitute for >> that should work even on Crays.
5069         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5070         Problem reported by Mark D. Baushke in
5071         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5072         * getdate.y (SHR): Likewise.
5073         (tm_diff): Use it.
5074         * strftime.c (SHR): Likewise.
5075         (tm_diff): Use it.
5076         * quotearg.c (struct quoting_options): Use unsigned int for
5077         quote_these_too, so that right shifts are well defined.  All uses
5078         changed.
5079
5080 2004-11-10  Simon Josefsson  <jas@extundo.com>
5081
5082         * getaddrinfo.h, getaddrinfo.c: New files.
5083
5084 2004-11-10  Jim Meyering  <jim@meyering.net>
5085
5086         Ensure that no close failure goes unreported.
5087         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5088         return early when it seems there's nothing to flush.
5089         Don't include __fpending.h.
5090
5091 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5092
5093         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5094
5095 2004-11-05  Bruno Haible  <bruno@clisp.org>
5096
5097         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5098         Reported by Mark D. Baushke <mdb@cvshome.org>.
5099
5100 2004-11-04  Bruno Haible  <bruno@clisp.org>
5101
5102         2004-09-11  Bruno Haible  <bruno@clisp.org>
5103                 * allocsa.valgrind: New file.
5104         2004-02-06  Bruno Haible  <bruno@clisp.org>
5105                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5106                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5107                 Reported by Christopher Seip <chris.seip@hp.com>.
5108
5109 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5110
5111         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5112         with errno == ERANGE if the buffer is too small.
5113         Problem reported by Mark D. Baushke.
5114
5115 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5116
5117         * xreadlink.c (MAXSIZE): New macro.
5118         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5119         size does not exceed MAXSIZE.  Avoid cast.
5120         As suggested by Mark D. Baushke in
5121         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5122         if readlink fails with buffer size just under MAXSIZE, try again
5123         with MAXSIZE.
5124
5125 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5126         and  Paul Eggert  <eggert@cs.ucla.edu>
5127
5128         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5129         (get_date): Overparenthesize to avoid GCC warning.
5130
5131 2004-11-02  Bruno Haible  <bruno@clisp.org>
5132
5133         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5134         function returns void.
5135
5136 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5137
5138         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5139         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5140         already declared.
5141
5142 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5143
5144         * getdate.y: Add support for TZ="foo" within a date string.
5145         Fix some bugs near time_t boundaries.  Reject dates with
5146         out-of-range components, e.g., "Sept 31".
5147         Include <stdlib.h>, "setenv.h", "xalloc.h".
5148         (ISDIGIT_LOCALE): Remove; unused.
5149         Note that the TZ and time functions used here are not reentrant.
5150         (mktime_ok, get_tz): New functions.
5151         (TZBUFSIZE): New constant.
5152         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5153         This requires that we sometimes generate our own TZ="XXX..." setting.
5154
5155 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5156
5157         * mktime.c (not_equal_tm): Remove redundant check.
5158
5159 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5160
5161         * getdate.y: Use Bison 1.875 features, and some minor
5162         code cleanups.  This change does not affect semantics.
5163         Don't include <stdlib.h>; no longer needed.
5164         Don't include unlocked-io.h; only the "#if TEST" code uses
5165         stdio, and performance isn't crucial there.
5166         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5167         Bison 1.875 features as described below.
5168         All uses of "PC." replaced by "pc->".
5169         (YYSTYPE): Add a forward declaration.
5170         (yylex, yyerror): Use full prototypes in forward decls.
5171         Use "%pure-parser" rather than obsolescent "%pure_parser".
5172         Use %parse-param and %lex-param instead of obsolescent
5173         YYPARSE_PARAM and YYLEX_PARAM.
5174         (meridian_table, month_and_day_table, time_units_table,
5175         relative_time_table, time_zone_table, military_table,
5176         lookup_zone, lookup_word, get_date):
5177         Use NULL instead of 0 where appropriate.
5178         (to_hour): Avoid abort (), to avoid a dependency on
5179         stdlib.h.
5180         (yyerror, yylex): Now accepts parser_control * arg.
5181         (main) [TEST]: Use '\0' rather than 0 for char.
5182
5183 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5184
5185         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5186         It's now the caller's responsibility to handle the case where
5187         !HAVE_GETPAGESIZE && !defined getpagesize.
5188
5189         * mktime.c (leapyear): Arg is long int, not int.
5190
5191 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5192
5193         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5194
5195 2004-10-12  Simon Josefsson  <jas@extundo.com>
5196
5197         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5198         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5199         to real functions.
5200
5201 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5202
5203         * vsnprintf.h: New file.
5204         * vsnprintf.c: New file.
5205
5206 2004-10-07  Bruno Haible  <bruno@clisp.org>
5207
5208         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5209         into the provided buffer.
5210
5211 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5212
5213         * diacrit.c, diacrit.h: Add GPL notice.
5214
5215         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5216         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5217         * logl.c (logl): Keep the code as similar to glibc as possible.
5218         This avoids a potential constant-folding bug.
5219
5220 2004-10-05  Bruno Haible  <bruno@clisp.org>
5221
5222         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5223
5224 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5225
5226         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5227         * xmalloc.c (xmemdup): Likewise.
5228         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5229         XFREE): Remove these long-obsolescent macros.
5230         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5231         * xstrdup.c: Remove.
5232
5233         * regex.c (re_comp): Cast gettext return value to char *,
5234         Problem reported by Martin Neitzel via Mark D. Baushke.
5235
5236 2004-10-04  Simon Josefsson  <jas@extundo.com>
5237
5238         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5239         '#ifdef USE_UNLOCKED_IO'.
5240
5241 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5242
5243         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5244         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5245         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5246         regex.c, sha1.c, version-etc.c, yesno.c:
5247         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5248         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5249         the includer's responsibility.
5250
5251         Sync from coreutils.
5252
5253         * modechange.c (mode_compile): Don't decrement a pointer that
5254         points to the start of a string, as the C Standard says the
5255         resulting behavior is undefined.
5256
5257         * backupfile.h (enum backuptype): Rename none -> no_backups,
5258         simple -> simple_backups, numbered_existing ->
5259         numbered_existing_backups, numbered -> numbered_backups
5260         to avoid shadowing problems.  All uses changed.
5261         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5262         * backupfile.c (check_extension, numbered_backup):
5263         Rename locals to avoid shadowing 'basename'.
5264         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5265         once.
5266
5267         * .cppi-disable: Add getopt_.h, getopt_int.h.
5268         * .cvsignore: Add getopt.h.
5269
5270 2004-10-04  Simon Josefsson  <jas@extundo.com>
5271
5272         * memmem.h: New file.
5273         * memmem.c: New file, taken from glibc.
5274
5275 2004-10-02  Jim Meyering  <jim@meyering.net>
5276
5277         * dirfd.h, getpagesize.h: Add copyright notice.
5278
5279 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5280
5281         * snprintf.c: Remove comments as to why each header is needed.
5282
5283 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5284
5285         * strsep.h: New file.
5286         * strsep.c: New file.
5287
5288 2004-10-01  Simon Josefsson  <jas@extundo.com>
5289
5290         * snprintf.c (snprintf): Handle size==0.
5291
5292 2004-10-01  Simon Josefsson  <jas@extundo.com>
5293             Bruno Haible  <bruno@clisp.org>
5294
5295         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5296         (snprintf): Declare 'args'.
5297
5298 2004-09-30  Simon Josefsson  <jas@extundo.com>
5299
5300         * snprintf.h, snprintf.c: New files.
5301
5302 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5303
5304         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5305         (hol_entry_help): Never translate an empty string.
5306         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5307         * argp.h (OPTION_NO_TRANS): New option.
5308
5309 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5310
5311         * xvasprintf.c: Include xalloc.h.
5312         (xvasprintf): Use xalloc_die, not xmalloc_die.
5313
5314 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5315
5316         * dummy.c: Change copyright notice to FSF, and license to GPL.
5317
5318 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5319
5320         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5321         Problem reported by Bruno Haible in:
5322         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5323
5324 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5325
5326         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5327         in case some system header has #define'd it.  Problem reported by
5328         Soeren D. Schulze in
5329         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5330
5331 2004-09-08  Bruno Haible  <bruno@clisp.org>
5332
5333         * stdint_.h: New file, taken from GNU clisp.
5334
5335 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5336
5337         * xvasprintf.h: New file.
5338         * xvasprintf.c: New file.
5339         * xasprintf.c: New file.
5340
5341 2004-09-08  Bruno Haible  <bruno@clisp.org>
5342
5343         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5344         is > INT_MAX.
5345         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5346
5347 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5348
5349         Import from coreutils.
5350         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5351         strings on unbounded length.  alloca's performance benefits aren't
5352         that important here.
5353         (V_STRDUP): Remove.
5354         (parse_with_separator): New function, with most of the internals
5355         of the old parse_user_spec.  Allow user to omit both user and group,
5356         for compatibility with FreeBSD.
5357         Clone only the user name, not the entire spec.
5358         Do not set *uid, *gid unless entirely successful.
5359         Avoid memory leak in some failing cases.
5360         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5361         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5362         (parse_user_spec): Rewrite to use parse_with_separator.
5363
5364 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5365
5366         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5367         its complicated substitute.
5368         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5369         and program_invocation_name.
5370         (__argp_basename) [!_LIBC]: Remove; the only use was
5371         replaced by its body.
5372         (__argp_short_program_name): Change condition from
5373         !defined __argp_short_program_name to
5374         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5375         to match argp-namefrob.h.
5376         (__argp_failure): Don't assume strerror_r returns char *.
5377         * argp-parse.c (N_): Define unconditionally.
5378         (argp_default_options): Fill out initializers with 0 to avoid
5379         gcc warnings.
5380
5381 2004-08-12  Simon Josefsson  <jas@extundo.com>
5382
5383         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5384         * getopt_.h: Renamed from getopt.h.
5385
5386 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5387
5388         Merge from coreutils.
5389
5390         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5391         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5392         for Reliant Unix 5.43.
5393
5394         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5395         (union fooround): Use uintmax_t, not long int.
5396         The rest is a merge from libc:
5397         [defined _LIBC]: Include <shlib-compat.h>.
5398         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5399
5400         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5401
5402         * strverscmp.c: Convert to UTF-8.
5403
5404 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5405
5406         * obstack.h (obstack_empty_p):
5407         Don't assume that chunk->contents is suitably aligned.
5408         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5409         Likewise. Problem reported by Benno in
5410         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5411
5412         * chown.c (rpl_chown): Work even if the file is writeable but not
5413         readable.  This could be improved further but it'd take some work.
5414
5415 2004-08-08  Simon Josefsson  <jas@extundo.com>
5416
5417         * xgethostname.c: Don't include error.h (not used).
5418
5419         * getpass.h: Add.
5420         * getpass.c: Include getpass.h first.
5421
5422 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5423
5424         * xalloc-die.c: New files.
5425         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5426         All uses removed.
5427         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5428         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5429         (_, N_, xalloc_die): Move to xalloc-die.c.
5430         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5431         so that we needn't mess with xalloc_msg_memory_exhausted.
5432
5433         * sha1.h: Renamed from sha.h.
5434         (SHA1_H): Renamed from _SHA_H.
5435         (sha1_ctx): Renamed from sha_ctx.
5436         (sha1_init_ctx): Renamed from sha_init_ctx.
5437         (sha1_process_block): Renamed from sha_process_block.
5438         (sha1_process_bytes): Renamed from sha_process_bytes.
5439         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5440         (sha1_read_ctx): Renamed from sha_read_ctx.
5441         (sha1_stream): Renamed from sha_stream.
5442         (sha1_buffer): Renamed from sha_buffer.
5443         * sha1.c: Likewise; renamed from sha.c.
5444         Do not include <sys/types.h>.
5445         Include <stddef.h> rather than <stdlib.h>.
5446
5447 2004-08-08  Bruno Haible  <bruno@clisp.org>
5448
5449         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5450         FILESYSTEM_PREFIX_LEN.
5451         * progreloc.c: Likewise.
5452         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5453
5454 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5455
5456         Merge from tar.
5457         * argp-help.c (make_hol, hol_append): Don't assume that
5458         SIZE_MAX is a valid preprocessor constant.
5459         (__argp_basename): Change from "#ifndef _LIBC"
5460         to "#ifndef __argp_short_program_name", so that
5461         we don't compile these functions for tar.
5462
5463         More merges from coreutils.
5464         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5465         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5466         yesno.h: New files.
5467         * addext.c: Remove; no longer needed.
5468         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5469         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5470         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5471         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5472         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5473         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5474         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5475         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5476         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5477         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5478         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5479         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5480         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5481         Import changes from coreutils.
5482
5483 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5484
5485         Merge from coreutils.
5486
5487         * .gdb-history: Remove; this doesn't belong here.
5488
5489         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5490         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5491         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5492
5493         * dirname.h: Include <stdbool.h>.
5494         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5495         for consistency with POSIX terminology.  All uses changed.
5496         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5497         (strip_trailing_slashes): Use bool for booleans.
5498         * stripslash.c (strip_trailing_slashes): Likewise.
5499
5500         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5501         sometimes returns a positive errno value even when it succeeds.
5502         (print_errno_message) [!LIBC]: Fall back on strerror if
5503         __strerror_r fails.
5504
5505         * path-concat.c (mempcpy): Don't define if a system header defines it.
5506         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5507         (longest_relative_suffix): New function.
5508         (path_concat): Use it.  Assume first argument is not NULL.
5509         Port to DOS.  Omit redundant separators.
5510         Report an error instead of returning NULL.
5511         Use mempcpy instead of memcpy.
5512         (xpath_concat): Remove: not declared or used.
5513
5514         * same.h: Include <stdbool.h>
5515         (same_name): Return bool, not int.
5516         * same.c (same_name): Likewise.
5517         (errno): Don't declare; we assume C89 or better now.
5518
5519         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5520         if not already defined.
5521
5522         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5523         * dup-safer.c (errno): Likewise.
5524
5525 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5526
5527         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5528         working.
5529
5530 2004-08-03  Simon Josefsson  <jas@extundo.com>
5531
5532         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5533         * progname.h: Don't include stdbool.h.
5534
5535 2004-08-02  Simon Josefsson  <jas@extundo.com>
5536
5537         * getsubopt.h: New file, with comments from Bruno Haible.
5538         * getsubopt.c: New file, from glibc, but slightly modified based on
5539         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5540
5541 2004-08-01  Simon Josefsson  <jas@extundo.com>
5542
5543         * xgetdomainname.c: Include stdlib.h, for free().
5544
5545 2004-07-16  Simon Josefsson  <jas@extundo.com>
5546
5547         * dummy.c: New file.
5548
5549 2004-07-16  Bruno Haible  <bruno@clisp.org>
5550
5551         * backupfile.h: Add extern "C" for C++.
5552         * closeout.h: Likewise.
5553         * copy-file.h: Likewise.
5554         * findprog.h: Likewise.
5555         * full-write.h: Likewise.
5556         * pathname.h: Likewise.
5557         * progname.h: Likewise.
5558         * stpcpy.h: Likewise.
5559         * stpncpy.h: Likewise.
5560         * strcase.h: Likewise.
5561         * strstr.h: Likewise.
5562         * xalloc.h: Likewise.
5563
5564         * mbswidth.h: Add extern "C" for C++.
5565         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5566
5567 2004-07-09  Simon Josefsson  <jas@extundo.com>
5568
5569         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5570         failed without this.)
5571
5572 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5573
5574         * fchown-stub.c: New file.
5575
5576 2004-06-24  Jim Meyering  <jim@meyering.net>
5577
5578         * obstack.h (obstack_base): Cast to (void *), per documentation.
5579
5580 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5581
5582         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5583
5584 2004-06-01  Jim Meyering  <jim@meyering.net>
5585
5586         * calloc.c: New file.
5587
5588 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5589
5590         * getdate.y (yylex): Allow space between sign and number.
5591         Problem reported by Dan Jacobson.
5592
5593 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5594         and  Jim Meyering  <jim@meyering.net>
5595
5596         Merge from coreutils CVS.
5597
5598         * stat-macros.h: New file, with contents from file-type.h
5599         and coreutils' system.h.
5600         * file-type.c: Include "stat-macros.h".
5601         * file-type.h (file_type): Move all macro definitions to new file,
5602         stat-macros.h.
5603
5604         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5605         Wrap old code with this conditional.
5606         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5607         function that does not dereference symlinks.
5608         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5609
5610         * xreadlink.c: Include xreadlink.h first, to catch .h file
5611         dependency problems.
5612         (xreadlink): Accept new arg SIZE, for efficiency.
5613         All decls and uses changed.
5614         * xreadlink.h: Include <stddef.h>, for size_t.
5615
5616         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5617         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5618
5619         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5620
5621 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5622
5623         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5624         macros to be defined.
5625         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5626         the allocator returns NULL because the requested size is zero.
5627
5628 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5629
5630         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5631         var.  Add comment explaining why libc still defines it.  This
5632         merges the following patch from glibc:
5633         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5634
5635 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5636
5637         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5638         present in glibc since revision 1.1 of this file.
5639         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5640         obstack_alignment_mask, obstack_alloc, obstack_base,
5641         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5642         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5643         obstack_grow0, obstack_init, obstack_int_grow,
5644         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5645         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5646         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5647         nonexistent functions.
5648
5649 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5650             Paul Eggert  <eggert@cs.ucla.edu>
5651
5652         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5653
5654 2004-05-14  Bruno Haible  <bruno@clisp.org>
5655
5656         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5657         that consists of a '.' followed by an empty digit string.
5658         Patch by Tor Lillqvist <tml@iki.fi>.
5659
5660 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5661
5662         Port obstack to the AS/400, where pointers are 16 bytes wide and
5663         you cannot cast an integer to a valid pointer.  This patch is
5664         currently waiting to be integrated into glibc; see
5665         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5666
5667         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5668         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5669         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5670         (struct obstack): temp member is now a union of a pointer and
5671         an integer, instead of an integer.  All integer uses changed.
5672         This does not affect the physical layout of struct obstack,
5673         except on hosts (like the AS/400) where the size or alignment of
5674         void * is greater than that of ptrdiff_t.
5675         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5676         __STDC__)]: Store temporary in pointer member of union, not
5677         integer member.
5678         * obstack.c: Include <stddef.h>, for offsetof.
5679         (struct fooalign): Remove; it doesn't need a name.
5680         (union fooround): Change double to long double, and add void *.
5681         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5682         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5683         not a macro.  Hence the values are always int; so remove all
5684         casts-to-int in uses.
5685
5686 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5687             Derek Price  <derek@ximbiot.com>
5688
5689         * alloca.c: Include <alloca.h>, to get our interface.
5690         * alloca_.h: Use __alloca on AIX, so that we don't have to
5691         include <alloca.h> first.  Use C89 prototype for alloca; this
5692         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5693         Use #elif for simplicity, since we can assume C89 now.
5694         Don't try to source the system alloca.h since it will not be found
5695         and to prevent recursively including its replacement.
5696         * fnmatch.c: Include <alloca.h> instead of opencoding.
5697         * regex.c: Likewise.
5698
5699 2004-05-16  Derek Price  <derek@ximbiot.com>
5700             Paul Eggert  <eggert@cs.ucla.edu>
5701
5702         getline cleanup.  This changes the getndelim2 API: both order of
5703         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5704         no delimiter).
5705
5706         * getline.c: Don't include stddef.h or stdio.h, since our
5707         interface does that.
5708         (getline): Always use getdelim, so that we don't have two
5709         copies of this code.
5710         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5711         if available.
5712         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5713         (GETNDELIM2_MAXIMUM): New macro.
5714         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5715         instead of the old practice of delim2==0.  All callers changed.
5716         Return -1 on overflow, instead of returning junk.
5717         Do not set *linesize unless allocation succeeds.
5718         * getndelim2.h: Do not include stddef.h; no longer needed, now
5719         that we include sys/types.h.
5720         * getnline.h: Likewise.
5721         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5722         (getndelim2): Reorder arguments.
5723         * getnline.c (getnline, getndelim):
5724         Don't discard the NMAX argument.
5725         (getnline): Invoke getndelim, to avoid code duplication.
5726         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5727         of (size_t) -1 by callers of the getnline family.
5728
5729 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5730
5731         * nanosleep.c (suspended): Change its type from int to
5732         sig_atomic_t volatile.
5733         (first_call): Make it private to rpl_nanosleep, and have it
5734         be zero initially as that's a bit faster.
5735         (my_usleep): Round up fractional times instead of truncating them,
5736         as this is the usual meaning for 'sleep'.
5737
5738         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5739         doesn't work.
5740         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5741         (ENOSYS): Define if not defined.
5742         (settime): Fall back on stime if it exists and settimeofday fails.
5743         But don't bother with fallbacks if a method fails with errno == EPERM.
5744
5745 2004-05-11  Jim Meyering  <jim@meyering.net>
5746
5747         Prior to this change, the save_cwd caller required read access to the
5748         current directory on most systems (ones with the fchdir function).
5749
5750         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5751         fails, try write-only, and finally, resort to using xgetcwd.
5752
5753 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5754
5755         * obstack.c, obstack.h: Import changes from libc.
5756
5757 2004-04-28  Bruno Haible  <bruno@clisp.org>
5758
5759         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5760         implicitly appends .exe to executables.
5761         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5762         accepts Windows pathnames.
5763         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5764         Cygwin like Windows, since it now accepts Windows pathnames.
5765         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5766         Cygwin like Windows, since it now accepts Windows pathnames.
5767         Reported by Derek Robert Price <derek@ximbiot.com>.
5768
5769 2004-04-20  Jim Meyering  <jim@meyering.net>
5770
5771         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5772
5773 2004-04-20  Jim Meyering  <jim@meyering.net>
5774             Bruno Haible  <bruno@clisp.org>
5775
5776         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5777         memory when realloc fails.
5778
5779 2004-04-18  Jim Meyering  <jim@meyering.net>
5780
5781         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5782         don't leak memory and do call END_UTMP_ENT.
5783
5784 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5785
5786         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5787         (CHAR_BIT): Remove, since we assume C89.
5788         Include <stdint.h> if available, as per current Autoconf CVS advice.
5789
5790 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5791
5792         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5793         not bool, to be more consistent with Unix conventions.
5794         Suggested by Bruno Haible.
5795
5796         Merge from coreutils.
5797
5798         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5799         New files.
5800
5801         * getdate.h: Include stdbool.h, and timespec.h instead of
5802         the usual <time.h> dance.
5803         (get_date): Change signature to support fractional time stamps.
5804         All callers changed.
5805         * getdate.y: Include "getdate.h" first, as we can now
5806         assume C89 and don't need to worry about 'const'.
5807         Similarly, include "unlocked-io.h" near start, not in middle.
5808         Include <limits.h>.
5809         (textint.value): Use long int rather than int.
5810         (textint.digits): Use size_t rather than int.
5811         (BILLION, LOG10_BILLION): New constants.
5812         (parser_control): New member rel_ns.  Members day_ordinal,
5813         time_zone, month, day, hour, minutes, rel_year, rel_month,
5814         rel_day, rel_hour, rel_minutes, rel_seconds
5815         are now long int, not int.  Member seconds is now struct timespec,
5816         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5817         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5818         not int.
5819         (%union.intval): Now long int, not int.
5820         New member timespec.
5821         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5822         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5823         (spec): Now is a timespec or an item list.
5824         (timespec, items): New nonterminals.
5825         (time, rel, relunit, number, get_date):
5826         Add support for fractional seconds.
5827         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5828         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5829         (to_hour): First arg is now long int, not int.
5830         (to_year): Returns long int, not int.
5831         Don't treat year -70 like 70.
5832         (tm_diff): Returns long int, not int.
5833         (lookup_word): Use bool instead of int when appropriate.
5834         (yylex): Use size_t for count, not int.
5835         Detect overflow when parsing large integer constants.
5836         Add support for fractions.
5837         (get_date): Make pointers 'const' if possible.
5838         Use more-portable code to detect integer overflow.
5839         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5840         Don't use ctime; it's not reliable if the year has >4 digits.
5841
5842         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5843         This is for compatibility with BSD.
5844
5845         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5846         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5847         From coreutils' system.h.
5848
5849         * userspec.c: Don't include "posixver.h".
5850         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5851         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5852         compatible extension.  Simplify code by removing a boolean int
5853         that was always nonzero if a string was nonnull.
5854
5855 2004-03-30  Jim Meyering  <jim@meyering.net>
5856
5857         Merge from coreutils.
5858
5859         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5860
5861         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5862         an empty input stream.
5863
5864         * readtokens.c: Include <stdbool.h>.
5865         (readtoken): Use `size_t' rather than int/long.
5866         All callers adjusted.
5867         Use `bool' rather than `int' where appropriate.
5868         Use memset rather than an explicit loop.
5869         Use x2nrealloc rather than xrealloc.
5870         Allow the use of `\0' as a delimiter.
5871         (readtokens): Likewise.
5872         * readtokens.h (readtoken, readtokens): Update prototypes.
5873
5874 2004-03-30  Bruno Haible  <bruno@clisp.org>
5875
5876         * getloadavg.c (getloadavg): Don't assume setlocale returns
5877         nonnull.
5878
5879 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5880
5881         Merge changes to getloadavg.c from coreutils and Emacs.
5882
5883         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5884         Define to an expression, not to the empty string.
5885         Include cloexec.h and xalloc.h.
5886         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5887         Use set_cloexec_flag rather than rolling our own.
5888         * cloexec.c, cloexec.h: New files.
5889
5890 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5891
5892         * getopt.h: Sync with libc CVS.
5893
5894 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5895             Bruno Haible  <bruno@clisp.org>
5896
5897         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5898         not on all platforms that have <wchar.h>.
5899         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5900
5901 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5902
5903         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5904         Sync with libc CVS.
5905         * getopt_int.h: New file, also synced from libc.
5906
5907 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5908
5909         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5910         '#if' expressions.  Unlike the code it replaces, it does not
5911         depend on (defined _SC_PAGESIZE).  However, it does depend on
5912         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5913         first reported by Jason Andrade in
5914         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5915
5916 2004-01-18  Simon Josefsson  <jas@extundo.com>
5917
5918         * strdup.h: New file.
5919         * strdup.c: Include it.
5920         * path-concat.c: Include strdup.h. Drop strdup declaration.
5921         * userspec.c: Include strdup.h. Drop strdup declaration.
5922
5923 2004-02-06  Karl Berry  <karl@gnu.org>
5924
5925         * config.charset: update from gettext 0.14.1.
5926
5927 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5928
5929         Add comments and code, prompted by suggestions from Bruno Haible
5930         for sh-quote.
5931         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5932         describing the enum quoting_style values.
5933         * quotearg.c (quotearg_alloc): New function.
5934         (quotearg_buffer_restyled): Treat lone { and } as special.
5935         Treat = as special.  Work around bug with older shells
5936         that "see" a '\' that is really the 2nd byte of a multibyte char.
5937         Quote empty string with shell_quoting_style.
5938
5939 2004-02-03  Bruno Haible  <bruno@clisp.org>
5940
5941         * pipe.h: New file, from GNU gettext.
5942         * pipe.c: New file, from GNU gettext.
5943
5944 2004-01-27  Bruno Haible  <bruno@clisp.org>
5945
5946         * execute.h: New file, from GNU gettext.
5947         * execute.c: New file, from GNU gettext.
5948         * w32spawn.h: New file, from GNU gettext.
5949
5950 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5951
5952         Exit-status fix from coreutils.
5953
5954         Use exit_failure consistently in place of EXIT_FAILURE,
5955         so that program exit statuses are consistent on failure.
5956
5957         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5958         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5959         * argmatch.h: Comment fix to match the above.
5960         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5961         Now a macro referring to exit_failure, instead of a separate
5962         variable.  Include "exitfail.h" to get it.
5963         * xstrtol.h: Include "exitfail.h".
5964         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5965
5966         * long-options.c (parse_long_options): Use prototype
5967         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5968         for clarity.
5969
5970 2004-01-21  Jim Meyering  <jim@meyering.net>
5971
5972         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5973         so as not to conflict with a different-sized __mktime_internal
5974         function in GNU libc.
5975         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5976         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5977
5978 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5979
5980         Merge from diffutils.
5981
5982         * file-type.c (file_type): Add typed memory objects.
5983         * file-type.h (S_TYPEISTMO): New macro.
5984
5985         * c-stack.h (c_stack_action): Remove argv argument.
5986         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5987         (die): Don't calculate message unless segv_action returns.
5988         (get_stack_location, min_address_from_argv, max_address_from_argv,
5989         volatile stack_base, volatile_stack_size): Remove.
5990         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5991         that every segmentation violation is a stack overflow.  (Ouch!)
5992         See Debian bug 136249 (still outstanding) for more info about why
5993         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5994
5995 2003-11-30  Bruno Haible  <bruno@clisp.org>
5996
5997         Safer stack allocation.
5998         * setenv.c: Include allocsa.h.
5999         (alloca): Remove fallback definition.
6000         (freea): Remove macro.
6001         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6002         instead of freea.
6003
6004 2003-10-17  Bruno Haible  <bruno@clisp.org>
6005
6006         * binary-io.h: Avoid warnings on Cygwin.
6007
6008 2003-12-28  Bruno Haible  <bruno@clisp.org>
6009
6010         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6011         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6012
6013 2003-11-28  Bruno Haible  <bruno@clisp.org>
6014
6015         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6016
6017 2003-11-27  Bruno Haible  <bruno@clisp.org>
6018
6019         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6020
6021 2003-11-17  Bruno Haible  <bruno@clisp.org>
6022
6023         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6024
6025 2003-11-24  Bruno Haible  <bruno@clisp.org>
6026
6027         * xallocsa.h: New file, from GNU gettext.
6028         * xallocsa.c: New file, from GNU gettext.
6029
6030 2003-11-24  Bruno Haible  <bruno@clisp.org>
6031
6032         * allocsa.h: New file, from GNU gettext.
6033         * allocsa.c: New file, from GNU gettext.
6034
6035 2003-11-24  Bruno Haible  <bruno@clisp.org>
6036
6037         * eealloc.h: New file.
6038
6039 2004-01-15  Jim Meyering  <jim@meyering.net>
6040
6041         Merge from coreutils.
6042
6043         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6044         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6045         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6046
6047         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6048         optional configure-time default.
6049
6050         * version-etc.c (version_etc_copyright): Update copyright date.
6051
6052         * xreadlink.c (xreadlink): Correct outdated comment.
6053
6054 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6055
6056         Merge from coreutils.
6057
6058         * posixver.c: Include posixver.h.
6059
6060         * same.c: Include <stdbool.h>, <limits.h>.
6061         (_POSIX_NAME_MAX): Define if not defined.
6062         (MIN): New macro.
6063         (same_name): If file names are silently truncated, report
6064         that the file names are the same if they are the same after
6065         the silent truncation.
6066
6067         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6068         conversion function.
6069         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6070         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6071         longer needed.
6072
6073 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6074
6075         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6076         with like-named macro in fnmatch.c.
6077         (EXT): Use an internal constant instead.
6078
6079         Merge fnmatch patches from glibc.
6080         * fnmatch.c (mbsinit): Remove define.
6081         Add libc_hidden_ver (__fnmatch, fnmatch).
6082         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6083         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6084
6085 2003-12-14  Karl Berry  <karl@gnu.org>
6086
6087         * config.charset: update from gettext-runtime.
6088
6089 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6090
6091         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6092         Bug reported by Alfred M. Szmidt.
6093
6094 2003-11-29  Karl Berry  <karl@gnu.org>
6095
6096         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6097
6098 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6099             Bruno Haible  <bruno@clisp.org>
6100
6101         * printf-parse.h: Don't include sys/types.h.
6102         (ARG_NONE): New macro.
6103         (char_directive): Change type of *arg_index fields to size_t.
6104         * printf-parse.c: Don't include sys/types.h.
6105         (SSIZE_MAX): Remove macro.
6106         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6107         Remove unnecessary overflow check.
6108         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6109         fields.
6110
6111 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6112
6113         * alloca.c: Remove dependency on xalloc module.
6114         (xalloc_die): Remove.
6115         (memory_full) [!defined emacs]: New macro.
6116         [!defined emacs]: Don't include xalloc.h.
6117         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6118         address arithmetic overflows.  Change datatypes a bit to avoid
6119         unnecessary casts.
6120
6121 2003-11-22  Jim Meyering  <jim@meyering.net>
6122
6123         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6124
6125 2003-11-17  Bruno Haible  <bruno@clisp.org>
6126
6127         * vasnprintf.c (alloca): Remove fallback definition.
6128         (freea): Remove definition.
6129         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6130         Reported by Paul Eggert.
6131
6132 2003-11-17  Jim Meyering  <jim@meyering.net>
6133
6134         On systems without utime and without a utimes function capable of
6135         dealing with a NULL struct utimbuf* argument, this utime replacement
6136         could -- in unusual circumstances -- leak a file descriptor.
6137         * utime.c: Include <unistd.h> and <errno.h>.
6138         (utime_null): Be sure to close `fd' and to preserve errno.
6139         Reported by Geoff Collyer via Arnold Robbins.
6140
6141 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6142             Bruno Haible  <bruno@clisp.org>
6143
6144         Protect against address arithmetic overflow.
6145         * printf-args.h: Include stddef.h.
6146         (arguments): Change type of field 'count' to size_t.
6147         * printf-args.c (printf_fetchargs): Use size_t instead of
6148         'unsigned int' where appropriate.
6149         * printf-parse.h: Include sys/types.h.
6150         (char_directive): Change type of *arg_index fields to ssize_t.
6151         (char_directives): Change type of fields 'count', max_*_length to
6152         size_t.
6153         * printf-parse.c: Include sys/types.h and xsize.h.
6154         (SSIZE_MAX): Define fallback value.
6155         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6156         instead of 'int' where appropriate. Check a_allocated, d_allocated
6157         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6158         * vasnprintf.c: Include xsize.h.
6159         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6160         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6161         overflow. Avoid wraparound when converting a width or precision from
6162         decimal to binary.
6163
6164 2003-11-16  Bruno Haible  <bruno@clisp.org>
6165
6166         Update from GNU gettext.
6167         * printf-parse.c: Generalize to it can be compiled for wide strings.
6168         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6169         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6170         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6171         SNPRINTF): New macros.
6172         Don't include <alloca.h> if the file is used inside libintl.
6173         (local_wcslen): New function, for Solaris 2.5.1.
6174         (VASNPRINTF): Use it instead of wcslen.
6175
6176 2003-11-16  Bruno Haible  <bruno@clisp.org>
6177
6178         * xsize.h (xmax): New function.
6179         (xsum, xsum3, xsum4): Declare as "pure" functions.
6180
6181 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6182
6183         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6184         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6185         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6186         heuristic is just as accurate as far as we know, and it removes a
6187         dependency on size_max.m4 and ptrdiff_max.m4.
6188
6189 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6190
6191         * xstrtol.c (__xstrtol): Remove "break" immediately after
6192         "return", to pacify some unknown compiler.  Problem reported
6193         by Joerg Schilling.
6194
6195 2003-11-11  Bruno Haible  <bruno@clisp.org>
6196
6197         * xsize.h (SIZE_MAX): Remove fallback definition.
6198         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6199         defined.
6200
6201 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6202
6203         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6204         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6205         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6206         From Bruno Haible.
6207         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6208         not (size_t) -1, since it's defined here.
6209
6210 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6211
6212         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6213         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6214         Reject sizes of exactly SIZE_MAX bytes.
6215         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6216         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6217
6218 2003-11-05  Bruno Haible  <bruno@clisp.org>
6219
6220         * xsize.h: Include limits.h, to avoid a possible collision with
6221         SIZE_MAX defined in <limits.h> on Solaris.
6222
6223 2003-11-04  Bruno Haible  <bruno@clisp.org>
6224
6225         * xsize.h: New file.
6226         * linebreak.c: Include xsize.h.
6227         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6228         argument for overflow.
6229         Suggested by Paul Eggert.
6230
6231 2003-10-31  Bruno Haible  <bruno@clisp.org>
6232
6233         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6234         to avoid (extremely rare) race condition.
6235         Suggested by Paul Eggert.
6236
6237 2003-11-03  Jim Meyering  <jim@meyering.net>
6238
6239         * userspec.c: Include "userspec.h".
6240         * userspec.h: New file.
6241
6242 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6243
6244         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6245         * mountlist.c (SIZE_MAX): Define if not defined already.
6246         (read_filesystem_list): Set and use me_type_malloced.
6247         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6248         whatever the type happens to be), for brevity and consistency.
6249         Check for size calculation overflow on Alphas running OSF/1.
6250
6251 2003-10-31  Jim Meyering  <jim@meyering.net>
6252
6253         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6254
6255         * linebuffer.c: Include <string.h> for declaration of memset.
6256
6257 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6258             Bruno Haible  <bruno@clisp.org>
6259
6260         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6261         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6262
6263 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6264
6265         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6266         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6267         no longer needed.
6268         * quotearg.c (quotearg_n_options): Use it.
6269         * group-member.c: Include <stdbool.h>.
6270         (free_group_info): Arg is now const *; don't free arg.
6271         (get_group_info): Now returns bool and accepts struct group_info *,
6272         rather than returning a malloc'ed struct group_info *.
6273         All uses changed.  Check for overflow in internal size calculation.
6274
6275         * getusershell.c (readname): Simplify the code by using x2nrealloc
6276         rather than xmalloc/xrealloc.
6277         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6278         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6279         conformance bug: the old code used a pointer after freeing the
6280         storage that it addressed.
6281         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6282         rather than doing it by hand.
6283         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6284         the buffer preserved.  Use free and xmalloc instead.
6285         * quotearg.c (quotearg_n_options): Likewise.
6286         Use a simpler test for size overflow.  Don't use xalloc_oversized
6287         because unsigned int might be wider than size_t (!); this suggests
6288         that we should switch from unsigned int to size_t for slot numbers.
6289
6290 2003-10-27  Bruno Haible  <bruno@clisp.org>
6291
6292         * stdbool_.h: Better support for BeOS.
6293
6294 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6295
6296         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6297         to allocate the returned structure.  Do not allocate a subarray,
6298         as x2nrealloc will do that.
6299         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6300         instead of xnrealloc.
6301         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6302
6303 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6304
6305         * xalloc.h (xalloc_oversized): New static inline function, for
6306         callers that want to do their own size-overflow checking.  Include
6307         <stdbool.h>, since xalloc_oversized returns bool.
6308         * xalloc.c (array_size_overflow): Remove.  All callers changed
6309         to use xalloc_oversized.
6310
6311         Add two functions x2realloc, x2nrealloc, for programs that grow
6312         arrays dynamically by doubling their sizes.
6313         * xalloc.h (x2realloc, x2nrealloc): New decls.
6314         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6315         New functions.
6316
6317         Port to C99 semantics for 'inline' of external functions.
6318         Bug reported by Bruno Haible.
6319         * xmalloc.c (xnmalloc_inline): New static inline function,
6320         with the old contents of xnmalloc.
6321         (xnmalloc, xmalloc): Use it.
6322         (xnrealloc_inline): New static inline function,
6323         with the old contents of xnrealloc.
6324         (xnrealloc, xrealloc): Use it.
6325
6326         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6327
6328 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6329
6330         Fix several address-calculation bugs in the hash modules,
6331         plus some minor code cleanup.
6332
6333         * hash.h: Include <stdbool.h>, for bool.
6334         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6335         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6336         hash_get_n_entries, hash_get_max_bucket_length,
6337         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6338         hash_rehash): Use size_t rather than unsigned.
6339         * hash.c (struct hash_table, hash_get_n_buckets,
6340         hash_get_n_buckets_used, hash_get_n_entries,
6341         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6342         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6343         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6344         Likewise.
6345         (SIZE_MAX): Define if not defined.
6346         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6347         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6348         hash_print):
6349         Use const * when possible.
6350         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6351         (check_tuning): Fix bug: if tuning parameters were very close to
6352         0 or 1, rounding errors could have caused subscript violations.
6353         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6354         (hash_initialize): Add 'fail:' label
6355         to free table and return NULL, and use it to simplify code.
6356         Use calloc rather than clearing the storage ourself.
6357         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6358         buffer size calculations.
6359         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6360         Include <stddef.h>, for size_t.
6361         * hash-pjw.c (hash_pjw): Likewise.
6362         Switch to method described by Bruno Haible.
6363         Include <limits.h>, for CHAR_BIT.
6364         (SIZE_BITS): New macro.
6365
6366 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6367
6368         * getndelim2.c (getndelim2): When size calculation overflows,
6369         ceiling the allocation at NMAX bytes rather than silently
6370         discarding input bytes before NMAX is reached.  This makes
6371         a difference only if NMAX exceeds SIZE_MAX / 2.
6372
6373         * obstack.c: Merge from glibc.
6374         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6375         Add libc_hidden_def (_obstack_newchunk).
6376         (_obstack_free) [! defined _LIBC]: Remove.
6377         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6378         a clone of the function body.
6379         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6380         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6381
6382         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6383         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6384         arg to memcpy.
6385
6386         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6387         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6388         Don't use lvalue casts, as GCC plans to remove support for them
6389         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6390         was also present in the non-GCC version, indicating that this
6391         code had always been buggy and had never been widely used.
6392         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6393         Use the fast variant of each macro, rather than copying the
6394         definiens of the fast variant; that way, we'll be more likely to
6395         catch future bugs in the fast variants.
6396
6397 2003-10-20  Bruno Haible  <bruno@clisp.org>
6398
6399         * wait-process.h: New file, from GNU gettext.
6400         * wait-process.c: New file, from GNU gettext.
6401
6402 2003-10-19  Jim Meyering  <jim@meyering.net>
6403
6404         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6405
6406 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6407
6408         * getgroups.c: Include <errno.h>, <stdlib.h>.
6409         (getgroups): First arg is int, not size_t.
6410         Don't let 'free' mangle errno.
6411
6412 2003-10-16  Jim Meyering  <jim@meyering.net>
6413
6414         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6415
6416 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6417
6418         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6419         (SIZE_MAX): Remove.
6420         (new_exclude, add_exclude_file): Initial size no longer needs to
6421         be a power of 2.
6422         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6423         our own address arithmetic overflow checking.
6424
6425         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6426         (fnmatch): Do not alloca more than 2000 wide characters;
6427         instead, use malloc for large buffers.
6428         Check for address arithmetic overflow, and return -1
6429         with errno set to ENOMEM in that case.
6430         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6431         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6432         instead, return -1.  Check for address arithmetic overflow.
6433
6434 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6435
6436         Handle invalid suffixes and overflow independently, so that
6437         callers can treat them independently as needed.  Fix some bugs in
6438         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6439         suffix for a human-readable blocksize.  The major caller-visible
6440         change is the addition of a new
6441         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6442         that both overflow and suffix chars were found.
6443
6444         * human.c (humblock): Don't check separately for invalid suffix
6445         char; that is xstrtoumax's job (now that its bug is fixed).
6446         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6447         INTMAX_MAX]: New macros.
6448         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6449         TYPE_MAXIMUM): New macros.
6450         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6451         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6452         if overflow occurs, as it's what __strtol does and it's more useful
6453         in practice.
6454         (__xstrtol): If __strtol reports some error other than ERANGE,
6455         reflect it to the caller as LONGINT_INVALID.  If it reports
6456         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6457         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6458         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6459         value.
6460         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6461         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6462         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6463         [defined UINTMAX_MAX]: New macros.
6464
6465 2003-10-14  Bruno Haible  <bruno@clisp.org>
6466
6467         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6468         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6469         Also use volatile where needed.
6470
6471 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6472
6473         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6474         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6475         and define in terms of the other primitives.
6476         * xmalloc.c: Include stdbool.h; do not include exit.h.
6477         (SIZE_MAX): Define if not already defined.
6478         (array_size_overflow): New function.
6479         (xalloc_die): Abort instead of exiting if 'error' returns.
6480         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6481         (xmalloc, xrealloc): Use them.
6482         (xcalloc): Check for address arithmetic overflow.
6483         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6484         a bit faster than strcpy.
6485
6486 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6487
6488         Merge getpass from libc, plus a few fixes.
6489
6490         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6491         Include <stdbool.h>.
6492         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6493         __fsetlocking to empty.
6494         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6495         do include <bits/libc-lock.h>.
6496         Do not include <fcntl.h>; not needed.
6497         [_LIBC]: Include <wchar.h>.
6498         (NOTCANCEL_MODE): New macro.
6499         (flockfile, funlockfile) [_LIBC]: New macros.
6500         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6501         [!_LIBC]: New macros.
6502         (call_fclose): New function.
6503         (getpass): Use it.  Save tty stream separately; this simplifies the
6504         code and makes it more reliable if stdin happens to equal stdout.
6505         Invoke __fsetlocking on tty.
6506         Handle thread cancellation if needed.
6507         Namespace cleanup (use __tcgetattr, __getline).
6508         Use bool for Booleans.
6509         [USE_IN_LIBIO]: Handle wide streams.
6510         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6511         stream might go where.
6512
6513         * unlocked-io.h: Include <stdio.h>, so that the caller
6514         doesn't have to include <stdio.h> before us.
6515         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6516         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6517         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6518         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6519         if not declared, so that we can use getpass.c code from libc without
6520         rewriting it.
6521         (flockfile, ftrylockfile, funlockfile): New macros.
6522
6523 2003-10-06  Bruno Haible  <bruno@clisp.org>
6524
6525         * version-etc-2.h: Remove file.
6526         * version-etc-2.c: Remove file.
6527
6528 2003-09-25  Jim Meyering  <jim@meyering.net>
6529             Bruno Haible  <bruno@clisp.org>
6530
6531         This lets translators provide better translations for the
6532         "Written by ..." part of --version output.
6533         * version-etc.h: Include stdarg.h.
6534         (version_etc_copyright): Declare as readonly.
6535         (version_etc): Make this function variadic with a NULL-terminated list
6536         of author name strings.
6537         (version_etc_va): New declaration.
6538         * version-etc.c: Include stdarg.h, stdlib.h.
6539         (version_etc_copyright): Declare as readonly.
6540         (version_etc_va): New function. Provide a different translatable string
6541         for each possible number of authors < 10. Abbreviate when there are 10
6542         authors or more.
6543         (version_etc): Make this function variadic. Call version_etc_va.
6544         Suggestion from Gary V. Vaughan.
6545
6546         * long-options.h (parse_long_options): Change prototype: the authors
6547         string is moved to the end and becomes variadic.
6548         * long-options.c: Include stdarg.h.
6549         (parse_long_options): Make this function variadic, too.
6550         Call version_etc_va, not version_etc.
6551
6552 2003-10-06  Bruno Haible  <bruno@clisp.org>
6553
6554         * fatal-signal.h: New file, from GNU gettext.
6555         * fatal-signal.c: New file, from GNU gettext.
6556
6557 2003-10-04  Karl Berry  <karl@gnu.org>
6558
6559         * argp*: update from libc.
6560
6561 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6562
6563         * getpass.c (getpass): Use a no-op fseek when switching from input to
6564         output mode on the same stream.
6565
6566 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6567
6568         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6569         Fix arg typo in previous patch.
6570
6571 2003-09-28  Jim Meyering  <jim@meyering.net>
6572
6573         * error.c: Correct cpp indentation.
6574
6575 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6576
6577         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6578         Omit the special code that used __typeof__, since we worry that
6579         it could be more trouble than it's worth.  See:
6580         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6581         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6582
6583         * free.c: New file.
6584
6585 2003-09-26  Jim Meyering  <jim@meyering.net>
6586
6587         * error.c (error_tail): Move some declarations
6588         into inner scope where the local variables are used.
6589
6590 2003-09-26  Bruno Haible  <bruno@clisp.org>
6591
6592         * stpncpy.h (gnu_stpncpy): New declaration.
6593         (stpncpy): Define as alias for gnu_stpncpy.
6594         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6595
6596 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6597
6598         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6599         (error_tail): Do not loop, reallocating temporary buffer, since
6600         the output cannot contain more wide characters than the input
6601         contains bytes, the size must be big enough already.  This avoids
6602         one potential size overflow calculation.  Check for size overflow
6603         when calculating temporary buffer size.  Free temporary buffer
6604         when done, if it was allocated with malloc; this plugs a memory
6605         leak.  Remove casts from void * to pointers, that are no longer
6606         needed now that we're assuming C89 or better.
6607
6608         Merge error changes from glibc.
6609
6610         * error.c, error.h: Update copyright notice header to match glibc.
6611         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6612         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6613         Disable cancellation while printing error.
6614         * error.h: Prepend __ to parameter names.
6615
6616 2003-09-25  Karl Berry  <karl@gnu.org>
6617
6618         * argp-fmtstream.c, argp-help.c: update from libc.
6619
6620 2003-09-25  Bruno Haible  <bruno@clisp.org>
6621
6622         * version-etc-2.h: New file, from version-etc.h with modifications.
6623         * version-etc-2.c: New file, from version-etc.c with modifications.
6624
6625 2003-09-25  Simon Josefsson  <jas@extundo.com>
6626
6627         * xgetdomainname.h: New file.
6628         * xgetdomainname.c: New file.
6629
6630 2003-09-25  Simon Josefsson  <jas@extundo.com>
6631             Bruno Haible  <bruno@clisp.org>
6632
6633         * getdomainname.h: New file.
6634         * getdomainname.c: New file.
6635
6636 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6637
6638         * linebuffer.c (freebuffer): Don't free the argument, just
6639         the buffer associated with the argument.  Bug reported by
6640         Simon Josefsson.
6641
6642 2003-09-19  Karl Berry  <karl@gnu.org>
6643
6644         * argp.h: update from libc.
6645
6646 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6647
6648         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6649         input error, instead of returning NULL the next time we are called
6650         (and therefore losing track of errno).
6651
6652 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6653
6654         * getndelim2.c (getndelim2): Don't trash errno when a read
6655         fails, so that the caller gets the proper errno.
6656
6657         * readutmp.c (read_utmp): Likewise.
6658         Check for fstat error.  Close stream and free storage
6659         when failing.
6660
6661 2003-09-14  Bruno Haible  <bruno@clisp.org>
6662
6663         * fwriteerror.h: New file.
6664         * fwriteerror.c: New file.
6665
6666 2003-09-14  Jim Meyering  <jim@meyering.net>
6667
6668         * getloadavg.c: Correct cpp indentation.
6669         * strdup.c: Likewise.
6670         * vasnprintf.c: Likewise.
6671
6672 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6673
6674         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6675         * obstack.c [!defined _LIBC]: Likewise.
6676         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6677         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6678         * exitfail.c: Don't include stdlib.h; no longer needed.
6679
6680         More changes to assume C89 or better.
6681
6682         * error.c (error_tail): Assume vprintf.
6683
6684         * argmatch.c (getenv): Remove decl.
6685         * progreloc.c (get_full_program_name): Define via prototype.
6686         * setenv.c (clearenv): Likewise.
6687         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6688         needed.
6689         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6690         (malloc, memcpy): Remove decls.
6691         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6692         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6693         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6694         (memcpy): Remove macro.
6695         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6696         (__P): Remove.  All uses removed.
6697         (PTR): Remove.  All uses changed to void *.
6698         (CHAR_BIT, NULL): Remove.
6699         (spaces, zeros, memset_space, memset_zero)
6700         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6701         Remove.
6702         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6703         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6704         Define with prototype.
6705         Remove now-unnecessary prototype decl.
6706         (extra_args_spec): Assume ANSI C.  All uses changed.
6707         (extra_args_spec_iso): Remove.
6708         (my_strftime, emacs_strftimeu): Define via prototype.
6709         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6710         unconditionally.
6711         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6712         * strtoimax.c: Include <stdlib.h> unconditionally.
6713         (strtoul, strtol): Remove decls.
6714         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6715         LONG_MAX): Remove.
6716         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6717         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6718         (LOCALE_PARAM_PROTO): New macro.
6719         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6720         (INTERNAL (strtol), strtol): Define with a prototype.
6721         (PARAMS): Remove.  All uses removed.
6722         * tempname.c: Include <string.h> unconditionally.
6723         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6724         * xgethostname.c (main): Define with a prototype.
6725         * xmalloc.c: Include "xalloc.h" first, to check interface.
6726         Include <stdlib.h> unconditionally.
6727         (calloc, malloc, realloc, free): Remove decls.
6728         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6729         Include <stdlib.h> unconditionally.  Sort include file names.
6730         (strtod): Remove.
6731         (xstrtod): Define with a prototype.
6732         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6733         (strtol, strtoul): Remove decls.
6734
6735 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6736
6737         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6738         Include <stdlib.h>, <string.h> unconditionally.
6739         Remove now-unnecessary cast to char *.
6740         * strnlen.c: Include <string.h> unconditionally.
6741         * yesno.c (yesno): Define with a prototype.
6742
6743 2003-09-10  Bruno Haible  <bruno@clisp.org>
6744
6745         * strcspn.c: Include <string.h> unconditionally.
6746         * strpbrk.c: Include <string.h> unconditionally.
6747         * strstr.c: Include <string.h> unconditionally.
6748         * unicodeio.c: Include <string.h> unconditionally.
6749         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6750         * unsetenv.c: Likewise.
6751         * xreadlink.c: Include <stdlib.h> unconditionally.
6752         * yesno.c: Include <stdlib.h> unconditionally.
6753         (rpmatch): Add prototype.
6754
6755 2003-09-10  Jim Meyering  <jim@meyering.net>
6756
6757         * error.c: Correct indentation of cpp directives.
6758
6759 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6760
6761         More K&R removal.
6762
6763         * acosl.c (main): Use a prototype.
6764         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6765         tanl.c: Likewise.
6766
6767         * getloadavg.c (getloadavg, main): Define via prototypes.
6768
6769         * getopt.h (struct option.name): Assume C89, and use 'const'.
6770         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6771         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6772         with a prototype.
6773         * getopt.c (const): Remove macro.
6774         Include <string.h> unconditionally.
6775         (my_index): Remove; all uses changed to strchr.
6776         (strlen): Remove decl.
6777         (exchange): Remove forward decl; no longer needed.
6778         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6779         Define with prototype.
6780         * getopt1.c (const): Remove macro.
6781         (getopt_long, getopt_long_only, main): Define with prototype.
6782
6783         * getugroups.c: Include <string.h> unconditionally.
6784
6785         * getusershell.c: Include <stdlib.h> unconditionally.
6786         (getusershell, setusershell, endusershell, readname, main):
6787         Define with prototypes.
6788
6789         * group-member.c: Include group-member.h first.
6790         Include <stdlib.h> unconditionally.
6791
6792         * hard-locale.c: Include hard-locale.h first.
6793         Include <stdlib.h>, <string.h> unconditionally.
6794
6795         * hash.c (free, malloc): Remove decls.
6796         Include <stdlib.h> unconditionally.
6797
6798         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6799         (getenv): Do not declare.
6800
6801         * idcache.c: Include <string.h> unconditionally.
6802
6803         * long-options.c: Include long-options.h first, to test interface.
6804         Include <stdlib.h> unconditionally.
6805
6806         * makepath.c: Include makepath.h first, to test interface.
6807         Include <stdlib.h> and <string.h> unconditionally.
6808
6809         * linebuffer.c: Include <stdlib.h>.
6810         (free): Remove decl.
6811
6812         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6813         rpl_malloc returns void *, not char *.
6814         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6815
6816         * md5.h: Include <limits.h> unconditionally.
6817         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6818         (__P): Remove; all uses removed.
6819         * md5.c: Include "md5.h" first.
6820         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6821         md5_buffer, md5_process_bytes, md5_process_block):
6822         Define with prototypes.
6823         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6824         * sha.c: Include "sha.h" first.
6825         Include <stdlib.h>, <string.h> unconditionally.
6826
6827         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6828         * memcmp.c (__ptr_t): Likewise.
6829         * memrchr.c (__ptr_t): Likewise.
6830         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6831         Include <string.h> unconditionally.
6832         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6833         * memchr.c: Include <stdlib.h> unconditionally.
6834         * memchr.c (LONG_MAX): Remove.
6835         * memrchr.c (LONG_MAX): Likewise.
6836         * memchr.c (__memchr): Define via a prototype.
6837         * memrchr.c (__memrchr): Likewise.
6838         * memcmp.c (__P): Remove, and remove all uses.
6839         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6840         Remove forward decls; no longer needed.
6841         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6842         Use types required by C89 in prototype.
6843
6844         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6845         * savedir.c: Likewise.
6846         * mkdir.c (free): Remove decl.
6847         * rmdir.c (rmdir): Define with a prototype.
6848         * savedir.c: Include savedir.h first, to test interface.
6849
6850         * mktime.c (STDC_HEADERS): Remove.
6851         Include <stdlib.h>, <string.h> unconditionally.
6852
6853         * modechange.c: Include <stdlib.h> unconditionally.
6854         (malloc): Remove decl.
6855
6856         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6857         (free): Remove decl.
6858
6859         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6860         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6861         (This type really should be intptr_t, but that's a C99ism.)
6862         (_obstack_memcpy): Remove: all uses changed to memcpy.
6863         Include <string.h> unconditionally.
6864         (struct obstack): Assume __STDC__ for types of members
6865         chunkfun, freefun, extra_arg.
6866         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6867         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6868         obstack_begin, obstack_specify_allocation,
6869         obstack_specify_allocation_with_arg, obstack_chunkfun,
6870         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6871         Remove unprototyped decls and the macros that use them.
6872         * obstack.c (POINTER): Remove.  All uses changed to void *.
6873         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6874         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6875         (defined __STDC__ && __STDC__)]:
6876         Remove nonprototyped code.
6877         Include <stdlib.h> unconditionally.
6878         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6879         _obstack_allocated_p, _obstack_free, obstack_free,
6880         _obstack_memory_used, print_and_abort):
6881         Define using prototypes.
6882         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6883         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6884         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6885         obstack_next_free, obstack_object_size, obstack_room) [0]:
6886         Remove unused, unprototyped code.
6887
6888         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6889
6890         * physmem.c (physmem_total, physmem_available, main): Define
6891         with prototypes.
6892
6893         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6894         (main): Define with a prototype.
6895
6896         * posixver.c (getenv): Remove decl.
6897
6898         * putenv.c (malloc): Returns void *, not char *.
6899         Include <string.h> unconditionally.
6900         (strchr, memcpy, NULL): Do not define.
6901
6902         * readtokens.c: Include readtokens.h first, to test interface.
6903         Include <stdlib.h>, <string.h> unconditionally.
6904         (init_tokenbuffer): Define with a prototype.
6905
6906         * regex.c (PARAMS): Remove.  All uses removed.
6907         All uses of _RE_ARGS removed, too.
6908         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6909         unconditionally.
6910         (bzero): Assume memset exists.
6911         (memcmp, memcpy, NULL): Remove.
6912         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6913         char, or assignments to local vars of type signed char.
6914         (init_syntax_once, PREFIX(extract_number_and_incr),
6915         PREFIX(print_partial_compiled_pattern),
6916         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6917         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6918         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6919         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6920         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6921         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6922         wcs_compile_range, byte_compile_range, truncate_wchar,
6923         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6924         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6925         count_mbs_length, wcs_re_match_2_internal,
6926         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6927         PREFIX(alt_match_null_string_p),
6928         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6929         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6930         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6931         now-unnecessary declaration, if any.
6932         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6933         regcomp, regexec):
6934         Remove now-unnecessary casts among pointer types.
6935         * regex.h (_RE_ARGS): Remove.  All uses removed.
6936
6937         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6938         (free): Remove decl.
6939
6940         * rpmatch.c: Include <stdlib.h> unconditionally.
6941
6942         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6943         (free): Remove decl.
6944
6945         * save-cwd.c: Include <stdlib.h> unconditionally.
6946         * xgetcwd.c: Likewise.
6947
6948         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6949         (free): Remove decl.
6950
6951         * strchrnul.c (strchrnul): Define with a prototype.
6952         Fix bug: c_in was not converted to char before searching.
6953
6954         The following changes are not K&R related:
6955
6956         * group-member.h: Include <sys/types.h>, so that this file is
6957         self-contained.
6958         * makepath.h: Likewise.
6959
6960         * getusershell.c (readname, default_index, line_size, readname):
6961         Use size_t, not int, for sizes.
6962         (readname): If the size overflows, report an error instead of
6963         looping forever.
6964
6965 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6966
6967         * getndelim2.c: Assume stdlib.h per the C89 spec.
6968
6969 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6970
6971         Assume C89 or better; remove K&R cruft.
6972         A few of these changes were first proposed by Derek Robert Price
6973         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6974
6975         * addext.c: Include <string.h> unconditionally.
6976         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6977         Don't declare getenv or malloc.
6978
6979         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6980         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6981         (NULL): Remove.
6982         (find_stack_direction, alloca): Use prototypes.
6983
6984         * atexit.c (atexit): Define using a prototype.
6985
6986         * basename.c, dirname.c, stripslash.c:
6987         Include <string.h> unconditionally.
6988
6989         * bcopy.c: Include <stddef.h>.
6990         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6991
6992         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6993
6994         * error.h (error, error_at_line, error_print_progname)
6995         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6996         * error.c: Include error.h first, to check interface.
6997         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6998         (VA_START): Remove; all uses changeed to va_start.
6999         (exit, strerror): Remove decls.
7000         (error_print_progname): Prototype uncondionally.
7001         Don't include <errno.h>; no longer needed.
7002         (private_strerror): Remove.
7003         (error_tail): Always define.
7004         (error, error_at_line): Assume C89 or better; always use prototypes.
7005         * fatal.c: Include "fatal.h" first, to test interface.
7006         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7007         (VA_START): Remove; all uses changed to va_start.
7008         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7009         this case.
7010         (exit): Remove decl.
7011         (fatal): Prototype unconditionally.  Assume va_start works.
7012         Abort at end, to pacify gcc.
7013
7014         * euidaccess.c (main): Define with a prototype.
7015
7016         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7017
7018         * exitfail.c: Include <stdlib.h> unconditionally.
7019
7020         * fnmatch_.h (__P): Remove.  All uses changed to assume
7021         prototypes.
7022         * fnmatch.c: Include fnmatch.h first, to test interface.
7023         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7024         (getenv): Remove decl.
7025         (fnmatch): Define using a prototype.
7026         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7027         (FCT): Define using a prototype.
7028
7029         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7030
7031         * gethostname.c: Include <stddef.h>.
7032         (gethostname): Define with prototype.  Length is size_t, not int.
7033
7034 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7035
7036         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7037         getversion.c should have been removed then, but was accidentally
7038         preserved.
7039
7040         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7041         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7042
7043 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7044
7045         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7046         copy_tm_result.  Bug reported by Simon Josefsson in
7047         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7048
7049 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7050
7051         * time_r.c, time_r.h: New files.
7052
7053         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7054         __localtime_r.
7055         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7056         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7057
7058         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7059         __gmtime_r.
7060         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7061         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7062         Include <time_r.h>.
7063
7064         * timegm.c: Switch to glibc implementation, with the following changes:
7065         [defined HAVE_CONFIG_H]: Include <config.h>.
7066         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7067         (__mktime_internal) [!defined _LIBC]: New decl.
7068         (__gmtime_r) [!defined _LIBC]: New macro and function.
7069         (timegm): Use a prototype, since gnulib assumes C89.
7070         Do not bother declaring tmp to be const, as it's not really usefu.
7071         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7072         (timegm): Declare only if HAVE_DECL_TIMEGM.
7073
7074 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7075
7076         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7077         Bug reported by Lute Kamstra in
7078         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7079
7080         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7081         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7082         course with correspondingly smaller numbers for tomorrow and
7083         yesterday.  From Tadayoshi Funaba.  Originally installed into
7084         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7085         coreutils merge?).
7086
7087 2003-08-31  Simon Josefsson  <jas@extundo.com>
7088
7089         * timegm.h: New file.
7090         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7091
7092 2003-08-31  Karl Berry  <karl@gnu.org>
7093
7094         * argp.h: update from libc.
7095
7096 2003-08-28  Bruno Haible  <bruno@clisp.org>
7097
7098         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7099         warning on QNX, which defines O_BINARY to 000000.
7100
7101 2003-08-24  Bruno Haible  <bruno@clisp.org>
7102
7103         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7104         MSVC7 <stdio.h> is included later.
7105
7106 2003-08-20  Bruno Haible  <bruno@clisp.org>
7107
7108         * progname.h: New file, from GNU gettext.
7109         * progname.c: New file, from GNU gettext.
7110         * progreloc.c: New file, from GNU gettext.
7111
7112 2003-08-19  Bruno Haible  <bruno@clisp.org>
7113
7114         * xstrdup.c: Assume <string.h> exists.
7115
7116 2003-08-18  Jim Meyering  <jim@meyering.net>
7117
7118         * setenv.h: Indent nested cpp directive.
7119         * vasnprintf.c: Remove trailing blanks.
7120
7121 2003-08-17  Simon Josefsson  <jas@extundo.com>
7122             Bruno Haible  <bruno@clisp.org>
7123
7124         * xstrndup.h: New file.
7125         * xstrndup.c: New file.
7126
7127 2003-08-17  Bruno Haible  <bruno@clisp.org>
7128
7129         * strndup.h: New file.
7130
7131 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7132
7133         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7134         space, undoing this 2003-08-12 change:
7135         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7136
7137 2003-08-16  Jim Meyering  <jim@meyering.net>
7138
7139         Merge from coreutils.
7140         * xstrtoimax.c: #else #if -> #elif.
7141         * xstrtoumax.c: Likewise.
7142
7143 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7144
7145         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7146         rather than tab, after '#' in shell-script copyright notices.
7147         Suggested by Bruno Haible.
7148
7149 2003-08-15  Jim Meyering  <jim@meyering.net>
7150         and Paul Eggert  <eggert@twinsun.com>
7151
7152         Merge from coreutils.
7153         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7154         member but strut utmpx does not.  Needed for AIX 4.3.3.
7155         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7156
7157 2003-08-15  Jim Meyering  <jim@meyering.net>
7158
7159         Merge from coreutils.
7160         * xgethostname.c: Include <stdlib.h>.
7161         (xghostname): Don't exit for anything other than memory-related
7162         failure; just return NULL.
7163         * userspec.c: Include "posixver.h".
7164         (parse_user_spec): Accept `.' as a separator only
7165         in pre-POSIX-200112 mode.
7166         * strtoimax.c: Use #elif rather than #else #if.
7167         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7168         Remove function, now that we can rely on a working tzset function.
7169         [!_LIBC]: Ensure that the required autoconf test has been run.
7170         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7171         Use underlying_strftime for %r.
7172         * sha.c: Merge in some clean-up and optimization changes from glibc.
7173         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7174         Ensure that it is a multiple of 64.
7175         Rearrange loop exit tests so as to avoid performing an
7176         additional fread after encountering an error or EOF.
7177         * realloc.c: Update copyright date.
7178
7179 2003-08-14  Jim Meyering  <jim@meyering.net>
7180
7181         Merge from coreutils.
7182         * obstack.h: Whitespace changes.
7183         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7184         and xcalloc return values.
7185         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7186         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7187         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7188         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7189         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7190         error from mntctl.
7191         Use mntctl's return value to drive the entry-processing loop, since
7192         we can't rely on the value of the vmt_length member in the last
7193         entry.  On some systems doing so could result in exhausting
7194         virtual memory.  Based in part on a patch from Mike Jetzer.
7195
7196 2003-08-14  Jim Meyering  <jim@meyering.net>
7197         and Paul Eggert  <eggert@twinsun.com>
7198
7199         Merges from coreutils, plus other fixes.
7200         * physmem.c: Merge in portability changes from gcc/libiberty
7201         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7202         for credits and details.  Thanks to Kaveh Ghazi for helping
7203         to keep these files in sync.
7204         (ARRAY_SIZE): Define it.
7205         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7206         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7207         (memcasecmp): Don't assume size_t fits in unsigned int.
7208         Remove casts and duplicate code.
7209         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7210         (memcpy): Remove definition.
7211         Merge in some clean-up and optimization changes from glibc.
7212         [BLOCKSIZE]: Move definition to top of file.
7213         Ensure that it is a multiple of 64.
7214         Rearrange loop exit tests so as to avoid performing an
7215         additional fread after encountering an error or EOF.
7216         * md5.h (md5_uintptr): Define.
7217         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7218         return to the initial working directory.  Preserve errno
7219         for caller.
7220         * idcache.c: Include "xalloc.h".
7221         (xmalloc, xrealloc): Remove decls.
7222         (getuser): Remove casts no longer required in C89.
7223         * human.c: Include stdio.h, for sprintf.
7224         * group-member.c: Include "xalloc.h".
7225         (xmalloc, xrealloc): Remove decls.
7226         (get_group_info): Remove casts no longer required in C89.
7227         * getusershell.c (readname): Remove casts no longer required in C89.
7228         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7229         * getline.c: Whitespace fix, from coreutils.
7230
7231 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7232
7233         * exclude.c: Include <ctype.h>
7234         (IN_CTYPE_DOMAIN): New macro.
7235         (is_space): New fn.
7236         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7237         and empty lines.
7238
7239         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7240         Undo previous (whitespace-only) change.
7241
7242 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7243
7244         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7245         Normalize leading white space and remove trailing white space.
7246         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7247         notice, as per ../config/srclist-update.
7248
7249         Merge from coreutils.
7250         * euidaccess.h: New file.
7251         * euidaccess.c: Include it.
7252         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7253         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7254         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7255
7256 2003-08-11  Bruno Haible  <bruno@clisp.org>
7257
7258         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7259         (vasnprintf): Use it instead of wcslen.
7260
7261 2003-08-11  Bruno Haible  <bruno@clisp.org>
7262
7263         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7264         value to ensure that _Bool promotes to int. Use #define for _Bool when
7265         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7266
7267 2003-08-10  Karl Berry  <karl@gnu.org>
7268
7269         * regex.h: update from libc (whitespace fix).
7270
7271 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7272
7273         Merge some files from coreutils.  These changes were
7274         originally made by Jim Meyering.
7275         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7276         many older Unixes require this.
7277         * alloca.c (alloca): Remove cast to argument of free;
7278         no longer needed in C89.
7279         * alloca_.h, regex.h: Fix white space to match
7280         what GNU indent does.
7281
7282 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7283
7284         * bumpalloc.h: Remove.
7285
7286 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7287
7288         * getloadavg.c: Change copyright notice and spacing to conform to
7289         GNU coding style.
7290
7291         Merge from coreutils.
7292         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7293         From glibc.
7294         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7295         from Karl Berry, implemented by Jim Meyering.
7296         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7297         from Dmitry V. Levin.
7298         Remove anachronistic cast of xrealloc.
7299         * fnmatch_.h (__const): Remove.  Use 'const'.
7300         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7301         type. Otherwise, it wouldn't compile with at least /bin/cc on
7302         ymp-cray-unicos9.0.2.X.
7303         Combine two mostly-identical uses of alloca into one.
7304         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7305
7306 2003-08-04  Dave Love <d.love@dl.ac.uk>
7307
7308         [From Emacs.]
7309
7310         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7311         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7312         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7313         obsolete NLIST_NAME_UNION.
7314         [__GNU__]: Undef BSD and FSCALE.
7315         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7316
7317 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7318
7319         * stdbool_.h (_Bool): Make it signed char, instead of
7320         an enum type, so that it's guaranteed to promote to int.  See:
7321         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7322
7323 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7324
7325         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7326         (strerror): Don't assume that a printable int fits in 14 bytes.
7327
7328 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7329             Bruno Haible  <bruno@clisp.org>
7330
7331         * getline.h (getline, getdelim): Change return type to ssize_t.
7332         * getline.c (getline, getdelim): Likewise.
7333         Remove _GNU_SOURCE define; now it's defined in config.h through
7334         m4/getline.m4.
7335
7336 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7337
7338         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7339         over-parenthesization in macros.
7340
7341         Sync with coreutils.
7342
7343         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7344         required by C99.
7345
7346         Use `exit_failure' for xalloc and xmemcoll instead of their own
7347         private exit-failure variables.
7348         * xalloc.h (xalloc_exit_failure): Remove.
7349         * xmalloc.c: Likewise.  Include exitfail.h.
7350         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7351         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7352         * xmemcoll.c: Likewise.  Include exitfail.h.
7353         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7354
7355 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7356
7357         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7358         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7359         to test that it can stand by itself.  Include "exitfail.h".
7360         Clients should set exit_failure instead.
7361         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7362
7363 2003-07-18  Andreas Schwab  <schwab@suse.de>
7364
7365         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7366
7367 2003-07-18  Bruno Haible  <bruno@clisp.org>
7368
7369         * getndelim2.h: New file.
7370         * getndelim2.c: Make into a module of its own. Include config.h,
7371         getndelim2.h.
7372         (getndelim2): Make non-static. Change return type to ssize_t.
7373         * getline.h: Change argument names.
7374         * getline.c: Include getndelim2.h instead of getndelim2.c.
7375         * getnline.c: Include getndelim2.h.
7376
7377 2003-07-17  Bruno Haible  <bruno@clisp.org>
7378
7379         * Makefile.am: Remove file.
7380         * Makefile.in: Remove file.
7381
7382 2003-07-17  Bruno Haible  <bruno@clisp.org>
7383
7384         * getnline.h: New file.
7385         * getnline.c: New file.
7386         * getndelim2.c: New file, extracted from getline.c.
7387         (getndelim2): Renamed from getdelim2, with added nmax argument.
7388         * getline.c: Include getndelim2.c.
7389         (getdelim2): Moved out to getndelim2.c.
7390         (getline, getdelim): Update.
7391
7392 2003-07-15    <karl@gnu.org>
7393
7394         * vasnprintf.c: update from gettext.
7395
7396 2003-07-15  Jim Meyering  <jim@meyering.net>
7397
7398         * makepath.c (make_path): Enclose diagnostic in _(...).
7399
7400 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7401
7402         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7403         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7404         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7405         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7406         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7407         updated automatically by ../config/srclist-update.  This changes
7408         their license from LPGL to GPL.
7409
7410 2003-07-14  Jim Meyering  <jim@meyering.net>
7411
7412         Don't emit diagnostics.  Let callers do that.
7413         * save-cwd.c: Don't include "error.h".
7414         (save_cwd): Don't call error.  Ensure that errno is valid
7415         when returning nonzero.
7416
7417         * save-cwd.h (restore_cwd): Update prototype.
7418         * save-cwd.c (restore_cwd): Remove two parameters.
7419         Simplify.  Don't call error upon failure.  Let callers do that.
7420         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7421         when auditing is enabled.  But don't bother updating the #if.
7422
7423 2003-07-14  Simon Josefsson  <jas@extundo.com>
7424
7425         * mempcpy.h: New file.
7426         * mempcpy.c: New file.
7427
7428 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7429
7430         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7431         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7432         unicodeio.c, unicodeio.h, unlocked-io.h:
7433         Switch from LGPL to GPL.
7434
7435 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7436
7437         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7438         it breaks C++ compilation.
7439         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7440
7441 2003-07-10  Jim Meyering  <jim@meyering.net>
7442
7443         * vasnprintf.c: Remove trailing blanks.
7444         Make cpp indentation consistent.
7445
7446 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7447
7448         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7449         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7450         Switch from LGPL to GPL.
7451
7452 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7453
7454         * mktime.c: Fix some boundary cases and remove need for floating point.
7455
7456         Issue a compile-time diagnostic if time_t is floating point, or if
7457         two's complement arithmetic is not in effect, or if arithmetic
7458         right shift does not propagate the sign.  These assumptions were
7459         all in the original code but they weren't checked.
7460
7461         (TIME_T_MIDPOINT, verify): New macros.
7462         (__isleap): Remove; it has integer overflow problems.
7463         (leapyear): New function, without those problems.
7464         (ydhms_tm_diff): Remove; splitting into two parts.
7465         (ydhms_diff): New function, containing the arithmetic part of
7466         the old ydhms_tm_diff function.  Issue a compile-time
7467         diagnostic if we are not using C99 integer division.
7468         Avoid casts when possible.
7469         (guess_time_tm): New function, containing the checking part of
7470         the old ydhms_tm_diff function.  Return the new value, rather than
7471         the difference between it and the old.  Accept a new argument T
7472         so that *T specifies the old value.  Check for overflow in the result.
7473
7474         (__mktime_internal): Use a time_t offset, not a long int offset.
7475         This undoes the 2003-06-04 change, which is no longer needed now
7476         that we have better overflow checking.
7477         (localtime_offset): Likewise.
7478
7479         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7480         and long are 64-bit but int is only 32-bit.
7481         (ydhms_diff): Use long int to store year1 and yday1.
7482         Issue a compile-time diagnostic if long int is not wide enough.
7483
7484         (__mktime_internal): Use long int to store adjusted year and yday.
7485         Use plain C rather than preprocessor commands, if that doesn't
7486         affect efficiency.
7487         Check for overflow (and try to repair) after each probe
7488         rather than checking only at the very end.  This avoids some bugs
7489         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7490         does not equal GMT offset at maximum time).
7491         Use integer to check for overflow rather than floating point; this
7492         is more portable to non-IEEE hosts, and is a tad faster.
7493         When we detect that we are oscillating between two values,
7494         don't check whether tm_isdst has the requested value, since
7495         we already know the answer.  When tm_isdst has the wrong value,
7496         use a different heuristic to find the right one, based on the
7497         extreme values actually observed in practice in tz2003a,
7498         rather than the (overly optimistic) "previous 3 calendar quarters".
7499
7500         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7501         "T const" to accommodate glibc style.
7502         (check_result): Use less-confusing report format.  "long" -> "long int.
7503         (main): Likewise.
7504         Don't loop if the iteration overflows time_t.
7505         Allow a negative step in the iteration.
7506
7507 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7508
7509         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7510         having it depend on HAVE_SYS_TYPES_H.
7511
7512 2003-06-25  Bruno Haible  <bruno@clisp.org>
7513
7514         * readlink.c: New file.
7515
7516 2003-06-20  Bruno Haible  <bruno@clisp.org>
7517
7518         Assume C89, so PARAMS isn't needed.
7519         * unicodeio.h (PARAMS): Remove.
7520         * unicodeio.c: Don't use PARAMS.
7521
7522 2003-06-18  Jim Meyering  <jim@meyering.net>
7523
7524         Merge changes from coreutils.
7525         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7526         Remove explicit declarations of xmalloc and realloc.
7527         Include xalloc.h.
7528         (read_utmp): Remove anachronistic cast of xmalloc.
7529
7530 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7531
7532         Assume C89, so PARAMS isn't needed.
7533         * backupfile.h (PARAMS): Remove.  All uses removed.
7534         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7535         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7536         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7537         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7538         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7539         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7540         xstrtol.h: Likewise.
7541         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7542         same.h, strverscmp.h: Do not include config.h; no longer needed.
7543         Anyway, config.h should always be included before any other file.
7544
7545 2003-06-11  Simon Josefsson  <jas@extundo.com>
7546
7547         * sysexit_.h: New file.
7548
7549 2003-05-20  Derek Price  <derek@ximbiot.com>
7550
7551         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7552
7553 2003-06-10  Simon Josefsson  <jas@extundo.com>
7554
7555         * strchrnul.h: New file.
7556         * strchrnul.c: New file.
7557
7558 2003-06-10  Simon Josefsson <jas@extundo.com>
7559
7560         * argp.h: New file, from glibc.
7561         * argp-ba.c: New file, from glibc.
7562         * argp-eexst.c: New file, from glibc.
7563         * argp-fmtstream.c: New file, from glibc.
7564         * argp-fmtstream.h: New file, from glibc.
7565         * argp-fs-xinl.c: New file, from glibc.
7566         * argp-help.c: New file, from glibc.
7567         * argp-namefrob.h: New file, from glibc.
7568         * argp-parse.c: New file, from glibc.
7569         * argp-pv.c: New file, from glibc.
7570         * argp-pvh.c: New file, from glibc.
7571         * argp-xinl.c: New file, from glibc.
7572
7573 2003-06-07  Jim Meyering  <jim@meyering.net>
7574
7575         * readtokens.h: Put `Free Software Foundation, Inc.'
7576         in place of my name in the copyright comment.
7577         Remove definition and uses of __P.
7578
7579         From coreutils.
7580         * stat.c: Don't declare xmalloc explicitly.
7581         Instead, include "xalloc.h".
7582         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7583         xrealloc, and xcalloc return values.
7584         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7585         Improve comment.
7586         * xgetcwd.h: Remove definition/uses of PARAMS.
7587
7588 2003-06-06  Jim Meyering  <jim@meyering.net>
7589
7590         * stdbool_.h: Renamed from stdbool.h.in.
7591
7592 2003-06-06  Jim Meyering  <jim@meyering.net>
7593
7594         Merge from coreutils.
7595         * same.c: (same_name): Declare *_basename locals to be `const'.
7596         Consolidate declarations and initializations of *_base* locals.
7597
7598         Merge from coreutils.
7599         This avoids a core dump on systems without GNU putenv,
7600         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7601         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7602         (unsetenv): New static function, from GNU libc.
7603         (rpl_putenv): Use it.
7604
7605         * modechange.c: Remove trailing blanks.
7606
7607         Merge from coreutils.
7608         * fsusage.c: Remove declaration of statfs.
7609         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7610
7611         * posixtm.c: Include <stdbool.h> unconditionally.
7612
7613 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7614
7615         * mktime.c (__mktime_internal): When resolving a tm_isdst
7616         mismatch, look in future quarters as well as past.  This fixes a
7617         bug when processing fall-backwards gaps immediately after a long
7618         period of daylight-saving time.
7619
7620         * mktime.c: Assume freestanding C89 or better.
7621         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7622         (__P): Remove; not used.
7623         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7624         (mktime, not_equal_tm, print_tm, check_result,
7625         main): Use prototypes.  Use const * where appropriate.
7626         (main): Fix typo in testing code that uncovered by above changes.
7627         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7628
7629 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7630
7631         * mktime.c: Fix Debian bug 177940
7632         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7633         (localtime_offset): Now long int, not time_t, because we want it
7634         to be guaranteed to be signed.  All uses changed.
7635         (__mktime_internal): If overflow would occur when adding offset,
7636         don't add it.
7637
7638         Merge 'human' changes from coreutils.  Rewrite to support
7639         locale-specific notations like thousands separators.
7640         * human.c: Simplify authorship notice.
7641         Include human.h immediately after config.h.
7642         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7643         <limits.h>: Do not include, since human.h does.
7644         (SIZE_MAX, UINTMAX_MAX): New macros.
7645         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7646         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7647         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7648         (power_letter): Renamed from suffixes.
7649         (generate_suffix_backwards): Remove.
7650         (adjust_value): Now takes int style (because of human.h changes)
7651         and long double value (for greater precision on some platforms).
7652         (group_number): New function.
7653         (human_readable): Use it.  Use integer options, not enum.
7654         Put the options before the sizes in the arg list.
7655         Support all the new options.
7656         The old human_readable function has been removed;
7657         use inttostr.h instead.
7658         (human_readable, default_block_size, humblock):
7659         Use uintmax_t, not int, for block sizes.
7660         (human_readable_inexact, block_size_types): Remove.
7661         (block_size_opts): New constant.
7662         (human_options): Renamed from human_block_size, with new signature
7663         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7664         * human.h: Add copyright and authorship notice.
7665         Include <limits.h> and <stdbool.h> unconditionally.
7666         (PARAMS): Remove.  All uses removed.
7667         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7668         (enum human_inexact_style): Remove tag; now a nameless enum.
7669         (human_floor, human_ceiling, human_round_to_even): Now have
7670         values 2, 0, 1 rather than -1, 1, 0.
7671         (human_group_digits, human_suppress_point_zero, human_autoscale,
7672         human_base_1024, human_SI, human_B): New constants.
7673         (human_readable_inexact, human_block_size): Remove.
7674         (human_readable): Size args are now uintmax_t, not int.
7675         (human_options): New decl.
7676
7677         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7678         unnecessary now that we assume C89 or better.  This change
7679         imported from coreutils.
7680
7681         * mktime.c (__mktime_internal): Do not reject negative timestamps
7682         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7683         in the 2003-05-30 sync from glibc.
7684
7685         .h files should stand alone, but we shouldn't include <sys/types.h>
7686         if we can get away with just <stddef.h>.
7687
7688         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7689         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7690         rather than <sys/types.h>, as we merely need size_t.
7691         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7692         to get size_t.
7693         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7694         Include <stdio.h>, to get FILE.
7695         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7696         memcasecmp.h has included <stddef.h> and all we need is size_t.
7697         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7698         our interface, instead of including <sys/types.h>
7699
7700 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7701
7702         [from coreutils]
7703         Fix some minor time-related bugs with POSIX time arguments.
7704         Some valid time stamps were being rejected (notably -1, and
7705         time stamps before 1900 on 64-bit hosts).  And some invalid
7706         time stamps were being accepted, e.g. September 31.
7707
7708         * posixtm.h (posixtime): Return bool instead of time_t, so
7709         that we can return (time_t) -1 successfully.
7710         * posixtm.c: Likewise.
7711         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7712         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7713         (t): Remove static var.
7714         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7715         of static var.  All uses changed.
7716         (year): Do not reject years before 1900; they can occur with
7717         64-bit time_t.
7718         (posix_time_parse): Do not check for out-of-range components;
7719         that is now the caller's responsibility, since our checks were
7720         only approximations.
7721         (posixtime): Use mktime to check for out-of-range components,
7722         since it knows them exactly.
7723         If mktime returns (time_t) -1, check whether an error actually occurred
7724         by invoking localtime on -1.
7725         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7726         posixtime failures better.
7727         Improve the test data (in comments only).
7728
7729 2003-05-30    <karl@gnu.org>
7730
7731         * mktime.c: update from libc.
7732
7733 2003-05-30  Bruno Haible  <bruno@clisp.org>
7734
7735         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7736         * localcharset.h: Likewise.
7737         * localcharset.c: Likewise.
7738
7739 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7740
7741         Assume the headers required for C89 freestanding compilers.
7742         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7743         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7744         without checking for HAVE_LIMITS_H.
7745         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7746         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7747         to do that.
7748         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7749         * exclude.c: Include <stdbool.h> unconditionally.
7750         * tempname.c: Include <stddef.h> unconditionally.
7751         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7752         * modechange.c, rpmatch.c (NULL): Don't define, since
7753         <stddef.h> does that.
7754         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7755         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7756         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7757         * xstrtol.c: Likewise.
7758         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7759         * savedir.c: Include <stddef.h> instead of defining NULL.
7760
7761         * addext.c (addext): Use assignment rather than cast, to avoid
7762         warnings on some platforms.
7763
7764         * mktime.c (__mktime_internal): Do not reject negative timestamps
7765         arbitrarily.
7766
7767 2003-05-10  Bruno Haible  <bruno@clisp.org>
7768
7769         * linebreak.c (iconv_string_length): Don't return -1 just because the
7770         string is longer than 4 KB.
7771
7772 2003-05-12  Jim Meyering  <jim@meyering.net>
7773
7774         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7775         the space-padded-by-default conversion specifiers, %e, %k, %l.
7776
7777 2003-05-03  Bruno Haible  <bruno@clisp.org>
7778
7779         Upgrade to Unicode-4.0.
7780         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7781         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7782         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7783         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7784         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7785         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7786         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7787         Change width of U+E0100..U+E01EF from 1 to 0.
7788
7789 2003-04-25  Bruno Haible  <bruno@clisp.org>
7790
7791         * copy-file.c: Include <stddef.h>, for size_t.
7792
7793 2003-04-25  Jim Meyering  <jim@meyering.net>
7794
7795         * copy-file.c (copy_file_preserving): Declare buf_size to be
7796         of type size_t, not int.
7797
7798 2003-04-11  Jim Meyering  <jim@meyering.net>
7799
7800         Merge changes from Coreutils.
7801
7802         2003-03-22  Jim Meyering  <jim@meyering.net>
7803
7804         * strftime.c (widen): Cast alloca return value to proper type.
7805
7806         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7807
7808         From GNU libc.
7809         * strftime.c (my_strftime): Handle very large width
7810         specifications for numeric values correctly.  Improve checks for
7811         overflow.
7812
7813         2003-01-19  Jim Meyering  <jim@meyering.net>
7814
7815         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7816         (nl_get_alt_digit) [! defined my_strftime]: Define.
7817         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7818         _nl_get_alt_digit and _nl_get_walt_digit.
7819
7820         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7821         These changes have no effect outside of _LIBC.
7822
7823 2003-04-10  Bruno Haible  <bruno@clisp.org>
7824
7825         * findprog.h: New file, from GNU gettext.
7826         * findprog.c: New file, from GNU gettext.
7827
7828 2003-04-05  Jim Meyering  <jim@meyering.net>
7829
7830         Merge changes from Coreutils.
7831
7832         * exclude.h (PARAMS): Remove definition and uses.
7833         * exclude.c: Remove uses of `PARAMS'.
7834
7835         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7836         Add test-cases for DOS filenames. Declare program_name.
7837         (main): Set up program_name.  Patch by Rich Dawe.
7838
7839         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7840         error from mntctl.
7841         Use mntctl's return value to drive the entry-processing loop, since
7842         we can't rely on the value of the vmt_length member in the last
7843         entry.  On some systems doing so could result in exhausting
7844         virtual memory.  Based in part on a patch from Mike Jetzer.
7845
7846 2003-04-04  Bruno Haible  <bruno@clisp.org>
7847
7848         * linebreak.h: New file, from GNU gettext.
7849         * linebreak.c: New file, from GNU gettext with slight modifications.
7850         * lbrkprop.h: New file, from GNU gettext.
7851
7852 2003-04-03  Bruno Haible  <bruno@clisp.org>
7853
7854         * utf8-ucs4.h: New file, from GNU gettext.
7855         * utf16-ucs4.h: New file, from GNU gettext.
7856         * ucs4-utf8.h: New file, from GNU gettext.
7857         * ucs4-utf16.h: New file, from GNU gettext.
7858
7859 2003-04-02  Bruno Haible  <bruno@clisp.org>
7860
7861         * binary-io.h: New file, from GNU gettext.
7862
7863 2003-04-01  Bruno Haible  <bruno@clisp.org>
7864
7865         * pathname.h: New file, from GNU gettext.
7866         * concatpath.c: New file, from GNU gettext.
7867
7868 2003-03-30  Bruno Haible  <bruno@clisp.org>
7869
7870         * copy-file.c (copy_file_preserving): Don't set owner if the function
7871         chown() doesn't exist.
7872
7873 2003-03-28  Bruno Haible  <bruno@clisp.org>
7874
7875         * copy-file.h: New file, from GNU gettext.
7876         * copy-file.c: New file, from GNU gettext.
7877
7878 2003-03-18  Jim Meyering  <jim@meyering.net>
7879
7880         * quote.c (quote_n): Fix typo in comment.
7881
7882 2003-03-14  Jim Meyering  <jim@meyering.net>
7883
7884         Merge changes from Coreutils.
7885         * obstack.h (obstack_object_size): Declare temporary, __o,
7886         to be const, in order to avoid warnings.
7887         (obstack_room): Likewise.
7888         (obstack_empty_p): Likewise.
7889
7890 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7891
7892         Merge changes from Bison.
7893         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7894         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7895         when compiling Bison 1.875's `bitset bset = obstack_alloc
7896         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7897         * hash.c: Include <stdbool.h> unconditionally.
7898
7899 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7900
7901         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7902         Reported by Bruce Becker; see:
7903         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7904
7905 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7906             Bruno Haible  <bruno@clisp.org>
7907
7908         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7909         Reported by John Hughes, see
7910         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7911
7912 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7913
7914         * poll_.h: New file.
7915         * poll.c: New file.
7916
7917 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7918
7919         * mathl.h: New file.
7920         * acosl.c: New file.
7921         * asinl.c: New file.
7922         * atanl.c: New file.
7923         * ceill.c: New file.
7924         * cosl.c: New file.
7925         * expl.c: New file.
7926         * floorl.c: New file.
7927         * frexpl.c: New file.
7928         * ldexpl.c: New file.
7929         * logl.c: New file.
7930         * sincosl.c: New file.
7931         * sinl.c: New file.
7932         * sqrtl.c: New file.
7933         * tanl.c: New file.
7934         * trigl.c: New file.
7935         * trigl.h: New file.
7936
7937 2003-02-17  Bruno Haible  <bruno@clisp.org>
7938
7939         * mkdtemp.h: New file, from GNU gettext.
7940         * mkdtemp.c: New file, from GNU gettext.
7941
7942 2003-01-31  Bruno Haible  <bruno@clisp.org>
7943
7944         * rename.c: #undef rename before defining rpl_rename.
7945         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7946
7947 2003-01-30  Bruno Haible  <bruno@clisp.org>
7948
7949         * printf-args.h: New file, from GNU gettext.
7950         * printf-args.c: New file, from GNU gettext.
7951         * printf-parse.h: New file, from GNU gettext.
7952         * printf-parse.c: New file, from GNU gettext.
7953         * vasnprintf.h: New file, from GNU gettext.
7954         * vasnprintf.c: New file, from GNU gettext.
7955         * asnprintf.c: New file, from GNU gettext.
7956         * vasprintf.h: New file, from GNU gettext with modifications.
7957         * vasprintf.c: New file, from GNU gettext.
7958         * asprintf.c: New file, from GNU gettext.
7959
7960 2003-01-29  Bruno Haible  <bruno@clisp.org>
7961
7962         * stpncpy.h: New file, from GNU gettext with modifications.
7963         * stpncpy.c: New file, from GNU gettext with modifications.
7964
7965 2003-01-28  Bruno Haible  <bruno@clisp.org>
7966
7967         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7968         Paul Eggert.
7969         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7970         Paul Eggert.
7971
7972 2003-01-27  Bruno Haible  <bruno@clisp.org>
7973
7974         * xsetenv.h: New file, from GNU gettext.
7975         * xsetenv.c: New file, from GNU gettext.
7976
7977 2003-01-23  Bruno Haible  <bruno@clisp.org>
7978
7979         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7980
7981 2003-01-22  Bruno Haible  <bruno@clisp.org>
7982
7983         * exit.h: New file, from GNU gettext.
7984
7985 2003-01-11  Bruno Haible  <bruno@clisp.org>
7986
7987         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7988         * strcase.h (strcasecmp, strncasecmp): Likewise.
7989
7990 2003-01-14  Jim Meyering  <jim@meyering.net>
7991
7992         * same.c (same_name): Tweak a comment.
7993
7994 2003-01-11  Bruno Haible  <bruno@clisp.org>
7995
7996         * same.c (same_name): Reorder tests so as to avoid calling stat()
7997         when a string comparison is sufficient.
7998
7999 2003-01-11  Bruno Haible  <bruno@clisp.org>
8000
8001         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8002         'unsigned int'.
8003
8004 2003-01-11  Bruno Haible  <bruno@clisp.org>
8005
8006         * hash-pjw.c: Add comment about low quality of this function.
8007
8008 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8009
8010         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8011         to avoid collisions with libcurses and libreadline.
8012
8013         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8014         * getstr.h, getstr.c: Remove.
8015         * getline.c: Include "getline.h", to check interface.
8016         Move body of old getstr.c here: this defines MIN_CHUNK and
8017         declares getdelim2, which is renamed from getstr.
8018         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8019
8020         * linebuffer.c (readlinebuffer): Renamed from readline.
8021         All uses changed.
8022         * linebuffer.h: Likewise.
8023         (readline): Remove backward-compatibility macro.
8024
8025 2003-01-12  Jim Meyering  <jim@meyering.net>
8026
8027         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8028
8029 2003-01-10  Bruno Haible  <bruno@clisp.org>
8030
8031         * alloca_.h: New file.
8032         * getdate.y: Unconditionally include alloca.h.
8033         * makepath.c: Likewise.
8034         * setenv.c: Likewise.
8035         * userspec.c: Likewise.
8036
8037 2003-01-09  Bruno Haible  <bruno@clisp.org>
8038
8039         * stdbool.h.in: New file.
8040
8041 2003-01-08  Bruno Haible  <bruno@clisp.org>
8042
8043         * safe-read.c: Include specification header first, to ensure its
8044         selfcontainedness.
8045         * full-write.c: Likewise.
8046
8047 2003-01-08  Jim Meyering  <jim@meyering.net>
8048
8049         * full-write.c: Undefine and define-away `const' after inclusion
8050         of errno.h, not before.  Suggestion from Bruno Haible.
8051
8052 2003-01-07  Jim Meyering  <jim@meyering.net>
8053
8054         * full-write.c: Rework so that it may serve to define full_read, too.
8055         * full-read.c: Simply #define FULL_READ and include full-write.c.
8056
8057 2003-01-06  Jim Meyering  <jim@meyering.net>
8058
8059         * version-etc.c: Update year in translatable copyright string.
8060
8061 2002-12-25  Bruno Haible  <bruno@clisp.org>
8062
8063         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8064         * xstrtol.h: Likewise.
8065         * xstrtoimax.c: Likewise.
8066         * xstrtoumax.c: Likewise.
8067         * human.h: Likewise.
8068
8069         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8070         on systems that have <inttypes.h> but not <stdint.h>.
8071
8072 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8073
8074         * memcoll.c (memcoll): Fall back on a simple algorithm using
8075         memcmp if strcoll doesn't work.
8076
8077 2002-12-23  Bruno Haible  <bruno@clisp.org>
8078
8079         * localcharset.h: New file.
8080         * localcharset.c: Include it.
8081         * unicodeio.c: Likewise.
8082
8083 2002-12-22  Bruno Haible  <bruno@clisp.org>
8084
8085         * utime.c (utime_null): No need to call ftruncate if the file was
8086         nonempty.
8087
8088 2002-12-23  Bruno Haible  <bruno@clisp.org>
8089
8090         * memcoll.c (STRCOLL): New macro.
8091         (memcoll): Use it.
8092
8093 2002-12-22  Bruno Haible  <bruno@clisp.org>
8094
8095         * getstr.h (getstr): Define, to avoid clash with libcurses.
8096         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8097
8098 2002-12-22  Bruno Haible  <bruno@clisp.org>
8099
8100         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8101
8102 2002-12-23  Bruno Haible  <bruno@clisp.org>
8103
8104         * getline.h: Include <stddef.h>, for size_t.
8105
8106         * unicodeio.h: Include <stddef.h>, for size_t.
8107         * unicodeio.c: Don't include <stddef.h>.
8108
8109 2002-12-17  Bruno Haible  <bruno@clisp.org>
8110
8111         * canon-host.c (strdup): Remove unused declaration.
8112
8113         * fsusage.c: Include full_read.h.
8114         (get_fs_usage): Use full_read instead of safe_read.
8115
8116         * utime.c (utime_null): Use SAFE_READ_ERROR.
8117
8118 2002-12-11  Bruno Haible  <bruno@clisp.org>
8119
8120         * setenv.h: Rewritten to cope with systems that have setenv() but not
8121         unsetenv().
8122         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8123         modifications:
8124
8125         2002-12-11  Bruno Haible  <bruno@clisp.org>
8126
8127                 * setenv.c (alloca): Fall back to malloc.
8128                 (freea): New macro.
8129                 (setenv): Use freea() to free memory allocated with alloca().
8130
8131         2002-11-13  Bruno Haible  <bruno@clisp.org>
8132
8133                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8134                 function declarations.
8135                 * unsetenv.c (unsetenv): Likewise.
8136
8137         2002-03-04  Bruno Haible  <bruno@clisp.org>
8138
8139                 Portability to AIX 4.3.3.
8140                 * unsetenv.c: New file, extracted from setenv.c.
8141                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8142
8143         2001-12-20  Bruno Haible  <bruno@clisp.org>
8144
8145                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8146                 use malloc instead. For SunOS 4.
8147
8148         2001-12-11  Bruno Haible  <bruno@clisp.org>
8149
8150                 * setenv.c: Declare alloca.
8151                 (compar_fn_t): New typedef.
8152                 (KNOWN_VALUE, STORE_VALUE): Use it.
8153
8154         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8155         setenv.h.
8156
8157 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8158
8159         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8160         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8161         Choose values that are less likely to collide with system fnmatch
8162         options.
8163         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8164         defined (e.g., a pure POSIX system).
8165         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8166         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8167
8168 2002-12-06  Jim Meyering  <jim@meyering.net>
8169
8170         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8171
8172         Merge in changes from libc's misc/error.c, in preparation
8173         for the merge of gnulib's changes back into libc.
8174
8175         * error.c (_): Define only if not already defined.
8176         Move definition to follow all #include directives.
8177         Include unlocked-io.h only if !_LIBC.
8178         [_LIBC]: Include <libio/libioP.h>.
8179         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8180         (fflush): Tweak definition to use INTUSE.
8181         (putc): Define.
8182
8183 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8184
8185         * alloca.c [defined emacs]: Include "lisp.h".
8186         (xalloc_die) [defined emacs]: New macro.
8187         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8188         [! defined emacs]: Include <xalloc.h>.
8189         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8190         (pointer): Typedef to POINTER_TYPE *.
8191         (malloc): Remove decl; we now always use xmalloc.
8192         (alloca): Use old-style definition, since Emacs needs this.
8193         Check for arithmetic overflow when computing combined size.
8194
8195 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8196
8197         Do not generate unlocked-io.h automatically, since it's easier to
8198         maintain it by hand.
8199
8200         * unlocked-io.h: New file, from GNU diffutils,
8201         but with proper copyright notice and attribution.
8202         * gen-uio: Remove.
8203         * Makefile.am: Add copyright notice.
8204         (libfetish_a_SOURCES): Add unlocked-io.h.
8205         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8206         (DISTCLEANFILES, io_functions): Remove macros.
8207         (EXTRA_DIST): Remove gen_uio.
8208         (unlocked-io.h): Remove rule.
8209
8210 2002-12-04  Jim Meyering  <jim@meyering.net>
8211
8212         Reflect the fact that stat.c and lstat.c are no longer generated.
8213         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8214         (DISTCLEANFILES): Likewise.
8215         (EXTRA_DIST): Likewise.
8216         (all_local): Don't depend on stat.c or lstat.c.
8217         (stat.c, lstat.c): Remove rules.
8218         (EXTRA_DIST): Remove xstat.in.
8219
8220         * xstat.in: Remove file.  Contents moved into stat.c.
8221         * stat.c: New file.  Contents mostly from xstat.in.
8222         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8223         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8224
8225         * safe-read.c: Rework so that it may serve to define safe_write, too.
8226         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8227
8228 2002-12-03  Jim Meyering  <jim@meyering.net>
8229
8230         * safe-read.c, safe-write.c: Change variable names and comments, but
8231         not semantics, to minimize the differences between these two files.
8232         (safe_read): Change comment to mention SAFE_READ_ERROR.
8233
8234         * safe-read.c (IS_EINTR): Define.
8235         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8236
8237 2002-12-02  Bruno Haible  <bruno@clisp.org>
8238
8239         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8240         Define, taken from safe-read.c.
8241         (INT_MAX): Provide fallback.
8242         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8243         * safe-write.h (SAFE_WRITE_ERROR): Define.
8244
8245         * safe-read.c (EINTR): Remove definition.
8246         (safe_read): Don't use EINTR if it is absent.
8247
8248 2002-12-02  Jim Meyering  <jim@meyering.net>
8249
8250         * safe-read.c (EINTR): Define.
8251         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8252         (INT_MAX): Provide fallback.
8253         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8254
8255         * safe-read.h (SAFE_READ_ERROR): Define.
8256
8257 2002-12-01  Jim Meyering  <jim@meyering.net>
8258
8259         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8260         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8261
8262 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8263
8264         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8265         hash_rehash): Replace `if (limit <= value) abort ();' with
8266         `if (! (value < limit)) abort ();', for readability.
8267
8268 2002-11-26    <karl@gnu.org>
8269
8270         * strdup.c: copy from libc again, with jim's ok.
8271         * .cppi-disable: re-add strdup.c
8272
8273 2002-11-25    <karl@gnu.org>
8274
8275         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8276         instead of "strtol.c".
8277
8278 2002-11-25  Jim Meyering  <jim@meyering.net>
8279
8280         * mktime.c: Sync from libc, now that it has the latest fix.
8281
8282 2002-11-24    <karl@gnu.org>
8283
8284         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8285         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8286
8287 2002-11-24  Jim Meyering  <jim@meyering.net>
8288
8289         Update from coreutils:
8290
8291         * mktime.c: Merge in changes from libc.
8292
8293         Avoid a link-time failure on some Linux systems.
8294         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8295         (__mon_yday): Declare with the STATIC attribute.
8296         (__mktime_internal): Likewise.
8297         Based on a report from Greg Schafer.
8298
8299 2002-11-23  Jim Meyering  <jim@meyering.net>
8300
8301         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8302         Use `unsigned', not `int', as type of index.
8303
8304         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8305
8306         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8307
8308 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8309
8310         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8311         hint that one should use `if (! x) abort ();' rather than `assert
8312         (x);', and anyway it's one less thing to worry about configuring.
8313         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8314         hash_rehash, hash_insert): Use abort rather than assert.
8315
8316 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8317
8318         * quotearg.h: Allow multiple inclusion by surrounding with
8319         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8320         so that we can be included first.
8321         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8322         * quotearg.c: Include quotearg.h immediately after config.h.
8323         No need to include stddef.h or sys/types.h any more.
8324         Surround local include files with "", not "<>".
8325         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8326         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8327         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8328         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8329         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8330         (ISPRINT): Remove; no longer needed now that we assume C89.
8331
8332         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8333         Preserve errno.
8334
8335         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8336         quotearg_char): Use SIZE_MAX rather than
8337         (size_t) -1 when we are talking about "infinity".
8338
8339         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8340
8341 2002-11-22  Bruno Haible  <bruno@clisp.org>
8342
8343         * safe-read.h: Assume C89. Add comments.
8344         (safe_read): Change return type to size_t.
8345         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8346         counts > SSIZE_MAX correctly.
8347         * safe-write.h: New file.
8348         * safe-write.c: New file.
8349         * full-read.h: New file.
8350         * full-read.c: New file.
8351         * full-write.h: Assume C89. Add comments.
8352         * full-write.c: Include safe-write.h.
8353         (full_write): Rewritten to use safe_write.
8354         Suggested by Jim Meyering and Paul Eggert.
8355
8356 2002-11-21  Bruno Haible  <bruno@clisp.org>
8357
8358         Remove case insensitive option matching.
8359         * argmatch.h (argcasematch): Remove declaration.
8360         (ARGCASEMATCH): Remove macro.
8361         (__xargmatch_internal): Remove case_sensitive argument.
8362         (XARGMATCH): Update.
8363         (XARGCASEMATCH): Remove macro.
8364         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8365         case_sensitive argument.
8366         (argcasematch): Remove function.
8367         (__xargmatch_internal): Remove case_sensitive argument.
8368         (main): Use XARGMATCH instead of XARGCASEMATCH.
8369
8370         * xmalloc.c: Change compile-time error message. Add comment about
8371         required autoconf version.
8372
8373 2002-11-21  Jim Meyering  <jim@meyering.net>
8374
8375         * strdup.c (strdup): Tweak comment and initial #if/#include.
8376
8377         Merge in changes from the coreutils.
8378
8379         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8380         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8381         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8382         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8383         int.  Work more efficiently if X is the same width as uintmax_t.
8384         Do not compare X to -1, to avoid bogus compiler warning.
8385         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8386         Don't assume that f_frsize and f_bsize are the same type.
8387
8388         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8389         on FreeBSD.
8390
8391         * makepath.c (make_path): Restore umask *before* creating the final
8392         component.
8393         (make_path): Minor reformatting.
8394
8395         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8396         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8397
8398         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8399         ones.  At least on GNU/Linux systems, `auto' means something else.
8400         From Michael Stone.
8401
8402 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8403
8404         Merge argmatch cleanups from Bison.  Assume C89.
8405
8406         * argmatch.c: Include config.h here, not in argmatch.h.
8407         Include stdlib.h, for EXIT_FAILURE.
8408         Always include <string.h>, since we assume C89.
8409         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8410         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8411         Include <stddef.h> instead, since it's all we need for size_t.
8412         (PARAMS): Remove.  All uses removed.
8413         (ARRAY_CARDINALITY): Do not bother to #undef.
8414         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8415         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8416         Remove unnecessary parentheses.
8417         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8418         Insert necessary parentheses.
8419         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8420         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8421
8422 2002-11-19  Bruno Haible  <bruno@clisp.org>
8423
8424         * mbswidth.c: Include mbswidth.h right at the beginning.
8425         * mbswidth.h: Include <stddef.h>, for size_t.
8426
8427         * mbswidth.h (PARAMS): Remove macro.
8428         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8429         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8430
8431         * gcd.h (PARAMS): Remove macro.
8432         (gcd): Use ANSI C function declarations.
8433         * gcd.c (gcd): Likewise.
8434
8435 2002-11-15  Bruno Haible  <bruno@clisp.org>
8436
8437         * strcspn.c: Include <stddef.h>.
8438         (strcspn): Use ANSI C function declaration. Change return type to
8439         size_t. Use NULL.
8440         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8441         (strpbrk): Use NULL.
8442         * strpbrk.h (PARAMS): Remove macro.
8443         (strpbrk): Use ANSI C function declaration.
8444         * strstr.c: Don't include <sys/types.h>.
8445         * strstr.h (PARAMS): Remove macro.
8446         (strstr): Use ANSI C function declarations.
8447
8448 2002-11-06  Bruno Haible  <bruno@clisp.org>
8449
8450         * gcd.h (gcd): Change argument type to 'unsigned long'.
8451         * gcd.c (gcd): Likewise.
8452
8453 2002-11-05  Bruno Haible  <bruno@clisp.org>
8454
8455         * gcd.h: New file, from gettext-0.11.5.
8456         * gcd.c: New file, from gettext-0.11.5.
8457
8458 2002-11-05  Bruno Haible  <bruno@clisp.org>
8459
8460         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8461         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8462         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8463         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8464
8465         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8466         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8467
8468         * closeout.c: Include gettext.h instead of <libintl.h>.
8469         * human.c: Include gettext.h instead of <libintl.h>.
8470         * quotearg.c: Include gettext.h instead of <libintl.h>.
8471         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8472         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8473         * userspec.c: Include gettext.h instead of <libintl.h>.
8474         * version-etc.c: Include gettext.h instead of <libintl.h>.
8475         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8476         (textdomain): Remove definition.
8477         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8478
8479         * long-options.c: Remove include of <libintl.h> and definition of _.
8480         * same.c: Remove include of <libintl.h> and definition of _.
8481
8482 2002-11-04  Bruno Haible  <bruno@clisp.org>
8483
8484         * stpcpy.h: New file, from GNU gettext-0.11.5.
8485         * strcase.h: New file, from GNU gettext-0.11.5.
8486         * strpbrk.h: New file, from GNU gettext-0.11.5.
8487         * strstr.h: New file, from GNU gettext-0.11.5.
8488         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8489
8490 2002-05-09  Bruno Haible  <bruno@clisp.org>
8491
8492         * config.charset: Update for newest glibc. Add canonical names
8493         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8494
8495 2002-05-09  Bruno Haible  <bruno@clisp.org>
8496
8497         * localcharset.c (get_charset_aliases): Add more Windows specific
8498         aliases.
8499
8500 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8501
8502         * config.charset: A few additions for Solaris.
8503
8504 2001-12-05  Bruno Haible  <bruno@clisp.org>
8505
8506         * localcharset.c (locale_charset): Don't return an empty string.
8507
8508 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8509
8510         * config.charset: msdos in uk_UA uses CP1125.
8511
8512 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8513
8514         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8515         * localcharset.c (locale_charset): Declare as extern "C".
8516
8517 2002-02-15  Bruno Haible  <bruno@clisp.org>
8518
8519         * config.charset [msdosdjgpp]: For Russian, use CP866.
8520
8521 2002-02-11  Bruno Haible  <bruno@clisp.org>
8522
8523         * config.charset: Add support for NetBSD.
8524
8525 2002-09-25    <karl@gnu.org>
8526
8527         * strdup.c: copy from libc/string (via ../config/srclist*).
8528         * getopt*: copy from libc/posix.
8529         * gettext.h: copy from gettext.
8530         * .cppi-disable: add strdup.c, gettext.h.
8531
8532 2002-07-01  Jim Meyering  <meyering@lucent.com>
8533
8534         * c-stack.c: Include sys/time.h.
8535         From Volker Borchert.
8536
8537 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8538
8539         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8540         New macro.  Use it uniformly instead of
8541         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8542         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8543         reported by Vin Shelton.
8544
8545 2002-06-22  Jim Meyering  <meyering@lucent.com>
8546
8547         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8548         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8549
8550 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8551
8552         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8553         Do not assume SA_SIGINFO behavior.
8554         Bug reported by Jim Meyering on NetBSD 1.5.2.
8555
8556 2002-06-22  Jim Meyering  <meyering@lucent.com>
8557
8558         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8559
8560         * exitfail.c, exitfail.h: Likewise.
8561         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8562
8563         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8564         of fnmatch.h.
8565         (EXTRA_DIST): Add fnmatch_loop.c.
8566         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8567
8568         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8569         * fnmatch.c: Update from diffutils-2.8.2.
8570         * fnmatch_.h: New file.  From diffutils-2.8.2.
8571         * fnmatch.h: Remove file.
8572
8573 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8574
8575         * file-type.h: Report an error if neither S_ISREG nor
8576         S_IFREG is defined, instead of using a test specific to glibc
8577         2.2.  This should be safe, since POSIX requires S_ISREG and
8578         Unix Version 7 had S_IFREG.  We don't need to check for
8579         <sys/types.h> since we don't use any symbols that it defines.
8580
8581 2002-06-15  Jim Meyering  <meyering@lucent.com>
8582
8583         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8584         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8585         have been included before this file.
8586
8587 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8588
8589         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8590         so that each temporary file name is unique and valid in the first
8591         8 characters, for operation under DOS.
8592
8593 2002-06-15  Jim Meyering  <meyering@lucent.com>
8594
8595         Work even with DJGPP 2.03, which lacks support for symlinks.
8596         From Richard Dawe.
8597         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8598         is defined.
8599         * lchown.c (S_ISLNK): Likewise.
8600
8601 2002-06-14  Jim Meyering  <meyering@lucent.com>
8602
8603         * file-type.h: Use the version from diffutils-2.8.2.
8604         * file-type.c: Likewise.
8605
8606 2002-05-27  Jim Meyering  <meyering@lucent.com>
8607
8608         Fix a problem seen only on nonconforming systems whereby ls.c's
8609         use of localtime, and then of gettimeofday would cause trouble:
8610         the localtime call used to initialize rpl_gettimeofday's save
8611         mechanism would clobber ls's current local time information so
8612         that in any long listing the first file would always be listed
8613         with date 1970-01-01.  Analysis by Volker Borchert.
8614
8615         * gettimeofday.c (localtime): Undefine.
8616         (rpl_localtime): New function.
8617
8618 2002-05-22  Jim Meyering  <meyering@lucent.com>
8619
8620         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8621         * file-type.h: New file.
8622         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8623
8624 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8625
8626         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8627
8628 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8629
8630         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8631         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8632         of 127, since 64 is the largest conceivable number for ancient
8633         nonstandard hosts.
8634         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8635
8636 2002-04-28  Jim Meyering  <meyering@lucent.com>
8637
8638         * sig2str.c (WTERMSIG): Remove definition (unused).
8639
8640 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8641
8642         * sig2str.h, sig2str.c: New files.
8643         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8644
8645 2002-04-24  Jim Meyering  <meyering@lucent.com>
8646
8647         * gettext.h: New file, from Gettext.
8648         * Makefile.am (INCLUDES): Remove -I../intl.
8649         (libfetish_a_SOURCES): Add gettext.h.
8650
8651 2002-04-16  Jim Meyering  <meyering@lucent.com>
8652
8653         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8654         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8655         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8656
8657 2002-04-12  Jim Meyering  <meyering@lucent.com>
8658
8659         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8660
8661 2002-03-10  Jim Meyering  <meyering@lucent.com>
8662
8663         * makepath.c (make_path): Remove a comma from a diagnostic.
8664         Suggestion from Santiago Vila.
8665
8666 2002-03-08  Jim Meyering  <meyering@lucent.com>
8667
8668         * rename.c: Mention that this wrapper is needed also on
8669         mips-dec-ultrix4.4 systems.
8670
8671 2002-03-02  Jim Meyering  <meyering@lucent.com>
8672
8673         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8674         not HAVE_CLOCK_SETTIME.
8675
8676 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8677
8678         * nanosleep.h: Rename to....
8679         * timespec.h: New name for nanosleep.h.  All uses changed.
8680
8681         * gettime.c: New file.
8682         * settime.c: New file.
8683         * stime.c: Remove.
8684
8685         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8686         timespec.h.  Remove nanosleep.h.
8687
8688 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8689
8690         * acl.c, acl.h: New files.
8691         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8692
8693 2002-02-24  Jim Meyering  <meyering@lucent.com>
8694
8695         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8696         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8697         cause trouble.  Reported by Nelson Beebe.
8698
8699 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8700
8701         * path-concat.c (xpath_concat): Reorder code to pacify
8702         compilers that don't know that xalloc_die never returns.
8703
8704 2002-02-20  Jim Meyering  <meyering@lucent.com>
8705
8706         * getdate.c: Regenerate using bison-1.33.
8707
8708 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8709
8710         * posixver.c, posixver.h: New files.
8711         * Makefile.am (libfetish_a_SOURCES): Add them.
8712
8713 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8714             Bruno Haible  <bruno@clisp.org>
8715
8716         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8717         (fwrite_success_callback): New declaration.
8718         * unicodeio.c (unicode_to_mb): New function, extracted from
8719         print_unicode_char. Call failure callback instead of error.
8720         (fwrite_success_callback): New function.
8721         (exit_failure_callback): New function.
8722         (fallback_failure_callback): New function.
8723         (print_unicode_char): Call unicode_to_mb.
8724
8725 2002-01-26  Jim Meyering  <meyering@lucent.com>
8726
8727         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8728
8729 2002-01-22  Jim Meyering  <meyering@lucent.com>
8730
8731         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8732         Otherwise, some versions of automake would omit the rule that makes
8733         Makefile from Makefile.in.
8734
8735 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8736
8737         * xmemcoll.h, xmemcoll.c: New files.
8738         * Makefile.am (libfetish_a_SOURCES): Add them.
8739         * memcoll.c: Include errno.h, and declare errno if not defined.
8740         (memcoll): Set errno to zero if there is no error.
8741
8742         * quotearg.c (quotearg_buffer_restyled):
8743         Fix bug with quoting buffers containing NUL when backslashing escapes.
8744         This bug was exposed by the other changes in this patch.
8745         (quotearg_n_options): New arg ARGSIZE.
8746         All callers changed.
8747         (quoting_options_from_style): New function.
8748         (quotearg_n_style): Use it.
8749         (quotearg_n_style_mem): New function.
8750
8751         * quotearg.h (quotearg_n_style_mem): New function.
8752
8753 2002-01-16  Jim Meyering  <meyering@lucent.com>
8754
8755         * getdate.y: Add three semicolons, each just before a closing brace.
8756         Bison (as of version 1.31) no longer papers over that mistake.
8757
8758 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8759
8760         * backupfile.c (ISDIGIT): Comment fix.
8761         * getdate.y (ISDIGIT): Likewise.
8762         * posixtm.c (ISDIGIT, year): Likewise.
8763         * strverscmp.c (ISDIGIT): Likewise.
8764         * userspec.c (ISDIGIT): Likewise.
8765
8766 2002-01-05  Jim Meyering  <meyering@lucent.com>
8767
8768         * version-etc.c (version_etc_copyright): Update copyright year.
8769
8770 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8771
8772         * closeout.c (close_stdout_status): If ferror (stdout), do
8773         not silently exit merely because the output buffer happens to
8774         have nothing pending.
8775
8776 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8777
8778         See the big note in ../ChangeLog.
8779         * human.c (suffixes): Prefer K to k for 1024.
8780         (generate_suffix_backwards): New function.
8781         (human_readable_inexact): Use it.
8782         * xstrtol.c (__xstrtol): If there is no number but there
8783         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8784         Accept 'K' as well as 'k'.
8785
8786 2001-12-15  Jim Meyering  <meyering@lucent.com>
8787
8788         * regex.h (__restrict_arr): Update from libc.
8789
8790         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8791         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8792         (STREQ): Define.
8793
8794 2001-12-10  Jim Meyering  <meyering@lucent.com>
8795
8796         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8797         Instead, include "xalloc.h".
8798         (initbuffer): Don't cast xmalloc return value to char*.
8799         (readline): Reword comment.
8800         Don't cast xrealloc return value to char*
8801         Return NULL, not 0.
8802
8803 2001-12-09  Jim Meyering  <meyering@lucent.com>
8804
8805         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8806         `signed and unsigned type in conditional expression'.
8807         * posixtm.c (posix_time_parse): Likewise.
8808
8809         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8810
8811         * readtokens.c (readtoken): Declare an index to be of type unsigned
8812         to avoid a pedantic warning.
8813
8814         * getstr.c: Don't include assert.h.
8815         (getstr): Remove warning-evoking assertions.
8816         Return -1 if offset parameter is out of bounds.
8817         Change the type of a local from int to size_t.
8818
8819         * strftime.c (my_strftime_localtime_r): Include this function
8820         definition in the `#if ! HAVE_TM_GMTOFF' block.
8821
8822         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8823         Include xalloc.h instead.
8824
8825 2001-12-02  Jim Meyering  <meyering@lucent.com>
8826
8827         * tempname.c: Don't declare getenv, thus reverting the change of
8828         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8829         included.
8830
8831         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8832         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8833
8834 2001-11-30  Akim Demaille  <akim@epita.fr>
8835
8836         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8837         before being defined.
8838
8839 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8840
8841         * quotearg.h (quotearg_n, quotearg_n_style):
8842         First arg is int, not unsigned.
8843         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8844         (SIZE_MAX, UINT_MAX): New macros.
8845         (quotearg_n_options): Abort if N is negative.
8846         Avoid overflow check on hosts where size_t is 64 bits and int
8847         is 32 bits, as overflow is impossible there.
8848         Fix off-by-one typo that caused unnecessary reallocation.
8849
8850 2001-11-27  Jim Meyering  <meyering@lucent.com>
8851
8852         * tempname.c: Merge with version from libc.
8853         * regex.c: Likewise.
8854
8855         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8856         for which STDC_HEADERS is 0, it was not included, resulting in a
8857         warning about an integer-to-pointer conversion problem with getenv.
8858         Reported by Volker Borchert.
8859
8860 2001-11-26  Jim Meyering  <meyering@lucent.com>
8861
8862         * gtod.h: Remove file.
8863         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8864         * gettimeofday.c: Don't include gtod.h.
8865         (GTOD_init): Remove function.
8866         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8867         Suggestion from Volker Borchert.
8868
8869 2001-11-23  Jim Meyering  <meyering@lucent.com>
8870
8871         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8872         * hash.c (struct hash_table): Define it here instead.
8873
8874 2001-11-22  Jim Meyering  <meyering@lucent.com>
8875
8876         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8877
8878 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8879
8880         * tempname.c (TMP_MAX): Remove; no longer needed.
8881         (TEMPORARIES): New macro.
8882         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8883         removes an artificial limitation (e.g. HP-UX 10.20, where
8884         TMP_MAX is 17576).
8885
8886 2001-11-18  Jim Meyering  <meyering@lucent.com>
8887
8888         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8889         on SunOS 4.
8890
8891         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8892         files will be created before anything else.
8893
8894 2001-11-17  Jim Meyering  <meyering@lucent.com>
8895
8896         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8897         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8898         rather than group writable.  Patch by Juan F. Codagnone.
8899
8900         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8901         Instead, include "xalloc.h".
8902
8903         * mountlist.c: Include unlocked-io.h after all system headers.
8904         Remove explicit declarations of xmalloc, xrealloc,
8905         and xstrdup.  Instead, include "xalloc.h".
8906
8907         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8908         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8909         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8910
8911         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8912         Reported by Padraig Brady.
8913
8914         * mkstemp.c: #undef mkstemp.
8915         Include config.h.
8916         (rpl_mkstemp): Rename from mkstemp.
8917         Protoize.
8918
8919 2001-11-16  Jim Meyering  <meyering@lucent.com>
8920
8921         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8922         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8923         determine the amount of total physical memory, use pstat_getstatic.
8924         HPUX-11 doesn't define _SC_PHYS_PAGES.
8925         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8926         If sysconf couldn't be used to determine the amount of available
8927         physical memory, use both pstat_getstatic and pstat_getdynamic.
8928         Based on a patch from Bob Proulx.
8929
8930 2001-11-05  Jim Meyering  <meyering@lucent.com>
8931
8932         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8933
8934 2001-11-03  Jim Meyering  <meyering@lucent.com>
8935
8936         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8937         in argmatch_to_argument call.
8938
8939         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8940         argument.
8941
8942         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8943         e.g., a fault due to an attempt to free a NULL pointer.
8944
8945 2001-11-01  Jim Meyering  <meyering@lucent.com>
8946
8947         * dirfd.c, dirfd.h: New files.
8948         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8949
8950         * hash.c (hash_print) [TESTING]: Clean up.
8951
8952 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8953
8954         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8955         to avoid a warning if -Wall.
8956
8957 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8958
8959         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8960
8961 2001-10-21  Jim Meyering  <meyering@lucent.com>
8962
8963         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8964         this code would end up calling gettext even in packages built
8965         with --disable-nls.
8966         * getopt.c (_): Likewise.
8967         * regex.c (_): Likewise.
8968
8969 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8970
8971         * error.c (strerror_r): Do not declare unless !_LIBC.
8972         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8973         Use strerror_r that is only a macro, even if it is not a function.
8974         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8975         (private_strerror): Use prototypes, not old-style function definition.
8976         (print_errno_message): New function.
8977         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8978         char*-flavored one.
8979         (error_tail, error, error_at_line): Use it.
8980
8981 2001-10-11  Jim Meyering  <meyering@lucent.com>
8982
8983         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8984         and quote_n (1, ... to avoid clobbering a buffer.
8985
8986 2001-10-05  Jim Meyering  <meyering@lucent.com>
8987
8988         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8989         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8990         * hash-pjw.h: New file.
8991
8992 2001-09-30  Jim Meyering  <meyering@lucent.com>
8993
8994         * mountlist.c [MOUNTED_GETFSSTAT]:
8995         Include <sys/ucred.h>, for Apple Darwin.
8996         Include sys/mount.h and sys/fs_types.h only if available.
8997         (FS_TYPE): Define.
8998         (read_filesystem_list): Use FS_TYPE.
8999
9000 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9001
9002         * exclude.c (excluded_filename): 0 -> false, since it's
9003         a boolean context.
9004
9005 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9006
9007         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9008         #defines strtoimax.  Also treat the other strto* functions
9009         like strtoimax.
9010
9011         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9012         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9013         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9014
9015 2001-09-26  Jim Meyering  <meyering@lucent.com>
9016
9017         Most macros in unlocked-io.h had the wrong number of arguments.
9018         * gen-uio: New script.
9019         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9020         * unlocked-io.hin: Remove file.
9021         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9022         rather than trying to embed it here.
9023         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9024         Reported by Padraig Brady.
9025
9026 2001-09-25  Volker Borchert  <bt@teknon.de>
9027
9028         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9029
9030 2001-09-23  Jim Meyering  <meyering@lucent.com>
9031
9032         * mountlist.c: Remove useless parentheses in #if directives.
9033         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9034         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9035
9036 2001-09-22  Jim Meyering  <meyering@lucent.com>
9037
9038         * localcharset.c: Update from latest gettext.
9039         * config.charset: Likewise.
9040
9041 2001-09-20  Jim Meyering  <meyering@lucent.com>
9042
9043         * xstrtol.c (strtoimax): Guard declaration with
9044         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9045         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9046         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9047         (strtoumax): Likewise, for completeness (it wasn't necessary).
9048
9049 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9050
9051         * strtoimax.c (HAVE_LONG_LONG):
9052         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9053         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9054         to work around bug in IBM C compiler.
9055
9056 2001-09-16  Jim Meyering  <meyering@lucent.com>
9057
9058         * mkdir.c: New file.
9059
9060 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9061
9062         * xgetcwd.c: Revert some of the previous change; intead,
9063         fix the HAVE_GETCWD_NULL code to behave more like the
9064         !HAVE_GETCWD_NULL code used to.
9065
9066         Include "xalloc.h".
9067         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9068         invoke xalloc_die.
9069
9070 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9071
9072         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9073         Use ssize_t, not int, to store result of readlink.
9074         Check for ssize_t overflow as well as size_t overflow,
9075         as POSIX says the result of readlink is implementation-defined
9076         when ssize_t overflows.
9077         Remove unnecessary cast to char*.
9078         Use free+malloc instead of realloc, as the storage doesn't need
9079         to be preserved and it's clearer and can be more efficient that way.
9080         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9081         * xreadlink.h (xreadlink): Update prototype.
9082
9083 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9084
9085         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9086         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9087         spotted by Jim Meyering.
9088
9089 2001-09-03  Jim Meyering  <meyering@lucent.com>
9090
9091         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9092
9093 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9094
9095         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9096         like the HAVE_GETCWD_NULL code.
9097         Include pathmax.h if not HAVE_GETCWD.
9098         Do not include xalloc.h.
9099         (INITIAL_BUFFER_SIZE): New symbol.
9100         Do not use xmalloc / xrealloc, since the caller is responsible for
9101         handling errors.  Preserve errno around `free' during failure.
9102         Do not overrun buffer when using getwd.
9103
9104 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9105
9106         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9107         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9108
9109 2001-09-02  Jim Meyering  <meyering@lucent.com>
9110
9111         * error.c: Update from GNU libc.
9112
9113 2001-09-01  Jim Meyering  <meyering@lucent.com>
9114
9115         * xreadlink.c: New file.
9116         * xreadlink.h: New file.
9117         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9118
9119         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9120         doesn't conflict with sparc Solaris 7's definition in
9121         /usr/include/sys/int_types.h.
9122
9123         * exclude.c: Use `""', not `<>' to #include non-system header files.
9124         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9125         and strncasecmp as r-values.  Unixware didn't have declarations.
9126
9127 2001-08-31  Jim Meyering  <meyering@lucent.com>
9128
9129         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9130         Use an initial, malloc'd, buffer of length 128 rather than
9131         a statically allocated one of length 1024.
9132
9133 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9134
9135         * xgetcwd.c: Don't include pathmax.h.
9136         Include stdlib.h and unistd.h if available.
9137         Include xalloc.h.
9138         (xmalloc, xstrdup, free): Remove decls.
9139         (xgetcwd): Don't assume sizes fit in unsigned.
9140         Check for overflow when computing sizes.
9141         Simplify reallocation code.
9142
9143 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9144
9145         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9146
9147         * strtoimax.c: Renamed from strtoxmax.c, removing the
9148         old strtoimax.c.
9149
9150         Also, make the following further changes to make this file's
9151         configuration more similar to that of strtol.c:
9152         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9153         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9154         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9155         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9156         changed to signed values.
9157
9158         And make the following changes as well:
9159         Fix copyright notice, as 1999 was missing.
9160         (verify): New macro.
9161         (strtoimax): Check sizes at compile-time, not run-time.
9162         Prefer strtol to strtoll if both work.
9163         (main): Remove; it was not that useful and was a pain to maintain.
9164
9165         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9166
9167 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9168
9169         * savedir.c (savedir): Remove size parameter, as POSIX says that
9170         a directory's st_size can have an arbitrary value, so the old
9171         usage could waste an arbitrary amount of memory.  All uses
9172         changed.
9173         * savedir.h: Update prototype.
9174
9175 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9176
9177         * xstrtol.c (strtoimax): New decl.
9178
9179 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9180
9181         * xstrtol.h: Add copyright notice.
9182         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9183         LONGINT_INVALID_SUFFIX_CHAR.
9184
9185 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9186
9187         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9188         tm to be declared.
9189
9190 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9191
9192         * hash.c: Remove '2001' from copyright notice.
9193
9194 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9195
9196         * full-write.h: New file.
9197         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9198         * full-write.c: Correct credits, as cccp.c no longer
9199         exists and anyway it was so heavily changed from the old cccp
9200         code as to be unrecognizable.  Include full-write.h.
9201         (full_write) Return size_t, with short writes meaning failure.
9202         All callers changed.  This fixes a bug with large buffers
9203         on 64-bit hosts.
9204         * utime.c: Include full-write.h.
9205
9206 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9207
9208         Merge 'exclude' changes from tar 1.13.22.
9209         This fixes one or two unlikely storage allocation overflow bugs,
9210         but doesn't change user-visible behavior otherwise.
9211
9212 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9213
9214         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9215         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9216         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9217         Include if available.
9218         (<xalloc.h>): Include
9219         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9220         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9221         collide with FNM macros.
9222         (struct patopts): New struct.
9223         (struct exclude): Use it, as exclude patterns now come with options.
9224         (new_exclude): Support above changes.
9225         (new_exclude, add_exclude_file):
9226         Initial size must now be a power of two to simplify overflow checking.
9227         (free_exclude, fnmatch_no_wildcards): New function.
9228         (excluded_filename): No longer requires options arg, as the options
9229         are determined by add_exclude.  Now returns bool, not int.
9230         (excluded_filename, add_exclude):
9231         Add support for the fancy new exclusion options.
9232         (add_exclude, add_exclude_file): Now takes int options arg.
9233         Check for arithmetic overflow when computing sizes.
9234         (add_exclude_file): xrealloc might modify errno, so don't
9235         realloc until after errno might be used.
9236
9237         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9238         New macros.
9239         (free_exclude): New decl.
9240         (add_exclude, add_exclude_file): Now takes int options arg.
9241         (excluded_filename): No longer requires options arg, as the options
9242         are determined by add_exclude.  Now returns bool, not int.
9243
9244 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9245
9246         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9247
9248 2001-08-27  Jim Meyering  <meyering@lucent.com>
9249
9250         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9251
9252         * version-etc.c (N_): Remove definition.
9253         Revert most of last change.
9254         Instead, simply don't mark the `Copyright...' string for translation.
9255         Based on advice from Paul Eggert.
9256
9257         * strtoxmax.c: Tweak comment.
9258
9259 2001-08-26  Jim Meyering  <meyering@lucent.com>
9260
9261         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9262         of copyright with `%s' so translators don't get an untranslated
9263         message in 2002.
9264         (COPYRIGHT_YEAR): Define.
9265         (version_etc): Use fprintf rather than fputs.
9266         Suggestion from Ulrich Drepper.
9267
9268         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9269
9270         * strtoll.c: New file, from GNU libc.
9271         * xstrtoimax.c: New file.
9272
9273         * xstrtol.h: Add xstrtoimax.
9274         * strtoumax.c: New file.  Simply include "strtoumax.c".
9275         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9276
9277         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9278         * strtoxmax.c: ... then renamed to this.
9279
9280 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9281
9282         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9283         Port to Solaris 8, where 'sed' requires a space after the 'r'
9284         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9285         Redirect output to $tmp just once.
9286
9287 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9288
9289         * addext.c (<errno.h>): Include.
9290         (errno): Declare if not defined.
9291         (addext): Work correctly when pathconf returns -1 and leaves
9292         errno alone because there is no limit.  Also, work even if
9293         pathconf returns a value greater than SIZE_MAX.
9294
9295 2001-08-12  Jim Meyering  <meyering@lucent.com>
9296
9297         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9298         Simply `return getcwd (NULL, 0);'.
9299         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9300         Use 1300 as initial value for length, not PATH_MAX.
9301
9302         * pathmax.h: Clean up cpp syntax.
9303
9304 2001-08-12  Jim Meyering  <meyering@lucent.com>
9305
9306         * gettimeofday.c: New file.
9307         * gtod.h: New file.
9308         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9309
9310 2001-08-04  Jim Meyering  <meyering@lucent.com>
9311
9312         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9313         to get in sync with glibc.
9314
9315 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9316
9317         The following changes are from gettext 0.10.39 as maintained by
9318         Bruno Haible.
9319
9320         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9321         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9322         with inverted sense.  All uses changed.
9323
9324         * mbswidth.c: Don't include <limits.h>.
9325         Include <stdlib.h> and <string.h> unconditionally.
9326         (iswcntrl, mbsinit, ISCNTRL): New macros.
9327         (mbsnwidth): Use K&R style function declarations.
9328         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9329         can optimize it when MB_CUR_MAX == 1.
9330         The width of control characters is zero, not 1.
9331
9332 2001-07-15  Jim Meyering  <meyering@lucent.com>
9333
9334         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9335         (BUILT_SOURCES): Add unlocked-io.h.
9336         (io_functions): Define.
9337         (unlocked-io.h): New rule.
9338         (DISTCLEANFILES): Add unlocked-io.h.
9339         (all-local): Depend on unlocked-io.h, to ensure it is created.
9340
9341         * unlocked-io.hin: New file
9342
9343         * regex.c: Update from glibc.
9344
9345 2001-07-05  Jim Meyering  <meyering@lucent.com>
9346
9347         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9348         recommendation.
9349         (libfetish_a_SOURCES): Put all .h files here instead.
9350         Remove a thus-exposed (better checks in automake) duplicate and
9351         two unnecessary .h files.
9352
9353 2001-06-11  Jim Meyering  <meyering@lucent.com>
9354
9355         * regex.c: Update from GNU libc.
9356
9357 2001-05-27  Jim Meyering  <meyering@lucent.com>
9358
9359         * readutmp.h (UT_TYPE): Define.
9360
9361 2001-05-24  Jim Meyering  <meyering@lucent.com>
9362
9363         * argmatch.c: Include "quote.h".
9364         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9365         quote function.  Reported by Göran Uddeborg.
9366
9367 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9368
9369         * dirname.c (dir_name): Compute append_dot using path, not newpath
9370         which is not yet declared.
9371
9372 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9373
9374         * Makefile.am (libfetish_a_SOURCES):
9375         Add strftime.c, since we now compile it on all hosts.
9376
9377         * strftime.c (my_strftime):
9378         Define to nstrftime if emacs, but only if my_strftime is not defined.
9379         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9380         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9381         Add one more extra argument: a nanoseconds value.
9382         All uses changed.
9383         (ns): New macro.
9384         (my_strftime function): Add %N format.
9385         (emacs_strftimeu): Renamed from emacs_strftime,
9386         with extra ut argument.
9387
9388 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9389
9390         dirname code cleanup.  base_name now behaves more compatibly
9391         with POSIX basename when given file names that have trailing
9392         slashes, and similarly for dir_name.  Add new primitives
9393         base_len and dir_len.  Put the directory-name-related decls
9394         into dirname.h.
9395
9396         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9397         * backupfile.c (base_name): Likewise.
9398         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9399         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9400         * makepath.c (strip_trailing_slashes): Likewise.
9401         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9402         Likewise.
9403         * rename.c (strip_trailing_slashes): Likewise.
9404         * same.c (base_name): Likewise.
9405         * stripslash.c (ISSLASH): Likewise.
9406
9407         * addext.c: Include <dirname.h> after size_t is defined.
9408         * backupfile.c: Likewise.
9409
9410         * addext.c (addext): Use base_len to trim redundant
9411         trailing slashes instead of doing it ourselves.
9412         But do not trim the last slash if it is not redundant.
9413
9414         * backupfile.c (find_backup_file_name,
9415         max_backup_version): Use base_len instead of rolling it ourselves.
9416         Handle the case of "" and (on DOS) "C:" correctly.
9417
9418         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9419         Include <string.h>, <dirname.h>.
9420         (base_name): Allow file names ending in slashes, other than names
9421         that are all slashes.  In this case, return the basename followed
9422         by the slashes.  This is more general, and can be used in places
9423         where the original base_name purposely had an assertion failure.
9424         (base_len): New function.
9425
9426         * dirname.c: Include <string.h> instead of <stdlib.h>.
9427         Do not include <assert.h>; no longer needed.
9428         Include xalloc.h.
9429         (memrchr): Remove decl.
9430         (dir_name_r): Remove.
9431         (dir_len): Renamed from dirlen.  All callers changed.
9432         Rewrite in terms of base_name, for simplicity and consistency.
9433         (dir_name): Never return NULL.  All callers changed.
9434         Do not include <stdlib.h> in test program; no longer needed.
9435         return 0; is fine for test program.
9436
9437         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9438         New macros.
9439         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9440
9441         * path-concat.c (path_concat): Use base_len to compute
9442         base length, not strlen; this means we cannot rely on memcpy
9443         to null-terminate.
9444
9445         * same.c (STREQ): Remove.
9446         (same_name): Handle the case where the basename ends in trailing '/'.
9447
9448         * stripslash.c (strip_trailing_slashes): Return nonzero if
9449         a slash was stripped.  Do not strip the last slash after a
9450         file system prefix.
9451
9452 2001-04-08  Jim Meyering  <meyering@lucent.com>
9453
9454         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9455         recomputed; that's necessary when the offset spans a DST transition.
9456         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9457
9458 2001-04-02  Jim Meyering  <meyering@lucent.com>
9459
9460         * regex.h, regex.c: Update from GNU libc.
9461
9462 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9463
9464         * version-etc.c (version_etc_copyright): Update to 2001.
9465
9466 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9467
9468         * tempname.c (uint64_t): Define to uintmax_t if
9469         not defined, and if UINT64_MAX is not defined.
9470         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9471         Reported by John David Anglin.
9472
9473 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9474
9475         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9476         alias if codeset is empty.
9477         * config.charset (BeOS): Use wildcard syntax.
9478
9479 2001-03-13  Jim Meyering  <meyering@lucent.com>
9480
9481         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9482         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9483         From Bruno Haible.
9484
9485 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9486
9487         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9488         Don't return NULL.
9489         * unicodeio.c (print_unicode_char): Simplify accordingly.
9490
9491 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9492
9493         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9494         support for DOS/DJGPP.
9495
9496 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9497
9498         * Makefile.am (libfetish_a_SOURCES):
9499         Add dup-safer.c, fopen-safer.c.
9500         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9501
9502         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9503
9504 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9505
9506         The mkstemp replacement is taken from glibc 2.2.2, with some
9507         portability fixes for use outside glibc, as follows:
9508
9509         * tempname.c (struct_stat64): New macro.
9510         (direxists, __gen_tempname): Use it.
9511         This avoids a portability problem with Solaris 8.
9512
9513         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9514         (<stddef.h>, <stdint.h>, <string.h>):
9515         Include only if STDC_HEADERS || _LIBC.
9516         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9517         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9518         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9519         (__set_errno): Define this macro if <errno.h> doesn't.
9520         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9521         Define these macros if <stdio.h> doesn't.
9522         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9523         Define these macros if <sys/stat.h>
9524         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9525         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9526         __xstat64): Define if not _LIBC.
9527         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9528         (__gen_tempname): Invoke gettimeofday only if
9529         HAVE_GETTIMEOFDAY || _LIBC;
9530         otherwise, fall back on plain "time".
9531         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9532
9533         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9534
9535         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9536
9537 2001-02-17  Jim Meyering  <meyering@lucent.com>
9538
9539         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9540         around included file name.
9541
9542         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9543
9544         * strftime.c: Update from GNU libc (the only changes were to comments).
9545
9546 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9547
9548         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9549
9550 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9551
9552         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9553         Remove workaround macros for hosts that have mbrtowc but not
9554         mbstate_t, as we now insist on proper declarations for both
9555         before using mbrtowc.
9556
9557 2001-02-17  Jim Meyering  <meyering@lucent.com>
9558
9559         * regex.c: Update from libc.
9560
9561 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9562
9563         * alloca.c (malloc): Undef before defining, since stdlib.h
9564         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9565         Reported by Mark Hounschell via Paul Eggert.
9566
9567 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9568
9569         * config.charset: Update for FreeBSD 4.2.
9570
9571 2001-01-26  Jim Meyering  <meyering@lucent.com>
9572
9573         * quotearg.c: Include stddef.h.
9574         * quote.c: Include stddef.h.
9575         Reported by Axel Kittenberger.
9576
9577         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9578         line in double quotes so that it evokes a better diagnostic.
9579         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9580         Reported by Axel Kittenberger.
9581
9582 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9583
9584         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9585         to avoid a warning.  Add back 'const' to inptr.
9586
9587 2001-01-16  Jim Meyering  <meyering@lucent.com>
9588
9589         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9590         From Bruno Haible.
9591
9592 2001-01-14  Jim Meyering  <meyering@lucent.com>
9593
9594         * rename.c: New file.  From Volker Borchert.
9595         Include stdlib.h, string.h or strings.h, and xalloc.h.
9596         Use strip_trailing_slashes rather than open-coding it.
9597
9598 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9599
9600         * strftime.c: Sync with glibc time/strftime.c 1.81.
9601
9602 2001-01-03  Jim Meyering  <meyering@lucent.com>
9603
9604         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9605         local `inptr' to avoid warning with some system declarations of iconv.
9606
9607 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9608
9609         * modechange.c: Do not assume that mode_t uses the
9610         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9611         the other-execute bit of FOO even if S_IXOTH != 1.
9612
9613         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9614         WOTH, XOTH, ALLM): New macros.
9615         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9616          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9617         Use them.
9618         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9619         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9620         (mode_compile):
9621         No need to use uintmax_t; unsigned long is long enough.
9622         Don't bother to get suffix since we don't use it.
9623
9624 2000-12-24  Jim Meyering  <meyering@lucent.com>
9625
9626         * hash.c (is_prime): Return explicit boolean values.
9627         (hash_get_first): Return NULL to appease Irix5.6's 89.
9628         Reported by Nelson Beebe.
9629
9630 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9631
9632         * localcharset.c (locale_charset): Add support for Win32.
9633
9634 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9635
9636         * physmem.h, physmem.c: New files.
9637
9638         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9639         (noinst_HEADERS): Add physmem.h.
9640
9641         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9642         't' for compatibility with Solaris 8 sort.
9643
9644 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9645
9646         * config.charset: Add support for BeOS.
9647
9648 2000-12-16  Jim Meyering  <meyering@lucent.com>
9649
9650         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9651         SHELLS_FILE to a file name that's useful on djgpp systems.
9652         Include stdlib.h.
9653         (ADDITIONAL_DEFAULT_SHELLS): Define.
9654         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9655         Based mostly on a patch from Prashant TR.
9656
9657 2000-12-16  Jim Meyering  <meyering@lucent.com>
9658
9659         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9660         N and M) would have treated it like `chown N:N FILE'.
9661
9662         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9663
9664 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9665
9666         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9667         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9668         to the list of canonical encodings. Rename EUC-CN to GB2312.
9669
9670 2000-12-08  Andreas Schwab  <schwab@suse.de>
9671
9672         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9673         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9674
9675 2000-12-07  Jim Meyering  <meyering@lucent.com>
9676
9677         * stripslash.c (ISSLASH): Define.
9678         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9679         From Prashant TR.
9680
9681         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9682         (dir_name_r): Declare this function as static.
9683         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9684         manifest itself on a name containing a mix of slashes and
9685         backslashes.
9686         Make this function work with names starting with a DOS-style
9687         drive letter and colon prefix.
9688         (dir_name): Append `.' if necessary.
9689         Based mostly on patches from Prashant TR and Eli Zaretskii.
9690
9691         * dirname.h (dir_name_r): Remove prototype.
9692
9693 2000-12-05  Jim Meyering  <meyering@lucent.com>
9694
9695         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9696
9697 2000-12-04  Jim Meyering  <meyering@lucent.com>
9698
9699         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9700         Also include memory.h, stdlib.h, unistd.h if appropriate.
9701         Reported by Andreas Jaeger (conflicting declaration of malloc).
9702
9703 2000-12-02  Jim Meyering  <meyering@lucent.com>
9704
9705         * closeout.h: Make idempotent, to avoid some obscure warnings.
9706
9707 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9708
9709         * memrchr.c: Include <config.h> before any system include file.
9710
9711 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9712
9713         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9714
9715 2000-11-26  Jim Meyering  <meyering@lucent.com>
9716
9717         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9718
9719 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9720
9721         * strftime.c (my_strftime): Do not invoke mbrlen with a
9722         size of (size_t) -1; it's not portable.
9723
9724 2000-11-17  Akim Demaille  <akim@epita.fr>
9725
9726         * obstack.h: Formatting changes.
9727         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9728         prevent type checking.
9729         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9730         cast the value to (void *): assigning a `foo *' to a `void *'
9731         variable is valid.
9732         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9733
9734 2000-11-17  Jim Meyering  <meyering@lucent.com>
9735
9736         * strstr.c: Update from GNU libc.
9737
9738 2000-11-16  Jim Meyering  <meyering@lucent.com>
9739
9740         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9741
9742 2000-11-11  Jim Meyering  <meyering@lucent.com>
9743
9744         * error.c: Add a couple #includes, merging from GNU libc version.
9745
9746 2000-11-10  Jim Meyering  <meyering@lucent.com>
9747
9748         * obstack.h: Update from GNU libc.
9749         * obstack.c: Likewise.
9750
9751 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9752
9753         * getusershell.c (setusershell): Use rewind rather than
9754         fseek/fseeko, to avoid configuration hassles with fseeko.
9755         Don't bother opening SHELLS_FILE if shellstream is NULL;
9756         it's not necessary.
9757
9758 2000-11-05  Jim Meyering  <meyering@lucent.com>
9759
9760         * makepath.h (make_dir): Declare.
9761         * makepath.c (make_dir): Remove `static' attribute.
9762         Tweak a comment.
9763
9764 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9765
9766         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9767         last one in a bucket, advance to the next bucket.
9768
9769 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9770
9771         * fnmatch.c: Do not comment out all the code if we are using
9772         the GNU C library, because in some cases we are replacing buggy
9773         code in the GNU C library itself.
9774
9775 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9776
9777         * error.h, getline.h, modechange.h:
9778         Remove "2000" from Copyright line, as the file hasn't been
9779         changed this year other than in the copyright notice.
9780
9781         * xalloc.h: Add "2000" to Copyright line, as this file
9782         was changed this year.
9783
9784 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9785
9786         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9787         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9788         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9789
9790 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9791
9792         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9793         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9794         doesn't define __restrict_arr.
9795
9796 2000-10-29  Jim Meyering  <meyering@lucent.com>
9797
9798         * xstat.in: Fix grammar in comment.
9799
9800 2000-10-28  Jim Meyering  <meyering@lucent.com>
9801
9802         * memchr.c: Update from libc.
9803         Adjust for portability:
9804         [HAVE_STDLIB_H]: Include stdlib.h.
9805         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9806         Undef __memchr, too.
9807         [!weak_alias]: Define __memchr to memchr.
9808
9809         * regex.c: Update from libc.
9810         * regex.h: Likewise.
9811         * getopt1.c: Likewise.
9812         * memcmp.c: Likewise.
9813
9814         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9815         Avoid using fseek, when possible -- it's broken by design.
9816         Patch by Ulrich Drepper.
9817
9818 2000-10-26  Jim Meyering  <meyering@lucent.com>
9819
9820         * strftime.c: Update from libc.
9821
9822 2000-10-25  Jim Meyering  <meyering@lucent.com>
9823
9824         * obstack.c: Update from libc.
9825
9826 2000-10-23  Jim Meyering  <meyering@lucent.com>
9827
9828         * hard-locale.c (hard_locale): Revert last change -- it was simply
9829         wrong.  That set_locale call must not have any side effects.
9830         From Paul Eggert.
9831
9832 2000-10-22  Jim Meyering  <meyering@lucent.com>
9833
9834         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9835         [CYCLIC]: Remove now-unused definition.
9836
9837         * save-cwd.c (O_DIRECTORY): Define, if needed.
9838         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9839         Suggestion from Ulrich Drepper.
9840
9841 2000-10-21  Jim Meyering  <meyering@lucent.com>
9842
9843         * dirname.c (dir_name_r): New function, factored out of dir_name.
9844         (dir_name): Use dir_name_r.
9845         * dirname.h (dir_name_r): Declare it.
9846
9847 2000-10-21  Jim Meyering  <meyering@lucent.com>
9848
9849         * dirname.c (memrchr): Declare if necessary.
9850         (dir_name): Remove the restriction that there be no
9851         trailing slashes.  Now, this code skips past them, effectively
9852         ignoring them.
9853         [TEST_DIRNAME] (main): New unit tests.
9854
9855         * memrchr.c: New file from GNU libc.
9856         Undef __memrchr, too.
9857         [!weak_alias]: Define __memrchr to memrchr.
9858         Guard weak_alias use with `#ifdef weak_alias'.
9859
9860 2000-10-17  Jim Meyering  <meyering@lucent.com>
9861
9862         * quote.h (PARAMS): Define and use.
9863         Reported by Akim Demaille.
9864
9865         * getopt.c: Update from libc.
9866
9867 2000-10-16  Jim Meyering  <meyering@lucent.com>
9868
9869         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9870         From Jan Fedak.
9871
9872 2000-09-25  Jim Meyering  <meyering@lucent.com>
9873
9874         * md5.h (rol): Define (from GnuPG).
9875
9876         * sha.c: Give credit (GnuPG) where due.
9877         (M): Use rol rather than open-coding it.
9878         Add a FIXME comment.
9879
9880 2000-09-21  Jim Meyering  <meyering@lucent.com>
9881
9882         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9883         Reported by Michael Stone.
9884
9885 2000-09-20  Jim Meyering  <meyering@lucent.com>
9886
9887         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9888         (noinst_HEADERS): Add sha.h.
9889         Based on code from Scott G. Miller and from GnuPG.
9890
9891 2000-09-15  Jim Meyering  <meyering@lucent.com>
9892
9893         * regex.c: Update from libc.
9894
9895 2000-09-10  Jim Meyering  <meyering@lucent.com>
9896
9897         * getopt.c (_getopt_internal): Update from glibc.
9898
9899 2000-09-09  Jim Meyering  <meyering@lucent.com>
9900
9901         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9902         think it should be used as a general replacement for isascii.
9903         * fnmatch.c: Likewise.
9904         * mbswidth.c: Likewise
9905         * regex.c: Likewise.
9906
9907         Don't use atoi.
9908         * userspec.c: Include sys/param.h and limits.h.
9909         Include xstrtol.h.
9910         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9911         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9912         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9913         UID, GID.  Check range.
9914
9915 2000-09-06  Jim Meyering  <meyering@lucent.com>
9916
9917         * getopt.c (_getopt_internal): Update from glibc.
9918
9919 2000-08-30  Jim Meyering  <meyering@lucent.com>
9920
9921         * strftime.c: Merge in changes from GNU libc.
9922
9923 2000-08-26  Jim Meyering  <meyering@lucent.com>
9924
9925         * closeout.c: Include "__fpending.h".
9926         (close_stdout_status): Return right away if there's nothing to flush.
9927
9928         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9929         * __fpending.c: New file.
9930         * __fpending.h: New file.
9931
9932 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9933
9934         Standardize on "memory exhausted" instead of "Memory exhausted"
9935         or "virtual memory exhausted".
9936         * obstack.c (print_and_abort): Use "memory exhausted", not
9937         "virtual memory exhausted".
9938         * same.c (same_name): Invoke xalloc_die instead of printing
9939         our own message.
9940         * userspec.c (parse_user_spec): Likewise.
9941         * bumpalloc.h: comment fix
9942         * same.c, userspec.c: Include xalloc.h.
9943
9944         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9945         not char *const and pointing to a constant array.
9946         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9947         (xrealloc): Comment fix.
9948
9949         * userspec.c (parse_user_spec):
9950         Don't translate a message until just before returning,
9951         to avoid unnecessary translation.
9952
9953 2000-08-07  Jim Meyering  <meyering@lucent.com>
9954
9955         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9956         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9957         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9958         getgroups.c, gethostname.c, getopt.h, group-member.c,
9959         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9960         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9961         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9962         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9963         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9964         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9965         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9966         yesno.c: Back out Copyright date changes for each file with no change
9967         this year.  This eases coordination with other programs using the same
9968         source code modules.  From Paul Eggert.
9969
9970 2000-08-03  Greg McGary  <greg@mcgary.org>
9971
9972         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9973         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9974         (EXTEND_BUFFER): Use them.
9975
9976 2000-08-01  Jim Meyering  <meyering@lucent.com>
9977
9978         * dirname.c (ISSLASH): Define.
9979         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9980         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9981         both `\' and `/' may be use as path separators.
9982         Based on a patch from Prashant TR.
9983
9984 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9985
9986         * quotearg.c (quotearg_n_options): Don't make the initial
9987         slot vector a constant, since it might get modified.
9988
9989 2000-07-31  Jim Meyering  <meyering@lucent.com>
9990
9991         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9992         * obstack.c (print_and_abort): Likewise.
9993
9994 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9995
9996         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9997         buffer, so that the caller can always quote one small
9998         component of a "memory exhausted" message in slot 0.
9999         From a suggestion by Jim Meyering.
10000
10001 2000-07-30  Jim Meyering  <meyering@lucent.com>
10002
10003         * makepath.c (make_path): Quote the other instance, too.
10004
10005         * quotearg.c (N_STATIC_SLOTVECS): Define.
10006         (STATIC_BUF_SIZE): Define.
10007         (quotearg_n_options): Use only statically allocated storage when
10008         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10009         than STATIC_BUF_SIZE.
10010
10011 2000-07-29  Jim Meyering  <meyering@lucent.com>
10012
10013         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10014         * dirname.c (dir_name): Likewise.
10015
10016         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10017
10018         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10019         (dir_name): Assert that there are no trailing slashes.
10020
10021 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10022
10023         * mbswidth.h (mbswidth): Add a flags argument.
10024         (mbswidth): New declaration.
10025         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10026         * mbswidth.c (mbswidth): Add a flags argument.
10027         (mbsnwidth): New function.
10028
10029 2000-07-24  Jim Meyering  <meyering@lucent.com>
10030
10031         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10032
10033 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10034
10035         * mbswidth.c (_XOPEN_SOURCE):
10036         Don't define; this causes problems on Solaris 7.
10037         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10038
10039 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10040
10041         * quotearg.c:
10042         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10043         so that mbstate_t is always defined.
10044
10045         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10046         be 1 in at least one GCC installation, and this configuration
10047         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10048         performance on hosts that have mbrtowc but have only unibyte
10049         locales, but I assume these hosts are rare.
10050
10051 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10052
10053         * quotearg.c: Streamline by invoking multibyte code only if needed.
10054         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10055         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10056         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10057         invoke multibyte primitives.
10058
10059 2000-07-23  Jim Meyering  <meyering@lucent.com>
10060
10061         * basename.c (base_name): Add an assertion.
10062
10063 2000-07-15  Bruno Haible  <clisp.cons.org>
10064
10065         * quotearg.c: When the system forces us to redefine mbstate_t,
10066         shadow its mbsinit function.
10067
10068 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10069
10070         * mbswidth.h: New file.
10071         * mbswidth.c: New file.
10072         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10073         (noinst_HEADERS): Add mbswidth.h.
10074
10075 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10076
10077         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10078         and IRIX 6.
10079
10080 2000-07-15  Jim Meyering  <meyering@lucent.com>
10081
10082         * makepath.c: Include quote.h.
10083         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10084         corresponding argument in a `quote (...)' call.
10085         Give better diagnostics.
10086
10087         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10088         (noinst_HEADERS): Add quote.h.
10089
10090         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10091         from tar's src/misc.c.
10092         * quote.h: New file.  Prototypes for same.
10093
10094 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10095
10096         From a suggestion by Bruno Haible.
10097         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10098         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10099         to decide whether to define the BeOS workaround macro;
10100         this adjusts to the change to AC_MBSTATE_T.
10101
10102 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10103
10104         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10105
10106         * quotearg.c (quoting_style_args, quoting_style_vals,
10107         quotearg_buffer_restyled): Add support for
10108         clocale_quoting_style.  Undo previous change to
10109         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10110         and "{RIGHT QUOTATION MARK}" msgids.
10111
10112 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10113
10114         The old behavior of quoting `like this' doesn't look good with
10115         newer, ISO-style fonts.  See:
10116         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10117
10118         Instead, quote "like this" by default.  Let the translator
10119         tailor the locale-specific quoting behavior by providing
10120         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10121
10122         * quotearg.c (N_): New macro.
10123         (gettext_default): New function.
10124         (quotearg_buffer_restyled): Use
10125         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10126         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10127
10128 2000-07-09  Jim Meyering  <meyering@lucent.com>
10129
10130         * Most files: Update copyright dates to include 2000.
10131
10132 2000-07-08  Jim Meyering  <meyering@lucent.com>
10133
10134         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10135         if not defined.
10136         (xgethostname): Remove now-unnecessary #ifdef.
10137         Move declaration of `err' into loop where it's used.
10138
10139 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10140
10141         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10142         by allocating a larger buffer. Test the gethostname return value for
10143         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10144         returns an error and ENAMETOOLONG isn't defined.
10145
10146 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10147         and Bruno Haible  <haible@clisp.cons.org>
10148
10149         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10150
10151 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10152
10153         * quotearg.c (struct quoting_options): Simplify quote_these_too
10154         dimension.
10155
10156 2000-07-03  Jim Meyering  <meyering@lucent.com>
10157
10158         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10159         Reported by Bruno Haible.
10160
10161 2000-07-04  Jim Meyering  <meyering@lucent.com>
10162
10163         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10164         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10165         lacks mbrtowc.
10166
10167 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10168         and Bruno Haible  <haible@clisp.cons.org>
10169
10170         * quotearg.c (mbrtowc):
10171         Assign to *pwc, and return 1 only if result is nonzero.
10172         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10173
10174 2000-07-03  Jim Meyering  <meyering@lucent.com>
10175
10176         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10177         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10178         From Bob Proulx.
10179
10180 2000-07-02  Jim Meyering  <meyering@lucent.com>
10181
10182         * quotearg.c (mbstate_t): Don't define here.
10183
10184 2000-07-02  Jim Meyering  <meyering@lucent.com>
10185
10186         * nanosleep.c (SIGCONT): Define if not already defined.
10187
10188 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10189
10190         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10191         per change in ../m4/ls-mntd-fs.m4.
10192         (read_filesystem_list): Ignore symbolic links.
10193
10194 2000-06-29  Jim Meyering  <meyering@lucent.com>
10195
10196         * same.c: Include <string.h> or <strings.h>, as appropriate,
10197         for declaration of strcmp.
10198
10199         * long-options.c: Include <stdlib.h>, for declaration of exit.
10200
10201         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10202         Avoid warning by casting result to `char *' to remove `const'.
10203
10204 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10205
10206         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10207
10208 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10209
10210         savedir now sets errno on failure and invokes xmalloc to get memory.
10211         Fix a couple of other minor bugs while we're at it.
10212
10213         * savedir.c (<unistd.h>): Do not include; there's no need.
10214         (NAMLEN): Remove macro.
10215         (malloc, realloc): Remove decls.
10216         (stpcpy): Likewise.
10217         ("xalloc.h"): Include.
10218         (NAME_SIZE_DEFAULT): New macro.
10219         (savedir): Use xmalloc / xrealloc to allocate memory.
10220         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10221         Skip "" directory entries.
10222         Use strlen to calculate directory entry length, since the old method
10223         is rarely used these days and isn't worth supporting.
10224         Don't use a pointer after freeing it.
10225         Check for integer overflow when calculating allocation size.
10226         Use memcpy to copy entries, instead of stpcpy.
10227         Set errno properly when returning NULL.
10228         Check for readdir error.
10229
10230 2000-06-26  Jim Meyering  <meyering@lucent.com>
10231
10232         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10233
10234 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10235
10236         * getusershell.c (xmalloc, xrealloc): Remove functions.
10237         Include xalloc.h.
10238         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10239
10240 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10241
10242         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10243
10244 2000-06-24  Jim Meyering  <meyering@lucent.com>
10245
10246         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10247
10248 2000-06-21  Jim Meyering  <meyering@lucent.com>
10249
10250         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10251
10252 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10253
10254         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10255         (mbrtowc, mbstate_t): Define substitutes if
10256         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10257         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10258         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10259
10260 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10261
10262         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10263         than 1024, return a memory chunk of least possible size, instead
10264         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10265         Use free/xmalloc instead of xrealloc to avoid copying for very long
10266         paths.
10267
10268 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10269
10270         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10271         address, not strdup.  Include <stdlib.h> and don't declare free().
10272
10273 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10274
10275         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10276         the empty string.
10277
10278 2000-06-21  Jim Meyering  <meyering@lucent.com>
10279
10280         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10281         (noinst_HEADERS): Add getstr.h.
10282
10283         * getline.c (getstr): Move into a separate file.
10284         * getstr.c (getstr): New file, extracted from getline.c, with
10285         the following changes: new parameter, delim2; both delim[12]
10286         parameters have type `int', not `char'.  The latter would lose
10287         with 8-bit delimiters.
10288         * getstr.h: New file.
10289
10290 2000-06-19  Jim Meyering  <meyering@lucent.com>
10291
10292         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10293
10294 2000-06-18  Jim Meyering  <meyering@lucent.com>
10295
10296         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10297         Besides, these days every porting target provides a mkdir function.
10298
10299         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10300         (this snippet comes from src/system.h).
10301
10302 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10303
10304         * human.c (adjust_value): New function.
10305         (human_readable_inexact): Apply rounding style even when
10306         printing approximate values.
10307
10308 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10309
10310         * human.c (human_readable_inexact): Allow an input block
10311         size that is not a multiple of the output block size, and vice versa.
10312         Reported by Piergiorgio Sartor.
10313
10314 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10315
10316         * getdate.y (get_date): Apply relative times after time
10317         zone indicator, not before.  Reported by Todd A. Jacobs.
10318
10319 2000-06-13  Jim Meyering  <meyering@lucent.com>
10320
10321         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10322
10323         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10324
10325 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10326
10327         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10328
10329 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10330
10331         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10332
10333 2000-06-04  Jim Meyering  <meyering@lucent.com>
10334
10335         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10336         SunOS 4.1.4 for which gid_t is an unsigned type.
10337
10338 2000-06-03  Jim Meyering  <meyering@lucent.com>
10339
10340         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10341
10342 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10343
10344         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10345         newer, don't install charset.alias.
10346         * config.charset: Change the Linux/glibc rules so they become empty
10347         on glibc-2.1 or newer.
10348
10349 2000-06-02  Jim Meyering  <meyering@lucent.com>
10350
10351         * mountlist.c: Back out last change.  Instead, do this...
10352         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10353         member using the same `ignore'-testing code.
10354         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10355         fs_type strings.
10356         From Mark D. Roth.
10357
10358 2000-05-29  Jim Meyering  <meyering@lucent.com>
10359
10360         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10361         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10362
10363 2000-05-22  Jim Meyering  <meyering@lucent.com>
10364
10365         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10366
10367 2000-05-18  Jim Meyering  <meyering@lucent.com>
10368
10369         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10370         back, too, since it may have been modified by allocate_entry.
10371         (hash_delete): Rewrite to use neither the assignment operator
10372         nor the comma operator in an if-expression.
10373
10374 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10375
10376         * closeout.c:
10377         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10378         Remove; no longer needed.
10379         "quotearg.h": Add include.
10380         (file_name): Do not bother to explicitly initialize to NULL; it's less
10381         efficient on some hosts.
10382         (close_stdout_status): Remove test as to whether stdout was already
10383         closed; it breaks for the case "echo x | sort >&-".
10384         Quote file name colons.
10385         Do not assume that _("write error") lacks format strings.
10386
10387 2000-05-15  Jim Meyering  <meyering@lucent.com>
10388
10389         * version-etc.c (version_etc_copyright): Update the copyright string
10390         used in all --version output.
10391
10392 2000-05-14  Jim Meyering  <meyering@lucent.com>
10393
10394         * closeout.c (close_stdout_set_file_name): New function.
10395         (close_stdout_status): Use new file-scoped global.
10396         Return right away if fstat says the stdout file descriptor is invalid.
10397         * closeout.h (close_stdout_set_file_name): Declare.
10398
10399 2000-05-10  Jim Meyering  <meyering@lucent.com>
10400
10401         * closeout.c [default_exit_status]: New file-scoped variable.
10402         (close_stdout_set_status): New function.
10403         * closeout.h (close_stdout_set_status): Declare.
10404
10405 2000-05-08  Jim Meyering  <meyering@lucent.com>
10406
10407         * long-options.c: Don't include closeout.h.
10408         (parse_long_options): Don't call close_stdout for --version.
10409
10410 2000-05-06  Jim Meyering  <meyering@lucent.com>
10411
10412         * strnlen.c: Undefine __strnlen and strnlen.
10413         [!weak_alias]: Define __strnlen to strnlen.
10414
10415         * atexit.c: New file, from libiberty.
10416
10417 2000-05-06  Jim Meyering  <meyering@lucent.com>
10418
10419         * closeout.c (close_stdout_status): Also check for errors on the
10420         stderr stream.
10421
10422 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10423
10424         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10425         instead of xmalloc, xrealloc, path_concat.
10426         (locale_charset): Treat empty environment variables as absent.
10427         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10428
10429 2000-05-04  Jim Meyering  <meyering@lucent.com>
10430
10431         * getopt.c: Update from glibc.
10432         * obstack.c: Likewise.
10433         * obstack.h: Likewise.
10434         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10435
10436         * regex.h: Likewise.
10437         * strndup.c: Likewise.
10438         * strnlen.c: New file, from glibc.
10439
10440 2000-05-01  Jim Meyering  <meyering@lucent.com>
10441
10442         * full-write.c (full_write): Remove `FIXME' part of comment.
10443
10444 2000-04-29  Jim Meyering  <meyering@lucent.com>
10445
10446         * path-concat.c: Declare strdup only if it's not defined.
10447         * canon-host.c: Likewise.
10448
10449 2000-04-28  Jim Meyering  <meyering@lucent.com>
10450
10451         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10452         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10453         included first, then limits.h is included by locale.h by libintl.h.
10454         From John David Anglin.
10455
10456 2000-04-25  Jim Meyering  <meyering@lucent.com>
10457
10458         * makepath.c (S_IRWXUGO): Define.
10459         (make_path): Always perform explicit chmod if MODE specifies any
10460         of the `special' permission bits.  Prompted by a bug report against
10461         install from Mate Wierdl and Joost van Baal.
10462
10463 2000-04-18  Jim Meyering  <meyering@lucent.com>
10464
10465         * README: New file.
10466
10467         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10468         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10469
10470 2000-04-17  Jim Meyering  <meyering@lucent.com>
10471
10472         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10473         the definition of it to rpl_strftime also defined-away the system's
10474         declaration.
10475
10476 2000-04-15  Jim Meyering  <meyering@lucent.com>
10477
10478         Use `C' to denote so-called `contiguous' files, the same way
10479         that tar does.
10480         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10481         (ftypelet): Use S_ISCTG.
10482         From Michael Deutschmann.
10483
10484 2000-04-14  Jim Meyering  <meyering@lucent.com>
10485
10486         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10487
10488 2000-04-08  Jim Meyering  <meyering@lucent.com>
10489
10490         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10491         names don't conflict.  Reported by Eli Zaretskii.
10492
10493 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10494
10495         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10496         bug.  Deal with the different error behavior of Irix iconv.
10497
10498 2000-04-07  Jim Meyering  <meyering@lucent.com>
10499
10500         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10501         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10502
10503 2000-04-05  Jim Meyering  <meyering@lucent.com>
10504
10505         Portability tweaks required for ultrix4.3.
10506         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10507         * readutmp.c: Include sys/types.h before sys/stat.h.
10508         * canon-host.c: Declare strdup.
10509         * path-concat.c: Likewise.
10510         From John David Anglin.
10511
10512 2000-04-04  Jim Meyering  <meyering@lucent.com>
10513
10514         Be more DOS 8.3-friendly.
10515         * ref-add.sin: Renamed from ref-add.sed.in.
10516         * ref-del.sin: Renamed from ref-del.sed.in.
10517         * Makefile.am: Reflect renaming.
10518         Reported by Eli Zaretskii.
10519
10520         Use a temporary file name that won't clash with `charset.alias'
10521         in the DOS 8.3 name space.
10522         * Makefile.am (charset_tmp): Define.
10523         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10524         (uninstall-local): Likewise.
10525         Reported by Eli Zaretskii.
10526
10527 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10528
10529         * time/strftime.c (my_strftime): Make sure we call the system
10530         strftime, not ourselves, when invoking the underlying strftime.
10531
10532 2000-03-24  Jim Meyering  <meyering@lucent.com>
10533
10534         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10535         (charset_alias): Define.
10536         (install-exec-local): Factor out common code.
10537         (uninstall-local): Split lines longer than 80.
10538         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10539         (SUFFIXES): Define.
10540         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10541         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10542
10543 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10544
10545         * config.charset: Output a line containing "Packages using this file".
10546         * ref-add.sed.in, ref-del.sed.in: New files.
10547         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10548         ref-del.sed): New rules.
10549
10550 2000-03-17  Jim Meyering  <meyering@lucent.com>
10551
10552         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10553         Otherwise, include <strings.h>
10554
10555 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10556
10557         * unicodeio.c (utf8_wctomb): New function.
10558         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10559         format instead of in UCS-4 with platform dependent endianness.
10560
10561 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10562
10563         * savedir.c (savedir): Work even if directory size is
10564         negative; this can happen with some screwy NFS configurations.
10565
10566 2000-03-06  Jim Meyering  <meyering@lucent.com>
10567
10568         * localcharset.c (get_charset_aliases): Don't try to free file_name
10569         if it's NULL (because we ran out of memory).  From Bruno Haible.
10570
10571 2000-03-05  Jim Meyering  <meyering@lucent.com>
10572
10573         * localcharset.c ("path-concat.h"): Include.
10574         (get_charset_aliases): Use path_concat instead of ANSI string
10575         concatenation.
10576
10577         * unicodeio.h (PARAMS): Define.
10578         Use it to guard prototype.
10579
10580 2000-03-04  Jim Meyering  <meyering@lucent.com>
10581
10582         * Makefile.am (install-exec-local): Create $(libdir) before installing
10583         into it.
10584         (uninstall-local): Uncomment this rule so `make distcheck' works
10585         once again.
10586
10587         * unicodeio.c (<errno.h>): Include it.
10588         (errno): Declare if not defined.
10589
10590         * localcharset.c: Add Bruno's comment justifying use of volatile.
10591
10592         * config.charset: New version, incorporating remarks from a linux
10593         i18n mailing list.  From Bruno Haible.
10594
10595 2000-03-02  Jim Meyering  <meyering@lucent.com>
10596
10597         * Makefile.am (EXTRA_DIST): Add config.charset.
10598
10599 2000-03-01  Jim Meyering  <meyering@lucent.com>
10600
10601         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10602         * unicodeio.c: Likewise.
10603
10604 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10605
10606         * config.charset: New file.
10607         * localcharset.c: New file.
10608         * unicodeio.h, unicodeio.c: New files.
10609         * Makefile.am (DEFS): Add -DLIBDIR=...
10610         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10611         (noinst_HEADERS): Add unicodeio.h.
10612         (all-local, install-exec-local, charset.alias): New targets.
10613
10614 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10615
10616         * quotearg.c (ALERT_CHAR): New macro.
10617         (quotearg_buffer_restyled): Use it.
10618
10619 2000-02-27  Jim Meyering  <meyering@lucent.com>
10620
10621         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10622         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10623
10624         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10625         not `#if STDC_HEADERS'.
10626         Declare malloc if needed.
10627
10628         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10629         now that autoconf always defines the HAVE_DECL_ symbols.
10630         * human.c: Likewise.
10631         * same.c: Likewise.
10632         * strtoumax.c: Likewise.
10633
10634         * backupfile.c: Arrange for cpp to fail if the configure-time
10635         declaration check was not run.
10636         * hash.c: Likewise.
10637         * human.c: Likewise.
10638         * same.c: Likewise.
10639         * strtoumax.c: Likewise.
10640
10641         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10642         then first look up the entire `.'-containing string as a login name.
10643
10644 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10645
10646         * getdate.y: Handle two-digit years with leading zeros correctly.
10647         (textint): New typedef.
10648         (parser_control): Member year changed from int to textint.
10649         All uses changed.
10650         (YYSTYPE): Removed; replaced by %union with int and textint members.
10651         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10652         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10653         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10654         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10655         (date, number, to_year): Use width of number in digits, not its value,
10656         to determine whether it's a 2-digit year, or a 2-digit time.
10657         (yylex): Store number of digits of numeric tokens.
10658         Reported by John Kendall.
10659
10660         (parser_control): Changed from struct parser_control to typedef (for
10661         consistency).  All uses changed.
10662
10663         (tID): Removed; not used.
10664         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10665
10666 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10667
10668         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10669         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10670
10671 2000-02-12  Jim Meyering  <meyering@lucent.com>
10672
10673         * userspec.c (ISDIGIT): Define it.
10674         (isdigit): Remove definition.
10675         (is_number): Use ISDIGIT, not isdigit.
10676         <libintl.h>: Include.
10677         (_ and N_): Define.
10678         (parse_user_spec): Mark translatable strings.
10679
10680 2000-02-10  Jim Meyering  <meyering@lucent.com>
10681
10682         With these changes, nanosleep.[ch] are finally enough like the other
10683         lib/* replacement files to compile on a few more losing systems.
10684
10685         * nanosleep.h: Don't include config.h.
10686         Remove prototype from declaration of nanosleep.
10687         (PARAMS): Remove now-unneeded definition.
10688         * nanosleep.c: #undef nanosleep.
10689         (rpl_nanosleep): Rename from nanosleep.
10690
10691 2000-02-03  Jim Meyering  <meyering@lucent.com>
10692
10693         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10694         rather than with `#if HAVE_UTMPNAME'.
10695
10696 2000-02-01  Jim Meyering  <meyering@lucent.com>
10697
10698         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10699
10700 2000-01-31  Jim Meyering  <meyering@lucent.com>
10701
10702         * nanosleep.h (nanosleep): Guard declaration with
10703         `#if ! HAVE_DECL_NANOSLEEP'.
10704         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10705         the declaration in that vendor's sys/timers.h.
10706         Reported by Christian Krackowizer.
10707
10708         * quotearg.c (ISASCII): Add #undef and move definition to follow
10709         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10710         (ISPRINT): Likewise.
10711         Reported by Tom Tromey.
10712
10713 2000-01-30  Jim Meyering  <meyering@lucent.com>
10714
10715         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10716         uses of ->ut_name.  The latter doesn't work with new Linux header files
10717         where only utmpx.ut_user is declared.
10718
10719         * readutmp.h (UT_USER): Define.
10720
10721 2000-01-23  Jim Meyering  <meyering@lucent.com>
10722
10723         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10724         obstack.c.
10725
10726 2000-01-22  Jim Meyering  <meyering@lucent.com>
10727
10728         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10729         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10730         Required for some AIX systems.  Reported by Christian Krackowizer.
10731         [TESTING] (main): New function.
10732
10733         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10734         * dirname.c (dir_name): Support for DOS-style file names with drive
10735         letters.
10736
10737         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10738
10739         * strverscmp.c (ISDIGIT): Define.
10740         (strverscmp): Use ISDIGIT, not isdigit.
10741
10742 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10743
10744         * nanosleep.c (nanosleep):
10745         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10746         POSIX.1 doesn't require SA_INTERRUPT and some systems
10747         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10748         it's been part of POSIX.1 since day 1 (in 1988).
10749
10750 2000-01-17  Jim Meyering  <meyering@lucent.com>
10751
10752         * interlock: Remove unused file.  Reported by François Pinard.
10753
10754 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10755
10756         * quotearg.c (quotearg_buffer_restyled): Do not quote
10757         alert, backslash, formfeed, and vertical tab unnecessarily in
10758         shell quoting style.
10759
10760
10761 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10762 Free Software Foundation, Inc.
10763 Copying and distribution of this file, with or without modification,
10764 are permitted provided the copyright notice and this notice are preserved.