* getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
[gnulib.git] / lib / ChangeLog
1 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
4         that prevented coreutils 6.1 from building.  Problem reported
5         by Petter Reinholdtsen.
6
7 2006-09-18  Jim Meyering  <jim@meyering.net>
8
9         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
10
11 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
12
13         * dirchownmod.c: Don't include fcntl.h; no longer needed.
14         (dirchownmod): New arg FD.  All callers changed.
15         Use FD rather than opening the directory ourself, as opening is
16         now the caller's responsibility.
17         * dirchownmod.h: Likewise.
18         * mkancesdirs.c: Include <sys/types.h>, for portability to older
19         hosts that require <sys/types.h> before <sys/stat.h>.  Include
20         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
21         (test_dir): Remove.
22         (mkancesdirs): Return length of prefix of FILE that has already
23         been made, or -2 if there is a child doing the work.  Redo
24         algorithm so that it is O(N) rather than O(N**2).  Optimize away
25         ".", and treat ".." specially since it might stray back into
26         already-created areas.  Use a subprocess if necessary.  New arg
27         WD; all users changed.  MAKE_DIR function should now return 1
28         if it creates a directory that is not readable.  Return -2 if
29         a child process is spun off.
30         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
31         Adjust signature to match code.
32         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
33         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
34         all users changed.
35         * savewd.c, savewd.h: New files.
36
37 2006-09-15  Jim Meyering  <jim@meyering.net>
38
39         * rename-dest-slash.c (has_trailing_slash): Use
40         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
41         (rpl_rename_dest_slash): Perform the cheaper trailing slash
42         test before testing whether SRC is a directory.
43         Suggestions from Bruno Haible.
44
45         Avoid a warning about an unused variable.
46         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
47         into the #ifdef block where it's used.
48
49         * rename-dest-slash.c: New file.
50
51 2006-09-14  Bruno Haible  <bruno@clisp.org>
52
53         * allocsa.c: Include <config.h> unconditionally.
54         * asnprintf.c: Likewise.
55         * asprintf.c: Likewise.
56         * c-strcasecmp.c: Likewise.
57         * c-strcasestr.c: Likewise.
58         * c-strncasecmp.c: Likewise.
59         * c-strstr.c: Likewise.
60         * classpath.c: Likewise.
61         * clean-temp.c: Likewise.
62         * concatpath.c: Likewise.
63         * copy-file.c: Likewise.
64         * csharpcomp.c: Likewise.
65         * csharpexec.c: Likewise.
66         * execute.c: Likewise.
67         * fatal-signal.c: Likewise.
68         * findprog.c: Likewise.
69         * fwriteerror.c: Likewise.
70         * gl_array_list.c: Likewise.
71         * gl_array_oset.c: Likewise.
72         * gl_avltree_list.c: Likewise.
73         * gl_avltree_oset.c: Likewise.
74         * gl_avltreehash_list.c: Likewise.
75         * gl_carray_list.c: Likewise.
76         * gl_linked_list.c: Likewise.
77         * gl_linkedhash_list.c: Likewise.
78         * gl_list.c: Likewise.
79         * gl_oset.c: Likewise.
80         * gl_rbtree_list.c: Likewise.
81         * gl_rbtree_oset.c: Likewise.
82         * gl_rbtreehash_list.c: Likewise.
83         * imaxabs.c: Likewise.
84         * imaxdiv.c: Likewise.
85         * javacomp.c: Likewise.
86         * javaexec.c: Likewise.
87         * javaversion.c: Likewise.
88         * linebreak.c: Likewise.
89         * localcharset.c: Likewise.
90         * lock.c: Likewise.
91         * mbchar.c: Likewise.
92         * mbswidth.c: Likewise.
93         * mkdtemp.c: Likewise.
94         * pipe.c: Likewise.
95         * printf-args.c: Likewise.
96         * printf-parse.c: Likewise.
97         * progname.c: Likewise.
98         * progreloc.c: Likewise.
99         * readlink.c: Likewise.
100         * sh-quote.c: Likewise.
101         * stpcpy.c: Likewise.
102         * stpncpy.c: Likewise.
103         * strcasecmp.c: Likewise.
104         * strcasestr.c: Likewise.
105         * strcspn.c: Likewise.
106         * striconv.c: Likewise.
107         * strncasecmp.c: Likewise.
108         * strnlen1.c: Likewise.
109         * strstr.c: Likewise.
110         * strtok_r.c: Likewise.
111         * tls.c: Likewise.
112         * tmpdir.c: Likewise.
113         * unicodeio.c: Likewise.
114         * unsetenv.c: Likewise.
115         * vasnprintf.c: Likewise.
116         * vasprintf.c: Likewise.
117         * wait-process.c: Likewise.
118         * xallocsa.c: Likewise.
119         * xsetenv.c: Likewise.
120         * xstriconv.c: Likewise.
121
122 2006-09-13  Eric Blake  <ebb9@byu.net>
123
124         * getopt.c: Fix typo in last commit.
125
126 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
127
128         * _fpending.c: Include <config.h> unconditionally, since we no
129         longer worry about uses that don't define HAVE_CONFIG_H.
130         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
131         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
132         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
133         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
134         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
135         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
136         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
137         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
138         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
139         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
140         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
141         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
142         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
143         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
144         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
145         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
146         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
147         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
148         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
149         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
150         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
151         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
152         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
153         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
154         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
155         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
156         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
157         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
158         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
159         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
160         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
161         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
162         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
163         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
164         Likewise.
165
166 2006-09-12  Jim Meyering  <jim@meyering.net>
167
168         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
169         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
170         Reported by Nelson H. F. Beebe.
171
172 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
173
174         * argp-help.c (argp_doc): Make sure NULL is not passed to
175         dgettext.
176
177 2006-09-10  Bruno Haible  <bruno@clisp.org>
178
179         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
180
181 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
182
183         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
184         program_invocation_name and program_invocation_short_name are
185         initialized.
186         * argp-namefrob.h: Move declarations of program_invocation_name
187         and program_invocation_short_name to argp.h, so they are visible
188         to user programs.
189         * argp.h: Likewise
190
191 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
192
193         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
194         convention.  Text proposed by Bruno Haible.
195         (struct argp_option): Document the use of N_() wrappers.
196
197         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
198         and translate the two parts separately, instead of feeding
199         the whole string to gettext.  This allows to exclude
200         '\v' from the strings visible to the translator by writing doc
201         strings as N_("..") "\v" N_("..").
202
203 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
204
205         * mktime.c (guess_time_tm): Fix bug where mktime
206         returned the maximum time_t value rather than (time_t) -1.
207         Problem originally reported by William Bardwell
208         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
209
210         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
211         Moved to here ...
212         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
213         ... from here.
214
215 2006-09-06  Bruno Haible  <bruno@clisp.org>
216
217         * striconv.h: New file.
218         * striconv.c: New file, merging iconvme.c with GNU gettext's
219         iconvstring.c.
220         * xstriconv.h: New file.
221         * xstriconv.c: New file.
222
223 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
224
225         * argz_.h: Sync from Libtool.
226
227         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
228                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
229
230         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
231
232 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
233
234         * trim.h: New file.
235         * trim.c: New file.
236
237 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
238
239         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
240         Problem reported by Ralf Wildenhues in
241         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
242
243         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
244         HAVE_STRUCT_STATFS_F_FSTYPENAME.
245
246 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
247
248         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
249         or stdbool.h, because they might not exist while configuring.
250
251         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
252         Don't include unistd.h or limits.h; not needed, since chdir-long.h
253         does that for us.
254         (O_DIRECTORY): Remove.
255
256 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
257
258         Work around a bug in both the Linux and SunOS 64-bit kernels:
259         nanosleep mishandles sleeps for longer than 2**31 seconds.
260         Problem reported by Frank v Waveren in
261         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
262         * nanosleep.c (BILLION): New constant.
263         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
264         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
265
266 2006-08-30  Jim Meyering  <jim@meyering.net>
267
268         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
269         the parameter.
270
271 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
272
273         * isapipe.c, isapipe.h: New files.
274
275 2006-08-29  Eric Blake  <ebb9@byu.net>
276
277         * error.c (error_at_line, print_errno_message): Match libc, after
278         resolution of upstream bug 3044.
279
280 2006-08-29  Bruno Haible  <bruno@clisp.org>
281
282         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
283
284 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
285
286         Sync from Libtool:
287
288         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
289
290         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
291         sharing with gnulib.  Report by Eric Blake.
292
293 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
294
295         * fcntl_.h: New file.
296         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
297         the fcntl module.
298         * dirchownmod.c: Likewise.
299         * fts.c: Likewise.
300
301         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
302         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
303         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
304         just before including <inttypes.h>, to avoid circular inclusion.
305
306 2006-08-28  Bruno Haible  <bruno@clisp.org>
307
308         * inttypes_.h (SCNX*): Remove definitions.
309         Reported by Eric Blake.
310
311 2006-08-26  Bruno Haible  <bruno@clisp.org>
312
313         * vasnprintf.c (EOVERFLOW): Remove definition.
314         (VASNPRINTF): Return a string of length > INT_MAX without failing.
315         * vasprintf.c: Include errno.h, limits.h.
316         (EOVERFLOW): New fallback definition.
317         (vasprintf): Test here whether the string length is > INT_MAX.
318         * vsnprintf.c: Include errno.h, limits.h.
319         (EOVERFLOW): New fallback definition.
320         (vsnprintf): Fix bug when generated string was too long for the buffer.
321         Test here whether the string length is > INT_MAX.
322
323 2006-08-26  Bruno Haible  <bruno@clisp.org>
324             Simon Josefsson  <jas@extundo.com>
325
326         BeOS portability.
327         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
328
329 2006-08-28  Bruno Haible  <bruno@clisp.org>
330
331         * c-strstr.h: New file, from GNU gettext.
332         * c-strstr.c: New file, from GNU gettext.
333
334 2006-08-26  Bruno Haible  <bruno@clisp.org>
335
336         * inttypes_.h: New file.
337         * inttypes.h: Remove file.
338         * stdint_.h: Include <inttypes.h> through its absolute filename.
339
340         * imaxabs.c: New file.
341
342         * imaxdiv.c: New file.
343
344 2006-08-22  Bruno Haible  <bruno@clisp.org>
345
346         * readutmp.h: Skip most definitions if neither <utmp.h> nor
347         <utmpx.h> exists.
348
349 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
350
351         BeOS portability.
352         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
353         Problem reported by Bruno Haible.
354
355 2006-08-21  Bruno Haible  <bruno@clisp.org>
356
357         BeOS portability.
358         * mbchar.h: Include <wctype.h> only if it exists.
359
360 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
361
362         * cycle-check.h: Include <stdint.h> unconditionally, since we
363         now assume the stdint module.  Do not include inttypes.h.
364         * fsusage.h: Likewise.
365         * getndelim2.c: Likewise.
366         * human.h: Likewise.
367         * inttostr.h: Likewise.
368         * obstack.c: Likewise.
369         * regex_internal.h: Likewise.
370         * tempname.c: Likewise.
371         * utimecmp.c: Likewise.
372         * xstrtol.h: Likewise.
373
374         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
375
376         * strtoimax.c: Adjust to macro name changes in Autoconf,
377         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
378         * xtime.h: Likewise.
379
380 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
381
382         * fchmodat.c: New file, from coreutils.  This was inadvertently
383         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
384
385 2006-08-18  Bruno Haible  <bruno@clisp.org>
386
387         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
388         (ME_DUMMY): Treat "kernfs" as a dummy.
389         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
390
391 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
392
393         Update from coreutils.
394
395         * __fpending.h: Add copyright notice.
396         * fprintftime.h: Likewise.
397         * savedir.c: Use (C) in copyright notice.
398         * savedir.h: Likewise.
399
400         2006-08-15  Jim Meyering  <jim@meyering.net>
401
402         * at-func.c: New file, with the logic of all emulated at-functions.
403         * openat-priv.h: Include <errno.h> and define ENOSYS,
404         in support of the EXPECTED_ERRNO macro.
405         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
406         Instead, define the appropriate symbols and include "at-func.c".
407         * mkdirat.c (mkdirat): Likewise.
408         * fchmodat.c (fchmodat): Likewise.
409         (ENOSYS): Remove definition.
410         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
411         Don't include "unistd--.h" -- it wasn't ever used.
412
413         2006-01-17  Jim Meyering  <jim@meyering.net>
414
415         Rewrite fts.c not to change the current working directory,
416         by using openat, fstatat, fdopendir, etc..
417
418         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
419         (HAVE_OPENAT_SUPPORT): Define.
420         [_LIBC] (fchdir): Don't undef or define; no longer used.
421         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
422         Now, this `function' always succeeds, and consumes its file descriptor
423         parameter -- so callers must not close such FDs.  Update callers.
424         (diropen_fd, opendirat, cwd_advance_fd): New functions.
425         (diropen): Add parameter, SP.  Adjust all callers.
426         Implement using diropen_fd, rather than open.
427         (fts_open): Initialize new member, fts_cwd_fd.
428         Remove fts_rft-setting code.
429         (fts_close): Close fts_cwd_fd, if necessary.
430         (__opendir2): Define in terms of opendir or opendirat,
431         depending on whether the FST_NOCHDIR flag is set.
432         (fts_build): Since fts_safe_changedir consumes its FD, and since
433         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
434         and close the dup'd file descriptor upon failure.
435         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
436         (fts_safe_changedir): Tweak semantics to reflect that this function
437         now calls cwd_advance_fd and hence consumes its FD argument.
438         * fts_.h [struct FTS] (fts_cwd_fd): New member.
439         [struct FTS] (fts_rft): Remove now-unused member.
440         [struct FTS] (fts_cycle.state): Improve comment.
441
442         * openat.c (openat_needs_fchdir): New function.
443         * openat.h (openat_needs_fchdir): Declare it.
444
445 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
446
447         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
448         Problem and fix reported by Pádraig Brady in
449         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
450
451 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
452
453         * memcoll.c (memcoll): Optimize for the common case where the
454         arguments are bytewise equal.
455
456 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
457
458         Change copyright notice from LGPL 2 to GPL 2, since that's the
459         standard form used in the gnulib repository.
460         * lock.c: LGPL -> GPL.
461         * lock.h: Likewise.
462         * strnlen1.c: Likewise.
463         * strnlen1.h: Likewise.
464         * tls.c: Likewise.
465         * tls.h: Likewise.
466         * tmpdir.c: Likewise.
467
468         * TODO: Remove; this belongs only in coreutils.
469
470 2006-08-14  Eric Blake  <ebb9@byu.net>
471
472         Import the following change from libc:
473
474         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
475
476         Upstream bug 2997.
477         * misc/error.c: Add space between program name and message if file
478         name is missing.
479
480 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
481
482         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
483         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
484
485         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
486         in wchar_t.  Problem reported by Eric Blake.
487
488         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
489         LEN is smaller than SIZE.  Suggested by Bruno Haible.
490         Also, help the compiler to keep LEN in a register.
491
492 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
493
494         * .cppi-disable: Add snprintf.h, socket_.h.
495         * snprintf.c: Include <errno.h> and <limits.h>.
496         (EOVERFLOW): Define if the system does not.
497         Do not include "minmax.h"; it wasn't used.
498         (snprintf): Don't assume size_t promotes to an unsigned type.
499         Fix bug when generated string was too long for the buffer: the
500         buffer's contents are supposed to be the initial prefix of the
501         output.  Don't assume vasnprintf returns EOVERFLOW if the size
502         exceeds INT_MAX; do the check ourselves.
503
504         Import the following changes from libc:
505
506         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
507
508         * posix/regex_internal.c (re_string_skip_chars): If no character has
509         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
510         to the byte which couldn't be converted.
511         (re_string_reconstruct): Don't clear valid_raw_len before calling
512         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
513         tip_context using re_string_context_at.
514
515         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
516
517         * posix/regex.h: g++ still cannot handled [restrict].
518
519         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
520
521         * posix/regex.h: Remove special handling for VMS.
522
523 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
524
525         Sync from coreutils.
526
527         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
528
529         * mountlist.c [ME_REMOTE]: Filter out cifs.
530         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
531
532 2006-08-08  Eric Blake  <ebb9@byu.net>
533
534         * verror.c (verror_at_line): Work around glibc bug 2997, so that
535         verror_at_line output complies with GNU Coding Standards even when
536         file is NULL.
537
538 2006-08-08  Eric Blake  <ebb9@byu.net>
539
540         * verror.h, verror.c: New files.
541
542 2006-08-07  Bruno Haible  <bruno@clisp.org>
543
544         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
545         versions of AIX.
546         Reported by Ralf Wildenhues.
547
548 2006-08-06  Eric Blake  <ebb9@byu.net>
549
550         * error.h: Fold in some upstream changes from glibc.
551         * error.c: Likewise.
552
553 2006-07-29  Bruno Haible  <bruno@clisp.org>
554
555         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
556
557 2006-07-29  Bruno Haible  <bruno@clisp.org>
558
559         * setenv.c: Undo unintended modification done on 2006-02-27.
560
561 2006-07-28  Eric Blake  <ebb9@byu.net>
562
563         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
564         macro expansion.
565
566 2006-07-28  Simon Josefsson  <jas@extundo.com>
567
568         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
569         #include's.
570
571 2006-07-28  Simon Josefsson  <jas@extundo.com>
572
573         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
574         #include's.
575
576 2006-07-28  Bruno Haible <bruno@clisp.org>
577
578         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
579
580 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
581
582         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
583         arpa/inet.h.
584
585 2006-07-28  Bruno Haible  <bruno@clisp.org>
586
587         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
588         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
589         fallbacks.
590         Avoids link error on FreeBSD 4.x.
591         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
592
593         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
594         encoding.
595         * mbswidth.c (iswcntrl): Likewise.
596
597 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
598
599         * modechange.c (mode_compile): Numeric modes now affect setuid and
600         setgid on directories only if they set these bits.
601         * modechange.h: Remove obsolete comment about masks.
602
603 2006-07-27  Bruno Haible  <bruno@clisp.org>
604
605         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
606         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
607         defined.
608
609 2006-07-26  Eric Blake  <ebb9@byu.net>
610
611         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
612         like mingw that lack mkstemp.
613         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
614         avoid compilation warning on mingw.
615
616 2006-07-25  Bruno Haible  <bruno@clisp.org>
617
618         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
619         <stdarg.h> or config.h.
620
621 2006-07-24  Bruno Haible  <bruno@clisp.org>
622
623         * clean-temp.h: New file, from GNU gettext.
624         * clean-temp.c: New file, from GNU gettext.
625
626 2006-07-24  Bruno Haible  <bruno@clisp.org>
627
628         * tmpdir.h: New file, from GNU gettext.
629         * tmpdir.c: New file, from GNU gettext.
630
631 2006-07-23  Bruno Haible  <bruno@clisp.org>
632
633         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
634         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
635         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
636         gl_linked_remove_at): Use it.
637
638 2006-07-23  Eric Blake  <ebb9@byu.net>
639
640         * tmpfile-safer.c: New file.
641         * stdio-safer.h (fopen_safer): Add prototype.
642         * stdio--.h (tmpfile): Make safer.
643
644 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
645
646         * close-stream.c, close-stream.h: New files.
647
648 2006-07-22  Bruno Haible  <bruno@clisp.org>
649
650         Merge from GNU gettext 0.15.
651
652         2005-07-05  Bruno Haible  <bruno@clisp.org>
653
654                 * printf-args.c (printf_fetchargs): Work around broken
655                 definition of wint_t on mingw.
656
657         2005-02-12  Bruno Haible  <bruno@clisp.org>
658
659                 * xallocsa.h: Add extern "C" for C++.
660
661         2006-05-17  Bruno Haible  <bruno@clisp.org>
662
663                 Cygwin portability.
664                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
665
666         2006-04-30  Bruno Haible  <bruno@clisp.org>
667
668                 * progreloc.c: Include <mach-o/dyld.h> if available.
669                 (find_executable): Use _NSGetExecutablePath when possible.
670
671         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
672
673                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
674                 function.
675
676         2005-12-29  Bruno Haible  <bruno@clisp.org>
677
678                 * progreloc.c (set_program_name_and_installdir): Fix
679                 compilation error.
680
681         2005-12-04  Bruno Haible  <bruno@clisp.org>
682
683                 Cygwin portability.
684                 * progreloc.c: Include <windows.h> also on Cygwin.
685                 (find_executable): Add support for Cygwin.
686                 (set_program_name_and_installdir): Handle also platforms with
687                 nonempty EXEEXT.
688
689         2006-07-11  Bruno Haible  <bruno@clisp.org>
690
691                 * javacomp.c: Fix a comment.
692                 Reported by Jim Meyering.
693
694         2006-04-30  Bruno Haible  <bruno@clisp.org>
695
696                 * javacomp.h (compile_java_class): Add source_version,
697                 target_version arguments.
698                 * javacomp.c: Rewritten to choose only a compiler that
699                 respects the specified source_version and target_version.
700
701         2006-06-27  Bruno Haible  <bruno@clisp.org>
702
703                 Assume correct S_ISDIR macro.
704                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
705
706         2006-07-22  Bruno Haible  <bruno@clisp.org>
707
708                 * javaversion.h: New file, from GNU gettext.
709                 * javaversion.c: New file, from GNU gettext.
710                 * javaversion.java: New file, from GNU gettext.
711                 * javaversion.class: New file, from GNU gettext.
712
713         2006-05-17  Bruno Haible  <bruno@clisp.org>
714
715                 Cygwin portability.
716                 * javaexec.c (execute_java_class): Test for jview program
717                 also on Cygwin.
718
719         2006-04-09  Bruno Haible  <bruno@clisp.org>
720
721                 * fatal-signal.c: Don't include string.h.
722                 (at_fatal_signal): Use a copying loop instead of memcpy.
723
724         2005-12-04  Bruno Haible  <bruno@clisp.org>
725
726                 * csharpexec.c: Add support for 'clix' launcher (untested).
727                 (execute_csharp_using_sscli): New function.
728                 (execute_csharp_program): Call it.
729
730         2006-06-21  Bruno Haible  <bruno@clisp.org>
731
732                 Avoid warnings from recent versions of mcs.
733                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
734                 -o, -L, -r any more. Use options documented since mcs-1.0
735                 instead. Similarly for -g.
736
737         2005-07-09  Bruno Haible  <bruno@clisp.org>
738
739                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
740                 add a .dll suffix.
741                 Reported by Mark Junker <mjscod@gmx.de>.
742
743         2006-06-17  Bruno Haible  <bruno@clisp.org>
744
745                 * config.charset: Update for NetBSD 3.0.
746
747         2006-05-17  Bruno Haible  <bruno@clisp.org>
748
749                 Cygwin portability.
750                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
751
752         2006-05-16  Bruno Haible  <bruno@clisp.org>
753
754                 * localcharset.c [CYGWIN]: Include <windows.h>.
755                 (get_charset_aliases): For Cygwin, return the same CPxxx
756                 aliases list as under WIN32.
757                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
758                 the environment variables. Fall back to GetACP().
759
760         2006-04-05  Bruno Haible  <bruno@clisp.org>
761
762                 * config.charset: Update Juan Manuel Guerrero's address.
763
764         2005-02-12  Bruno Haible  <bruno@clisp.org>
765
766                 * allocsa.h: Add extern "C" for C++.
767
768         2005-02-10  Bruno Haible  <bruno@clisp.org>
769
770                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
771                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
772
773         2006-07-22  Bruno Haible  <bruno@clisp.org>
774
775                 * gettext.h: Update to GNU gettext-0.15.
776
777 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
778         and Simon Josefsson <jas@extundo.com>
779
780         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
781
782         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
783
784 2006-07-21  Eric Blake  <ebb9@byu.net>
785
786         * stdlib-safer.h: New file from coreutils, required by
787         stdlib--.h.
788
789 2006-07-19  Derek R. Price  <derek@ximbiot.com>
790
791         * getaddrinfo.h: Don't define unimplemented AI_* flags.
792         Reindent and repaginate.
793
794 2006-07-17  Bruno Haible  <bruno@clisp.org>
795
796         * gl_list.h: New file.
797         * gl_list.c: New file.
798         * gl_array_list.h: New file.
799         * gl_array_list.c: New file.
800         * gl_carray_list.h: New file.
801         * gl_carray_list.c: New file.
802         * gl_linked_list.h: New file.
803         * gl_linked_list.c: New file.
804         * gl_anylinked_list1.h: New file.
805         * gl_anylinked_list2.h: New file.
806         * gl_avltree_list.h: New file.
807         * gl_avltree_list.c: New file.
808         * gl_anyavltree_list1.h: New file.
809         * gl_anyavltree_list2.h: New file.
810         * gl_rbtree_list.h: New file.
811         * gl_rbtree_list.c: New file.
812         * gl_anyrbtree_list1.h: New file.
813         * gl_anyrbtree_list2.h: New file.
814         * gl_anytree_list1.h: New file.
815         * gl_anytree_list2.h: New file.
816         * gl_linkedhash_list.h: New file.
817         * gl_linkedhash_list.c: New file.
818         * gl_anyhash_list1.h: New file.
819         * gl_anyhash_list2.h: New file.
820         * gl_avltreehash_list.h: New file.
821         * gl_avltreehash_list.c: New file.
822         * gl_rbtreehash_list.h: New file.
823         * gl_rbtreehash_list.c: New file.
824         * gl_anytreehash_list1.h: New file.
825         * gl_anytreehash_list2.h: New file.
826
827         * gl_oset.h: New file.
828         * gl_oset.c: New file.
829         * gl_array_oset.h: New file.
830         * gl_array_oset.c: New file.
831         * gl_avltree_oset.h: New file.
832         * gl_avltree_oset.c: New file.
833         * gl_rbtree_oset.h: New file.
834         * gl_rbtree_oset.c: New file.
835         * gl_anytree_oset.h: New file.
836
837 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
838
839         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
840         New files.
841         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
842         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
843         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
844         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
845         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
846         callers changed.  Revamp internals significantly, by not
847         attempting to create directories that are temporarily more
848         permissive than the final results.  Do not attempt to use
849         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
850         This removes some race conditions, fixes some bugs, and simplifies
851         things.  Use new dirchownmod function to do owner and mode changes.
852         * mkdir-p.h: Likewise.
853         * modechange.c (octal_to_mode): New function.
854         (struct mode_change): New member mentioned.
855         (make_node_op_equals): New arg mentioned.  All callers changed.
856         (mode_compile): Keep track of which mode bits the user has explicitly
857         mentioned.
858         (mode_adjust): New arg DIR, so that we implement the X op correctly.
859         New arg PMODE_BITS, to keep track of which mode bits the user
860         mentioned; it treats S_ISUID and S_ISGID speciall.
861         All callers changed.
862         * modechange.h: Likewise.
863
864 2006-07-11  Derek R. Price  <derek@ximbiot.com>
865
866         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
867
868 2006-07-10  Derek R. Price  <derek@ximbiot.com>
869
870         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
871         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
872         macros into the GNU _D_EXACT_NAMLEN.
873         * savedir.c:  Likewise.
874         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
875
876 2006-07-09  Jim Meyering  <jim@meyering.net>
877
878         * argp-pv.c: Remove a doubled word in a comment.
879         * check-version.c (check_version): Likewise.
880         * javacomp.c (compile_java_class): Likewise.
881
882 2006-07-08  Jim Meyering  <jim@meyering.net>
883
884         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
885
886 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
887
888         * getaddrinfo.c: Changes to compile under MSVC6: changed
889         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
890         brackets.  Other minor changes to suppress some compiler
891         warnings.
892
893 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
894
895         * getloadavg.c: Use __VMS, not VMS.
896         * getopt.c: Likewise.
897         * getpagesize.h: Likewise.
898         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
899         probably does not work.
900
901 2006-07-06  Derek R. Price  <derek@ximbiot.com>
902         and Paul Eggert  <eggert@cs.ucla.edu>
903
904         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
905         Don't worry about this obsolete case any more.
906         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
907         directories.
908         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
909         worry about this obsolete case any more.
910         * fts.c: Likewise.
911         * getcwd.c: Likewise.
912         * glob.h: Likewise.
913         * savedir.c: Likewise.
914
915 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
916
917         * .cppi-disable: Add wcwidth.
918         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
919         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
920         (ISGRAPH): Remove.  All uses changed to isgraph.
921         (FOLD) [!defined _LIBC]: Remove special case.
922         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
923         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
924         HAVE_ISBLANK.
925         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
926
927 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
928
929         * strtod.c (strtod): cast the argument of tolower to unsigned char.
930
931 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
932
933         * memcasecmp.c: Include <limits.h>.
934         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
935         * strtod.c (strtod): Don't assume isspace works on negative chars.
936         Don't assume isdigit succeeds only on '0' through '9'.
937
938 2006-07-05  Derek R. Price  <derek@ximbiot.com>
939
940         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
941         All uses of is_space replaced by isspace.
942         * exit.h: Don't talk about STDC_HEADERS.
943         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
944         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
945         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
946         replaced by isprint etc.
947         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
948         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
949         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
950         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
951         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
952         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
953
954 2006-07-05  Eric Blake  <ebb9@byu.net>
955
956         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
957         missing from netdb.h.
958         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
959
960 2006-06-27  Bruno Haible  <bruno@clisp.org>
961
962         Assume ANSI C header files and <ctype.h> functions.
963         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
964         (mbsnwidth): Use isprint, iscntrl instead.
965
966 2006-07-03  Jim Meyering  <jim@meyering.net>
967
968         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
969         macro is used before the first cycle_check call.
970
971 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
972
973         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
974         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
975         reported by Mark D. Baushke, one in
976         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
977
978         Merge from coreutils.
979
980         * .cppi-disable: Add stdint_.h.
981         * .cvsignore: Add stdint.h.
982
983         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
984
985         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
986         both double and long double versions.
987         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
988         * xstrtold.c: New file.
989         * xstrtod.h (xstrtold): New decl.
990
991         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
992
993         * filemode.c (setst): Remove.
994         (strmode): Rewrite to avoid setst.  This makes the code shorter,
995         (arguably) clearer, and the generated code is a bit smaller on my
996         Debian GNU/Linux stable x86 host.
997
998         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
999
1000         * filemode.c: Include "filemode.h" first, to test the interface.
1001         Assume that filemode.h includes sys/types.h and sys/stat.h.
1002         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1003         (ftypelet): Reorder to put common cases first, for efficiency.
1004         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1005         to do 'M'.
1006         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1007         of 10, for compatibility with FreeBSD.  All callers changed.
1008         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1009         that can't be deduced solely from st_mode.  First arg is now a const
1010         pointer.
1011         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1012         (strmode): Renamed from mode_string.
1013         (filemodestring): New decl.
1014         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1015         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1016         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1017
1018         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1019
1020         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1021         fsusage.h now does that.  Include fsusage.h first, to test interface.
1022         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1023         at most one method (the old code could have generated decls that
1024         didn't conform to C89, not that this was ever exercised).
1025         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1026
1027         2006-03-19  Jim Meyering  <jim@meyering.net>
1028
1029         Work even in a chroot where d_ino values for entries in "/"
1030         don't match the stat.st_ino values for the same names.
1031         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1032         number, iterate through all entries again, using lstat instead.
1033         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1034         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1035
1036         * getcwd.c (__getcwd): Clarify a comment.
1037         Use memcpy in place of a call to strcpy.
1038
1039         2006-03-12  Jim Meyering  <jim@meyering.net>
1040
1041         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1042         that of the current directory (which we're about to chdir ".." out of),
1043         then save the dev-ino of the parent, instead.
1044
1045         * same-inode.h (SAME_INODE): New file/macro.
1046         * chdir-safer.c (SAME_INODE): Remove definition.
1047         Include "same-inode.h", instead.
1048         * same.c: Likewise.
1049         * cycle-check.h: Include "same-inode.h".
1050         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1051         * cycle-check.c (SAME_INODE): Remove definition.
1052         * root-dev-ino.h: Include "same-inode.h".
1053
1054         2006-03-11  Eric Blake  <ebb9@byu.net>
1055
1056         * same.c (same_name): s/base_name/last_component/
1057         * backupfile.c (check_extension, numbered_backup): Likewise.
1058         * filenamecat.c (file_name_concat): Likewise.
1059
1060         2006-03-11  Eric Blake  <ebb9@byu.net>,
1061                     Paul Eggert  <eggert@cs.ucla.edu>
1062
1063         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1064         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1065         drive prefix.
1066         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1067         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1068         (last_component): New method.
1069         * dirname.c (dir_len): Determine when drive letters need a
1070         subsequent slash.  Preserve // when it is special.
1071         (dir_name): Don't append dot when drive letter is absolute.
1072         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1073         * basename.c (base_name): New semantics - malloc the result.
1074         Preserve // when it is special.  Preserve relative files that look
1075         like drive letters.
1076         (base_len): Preserve // when it is special.
1077         (last_component): New method, similar to old base_name semantics.
1078         * stripslash.c (strip_trailing_slashes): Use last_component, not
1079         base_name.  Strip redundant slashes from ///.
1080
1081 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1082
1083         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1084         both are 64 bits, since this seems to be the tradition, and this
1085         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1086         we ever run into a host that prefers long long to long in this
1087         case, we'll need another configure-time test.  Problem reported by
1088         Jim Meyering.
1089
1090 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1091
1092         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1093         possible collision with system files.
1094         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1095         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1096         WCHAR_MIN and WCHAR_MAX in this case.
1097         (<stddef.h>): Do not include; no longer needed.
1098         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1099         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1100         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1101         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1102         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1103         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1104         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1105         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1106         !defined(__c99))]: Include in this case too, since it's harmless
1107         now.
1108         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1109         dangerous to do so.
1110         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1111         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1112         (_STDINT_MIN, _STDINT_MAX): New macros.
1113         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1114         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1115         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1116         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1117         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1118         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1119         macros, not typedefs; this simplifies things quite a bit.
1120         Use long int for all types narrower than int64_t.
1121         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1122         Define in terms of long long int or int64_t or long int,
1123         not int64_t or int32_t.  This saves some compile-time testing.
1124         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1125         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1126         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1127         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1128         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1129         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1130         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1131         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1132         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1133         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1134         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1135         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1136         undef any previous version and define our own version, for
1137         simplicity and consistency with the new macros for types.
1138         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1139         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1140         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1141         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1142         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1143         @WINT_T_SUFFIX@ to keep things simple here.
1144         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1145         Simplify by assuming typical 8/16/32/64 host, since we're
1146         already doing that elsewhere anyway.
1147         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1148         and assume long long int is 64 bits if available.  This
1149         speeds up 'configure'.
1150
1151 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1152
1153         * getaddrinfo.c: fixed typo
1154
1155 2006-06-29  Eric Blake  <ebb9@byu.net>
1156
1157         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1158         unused static function.
1159
1160 2006-06-29  Eric Blake  <ebb9@byu.net>
1161
1162         * stat_.h: New file.
1163
1164 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1165
1166         * strftime.c: Assume strftime() exists.
1167
1168 2006-06-28  Bruno Haible  <bruno@clisp.org>
1169
1170         * getaddrinfo.h: Fix POSIX URL.
1171         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1172         (use_win32_p): Make static.
1173         (getaddrinfo): Reject service name if it is empty or does not consist
1174         solely of decimal digits, or if its value is > 65535.
1175         (getnameinfo): Remove useless casts.
1176
1177 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1178
1179         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1180         Autoconf 2.60 says this stuff was obsolete.
1181
1182 2006-05-12  Bruno Haible  <bruno@clisp.org>
1183
1184         * mkdtemp.c [MINGW]: Include <io.h>.
1185         (mkdir): Define using _mkdir.
1186
1187 2006-06-28  Bruno Haible  <bruno@clisp.org>
1188
1189         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1190         declaration for wcwidth.
1191         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1192
1193 2006-06-28  Eric Blake  <ebb9@byu.net>
1194
1195         * xvasprintf.h: Fix comments.
1196
1197 2006-06-28  Eric Blake  <ebb9@byu.net>
1198
1199         * mbchar.h (wcwidth): Include wcwidth.h.
1200         * mbswidth.c (wcwidth): Move from here...
1201         * wcwidth.h: ...to this new file.
1202
1203 2006-06-28  Simon Josefsson  <jas@extundo.com>
1204
1205         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1206         functions there.  It will succeed on Windows XP, but on Windows
1207         2000 and (presumably) earlier, it will fail, and use the internal
1208         re-implementation.
1209         (use_win32_p): New function.
1210         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1211         Support AI_NUMERICSERV to disable getservbyname.
1212         (getnameinfo): New function, only supports
1213         NI_NUMERICHOST|NI_NUMERICSERV for now.
1214
1215         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1216         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1217         getnameinfo.
1218
1219 2006-06-27  Bruno Haible  <bruno@clisp.org>
1220
1221         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1222
1223 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1224
1225         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1226         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1227         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1228
1229 2006-06-26  Bruno Haible  <bruno@clisp.org>
1230
1231         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1232         WCHAR_MAX.
1233         Reported by Mark D. Baushke and Larry Jones.
1234
1235 2006-06-26  Bruno Haible  <bruno@clisp.org>
1236
1237         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1238         in pre-C99 mode.
1239         Suggested by Mark D. Baushke and Larry Jones.
1240
1241 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1242
1243         * stdint_.h: Treat BSD/OS like OpenBSD.
1244
1245 2006-06-23  Bruno Haible  <bruno@clisp.org>
1246
1247         * stdint_.h: Treat IRIX like OpenBSD.
1248
1249 2006-06-23  Bruno Haible  <bruno@clisp.org>
1250
1251         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1252         ISO C 99 Technical Corrigendum 1.
1253
1254 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1255
1256         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1257         Some compiler complained about some of them.  Problem reported by
1258         Larry Jones in
1259         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1260
1261 2006-06-21  Simon Josefsson  <jas@extundo.com>
1262
1263         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1264         variable.
1265
1266         * socket_.h: Don't define WINVER.
1267
1268         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1269         slightly modified to work in gnulib.
1270
1271 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1272
1273         * read-file.c (fread_file): Start with buffer allocation of
1274         0 bytes rather than 1 byte; this simplifies the code.
1275         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1276         code to free buffer and save/restore errno.
1277         (internal_read_file): Remove unused local.
1278
1279 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1280
1281         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1282         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1283         Problem reported by Denis Excoffier in
1284         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1285
1286 2006-06-19  Simon Josefsson  <jas@extundo.com>
1287
1288         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1289
1290 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1291
1292         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1293
1294 2006-06-17  Bruno Haible  <bruno@clisp.org>
1295
1296         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1297
1298 2006-06-17  Bruno Haible  <bruno@clisp.org>
1299
1300         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1301         problem on Solaris 2.5.1.
1302
1303 2006-06-16  Eric Blake  <ebb9@byu.net>
1304
1305         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1306         * unicodeio.c [!defined errno]: Likewise.
1307         * strtol.c [!defined errno]: Likewise.
1308         * strtod.c [!defined errno]: Likewise.
1309
1310 2006-06-15  Bruno Haible  <bruno@clisp.org>
1311
1312         * stdint_.h: Rewritten to be fully auto-configured.
1313         Fixes bug on HP-UX/IA64.
1314
1315 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1316
1317         * getdate.y (__attribute__): Don't define if already defined.
1318         Problem reported by Larry Jones.
1319         * utimens.c (__attribute__): Likewise.
1320
1321 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1322
1323         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1324         reported by Andreas Schwab.
1325
1326 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1327             Bruno Haible  <bruno@clisp.org>
1328
1329         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1330
1331 2006-05-26  Martin Lambers  <marlam@marlam.de>
1332
1333         * getpass.c: Updates the test for the native W32 API, and adds
1334         missing includes, thus fixing compilation warnings.
1335
1336 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1337
1338         * tempname.c (small_open, large_open): New macros.
1339         (__open, __open64) [!_LIBC]: Remove.
1340         (__gen_tempname): Use small_open and large_open instead of __open
1341         and __open64.  This fixes a portability bug on HP-UX 11.11i
1342         reported by Simon Wing-Tang in
1343         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1344
1345 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1346
1347         * exclude.c (exclude_fnmatch): New function.
1348         (excluded_file_name): Call exclude_fnmatch.
1349         * exclude.h (excluded_file_name): New prototype
1350
1351 2006-05-24  Bruno Haible  <bruno@clisp.org>
1352
1353         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1354         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1355         Reported by Thorsten Maerz <torte@netztorte.de> via
1356         Aaron Stone <aaron@serendipity.cx>.
1357
1358 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1359
1360         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1361         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1362         (my_usleep): Don't mishandle maximum value.
1363
1364 2006-05-19  Jim Meyering  <jim@meyering.net>
1365
1366         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1367
1368 2006-05-17  Bruno Haible  <bruno@clisp.org>
1369
1370         Cygwin portability.
1371         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1372
1373 2006-05-17  Bruno Haible  <bruno@clisp.org>
1374
1375         * stdint_.h: Fix recognition of Cygwin.
1376
1377 2006-05-11  Jim Meyering  <jim@meyering.net>
1378
1379         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1380
1381 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1382
1383         * crc.c (crc32_update): Remove unnecessary L suffix.
1384         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1385         unwanted sign propagation, e.g., on hosts with 64-bit int.
1386         There still are some problems with reeelly weird theoretical hosts
1387         (e.g., 33-bit int) but it's not worth worrying about now.
1388         * sha1.c (rol): Likewise.
1389         (K1, K2, K3, K4): Remove unnecessary L suffix.
1390
1391 2006-05-10  Bruno Haible  <bruno@clisp.org>
1392
1393         * des.c: Cast to avoid warnings.
1394
1395 2006-05-10  Simon Josefsson  <jas@extundo.com>
1396
1397         * md4.c: Typo fix, update copyright years.
1398         (K1, K2): Don't use L because it turn computations into 64-bit on
1399         64-bit platforms.
1400
1401 2006-05-09  Bruno Haible  <bruno@clisp.org>
1402
1403         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1404         (EOVERFLOW): Define fallback value.
1405         (xstrcat): New function.
1406         (xvasprintf): Recognize the special case of a string concatenation.
1407
1408 2006-05-01  Bruno Haible  <bruno@clisp.org>
1409
1410         * stdint_.h: Shorter URL.
1411         * inttypes.h: Likewise.
1412
1413 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1414
1415         * verify.h: Document the internals better.  Most of this change
1416         was written by Bruno Haible.
1417
1418 2006-04-29  Bruno Haible  <bruno@clisp.org>
1419
1420         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1421         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1422
1423 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1424
1425         * getdate.y (get_date): When adding relative date, start with the
1426         initial time, not with the result of the first mktime call.
1427
1428 2006-04-23  Bruno Haible  <bruno@clisp.org>
1429
1430         * copy-file.c: Include <unistd.h> unconditionally.
1431         * execute.c: Likewise.
1432         * fatal-signal.c: Likewise.
1433         * findprog.c: Likewise.
1434         * mkdtemp.c: Likewise.
1435         * pipe.h: Likewise.
1436         * pipe.c: Likewise.
1437         * wait-process.h: Likewise.
1438
1439 2006-04-23  Bruno Haible  <bruno@clisp.org>
1440
1441         * fwriteerror.c (fwriteerror): Call fclose also when an error
1442         condition was already detected.
1443         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1444
1445 2006-04-19  Derek Price  <derek@ximbiot.com>
1446             Eric Blake  <ebb9@byu.net>
1447
1448         * inttypes.h: Correct grammar in comment.
1449
1450 2006-04-18  Derek Price  <derek@ximbiot.com>
1451             Paul Eggert  <eggert@cs.ucla.edu>
1452
1453         * inttypes.h: New file.
1454         * strtoimax.c: Assume <inttypes.h>.
1455
1456 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1457
1458         * utimens.c (futimens): glibc futimesat messes up if /proc
1459         isn't mounted.  Problem reported by Kir Kolyshkin.
1460
1461 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1462
1463         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1464         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1465         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1466
1467 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1468
1469         Merge regex changes from libc, removing some of our
1470         POSIX-conformance changes that were rejected and redoing them in a
1471         less-intrusive way.
1472
1473         * regcomp.c (re_compile_internal, init_dfa):
1474         Length arg is now size_t, not Idx.  All uses changed.
1475         (peek_token): Forward decl now says internal_function.
1476         (__re_error_msgid, __re_error_msgid_idx):
1477         Now static rather than extern with attribute_hidden.
1478         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1479         For some reason libc prefers K&R style defns for external functions.
1480         (regerror) [!defined _LIBC]: Likewise.
1481         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1482         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1483         (build_range_exp, build_collating_symbol):
1484         Use K&R-style defn.
1485         (re_compile_fastmap): Use '\0' to memset, not 0.
1486         (utf8_sb_map): Make the calculations more obvious.
1487         (init_dfa, parse_bracket_exp, build_charclass_op):
1488         Call calloc and cast result, as glibc does.
1489         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1490         (build_range_exp, build_collating_symbol):
1491         Now internal functions.
1492
1493         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1494
1495         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1496         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1497         Don't depend on VMS; depend on __VMS instead, for POSIX
1498         namespace cleanness.
1499         (regoff_t): Define to ssize_t, not long int.
1500
1501         Remove the REG_ macros named below.  Instead, make the old names
1502         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1503         __USE_GNU_REGEX.
1504         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1505         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1506         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1507         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1508         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1509         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1510         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1511         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1512         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1513         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1514         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1515         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1516         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1517         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1518         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1519         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1520         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1521         (REG_NREGS):
1522         Remove.  All uses replaced by the old RE_* names.
1523         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1524         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1525         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1526         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1527         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1528         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1529         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1530         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1531         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1532         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1533         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1534         Don't bother having these macros be independent of each others'
1535         values, since they no longer exist in the POSIX name space.
1536
1537         Rename the following member names back to their old names,
1538         unless !__USE_GNU_REGEX.  All uses changed back.
1539         (buffer): Renamed from re_buffer.
1540         (allocated): Renamed from re_allocated.
1541         (used): Renamed from re_used.
1542         (syntax): Renamed from re_syntax.
1543         (fastmap): Renamed from re_fastmap.
1544         (translate): Renamed from re_translate.
1545         (can_be_null): Renamed from re_can_be_null.
1546         (regs_allocated): Renamed from re_regs_allocated.
1547         (fastmap_accurate): Renamed from re_fastmap_accurate.
1548         (no_sub): Renamed from re_no_sub.
1549         (not_bol): Renamed from re_not_bol.
1550         (not_eol): Renamed from re_not_eol.
1551         (newline_anchor): Renamed from re_newline_anchor.
1552         (num_regs): Renamed from rm_num_regs.
1553         (start): Renamed from rm_start.
1554         (end): Renamed from rm_end.
1555
1556         (free_state): Move up a bit.
1557
1558         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1559         #define to be empty.
1560         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1561         when that is what is intended.
1562         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1563         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1564         (MAX): New macro.
1565         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1566         All uses changed back to re_malloc, etc.  It's now the caller's
1567         responsibility to check for overflow; all callers changed.
1568         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1569         (re_x2nrealloc): Remove.
1570         (free_state): Remove decl.
1571
1572         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1573         (re_set_registers, re_exec):
1574         Use K&R-style defn.
1575
1576         2006-01-31  Roland McGrath  <roland@redhat.com>
1577
1578         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1579         Reported by Mike Frysinger <vapier@gentoo.org>.
1580
1581         2006-01-15  Andreas Jaeger  <aj@suse.de>
1582
1583         [BZ #1950]
1584         * regex_internal.c (re_string_reconstruct): Adjust for
1585         build_wcs_upper_buffer change.
1586         (build_wcs_upper_buffer): Change return type.
1587
1588         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1589
1590         * regex_internal.h: Include <stdint.h> if available.
1591
1592         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1593
1594         * regex_internal.h (SIZE_MAX): Provide a default definition.
1595
1596         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1597
1598         * regcomp.c: Adjust for changed secondary hash function.
1599
1600         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1601
1602         * regex.h: Pretty printing.
1603         Clean up namespace a bit.
1604
1605         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1606
1607         * regexec.c (update_cur_sifted_state, check_arrival,
1608         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1609
1610         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1611                     Ulrich Drepper  <drepper@redhat.com>
1612
1613         [BZ #1302]
1614         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1615         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1616
1617         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1618
1619         [BZ #281]
1620         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1621         * regcomp.c: Remove unnecessary uses of
1622         unsigned RE_TRANSLATE_TYPE.
1623         * regex_internal.h: Likewise.
1624         * regex_internal.c: Likewise.
1625         * regexec.c: Likewise.
1626         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1627
1628         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1629
1630         * regexec.c (find_recover_state): Remove unnecessary
1631         initialization.
1632         (transit_state_bkref): Make DFA a const pointer.
1633         (get_subexp): Likewise.
1634         (check_arrival): Likewise.
1635         (update_cur_sifted_state): Likewise.
1636         (re_search_internal): Likewise.
1637         (prune_impossible_nodes): Likewise.
1638         (acquire_init_state_context): Likewise.
1639         (proceed_next_node): Likewise.
1640         (set_regs): Likewise.
1641         (free_fail_stack_return): Likewise.
1642         (check_arrival_expand_ecl): Mark DFA parameter as const.
1643         (check_arrival_expand_ecl_sub): Likewise.
1644         (check_subexp_limits): Likewise.
1645         (sub_epsilon_src_nodes):  Likewise.
1646         (add_epsilon_src_nodes):  Likewise.
1647         (merge_state_array): Likewise.
1648         (update_regs): Likewise.
1649         (build_trtable): Likewise.
1650         (sift_states_backward): Mark MCTX parameter as const.
1651         (build_sifted_states): Likewise.
1652         (update_cur_sifted_state): Likewise.
1653         (sift_states_mkref): Likewise.
1654         (check_arrival_expand_ecl): Mark eclosure as const.
1655         (check_dst_limits_calc_pos_1): Likewise.
1656         * regex_internal.h (re_match_context_t): Make dfa a const
1657         pointer.
1658
1659         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1660
1661         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1662         (transit_state_sb): Likewise.
1663         (transit_state_mb): Likewise.
1664         (sift_states_iter_mb): Likewise.
1665         (check_arrival_add_next_nodes): Likewise.
1666         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1667         [_LIBC] (re_search_2_stub): Use mempcpy.
1668
1669         * regex_internal.c (re_string_reconstruct): Avoid calling
1670         mbrtowc for very simple UTF-8 case.
1671
1672         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1673         a pointer-to-const.
1674         (re_acquire_state_context): Likewise.
1675         * regex_internal.h: Adjust prototypes.
1676
1677         * regex.c: Prevent using C++ compilers.
1678
1679         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1680         (re_acquire_state_context): Likewise.
1681
1682 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1683             Bruno Haible  <bruno@clisp.org>
1684
1685         * stdint_.h: On OpenBSD, don't redefine types already included in
1686         <sys/types.h> and <inttypes.h>.
1687
1688 2006-03-24  Eric Blake  <ebb9@byu.net>
1689
1690         * time_r.c (copy_string_result): Remove, as it is no longer used.
1691
1692 2006-03-24  Simon Josefsson  <jas@extundo.com>
1693
1694         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1695         including some doc fixes.
1696         (base64_encode_alloc): Fix +1 bug on allocation failures.
1697
1698 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1699
1700         * base64.c (base64_encode): Do not read past end of array with
1701         unsanitized input on systems with CHAR_BIT > 8.
1702
1703 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1704
1705         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1706         Typedef to long int, not to off_, as POSIX will likely change
1707         in that direction.
1708
1709 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1710
1711         * argp-help.c (validate_uparams): Fix typo
1712         * argp-parse.c (argp_default_options): Consistently begin help
1713         messages with a lowercase letter.
1714
1715 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1716
1717         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1718         overrun buffers and shouldn't be used (much as gets shouldn't be
1719         used).
1720         * time_r.c (asctime_r, ctime_r): Likewise.
1721
1722 2006-03-08  Simon Josefsson  <jas@extundo.com>
1723
1724         * gc-gnulib.c (randomize): Don't open files called 'no', they
1725         signal that configure disabled the device.
1726
1727 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1728
1729         * c-stack.c: Include unistd.h unconditionally, since we now assume
1730         the unistd module.
1731         * getlogin_r.c: Likewise.
1732         * getlogin_r.h: Likewise.
1733         * glob.c: Likewise.
1734         * pagealign_alloc.c: Likewise.
1735         * unistd_.h: Remove; no longer needed.
1736
1737 2006-03-07  Simon Josefsson  <jas@extundo.com>
1738
1739         * unistd_.h: New file.
1740
1741 2006-03-07  Simon Josefsson  <jas@extundo.com>
1742
1743         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1744
1745 2006-03-01  Simon Josefsson  <jas@extundo.com>
1746
1747         * readline.c: Fix typo, tiny patch from Stepan Kasal
1748         <kasal@ucw.cz>.
1749
1750 2006-02-28  Simon Josefsson  <jas@extundo.com>
1751
1752         * getopt.c: Protect #include of unistd.h, for MSVS.
1753
1754 2006-02-27  Simon Josefsson  <jas@extundo.com>
1755
1756         * base64.h: Indent #define's.  From Jim Meyering
1757         <jim@meyering.net>.
1758
1759 2006-02-27  Jim Meyering  <jim@meyering.net>
1760
1761         Revert the change of 2006-02-24, so these files can continue
1762         to be sync'd from gettext.
1763         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1764         of `config.h'.
1765
1766 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1767
1768         * glob.c: Say "invalid" rather than "illegal" in comments.
1769
1770 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1771
1772         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1773
1774 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1775
1776         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1777         AT_FDCWD exceeds INT_MAX.
1778         * openat.h (AT_FDCWD): Likewise.
1779
1780 2006-02-14  Jim Meyering  <jim@meyering.net>
1781
1782         Sync from coreutils.
1783
1784         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1785         failure on deficient systems, and simplify gnulib lgpl dependencies.
1786         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1787         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1788
1789         * xalloc-die.c: Remove unused definition of N_.
1790
1791 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1792
1793         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1794
1795 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1796
1797         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1798         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1799
1800 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1801
1802         * argp-namefrob.h: Restore changes accidentally lost during the
1803         "autoupdate" on 2005-12-12.
1804
1805 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1806
1807         * fnmatch.c (L_): Renamed from L, to work around a bug in
1808         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1809         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1810         All uses changed.
1811
1812 2006-01-26  Simon Josefsson  <jas@extundo.com>
1813
1814         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1815         prototype is visible on mingw32.
1816
1817         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1818         for mingw32.
1819
1820         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1821         mingw32).
1822
1823 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1824
1825         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1826         attempt to open for write; this always fails, at least on POSIX
1827         hosts.  This reinstates the 2006-01-09 change, which was
1828         inadvertently removed.
1829
1830 2006-01-26  Bruno Haible  <bruno@clisp.org>
1831             Paul Eggert  <eggert@cs.ucla.edu>
1832
1833         * stdbool_.h (_Bool)
1834         [(! (defined __cplusplus || defined __BEOS__)
1835           && !defined __GNUC__
1836           && !(defined __HP_cc || defined __xlc__
1837                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1838                || defined __sgi))]:
1839         #define to signed char in these cases too; this simplifies
1840         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1841         etc., separately) and makes it more conservative.
1842
1843 2006-01-21  Jim Meyering  <jim@meyering.net>
1844
1845         Sync from the stable (b5) branch of coreutils:
1846
1847         * fts.c (fts_children): Don't let close() clobber errno from
1848         failed fchdir().
1849
1850         * fts.c (fts_stat): When following a symlink-to-directory,
1851         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1852         a dangling symlink.  That can also happen at least for ELOOP.
1853         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1854         FYI, this bug predates the inclusion of fts.c in coreutils.
1855
1856         * fts.c (fts_open): Put new maxarglen declaration and uses
1857         in their own block, so pre-c99 compilers don't object.
1858
1859         Avoid the double-free (first in fts_read, second in fts_close) that
1860         would occur when an `active' directory is made inaccessible (e.g.,
1861         via chmod a-x) during a traversal.
1862         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1863         before returning.  Reproduce this failure by
1864         mkdir -p a/b; cd a; chmod a-x . b
1865         Reported by Stavros Passas.
1866
1867 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1868
1869         * argp-namefrob.h: Bugfix. Remove stray #
1870
1871 2006-01-25  Bruno Haible  <bruno@clisp.org>
1872
1873         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1874         warnings.
1875         Reported by Paul Eggert.
1876
1877 2006-01-25  Jim Meyering  <jim@meyering.net>
1878
1879         * fileblocks.c: Remove more useless parentheses.
1880         * readutmp.h: Likewise.
1881
1882 2006-01-24  Bruno Haible  <bruno@clisp.org>
1883
1884         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1885         has it.
1886         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1887         2005-11-26.
1888
1889         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1890         to avoid problems with the built-in _Bool type.
1891         Reported by Paul Eggert on 2005-11-26.
1892
1893 2006-01-24  Jim Meyering  <jim@meyering.net>
1894
1895         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1896
1897 2006-01-24  Simon Josefsson  <jas@extundo.com>
1898
1899         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1900         Bruno.
1901
1902 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1903
1904         Work around porting bugs reported by Dieter in
1905         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1906         * getopt.c (_NOPROTO): Remove; no longer needed.
1907         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1908         Include "getopt.h" first, to check interface.
1909         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1910         !HAVE_DECL_GETENV.
1911         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1912         (__strndup): Revert to K&R-style function dfns, the glibc style.
1913         * strnlen.c: Don't claim it's taken from glibc; it's not.
1914         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1915         Include strnlen.h first, to get prototype properly.
1916         (strnlen): Renamed from __strnlen.
1917         Remove weak alias.
1918
1919 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1920
1921         These changes imported from libc.
1922         * getopt.c: Use __fxprintf instead of inline stream orientation
1923         test and two separate function calls.
1924         * strndup.c (__strndup): Add libc_hidden_def.
1925
1926 2006-01-22  Bruno Haible  <bruno@clisp.org>
1927
1928         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1929         temporary buffer for sprintf, take into account the precision also
1930         for 'd', 'i', 'u', 'o', 'x', 'X'.
1931
1932 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1933
1934         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1935         to pacify gcc -Wswitch-default.
1936
1937 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1938
1939         * argp-help.c (usage_long_opt): Do not print DOC options.
1940         (__argp_base_name): Removed
1941         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1942         typo.
1943         (__argp_base_name): Provide macro definition or extern declaration
1944         depending on the configuration
1945
1946 2006-01-20  Simon Josefsson  <jas@extundo.com>
1947
1948         * inet_ntop.h: Unconditionally include sys/socket.h.
1949
1950 2006-01-19  Simon Josefsson  <jas@extundo.com>
1951
1952         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1953
1954 2006-01-12  Simon Josefsson  <jas@extundo.com>
1955
1956         * base64.c: Fix warning, reported by Bruno Haible
1957         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1958
1959 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1960
1961         Sync from coreutils.
1962         * md5.c: Fix commentary typos.
1963         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1964         * md5.h (__attribute__): Remove; unused.
1965         * sha1.c: Fix commentary to match md5 better.
1966         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1967         so that we don't need to worry about alignment.  All uses changed.
1968         This merges the 2005-10-28 md5 change into sha1.
1969
1970 2006-01-11  Jim Meyering  <jim@meyering.net>
1971
1972         Sync from coreutils.
1973         * md5.c (OP): Fix spacing.
1974
1975 2006-01-11  Simon Josefsson  <jas@extundo.com>
1976
1977         * stdint_.h (SIZE_MAX): Add missing (.
1978
1979 2006-01-10  Bruno Haible  <bruno@clisp.org>
1980
1981         * argp.h (__const): Remove macro. Use const instead.
1982         * argp-fmtstream.h (__const): Likewise.
1983         * glob_.h (__const): Remove macro.
1984         * glob-libc.h: Use const instead of __const.
1985
1986 2006-01-10  Jim Meyering  <jim@meyering.net>
1987
1988         Avoid the double-free (first in fts_read, second in fts_close) that
1989         would occur when an `active' directory is made inaccessible (e.g.,
1990         via chmod a-x) during a traversal.
1991         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1992         before returning.  Reproduce this failure by
1993         mkdir -p a/b; cd a; chmod a-x . b
1994         Reported by Stavros Passas.
1995
1996         Sync from coreutils.
1997         * sha1.c: Tweak grammar in a comment.
1998
1999 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2000
2001         * regex_internal.h (BITSET_WORD_BITS):
2002         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2003         preprocessor mishandles large unsigned values as if they were signed.
2004         Problem reported by Claudio Fontana in
2005         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2006
2007 2006-01-10  Simon Josefsson  <jas@extundo.com>
2008
2009         * socket_.h: New file.
2010
2011 2006-01-10  Bruno Haible  <bruno@clisp.org>
2012
2013         * localcharset.c: Update from GNU gettext.
2014
2015 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2016
2017         Sync from coreutils.
2018         * chdir-long.c (cdb_free): Don't bother trying to open directory
2019         for write access: POSIX says that must fail.
2020         * fts.c (diropen): Likewise.
2021         * save-cwd.c (save_cwd): Likewise.
2022         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2023         well, for minor improvements on hosts that lack O_DIRECTORY.
2024         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2025         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2026         Fall back on chown if open failed with EACCES.
2027
2028         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2029         Report an error at compile-time if only a 1-second nominal clock
2030         resolution is found.
2031
2032         * lchmod.h: New file.
2033         * mkdir-p.c: Include lchmod.h, lchown.h.
2034         (make_dir_parents): Use lchown rather than chown, and
2035         lchmod rather than chmod.
2036
2037         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2038         too.  Problem with "none" reported by Bob Proulx.  Problem with
2039         "proc" reported by n0dalus.
2040
2041         * mountlist.c: Include <limits.h>.
2042         (dev_from_mount_options)
2043         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2044         New function.  It no longer assumes "dev=" has the System V meaning
2045         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2046         (read_file_system_list)
2047         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2048         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2049         dev= in that case.
2050
2051         * posixtm.h (PDS_PRE_2000): New macro.
2052         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2053         All usages changed.  Reject dates outside the range 1969-1999 if
2054         PDS_PRE_2000 is used.
2055
2056 2006-01-09  Jim Meyering  <jim@meyering.net>
2057
2058         Sync from coreutils.
2059
2060         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2061
2062         * chdir-safer.h, chdir-safer.c: New files.
2063
2064         * modechange.c (mode_compile): Reject an invalid mode string
2065         that starts with an octal digit.  From Andreas Gruenbacher.
2066
2067         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2068         and dup to open_safer and dup_safer, respectively.
2069         (openat_permissive): Fix typo in comment.
2070
2071         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2072         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2073         (_): Remove; no longer needed.
2074         (openat): Renamed from rpl_openat; no need for rpl_openat
2075         since openat.h renames openat for us.
2076         Replace most of the body with a call to openat_permissive,
2077         to avoid duplicate code.
2078         Port to (probably hypothetical) environments were mode_t is
2079         wider than int.
2080         (openat_permissive): Require mode arg, so that we can check
2081         types better.  Put it just after flags.  Change cwd failure
2082         indicator from pointer-to-bool to pointer-to-errno-value.
2083         All callers changed.
2084         Invoke openat_save_fail and/or openat_restore_fail if
2085         cwd_errno is null, so that openat can call us.
2086         (openat_permissive, fdopendir, fstatat, unlinkat):
2087         Simplify errno handling to avoid some duplicate code,
2088         as it's OK to set errno on success.
2089         * openat.h: Revamp code so that function macros depend on
2090         __OPENAT_PREFIX only, not also on AT_FDCWD.
2091         (openat_ro): Remove.  Caller changed to use openat_permissive.
2092         (openat_permissive): Now a macro, if not a function.
2093         (openat_restore_fail, openat_save_fail): Now always functions,
2094         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2095
2096         * openat-priv.h: New file, defining macros used by mkdirat.c
2097         and openat.c.
2098         * mkdirat.c: Include openat-priv.h.
2099         Remove definitions of macros defined therein.
2100         * openat.c: Likewise.
2101
2102         * mkdirat.c (mkdirat): New file and function.
2103         * openat.h (mkdirat): Declare.
2104
2105         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2106
2107         * openat.h (openat_permissive): Declare.
2108         (openat_ro): Define.
2109
2110         * openat.c (EXPECTED_ERRNO): New macro.
2111         (openat_permissive): New function -- used in remove.c rewrite.
2112         (all functions): Set errno just before returning, only if there
2113         was an actual failure.
2114         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2115
2116         Emulate openat-family functions using Linux's procfs, if possible.
2117         Idea and some code based on Ulrich Drepper's glibc changes.
2118
2119         * openat.c: (BUILD_PROC_NAME): New macro.
2120         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2121         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2122         before falling back on save_cwd and restore_cwd.
2123         (fdopendir, fstatat, unlinkat): Likewise.
2124
2125         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2126         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2127
2128         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2129         as second argument to va_arg.  Otherwise, some versions of gcc
2130         warn that `if this code is reached, the program will abort'.
2131
2132 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2133
2134         Sync from coreutils.
2135
2136         Add POSIX ACL support
2137         * acl.h (copy_acl, set_acl): Add declarations.
2138         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2139         systems other than Linux.
2140         (chmod_or_fchmod): New function: use fchmod when possible,
2141         and chmod otherwise.
2142         (file_has_acl): Add a POSIX ACL implementation, with a
2143         Linux-specific subcase.
2144         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2145         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2146         acls are unsupported.
2147         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2148         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2149         are unsupported.
2150
2151 2006-01-09  Bruno Haible  <bruno@clisp.org>
2152
2153         * sysexit_.h (EX_OK): New macro.
2154         Suggested by Martin Lambers <marlam@marlam.de>.
2155
2156 2006-01-09  Bruno Haible  <bruno@clisp.org>
2157
2158         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2159         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2160         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2161         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2162
2163 2006-01-09  Bruno Haible  <bruno@clisp.org>
2164
2165         * stdint_.h (SIZE_MAX): Write the value without involving negative
2166         numbers.
2167
2168 2005-10-16  Bruno Haible  <bruno@clisp.org>
2169
2170         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2171         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2172
2173 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2174
2175         * strftime.c (tzname): Don't declare if it is already #defined.
2176         Problem reported for Mingw by Mark Junker.
2177
2178 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2179
2180         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2181         long int, not int, for nanosecond counts, so that people who are
2182         used to POSIX struct timespec won't be surprised.  Reported by Jim
2183         Meyering.
2184
2185 2005-12-16  Jim Meyering  <jim@meyering.net>
2186
2187         * fprintftime.c, fprintftime.h: New files.
2188
2189 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2190
2191         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2192         * argp-help.c (fill_in_uparams): Check if the constructed
2193         struct uparams is valid. Fall back to the default values if it is
2194         not.
2195
2196 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2197
2198         * argp-help.c (__argp_base_name): New function
2199         (__argp_short_program_name): Rewrite using __argp_base_name
2200         * argp-namefrob.h: Define program_invocation_name and
2201         program_invocation_short_name if requested
2202         (__argp_base_name): Add prototype
2203         * argp-parse.c (argp_def): Use gettext wrappers
2204         (argp_default_parser): Use __argp_base_name
2205         * argp-pin.c: New file. Defines program_invocation_name and
2206         program_invocation_short_name on systems that lack them.
2207
2208 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2209
2210         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2211         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2212         porting problem reported by Georg Schwarz in
2213         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2214
2215 2005-07-09  Bruno Haible  <bruno@clisp.org>
2216
2217         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2218         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2219         Reported by Mark Junker <mjscod@gmx.de>.
2220
2221 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2222
2223         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2224         (uintmax_t) [defined uintmax_t]: Do not declare.
2225         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2226         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2227         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2228         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2229         sake of portability to weird hosts that C allows (though we don't
2230         know of any practical examples).
2231
2232         * savedir.h (fdsavedir): New decl.
2233         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2234         contains most of the former guts of savedir.
2235         (savedir): Use savedirstream.
2236         Include "openat.h".
2237
2238 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2239
2240         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2241         coreutils no longer futzes with rounding modes.
2242
2243 2005-11-14  Jim Meyering  <jim@meyering.net>
2244
2245         * mkstemp-safer.c: Include <config.h>, required for possible
2246         replacement of mkstemp.
2247
2248 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2249
2250         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2251         business.
2252         (gethrxtime) [! (HAVE_NANOUPTIME
2253         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2254         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2255         our own approximation.
2256
2257 2005-11-10  Simon Josefsson  <jas@extundo.com>
2258
2259         * readline.c: Remove EOL.
2260
2261 2005-11-08  Eric Blake  <ebb9@byu.net>
2262
2263         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2264
2265 2005-11-08  Eric Blake  <ebb9@byu.net>
2266
2267         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2268
2269 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2270
2271         Fix porting problem reported by Theodoros V. Kalamatianos.
2272         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2273         Don't assume that futimes failing means we must fail.
2274
2275 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2276
2277         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2278         leave errno alone.  Problem reported by Dmitry V. Levin.
2279
2280 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2281
2282         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2283         errno alone.  Problem reported by Frederic Jolliton.
2284
2285 2005-10-28  Simon Josefsson  <jas@extundo.com>
2286
2287         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2288         "restrict" keywords, as per POSIX.  Protect the function
2289         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2290         Don't use K&R prototypes.  Check the sprintf return values.
2291         Re-define EAFNOSUPPORT if not present.  Indent.
2292
2293         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2294         suggested by Bruno Haible <bruno@clisp.org>.
2295
2296         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2297
2298         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2299
2300         * gc-libgcrypt.c: Add MD2 (which is not available through
2301         libgcrypt).
2302
2303         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2304
2305         * md2.h, md2.c: New files.
2306
2307 2005-10-24  Simon Josefsson  <jas@extundo.com>
2308
2309         * md4.h: Shrink buffer size, now that we changed the type.
2310
2311 2005-10-22  Simon Josefsson  <jas@extundo.com>
2312
2313         * arcfour.h, arcfour.c: Use fixed size indices in the
2314         arcfour_context struct (simplify test vector testing in GNU
2315         Shishi).
2316
2317 2005-10-22  Simon Josefsson  <jas@extundo.com>
2318
2319         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2320         suggested by Bruno Haible <bruno@clisp.org>.
2321
2322 2005-10-22  Simon Josefsson  <jas@extundo.com>
2323
2324         * crc.h: Include stddef.h, for size_t.
2325
2326 2005-10-21  Simon Josefsson  <jas@extundo.com>
2327
2328         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2329         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2330
2331 2005-10-21  Simon Josefsson  <jas@extundo.com>
2332
2333         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2334         block.
2335
2336 2005-10-21  Simon Josefsson  <jas@extundo.com>
2337
2338         * gc-gnulib.c: Support ARCTWO in CBC mode.
2339
2340 2005-10-21  Simon Josefsson  <jas@extundo.com>
2341
2342         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2343         <bruno@clisp.org>.
2344
2345         * hmac-sha1.c (hmac_sha1): Likewise.
2346
2347         * crc.c (crc32_update): Actually use crc parameter, suggested by
2348         Bruno Haible <bruno@clisp.org>.
2349
2350         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2351         <bruno@clisp.org>.
2352
2353 2005-10-21  Simon Josefsson  <jas@extundo.com>
2354
2355         * des.h, des.c: New files.
2356
2357         * gc-gnulib.c: Support DES.c
2358
2359 2005-10-21  Simon Josefsson  <jas@extundo.com>
2360
2361         * arctwo.h, arctwo.c: New files.
2362
2363         * gc-gnulib.c: Support ARCTWO.
2364
2365 2005-10-21  Simon Josefsson  <jas@extundo.com>
2366
2367         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2368
2369 2005-10-19  Simon Josefsson  <jas@extundo.com>
2370
2371         * gc-gnulib.c: Support ARCFOUR.
2372
2373 2005-10-19  Simon Josefsson  <jas@extundo.com>
2374
2375         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2376         support.
2377
2378         * gc.h: Add ECB enum type.
2379
2380         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2381
2382 2005-10-19  Simon Josefsson  <jas@extundo.com>
2383
2384         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2385
2386 2005-10-18  Simon Josefsson  <jas@extundo.com>
2387
2388         * md4.h, md4.c: New files, based on md5.?.
2389
2390 2005-10-17  Simon Josefsson  <jas@extundo.com>
2391
2392         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2393
2394         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2395
2396 2005-10-17  Simon Josefsson  <jas@extundo.com>
2397
2398         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2399
2400 2005-10-17  Simon Josefsson  <jas@extundo.com>
2401
2402         * gc.h, gc-libgcrypt.c: Add ciphers.
2403
2404 2005-10-17  Simon Josefsson  <jas@extundo.com>
2405
2406         * sha1.c: Use uint32_t instead of md5_uint32.t
2407
2408         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2409         md5.h.
2410
2411         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2412
2413         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2414
2415 2005-10-15  Simon Josefsson  <jas@extundo.com>
2416
2417         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2418
2419         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2420
2421 2005-10-14  Simon Josefsson  <jas@extundo.com>
2422
2423         * arcfour.h, arcfour.c: New files.
2424
2425 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2426
2427         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2428         include <wchar.h>; no longer needed.
2429
2430 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2431         and  Ulrich Drepper  <drepper@redhat.com>
2432
2433         Import from libc.
2434         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2435         instead of inline stream orientation test and two separate
2436         function calls.  Pay no attention to USE_IN_LIBIO.
2437
2438 2005-10-14  Roland McGrath  <roland@redhat.com>
2439
2440         Import from libc.  [BZ #1331]
2441         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2442         macro argument.
2443         Reported by Matej Vela <vela@debian.org>.
2444
2445 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2446
2447         * mkdir-p.c (make_dir_parents): Don't report an error if an
2448         intermediate directory is in a read-only file system.  Problem
2449         reported by Eric Blake.
2450
2451 2005-10-13  Simon Josefsson  <jas@extundo.com>
2452
2453         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2454         Move memory allocation outside of loop.
2455
2456 2005-10-12  Simon Josefsson  <jas@extundo.com>
2457
2458         * gc-pbkdf2-sha1.c: New file.
2459
2460         * gc.h: Add gc_pbkdf2_sha1 prototype.
2461
2462 2005-10-12  Simon Josefsson  <jas@extundo.com>
2463
2464         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2465         suggested by Bruno Haible <bruno@clisp.org>.
2466
2467 2005-10-12  Simon Josefsson  <jas@extundo.com>
2468
2469         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2470
2471         * gc-gnulib.c (gc_hmac_sha1): New function.
2472
2473 2005-10-12  Simon Josefsson  <jas@extundo.com>
2474
2475         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2476
2477 2005-10-12  Simon Josefsson  <jas@extundo.com>
2478
2479         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2480         GC_USE_HMAC_MD5, respectively.
2481
2482         * gc-libgcrypt.c (gc_md5): Fix assert call.
2483         (gc_md5): Fix typo.
2484
2485         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2486
2487         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2488
2489         * gc-gnulib.c (gc_hash_buffer): Ditto.
2490
2491 2005-10-11  Bruno Haible  <bruno@clisp.org>
2492
2493         * c-strcasestr.h: New file, from GNU gettext.
2494         * c-strcasestr.c: New file, from GNU gettext.
2495
2496 2005-10-11  Bruno Haible  <bruno@clisp.org>
2497
2498         * c-strcase.h: New file, from GNU gettext.
2499         * c-strcasecmp.c: New file, from GNU gettext.
2500         * c-strncasecmp.c: New file, from GNU gettext.
2501
2502 2005-10-11  Simon Josefsson  <jas@extundo.com>
2503
2504         * crc.h, crc.c: New files.
2505
2506         * gc.h (gc_hash_buffer): Add doc.
2507
2508 2005-10-08  Simon Josefsson  <jas@extundo.com>
2509
2510         * gc.h: Add gc_hash and gc_hash_buffer.
2511
2512         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2513
2514         * gc-libgcrypt.c (gc_hash_buffer): Add.
2515
2516 2005-10-11  Bruno Haible  <bruno@clisp.org>
2517
2518         * strcasecmp.c: Include limits.h.
2519         (strcasecmp): Avoid integer overflow on exotic platforms.
2520         * strncasecmp.c: Include limits.h.
2521         (strncasecmp): Avoid integer overflow on exotic platforms.
2522         Reported by Paul Eggert.
2523
2524 2005-10-06  Simon Josefsson  <jas@extundo.com>
2525
2526         * hmac-md5.c: New file.
2527
2528         * hmac.h: New file.
2529
2530 2005-10-06  Simon Josefsson  <jas@extundo.com>
2531
2532         * memxor.c (memxor): Avoid casts and warnings.
2533
2534 2005-10-05  Derek Price  <derek@ximbiot.com>
2535
2536         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2537
2538 2005-10-05  Simon Josefsson  <jas@extundo.com>
2539
2540         * memxor.c (memxor): Fix compiler error.
2541
2542         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2543         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2544
2545         * memxor.h, memxor.c: New files.
2546
2547         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2548         we assume all systems have it, suggested by Jim Meyering
2549         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2550         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2551         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2552         same reasons.
2553
2554 2005-10-04  Bruno Haible  <bruno@clisp.org>
2555
2556         * verify.h (verify_true): Provide alternative definition for C++.
2557
2558 2005-10-04  Simon Josefsson  <jas@extundo.com>
2559
2560         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2561         D. Baushke" <mdb@gnu.org>.
2562
2563 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2564
2565         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2566         (SSIZE_MAX): New macro, if not already defined.
2567         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2568         than 2 GiB.
2569
2570 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2571
2572         * exclude.c: Include verify.h.
2573         (verify): Remove.  All callers changed to use verify.h's version.
2574         * strtoimax.c: Likewise.
2575         * utimecmp.c: Likewis.e
2576
2577         Sync from coreutils.
2578         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2579         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2580         * .cvsignore: Add fts.h, search.h, t-fpending.
2581         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2582         bother returning ENOSYS if settimeofday or stime fails; just let
2583         them return whatever errno they want to return.
2584         * utimens.c: Include unistd.h, for dup2.
2585         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2586         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2587
2588 2005-10-02  Jim Meyering  <jim@meyering.net>
2589
2590         Sync from coreutils.
2591         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2592         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2593         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2594         Remove AT_FDCWD test.
2595         Do not consume the fd unless successful.
2596         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2597         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2598         block, so that we don't even try to compile it if settimeofday is
2599         available.  This works around a compilation failure on OSF1 V5.1,
2600         due to stime requiring a `long int*' while tv_sec is `int'.
2601
2602 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2603
2604         * getdelim.c (getdelim): Remove unused variables.
2605
2606 2005-10-01  Simon Josefsson  <jas@extundo.com>
2607
2608         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2609         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2610         AI_* and EAI_* definitions.  Protect function declarations.
2611
2612 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2613
2614         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2615         so that the code works even with ancient cpp.  Portability problem
2616         with GCC 2.7.2.1 reported by Thomas M.Ott.
2617
2618 2005-09-27  Jim Meyering  <jim@meyering.net>
2619
2620         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2621
2622         * intprops.h (signed_type_or_expr__): Define.
2623         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2624         for unsigned types.
2625
2626 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2627
2628         * verify.h (verify_expr): Remove, replacing with:
2629         (verify_true): New macro that returns true instead of void.
2630         (verify_type__): Remove.
2631         (verify): Use verify_true rather than verify_type__.
2632
2633 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2634
2635         * utimens.c (ENOSYS): Define if not already defined.
2636         (futimens): Support having a null PATH if the file descriptor
2637         is nonnegative.
2638
2639         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2640         Remove.
2641         (__attribute): Define to empty unless GCC 3.1 or later.
2642         This works around a core dump on OpenBSD 3.4, which has GCC
2643         2.95.3, which dumps core when given __attribute__(()).  It also
2644         simplifies other tests, since we really don't want to bother with
2645         worrying about which ancient version of GCC supported what.
2646         Original problem reported by Yoann Vandoorselaere, with part of
2647         the fix suggested by Derek Price.
2648
2649 2005-09-24  Jim Meyering  <jim@meyering.net>
2650
2651         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2652         so we can once again use a positive bitfield width of 1 -- now we
2653         don't have to explain why we were using a bitfield width of 2.
2654
2655 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2656
2657         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2658         Problem reported by Eric Blake.
2659         (getaddrinfo): Initialize se so that it's not garbage.
2660         Redo internal storage allocation so that it doesn't make unportable
2661         assumptions about alignment.
2662         Fix a memory leak.
2663
2664         * utimens.c (futimens): Use futimesat if available.
2665         Prefer it to futimes since it doesn't have the futimes bug.
2666
2667         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2668         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2669         Instead, declare a function that returns a pointer to an array,
2670         and use verify_type__ to declare the size of the array.
2671         Problem and germ of a solution reported by Bruno Haible.
2672         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2673         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2674
2675 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2676
2677         Sync from coreutils.
2678
2679         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2680         stat-time.h.
2681         * argmatch.h: Include verify.h
2682         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2683         (ARGMATCH_ASSERT): Remove; unused.
2684         * canonicalize.c: Assume STDC_HEADERS.
2685         * exclude.c: Include "strcase.h".
2686         * regex_internal.h [!defined _LIBC]: Likewise.
2687         * getusershell.c: Include stdio--.h rather than stdio.h
2688         and stdio-safer.h.
2689         (getusershell): Call fopen, not fopen_safer.
2690         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2691         Do not include unistd-safer.h.
2692         (save_cwd): Don't call fd_safer; no longer needed
2693         now that we include fcntl--.h.
2694
2695         * getdate.y (relative_time): New type.
2696         (RELATIVE_TIME_0): New constant.
2697         (parser_control): Use relative_time instead of doing it ourselves.
2698         (%union): Add new relative_time rel member.
2699         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2700         Now typeless.
2701         (relunit, relunit_snumber): Now of type rel.
2702         (zone, rel, relunit, get_date): Adjust to above changes.
2703
2704         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2705         Do not include unistd-safer.h.
2706         (getloadavg): Don't call fd_safer; no longer needed
2707         now that we include fcntl--.h.
2708
2709         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2710         (make_dir_parents): Treat ENOSYS like EEXIST.
2711
2712         Improve quality of diagnostics on restore_cwd failure.
2713         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2714         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2715         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2716         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2717         each time through the loop.  Do not diagnose restore_cwd failure;
2718         that is the caller's job (and perhaps the caller does not care).
2719
2720         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2721         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2722         If the file already exists but is not a directory, don't bother
2723         to try to make its parents.
2724         Close potential file descriptor leak if we can't chdir("/") (!).
2725         Don't always return true if chdir($PWD) fails; return true only
2726         if the requested action was done successfully (except for the
2727         chdir($PWD)).
2728         Don't log final directory unless we actually made it.
2729         Refactor to avoid duplicate code to fix up permissions.
2730         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2731
2732         * strftime.c (my_strftime): Rewrite the previous change slightly,
2733         to make it a bit faster and (I hope) clearer.
2734         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2735         Fix bug in formats like %2N.
2736
2737         * verify.h: New file.
2738
2739 2005-09-22  Jim Meyering  <jim@meyering.net>
2740
2741         Sync from coreutils.
2742
2743         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2744
2745         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2746         the .tm_year member, since otherwise gcc-4.0 would now warn about
2747         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2748
2749         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2750         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2751
2752         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2753         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2754         when run in a time zone for which daylight savings time is in effect
2755         for the starting date.
2756
2757         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2758         stop us from restricting permissions of just-created absolute-named
2759         directories.
2760         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2761         to restore initial working directory.
2762         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2763         to tell caller if/when we change the working directory and are
2764         unable to return to the initial one.
2765         * mkdir-p.h (make_dir_parents): Update prototype.
2766         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2767         `return false'.  This fixes a bug introduced on 2004-07-30.
2768
2769         * openat.c (fdopendir): Be sure to close the supplied
2770         file descriptor before returning.  This makes our replacement
2771         implementation a little closer to Solaris's, where fdopendir
2772         ties the file descriptor to the returned DIR* pointer.
2773         * openat.c (unlinkat): New function.
2774         * openat.h (unlinkat): Add prototype.
2775         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2776         (openat_restore_fail): Rename from openat_restore_die.
2777         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2778
2779         Provide an alternative to exiting immediately upon save_cwd or
2780         restore_cwd failure.  Now, an application can arrange e.g.,
2781         to perform a longjump in that case.
2782         * openat.c: Include dirname.h.
2783         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2784         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2785         and openat_restore_die rather than calling error directly.
2786         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2787
2788         * openat-die.c (openat_save_die, openat_restore_die): New file.
2789         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2790
2791         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2792         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2793                             int utc, int nanoseconds);
2794         Background:
2795         date should not have to allocate a megabyte of virtual memory to
2796         handle a format argument like +%1048575T.  When implemented with
2797         strftime, it must allocate such a buffer, use strftime to fill it
2798         in, print it, then free it.
2799         With fprintftime, it simply prints everything and exits.
2800         With no need for memory allocation, that's one fewer way to fail.
2801         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2802         optional field width, not before, so we accept %9:z, not %:9z.
2803         (my_strftime): Be sure to use L_('x') for literals.
2804
2805         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2806         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2807         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2808         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2809         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2810         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2811         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2812         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2813         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2814
2815         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2816         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2817         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2818         and don't include <sys/file.h>).
2819
2820 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2821
2822         Sync from coreutils.
2823
2824         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2825         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2826         [!LDAV_DONE]: Avoid unused variable warning.
2827
2828 2005-09-21  Bruno Haible  <bruno@clisp.org>
2829
2830         * unicodeio.h (unicode_to_mb): New declaration.
2831
2832 2005-09-20  Derek Price  <derek@ximbiot.com>
2833
2834         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2835
2836 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2837
2838         Use a consistent style for including <config.h>.
2839         * __fpending.c, acl.c, argmatch.c,
2840         argp-help.c, argp-parse.c,
2841         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2842         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2843         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2844         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2845         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2846         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2847         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2848         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2849         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2850         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2851         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2852         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2853         modechange.c, mountlist.c, open-safer.c, physmem.c,
2854         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2855         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2856         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2857         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2858         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2859         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2860         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2861         userspec.c, utimecmp.c, version-etc-fsf.c,
2862         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2863         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2864         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2865         Standardize inclusion of config.h.
2866         * __fpending.h, dirfd.h, getdate.h, human.h,
2867         inttostr.h:  Removed inclusion of config.h from header files.
2868         * inttostr.c:  Adjusted in-tree users.
2869         * timespec.h: Remove superfluous warning to include config.h.
2870         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2871         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2872         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2873         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2874
2875 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2876
2877         * stat-time.h: New file.
2878         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2879         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2880         in a different way.
2881         (timespec_cmp): New function.
2882         * utimecmp.c: Include stat-time.h.
2883         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2884         members exist, not on the obsolescent ST_MTIM_NSEC.
2885         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2886
2887 2005-09-15  Derek Price  <derek@ximbiot.com>
2888             Paul Eggert  <eggert@cs.ucla.edu>
2889
2890         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2891         changes, consolidating in...
2892         * regex_internal.h: ...this file.
2893
2894 2005-09-15  Derek Price  <derek@ximbiot.com>
2895
2896         * regex_internal.h: Blank `pure' for GNUC < 3.
2897         * regex_internal.c: Ditto, using this...
2898         (__GNUC_PREREQ): ...new macro.
2899         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2900         (__GNUC_PREREQ): ...this new macro.
2901
2902         * strstr.h: Include string.h. Define strstr as a macro here.
2903
2904 2005-09-13  Derek Price  <derek@ximbiot.com>
2905
2906         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2907         failure.
2908         Reported by Jim Meyering  <jim@meyering.net>.
2909
2910 2005-09-13  Jim Meyering  <jim@meyering.net>
2911
2912         * canon-host.c: Filter through gnu indent and reword comments slightly.
2913         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2914
2915 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2916
2917         * base64.c: Typo.
2918         (base64_encode): Put b64str in initialized data section.
2919
2920 2005-09-12  Derek Price  <derek@ximbiot.com>
2921
2922         Return usable errors from canon-host.
2923         * canon-host.h: New file.
2924         * canon-host.c (canon_host): Wrap...
2925         (canon_host_r): ...this new function, which now relies exclusively on
2926         getaddrinfo.
2927         (ch_strerror): New function.
2928         (last_cherror): New global.
2929         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2930         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2931         void *.
2932         (freeaddrinfo): Free ai->ai_canonname when set.
2933
2934 2005-09-12  Derek Price  <derek@ximbiot.com>
2935             Paul Eggert  <eggert@cs.ucla.edu>
2936
2937         * glob-libc.h: Renamed from glob_.h.  The new version is
2938         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2939         protecting things that should be done only in gnulib contexts.
2940         * glob_.h: New file, containing only the glob things needed for
2941         gnulib.
2942         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2943         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2944         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2945         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2946         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2947         and to respect the namespace rules better.
2948
2949 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2950
2951         Merge glibc and coreutils changes into gnulib, plus a few
2952         extra fixes.
2953         * md5.c: Use #error rather than a string.
2954         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2955         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2956         (__attribute__): Define to empty for non recent-GCC.
2957         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2958         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2959         Renamed from their non-__ counterparts, with new macros replacing
2960         them if not _LIBC.  Add __THROW attribute.
2961         (rol): Remove.
2962         (struct md5_ctx): Align buffer if using GCC.
2963         * sha1.h (struct sha1_ctx): Likewise.
2964         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2965         The old name was backwards.
2966         (NOTSWAP): Remove; not used.
2967         (rol): New macro, moved here from md5.h.
2968         (sha1_process_block): Remove a FIXME that doesn't make sense.
2969
2970 2005-09-12  Derek Price  <derek@ximbiot.com>
2971
2972         * gai_strerror.c: Include config.h when available.  Include
2973         getaddrinfo.h before other headers to test interface.
2974         Reported by Larry Jones <lawrence.jones@ugs.com>.
2975
2976 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2977
2978         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2979         definitions, since that's the preferred style in glibc.
2980         Fix a minor spacing issue, and update copyright notice to match glibc's.
2981
2982 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2983
2984         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2985
2986 2005-09-06  Simon Josefsson  <jas@extundo.com>
2987
2988         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2989         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2990
2991 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2992
2993         Change bitset word type from unsigned int to unsigned long int,
2994         as this has better performance on typical 64-bit hosts.
2995         Port bitset code to hosts with unusual word sizes.
2996         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2997         (build_collating_symbol):
2998         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2999         argument is a bitset.  This is merely a style issue, but it makes
3000         it clearer that an entire array is expected.
3001         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3002         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3003         Port to the case where bitset_word is not the same as unsigned int.
3004         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3005         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3006         Likewise.
3007         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3008         (build_trtable, group_nodes_into_DFAstates):
3009         Likewise.
3010         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3011         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3012         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3013         * regexec.c (group_nodes_into_DFAstates): Likewise.
3014         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3015         * regcomp.c (optimize_subexps, lower_subexp):
3016         Work even if bitset_word has holes in its bitwise representation.
3017         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3018         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3019         Likewise.
3020         * regex_internal.c (re_string_reconstruct):
3021         Don't assume UCHAR_MAX == 255.
3022         * regex_internal.h (bitset_set_all): Likewise.
3023         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3024         All uses changed.
3025         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3026         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3027         All uses changed.
3028         (BITSET_WORD_MAX): New macro.
3029         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3030         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3031         (bitset_empty, bitset_copy):
3032         Prefer sizeof (bitset) to multiplying it out ourselves.
3033         (bitset_not_merge): Remove; unused.
3034         (bitset_contain): Return bool, not unsigned int with one bit on.
3035         All callers changed.
3036         * regexec.c (build_trtable): Don't assume bitset has no stricter
3037         alignment than re_node_set; do this by defining a new internal
3038         type struct dests_alloc and using it to allocate memory.
3039
3040 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3041
3042         Check for arithmetic overflow when calculating sizes, to prevent
3043         some buffer-overflow issues.  These patches are conservative, in the
3044         sense that when I couldn't determine whether an overflow was possible,
3045         I inserted a run-time check.
3046         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3047         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3048         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3049         (re_xnrealloc, re_x2nrealloc): New inline functions.
3050         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3051         (build_equiv_class, build_charclass): Check for arithmetic overflow
3052         in size expression calculations.
3053         * regex_internal.c (re_string_realloc_buffers):
3054         (build_wcs_upper_buffer, re_node_set_add_intersect):
3055         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3056         (re_dfa_add_node, register_state): Likewise.
3057         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3058         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3059         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3060         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3061
3062 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3063
3064         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3065         to avoid a collision with bits/local_lim.h in glibc.
3066         All uses changed.  Problem reported by Dmitry V. Levin in
3067         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3068
3069         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3070         bugs in int versus size_t comparisons.
3071         (re_string_context_at): Fix bug where the code assumed that
3072         Idx is signed.
3073
3074         Use bool where appropriate.
3075         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3076         All callers changed.
3077         (calc_eclosure_iter): Likewise, for ROOT arg.
3078         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3079         (build_charclass_op): Likewise, for NON_MATCH arg.
3080         * regex_internal.c (re_string_allocate, re_string_construct):
3081         (re_string_construct_common): Likewise, for ICASE arg.
3082         * regexec.c (re_search_2_stub, re_search_stub):
3083         Likewise, for RET_LEN arg.
3084         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3085         (set_regs): Likewise, for FL_BACKTRACK arg.
3086         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3087         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3088         (calc_eclosure_iter, parse_bracket_exp):
3089         Use bool for internal variables that are booleans.
3090         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3091         (set_regs, build_sifted_states, sift_states_bkref):
3092         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3093         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3094         (find_collation_sequence_value):
3095         Likewise.
3096         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3097         (re_node_set_compare):
3098         Return bool, not int. All callers changed.
3099         * regexec.c (check_halt_node_context, check_dst_limits):
3100         (build_trtable, check_node_accept): Likewise.
3101         * regex_internal.h: Include stdbool.h.
3102
3103         Fix bugs uncovered when converting to bool.
3104         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3105         failure instead of charging ahead blindly.
3106         * regex_internal.c (register_state): Likewise.
3107         * regexec.c (re_search_2_stub): Use simpler method than boolean
3108         for freeing internal storage.
3109         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3110         bitset pieces used as boolean, to avoid undefined behavior
3111         on hosts that do int overflow checking.
3112
3113 2005-08-31  Derek Price  <derek@ximbiot.com>
3114
3115         * getdelim.c (getdelim): Return EOF on EOF.
3116         Reported by Larry Jones <lawrence.jones@ugs.com>.
3117
3118 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3119
3120         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3121         lengths fit in regoff_t; this isn't true if regoff_t is the same
3122         width as size_t.
3123         * regex.c (re_search_internal): 5th arg is LAST_START
3124         (= START + RANGE) instead of RANGE.  This avoids overflow
3125         problems when regoff_t is the same width as size_t.
3126         All callers changed.
3127         (re_search_2_stub): Check for overflow when adding the
3128         sizes of the two strings.
3129         (re_search_stub): Check for overflow when adding START
3130         to RANGE; if it occurs, substitute the extreme value.
3131
3132 2005-08-31  Jim Meyering  <jim@meyering.net>
3133
3134         * regcomp.c (search_duplicated_node): Make first pointer arg
3135         a pointer-to-const.
3136         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3137         (register_state): Likewise.
3138         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3139         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3140         (group_nodes_into_DFAstates): Likewise.
3141
3142 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3143
3144         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3145         old glibc regex code mishandles strings longer than 2**31 bytes.
3146         This patch fixes this when the regex code is used in gnulib
3147         (i.e., outside glibc).
3148
3149         This patch should not affect the use of the regex code inside
3150         glibc.  No doubt this problem also needs to be handled for glibc
3151         as well, but the result will be an incompatible change to the
3152         glibc ABI, and the old ABI will have to be supported too.  That
3153         can be the the subject for another patch.
3154
3155         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3156         governing whether the rest of this patch is active.  By default,
3157         the macro is disabled and the patch has no effect.
3158         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3159         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3160         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3161         (re_match_2, re_set_registers): Use the new types.
3162         * regex_internal.h (Idx, re_hashval_t): New types.
3163         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3164         New macros.
3165         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3166         (re_string_context_at, bin_tree_t, re_dfastate_t):
3167         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3168         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3169         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3170         (re_string_char_size_at, re_string_wchar_at):
3171         (re_string_elem_size_at):
3172         Use the new types and macros to port to 64-bit hosts.
3173         Use unsigned types for internal values, so that the code
3174         mostly works even for arrays larger than SSIZE_MAX.
3175         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3176         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3177         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3178         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3179         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3180         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3181         (calc_inveclosure, parse_dup_op, build_range_exp):
3182         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3183         (fetch_number, create_token_tree, mark_opt_subexp):
3184         Likewise.
3185         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3186         (create_cd_newstate, re_string_allocate, re_string_construct):
3187         (re_string_realloc_buffers, build_wcs_upper_buffer):
3188         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3189         (re_string_reconstruct, re_string_peek_byte_case):
3190         (re_string_fetch_byte_case, re_string_context_at):
3191         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3192         (re_node_set_init_copy, re_node_set_add_intersect):
3193         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3194         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3195         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3196         (re_acquire_state, re_acquire_state_context, register_state):
3197         Likewise.
3198         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3199         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3200         (re_search_internal, re_search_2_stub, re_search_stub)
3201         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3202         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3203         (update_cur_sifted_state, check_dst_limits):
3204         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3205         (check_subexp_limits, sift_states_bkref, merge_state_array):
3206         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3207         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3208         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3209         (expand_bkref_cache, check_node_accept_bytes):
3210         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3211         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3212         (acquire_init_state_context, check_halt_node_context):
3213         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3214         (sift_states_backward, clean_state_log_if_needed):
3215         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3216         (find_recover_state, transit_state_sb, transit_state_mb):
3217         (transit_state_bkref, build_trtable, match_ctx_clean):
3218         Likewise.
3219         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3220         to work around an assumption that REG_MISSING is negative.
3221
3222         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3223         (seek_collating_symbol_entry) [defined _LIBC]:
3224         (lookup_collation_sequence_value) [defined _LIBC]:
3225         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3226         Use prototypes rather than old-style function definitions.
3227         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3228         (transit_state_sb) [0]:
3229         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3230
3231         * regexec.c (re_search_internal): Simplify update of rm_so and
3232         rm_eo.
3233
3234         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3235         (optimize_subexps, lower_subexp):
3236         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3237         since the signed shift might overflow.  Use 1u<<31 instead.
3238         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3239         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3240         Likewise.
3241
3242         * regcomp.c (optimize_subexps, lower_subexp):
3243         Use CHAR_BIT rather than 8, for clarity.
3244         * regexec.c (check_dst_limits_calc_pos_1):
3245         (check_subexp_matching_top): Likewise.
3246         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3247         have to worry about portability issues when shifting it left.
3248         Remove no-longer-needed test for table_size > 0.
3249         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3250         in a word, as the resulting behavior is undefined.
3251         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3252         in one case, a <= should have been an <, and in another case the
3253         whole test was missing.
3254         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3255         the standard name CHAR_BIT.
3256         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3257         this is not true on one's complement and signed-magnitude hosts.
3258
3259         * regex_internal.h (re_sub_match_top_t): Remove unused member
3260         next_last_offset.
3261         (struct re_dfa_t): Remove unused member states_alloc.
3262         * regcomp.c (init_dfa): Don't initialize unused members.
3263
3264 2005-08-31  Bruno Haible  <bruno@clisp.org>
3265
3266         * strstr.c: Include <stddef.h>, for NULL.
3267         * strcasestr.c: Likewise.
3268         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3269
3270 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3271
3272         * iconvme.h: Add prototype for iconv_alloc.
3273
3274 2005-08-29  Simon Josefsson  <jas@extundo.com>
3275
3276         * iconvme.c: Fix errno.
3277
3278 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3279
3280         * iconvme.c: Split iconv_string into iconv_alloc.
3281
3282 2005-08-27  Jim Meyering  <jim@meyering.net>
3283
3284         * fopen-safer.c: Merge minor changes from coreutils.
3285         * dup-safer.c: Likewise.
3286         * fd-safer.c: Likewise.
3287
3288         Merge from coreutils.
3289         * stdio--.h: New file.
3290         * stdlib--.h: New file.
3291         * mkstemp-safer.c: New file.
3292
3293         GNU tar needs these.
3294         * pipe-safer.c: New file.
3295         * creat-safer.c: New file.
3296         * fcntl--.h (creat): Define to creat_safer.
3297         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3298         * unistd--.h (pipe): Define to pipe_safer.
3299         * unistd-safer.h: Declare pipe_safer.
3300
3301 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3302
3303         * regex_internal.h: Remove all references to
3304         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3305         or better.
3306         (bitset_not, bitset_merge, bitset_not_merge):
3307         (bitset_mask, re_string_allocate, re_string_construct):
3308         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3309         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3310         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3311         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3312         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3313         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3314         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3315         (re_acquire_state_context):
3316         Remove unnecessary forward decls.
3317         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3318         Put __attribute at function definition,
3319         now that the function decl has been removed.
3320         * regex_internal.c (re_string_peek_byte_case):
3321         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3322         Likewise.
3323
3324 2005-08-26  Simon Josefsson  <jas@extundo.com>
3325
3326         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3327         Haible <bruno@clisp.org>.
3328
3329 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3330
3331         * regexec.c (set_regs): Don't alloca with an unbounded size.
3332
3333         alloca modernization/simplification for regex.
3334         * regex.c: Remove portability cruft for alloca.  This no longer
3335         needs to be at the start of the file, and can be moved into
3336         regex_internal.h and simplified.
3337         * regex_internal.h: Include <alloca.h>.
3338         (__libc_use_alloca) [!defined _LIBC]: New macro.
3339         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3340         now works outside glibc.
3341
3342 2005-08-24  Simon Josefsson  <jas@extundo.com>
3343
3344         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3345         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3346         GLIBC specific code.
3347
3348 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3349
3350         Make regex safe for g++.  This fixes one real bug (an "err"
3351         that should have been "*err").  g++ problem reported by
3352         Sam Steingold.
3353         * regex_internal.h (re_calloc): New macro, consistent with
3354         re_malloc etc.  All callers of calloc changed to use re_calloc.
3355         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3356         not int.  All callers changed.
3357         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3358         just use an array of size MB_LEN_MAX.
3359         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3360         (find_recover_state): Change "err" to "*err"; this fixes what
3361         appears to be a real bug.
3362         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3363         versus int.
3364
3365 2005-08-25  Jim Meyering  <jim@meyering.net>
3366
3367         * open-safer.c: Include <config.h>.
3368         Otherwise, we'd lose LARGEFILE support in any file using
3369         e.g. "fcntl--.h"
3370
3371 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3372
3373         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3374         * regex.h (regerror): Likewise.
3375
3376         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3377         requires this.  (The code never needed it.)
3378
3379         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3380         All uses of recently-renamed identifiers changed to use the new,
3381         POSIX-compliant names.  The code will build and run just fine
3382         without these changes, but it's better to eat our own dog food
3383         and use the standard-conforming names.
3384
3385         * regex.h: Fix a multitude of POSIX name space violations.
3386         These changes have an effect only for programs that define
3387         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3388         do not change anything for programs compiled in the normal way.
3389         Also, there is no effect on the ABI.
3390
3391         (_REGEX_SOURCE): New macro.
3392         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3393         defined and _GNU_SOURCE is not; this fixes a name space violation.
3394
3395         Rename the following macros to obey POSIX requirements.
3396         The old names are still visible as macros if _REGEX_SOURCE is defined.
3397         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3398         RE_BACKSLASH_ESCAPE_IN_LISTS.
3399         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3400         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3401         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3402         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3403         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3404         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3405         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3406         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3407         (REG_INTERVALS): renamed from RE_INTERVALS.
3408         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3409         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3410         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3411         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3412         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3413         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3414         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3415         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3416         RE_UNMATCHED_RIGHT_PAREN_ORD.
3417         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3418         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3419         (REG_DEBUG): renamed from RE_DEBUG.
3420         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3421         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3422         unusual, since we can't clash with the POSIX REG_ICASE.
3423         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3424         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3425         (REG_NO_SUB): renamed from RE_NO_SUB.
3426         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3427         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3428         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3429         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3430         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3431         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3432         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3433         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3434         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3435         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3436         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3437         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3438         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3439         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3440         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3441         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3442         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3443         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3444         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3445         (REG_FIXED): Renamed from REGS_FIXED.
3446         (REG_NREGS): Renamed from RE_NREGS.
3447
3448         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3449         of other REG_* macros, since POSIX says the user is allowed to
3450         #undef these macros selectively.
3451
3452         (reg_errcode_t): Update comment stating what other tables need
3453         to be consistent.
3454
3455         Rename the following enum values to obey POSIX requirements.
3456         The old names are still visible as macros.
3457         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3458         is not defined, since GNU is supposed to be a superset of POSIX as
3459         much as possible, and since we want reg_errcode_t to be a signed
3460         type for implementation consistency.
3461         (_REG_NOERROR): Renamed from REG_NOERROR.
3462         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3463         (_REG_BADPAT): Renamed from REG_BADPAT.
3464         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3465         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3466         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3467         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3468         (_REG_EBRACK): Renamed from REG_EBRACK.
3469         (_REG_EPAREN): Renamed from REG_EPAREN.
3470         (_REG_EBRACE): Renamed from REG_EBRACE.
3471         (_REG_BADBR): Renamed from REG_BADBR.
3472         (_REG_ERANGE): Renamed from REG_ERANGE.
3473         (_REG_ESPACE): Renamed from REG_ESPACE.
3474         (_REG_BADRPT): Renamed from REG_BADRPT.
3475         (_REG_EEND): Renamed from REG_EEND.
3476         (_REG_ESIZE): Renamed from REG_ESIZE.
3477         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3478         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3479         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3480         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3481         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3482
3483         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3484         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3485         changed.  But support the old name if the new one is not defined
3486         and if _REGEX_SOURCE.
3487
3488         Change the following member names in struct re_pattern_buffer.
3489         The old names are still supported if !_REGEX_SOURCE.
3490         The new names are always supported, regardless of _REGEX_SOURCE.
3491         (re_buffer): Renamed from buffer.
3492         (re_allocated): Renamed from allocated.
3493         (re_used): Renamed from used.
3494         (re_syntax): Renamed from syntax.
3495         (re_fastmap): Renamed from fastmap.
3496         (re_translate): Renamed from translate.
3497         (re_can_be_null): Renamed from can_be_null.
3498         (re_regs_allocated): Renamed from regs_allocated.
3499         (re_fastmap_accurate): Renamed from fastmap_accurate.
3500         (re_no_sub): Renamed from no_sub.
3501         (re_not_bol): Renamed from not_bol.
3502         (re_not_eol): Renamed from not_eol.
3503         (re_newline_anchor): Renamed from newline_anchor.
3504
3505         Change the following member names in struct re_registers.
3506         The old names are still supported if !_REGEX_SOURCE.
3507         The new names are always supported, regardless of _REGEX_SOURCE.
3508         (rm_num_regs): Renamed from num_regs.
3509         (rm_start): Renamed from start.
3510         (rm_end): Renamed from end.
3511
3512         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3513         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3514         Prepend __ to parameter names.
3515
3516         Undo yesterday's changes.
3517
3518 2005-08-24  Jim Meyering  <jim@meyering.net>
3519
3520         Sync from coreutils.
3521         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3522
3523 2005-08-21  Bruno Haible  <bruno@clisp.org>
3524
3525         * lock.h: Add multiple inclusion guard.
3526         * tls.h: Add multiple inclusion guard.
3527
3528 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3529
3530         * regex.h (REG_NOSYS)
3531         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3532         Define, since POSIX requires it as of 2001.
3533         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3534         New private symbol, used to keep the enum signed in all cases.
3535         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3536         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3537
3538         * regex_internal.c (re_string_skip_chars, register_state):
3539         (calc_state_hash):
3540         Remove forward decls; no longer needed now that we use prototypes.
3541         * regexec.c (acquire_init_state_context, check_halt_node_context):
3542         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3543         (clean_state_log_if_needed): Likewise.
3544
3545 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3546
3547         Fix problems reported by Sam Steingold in
3548         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3549         * regexec.c (sift_states_bkref): Fix portability bug: the code
3550         assumed that reg_errcode_t is a signed type, which is not
3551         necessarily true if _XOPEN_SOURCE is not defined.
3552         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3553         some compilers warn about it otherwise.
3554
3555 2005-08-20  Jim Meyering  <jim@meyering.net>
3556
3557         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3558         of unused local, dfa.
3559
3560 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3561
3562         * regcomp.c (create_initial_state): Remove duplicate decl.
3563         (init_word_char, create_initial_state, duplicate_node_closure):
3564         (fetch_token, peek_token_bracket, build_range_exp):
3565         (build_collating_symbol): Remove forward decls; no longer needed
3566         now that we use prototypes.
3567
3568         * regcomp.c:
3569         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3570         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3571         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3572         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3573         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3574         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3575         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3576         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3577         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3578         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3579         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3580         (build_charclass, build_charclass_op, fetch_number, create_tree):
3581         (create_token_tree, mark_opt_subexp, duplicate_tree):
3582         Use prototypes rather than old-style definitions.
3583
3584         * regex_internal.c:
3585         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3586         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3587         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3588         (re_string_reconstruct, re_string_peek_byte_case):
3589         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3590         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3591         (re_node_set_init_copy, re_node_set_add_intersect):
3592         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3593         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3594         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3595         (re_acquire_state, re_acquire_state_context, register_state):
3596         (create_ci_newstate, create_cd_newstate, free_state):
3597         Likewise.
3598         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3599         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3600         (re_search_internal, prune_impossible_nodes):
3601         (acquire_init_state_context, check_matching, static):
3602         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3603         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3604         (update_regs, sift_states_backward, build_sifted_states):
3605         (clean_state_log_if_needed, merge_state_array):
3606         (update_cur_sifted_state, add_epsilon_src_nodes):
3607         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3608         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3609         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3610         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3611         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3612         (check_arrival, check_arrival_add_next_nodes):
3613         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3614         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3615         (check_node_accept_bytes, check_node_accept, extend_buffers):
3616         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3617         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3618         (sift_ctx_init):
3619         Likewise.
3620
3621         * regex_internal.h:
3622         (re_string_allocate, re_string_construct, re_string_reconstruct):
3623         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3624         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3625         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3626         (re_string_context_at, re_string_peek_byte_case):
3627         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3628         is defined, since we now use prototypes always.
3629
3630         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3631         C89 or better.  All uses removed.
3632
3633 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3634
3635         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3636         [defined lint]: Suppress bogus uninitialized-variable warnings.
3637
3638         * regcomp.c (duplicate_node): Return new index, not an error code,
3639         and let the caller return REG_ESPACE if out of space.  This
3640         removes an uninitialied-variable warning with GCC 4.0.1, and also
3641         avoids taking the address of a local variable.  All callers
3642         changed.
3643
3644 2005-08-19  Jim Meyering  <jim@meyering.net>
3645
3646         * regexec.c (proceed_next_node): Redo local variables to
3647         avoid GCC shadowing warnings.
3648
3649 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3650
3651         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3652         (re_node_set_insert_last, re_dfa_add_node):
3653         Rename local variables to avoid GCC shadowing warnings.
3654
3655 2005-08-18  Bruno Haible  <bruno@clisp.org>
3656
3657         * strstr.c (strstr): Fix return value in multibyte case.
3658         * strcasestr.c (strcasestr): Likewise.
3659
3660 2005-08-17  Jim Meyering  <jim@meyering.net>
3661
3662         Make the %s format (seconds since the epoch) work for a negative
3663         number and when used with a zero-padded field width, e.g. %015s.
3664
3665         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3666         label so that it precedes the code to set `digits'.  Otherwise,
3667         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3668         print `00-22'.  Now, it prints `-0022', as it should.
3669
3670 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3671
3672         * regex.h: Remove useless space-before-tab.  From coreutils.
3673
3674 2005-08-17  Bruno Haible  <bruno@clisp.org>
3675
3676         * strcasestr.h: New file.
3677         * strcasestr.c: New file.
3678
3679 2005-08-17  Bruno Haible  <bruno@clisp.org>
3680
3681         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3682         * strstr.c: Completely rewritten, with multibyte locale support.
3683
3684 2005-08-17  Bruno Haible  <bruno@clisp.org>
3685
3686         * strcasecmp.c: Use mbuiter.h.
3687
3688 2005-08-17  Bruno Haible  <bruno@clisp.org>
3689
3690         * mbuiter.h: New file.
3691
3692 2005-08-16  Bruno Haible  <bruno@clisp.org>
3693
3694         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3695         (mbi_init): Update.
3696         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3697         NUL byte, not after it.
3698
3699 2005-08-16  Bruno Haible  <bruno@clisp.org>
3700
3701         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3702         the valid ones. Makes the comparison operations transitive:
3703         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3704         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3705
3706 2005-08-16  Bruno Haible  <bruno@clisp.org>
3707
3708         * strcase.h (strcasecmp): Add note in comments.
3709         * strncasecmp.c: Use code from strcasecmp.c.
3710         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3711         (strcasecmp): Work correctly in multibyte locales.
3712
3713 2005-08-16  Bruno Haible  <bruno@clisp.org>
3714
3715         * strnlen1.h: New file.
3716         * strnlen1.c: New file.
3717
3718 2005-08-16  Bruno Haible  <bruno@clisp.org>
3719
3720         * mbfile.h: New file.
3721
3722 2005-08-16  Bruno Haible  <bruno@clisp.org>
3723
3724         * mbiter.h: New file.
3725
3726 2005-08-16  Bruno Haible  <bruno@clisp.org>
3727
3728         * mbchar.h: New file.
3729         * mbchar.c: New file.
3730
3731 2005-08-16  Bruno Haible  <bruno@clisp.org>
3732
3733         * tls.h: New file, from GNU gettext.
3734         * tls.c: New file, from GNU gettext.
3735
3736 2005-08-15  Bruno Haible  <bruno@clisp.org>
3737
3738         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3739         is defined.
3740
3741 2005-08-14  Jim Meyering  <jim@meyering.net>
3742
3743         Sync from coreutils.
3744
3745         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3746         Use the hash-table-based cycle-detection code not just when
3747         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3748         Reported by James Youngman in
3749         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3750         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3751         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3752         This lets us compile with -DFTS_DEBUG, once again.
3753         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3754         * fts.c (fd_safer): Remove decl.
3755         Include fcntl--.h rather than unistd-safer.h
3756         (fts_safe_changedir): Don't call fd_safer; no longer needed
3757         now that we include fcntl--.h.
3758
3759 2005-08-11  Simon Josefsson  <jas@extundo.com>
3760
3761         * readline.h, readline.c: New file.
3762
3763 2005-08-11  Bruno Haible  <bruno@clisp.org>
3764
3765         * strnlen.h (strnlen): Change parameter name to match comment.
3766
3767 2005-08-10  Simon Josefsson  <jas@extundo.com>
3768
3769         * strndup.c: Use strnlen.h.
3770
3771         * strnlen.h: New file.
3772
3773 2005-08-02  Simon Josefsson  <jas@extundo.com>
3774
3775         * getline.h, getline.c: Rewrite.
3776
3777         * getdelim.h, getdelim.c: New files, ported from glibc.
3778
3779 2005-07-31  Bruno Haible  <bruno@clisp.org>
3780
3781         * lock.h (gl_lock_initializer): New macro.
3782         (gl_lock_define_initialized): Use it.
3783         (gl_rwlock_initializer): New macro.
3784         (gl_rwlock_define_initialized): Use it.
3785         (gl_recursive_lock_initializer): New macro.
3786         (gl_recursive_lock_define_initialized): Use it.
3787
3788 2005-07-26  Bruno Haible  <bruno@clisp.org>
3789
3790         * lock.h: Update from GNU gettext.
3791         * lock.c: Update from GNU gettext.
3792
3793 2005-07-18  Bruno Haible  <bruno@clisp.org>
3794
3795         * lock.h (gl_once_t): New type.
3796         (gl_once_define, gl_once): New macros.
3797         * lock.c (fresh_once): New variable.
3798         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3799         functions.
3800
3801 2005-07-18  Simon Josefsson  <jas@extundo.com>
3802
3803         * check-version.c (check_version): Accept identical versions too.
3804
3805 2005-07-18  Bruno Haible  <bruno@clisp.org>
3806
3807         * lock.h: New file, from GNU gettext.
3808         * lock.c: New file, from GNU gettext.
3809
3810 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3811
3812         * quotearg.c: Add translator comment suggested by Bruno Haible,
3813         with a minor change.
3814
3815 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3816
3817         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3818         copyright symbol and the year.
3819         * version-etc.c (COPYRIGHT_YEAR): New constant.
3820         (version_etc_va): Use parameterized copyright notice.
3821         Reword to conform to the current GNU coding standards.
3822
3823 2005-07-11  Simon Josefsson  <jas@extundo.com>
3824
3825         * size_max.h: New file.
3826
3827 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3828
3829         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3830         block of defines.
3831
3832 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3833        and  Paul Eggert  <eggert@cs.ucla.edu>
3834
3835         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3836         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3837
3838 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3839
3840         * regex.c, regex.h: Sync from libc.
3841         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3842         New files, synced from libc, except that regex_internal.h
3843         currently has a small porting fix.
3844
3845 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3846
3847         Remove the dependency of the strftime module on the tzset module.
3848         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3849         Copy the input structure, to work around some of the bug with
3850         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3851         Solaris releases, you should also use the tzset module, but we won't
3852         require it as a dependency any more since we don't want LGPLed code
3853         to depend on GPLed code.
3854
3855 2005-07-02  Jim Meyering  <jim@meyering.net>
3856
3857         * backupfile.c (backup_args): Change a `0' to NULL.
3858
3859 2005-07-01  Jim Meyering  <jim@meyering.net>
3860
3861         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3862         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3863         * save-cwd.c, tempname.c:
3864         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3865         and don't include <sys/file.h>).
3866
3867 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3868
3869         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3870         declares only 'struct timespec;' (!).
3871
3872 2005-06-29  Jim Meyering  <jim@meyering.net>
3873
3874         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3875         type name.  Use the variable name instead.
3876         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3877
3878 2005-06-28  Simon Josefsson  <jas@extundo.com>
3879
3880         * check-version.h, check-version.c: New files.
3881
3882 2005-06-28  Simon Josefsson  <jas@extundo.com>
3883
3884         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3885         collision with global variable.  Better indentation.  Don't
3886         increment buffer pointer beyond buffer end.  Based on comments
3887         from Paul Eggert <eggert@cs.ucla.edu>.
3888
3889         * base64.h: Indent.
3890
3891 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3892
3893         * canon-host.c (canon-host): Append trailing "," to 0 in
3894         initializer of struct addrinfo, as an indication that we don't
3895         care how many members the structure has.
3896
3897 2005-06-24  Derek Price  <derek@ximbiot.com>
3898         and Bruno Haible  <bruno@clisp.org>
3899
3900         Remove stat module & update lstat.
3901         * stat.c: Remove this file...
3902         (slash_aware_lstat): ...moving this content and its support...
3903         * lstat.c (rpl_lstat): ...into here.
3904         * lstat.h: New file.
3905
3906 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3907
3908         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3909         (ranged_convert): Don't save conversion in a temporary struct.
3910         This causes a warning with GCC 4.0.0, and anyway in the typical
3911         case it's not worth the extra 100 bytes or so of code.
3912         (ranged_convert, __mktime_internal): When calling a function via a
3913         pointer P, use P () rather than (*P) (), as we now assume C89 or
3914         better.
3915
3916 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3917
3918         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3919         "who -r" failed to give output.  Problem reported by Tim Waugh.
3920
3921         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3922         (xcalloc): Use it to avoid needless tests.
3923         Problem reported by Jim Meyering.
3924
3925 2005-06-16  Jim Meyering  <jim@meyering.net>
3926
3927         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3928         when either N or S is zero.
3929
3930 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3931
3932         * argp.h (__option_is_short): Check upper limit of
3933         __key. Isprint() requires its argument to have the value
3934         of an unsigned char or EOF.
3935
3936 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3937
3938         * fnmatch.c (fnmatch): If there is an encoding error in a
3939         multibyte string or pattern, fall back on unibyte matching.
3940         Problem reported by James Youngman.
3941
3942 2005-06-08  Bruno Haible  <bruno@clisp.org>
3943
3944         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3945         warning on mingw.
3946
3947 2005-06-08  Bruno Haible  <bruno@clisp.org>
3948
3949         * csharpcomp.h: New file, from GNU gettext.
3950         * csharpcomp.c: New file, from GNU gettext.
3951         * csharpcomp.sh.in: New file, from GNU gettext.
3952
3953 2005-06-07  Derek Price  <derek@ximbiot.com>
3954
3955         Sync from CVS.
3956         * glob_.h: Indent nested #ifdef.
3957
3958 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3959
3960         Sync from coreutils.
3961         Use "file name" when talking about file names, instead of "filename"
3962         or "path", as per the GNU coding standards.
3963         * mkdir-p.c: Renamed from makepath.c.
3964         (make_dir_parents): Renamed from make_path.  All callers changed.
3965         * mkdir-p.h: Likewise.  All includers changed.
3966         * filenamecat.c: Renamed from path-concat.c.
3967         (file_name_concat): Renamed from path_concat.  All callers changed.
3968         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3969         * filenamecat.h: Likewise.  All includers changed.
3970         * acl.c: Don't use "path" or "filename" to mean "file name"
3971         in comments or local variable names.
3972         * basename.c: Likewise.
3973         * canonicalize.c, canonicalize.h: Likewise.
3974         * dirname.c, dirname.h: Likewise.
3975         * euidaccess.c: Likewise.
3976         * exclude.c: Likewise
3977         * fnmatch_.h, fnmatch_loop.c: Likewise.
3978         * fsusage.c, fsuage.h: Likewise.
3979         * fts.c, fts_.h: Likewise.
3980         * getcwd.c: Likewise.
3981         * getloadavg.c: Likewise.
3982         * mkstemp.c: Likewise.
3983         * mountlist.c, mountlist.h: Likewise.
3984         * openat.c, openat.h: Likewise.
3985         * readlink-stub.c: Likewise.
3986         * readutmp.c, readutmp.h: Likewise.
3987         * rename.c: Likewise.
3988         * rmdir.c: Likewise.
3989         * same.c: Likewise.
3990         * savedir.c: Likewise.
3991         * stripslash.c: Likewise.
3992         * tempname.c: Likewise.
3993         * xreadlink.c: Likewise.
3994         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3995         All uses changed.
3996         * exclude.h: Likewise.
3997
3998         * euidaccess.c (getuid, getgid, getuid, getegid)
3999         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4000         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4001         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4002         * pathmax.h: Include <limits.h> unconditionally, since other
4003         files have been getting away with it for years (MORE/BSD 4.3
4004         is extinct now).
4005         * userspec.c (getpwnam, getgrnam, getgrgid)
4006         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4007
4008         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4009         Define to 256, not 255, as per modern POSIX.
4010
4011 2005-06-01  Bruno Haible  <bruno@clisp.org>
4012
4013         * csharpexec.h: New file, from GNU gettext.
4014         * csharpexec.c: New file, from GNU gettext.
4015         * csharpexec.sh.in: New file, from GNU gettext.
4016
4017 2005-05-31  Derek Price  <derek@ximbiot.com>
4018             Paul Eggert  <eggert@cs.ucla.edu>
4019
4020         Sync from cvs.
4021         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4022
4023 2005-05-29  Derek Price  <derek@ximbiot.com>
4024             Paul Eggert  <eggert@cs.ucla.edu>
4025
4026         * glob_.h, glob.c: New files.
4027
4028 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4029
4030         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4031
4032         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4033         the configuration hassle isn't worth it.
4034         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4035         (LONGEST_MODIFIER, PRIuMAX): Remove.
4036
4037 2005-05-27  Bruno Haible  <bruno@clisp.org>
4038
4039         * getlogin_r.h: Remove second include of <stddef.h>.
4040
4041 2005-05-25  Bruno Haible  <bruno@clisp.org>
4042             Derek Price  <derek@ximbiot.com>
4043
4044         * getlogin_r.h: Simplify API documentation.
4045
4046 2005-05-25  Derek Price  <derek@ximbiot.com>
4047             Paul Eggert  <eggert@cs.ucla.edu>
4048
4049         * getlogin_r.c, getlogin_r.h: New files.
4050
4051 2005-05-22  Bruno Haible  <bruno@clisp.org>
4052
4053         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4054         Also include <sys/param.h> if it defines MIN, MAX.
4055         Based on a patch by Derek Price <derek@ximbiot.com>.
4056
4057 2005-05-22  Bruno Haible  <bruno@clisp.org>
4058
4059         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4060         (INT64_MIN): Fix definition.
4061         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4062
4063         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4064         NEED_SIGNED_INT_TYPES.
4065
4066         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4067         HAVE_SYSTEM_INTTYPES.
4068
4069 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4070
4071         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4072         so that unistd-safer.h (GPL'ed code) need not be included.
4073
4074 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4075
4076         New fts module.
4077         * fts.c: Don't include "cycle-check.h" or "hash.h".
4078         (setup_dir, free_dir): New functions.
4079         (enter_dir, leave_dir): Define trivial
4080         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4081         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4082         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4083         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4084         Move to fts-cycle.c.
4085         (fts_open): Use setup_dir.
4086         (fts_close): Use free_dir.
4087         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4088         This adds a label and some gotos, but the alternatives were messier.
4089         Check for memory allocation failure when entering a dir.
4090         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4091         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4092         (FTS): New member fts_cycle, that is a union that contains the
4093         old active_dir_ht and cycle_state.  All uses changed to mention
4094         fts_cycle.ht and fts_cycle.state.
4095         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4096         fts.c, with the following changes:
4097         (setup_dir, free_dir): New functions.
4098         (enter_dir): Now returns bool.  Return true if successful, false
4099         if memory exhausted.  All callers changed.
4100         Do not bother partly cleaning up on
4101         memory allocation failure; that is free_dir's job.
4102         However, free ad if hash_insert fails, to avoid memory leak.
4103         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4104         fts->fts_options to see which union member to use.
4105
4106 2005-05-20  Jim Meyering  <jim@meyering.net>
4107
4108         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4109         Now a macro, to pacify GCC.
4110
4111 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4112
4113         * chown.c (rpl_chown): Return -1 on failure.
4114
4115 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4116
4117         * canonicalize.c: Include canonicalize.h first, to test interface.
4118         Include <stddef.h> unconditionally, since we assume C89 now.
4119         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4120         * fts.c: Include fts_.h first, to check interface.
4121         Do not include intprops.h; no longer needed.
4122         Include cycle-check.h and hash.h, since fts_.h no longer does.
4123         Remove unnecessary casts of closedir to void.
4124         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4125         decide whether to decrement nlinks.
4126         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4127         (FTS): Use struct hash_table * instead of Hash_table, so that
4128         we no longer need to include hash.h here.
4129
4130 2005-05-17  Jim Meyering  <jim@meyering.net>
4131
4132         * fts.c, fts_.h: New files, from coreutils.
4133
4134 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4135
4136         Sync from coreutils.
4137         * unlinkdir.c, unlinkdir.h: New files.
4138         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4139         regex.h, unlocked-io.h, xtime.h:
4140         White space changes only.
4141         * makepath.c (make_path): Port to hosts where leading "//" is special.
4142         * yesno.c: Include getline.h, not ctype.h.
4143         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4144         Use getline to remove arbitrary restriction on response length.
4145
4146 2005-05-13  Bruno Haible  <bruno@clisp.org>
4147
4148         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4149         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4150         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4151         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4152         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4153         Add support for 64-bit integers in the MSVC compiler.
4154
4155 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4156
4157         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4158         Change the initial comment to refer to GPL, not LGPL.
4159         gnulib-tool will change it to LGPL as needed.
4160
4161         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4162         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4163         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4164         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4165         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4166         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4167         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4168         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4169         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4170         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4171         concatpath.c, config.charset, copy-file.c, copy-file.h,
4172         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4173         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4174         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4175         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4176         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4177         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4178         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4179         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4180         full-read.c, full-read.h, full-write.c, full-write.h,
4181         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4182         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4183         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4184         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4185         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4186         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4187         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4188         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4189         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4190         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4191         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4192         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4193         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4194         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4195         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4196         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4197         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4198         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4199         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4200         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4201         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4202         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4203         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4204         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4205         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4206         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4207         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4208         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4209         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4210         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4211         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4212         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4213         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4214         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4215         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4216         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4217         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4218         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4219         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4220         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4221         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4222         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4223         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4224         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4225         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4226         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4227         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4228         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4229         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4230         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4231         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4232         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4233         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4234         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4235         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4236         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4237         Update FSF postal mail address.
4238
4239 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4240
4241         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4242         specified in ai_socktype. Fix invalid ai_protocol
4243         check. ai_protocol is usually set to 0 or depending on
4244         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4245         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4246         ai_socktype / ai_protocol in the returned addrinfo structure.
4247
4248 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4249             Bruno Haible  <bruno@clisp.org>
4250
4251         * inet_ntop.h: New file.
4252         * inet_ntop.c: New file, from glibc with modifications.
4253
4254 2005-05-08  Jim Meyering  <jim@meyering.net>
4255
4256         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4257
4258 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4259
4260         Merge from coreutils.  Among other things,
4261         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4262         * fd-safer.c: New file.
4263         * fcntl-safer.h, open-safer.c: Remove.
4264         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4265         * dup-safer.c: Include unistd-safer.h first.
4266         Don't include errno.h.
4267         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4268         * file-type.h: Don't assume invoker included sys/stat.h first.
4269         * file-type.c: Rely on file-type.h change.
4270         * getloadavg.c: Include unistd-safer.h.
4271         (getloadavg): Use safer open.
4272         * getusershell.c: Include "stdio-safer.h".
4273         (getusershell): Use safer fopen.
4274         * long-options.c (long_options): Use NULL rather than 0.
4275         * modechange.h (mode_free): Remove; all callers changed to invoke
4276         'free'.
4277         * modechange.c: Likewise.
4278         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4279         (MODE_DONE): New constant.
4280         (struct mode_change): Remove 'next' member.
4281         (make_node_op_equals): New function; like the old one of the
4282         same name, except it allocates an array.
4283         (mode_compile, mode_create_from_ref): Use it.
4284         (mode_compile): Allocate result as an array, not a linked list.
4285         Parse octal string ourself, so that we catch mistakes like "+0".
4286         (mode_adjust): Arg is an array, not a linked list.
4287         * modechange.c: Include stat-macros.h, xalloc.h.
4288         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4289         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4290         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4291         Remove.  This is now stat-macros.h's job.
4292         (talloc): Remove.  All callers replaced by xalloc, so that
4293         our invokers don't have to worry about reporting memory failures.
4294         (make_node_op_equals): Remove.
4295         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4296         New constants.
4297         (struct mode_change): Moved here from modechange.h.
4298         (mode_append_entry): Remove.
4299         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4300         apps to have incorrect behavior.  Use simpler algorithm for head
4301         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4302         Detect more invalid usages rather than having somewhat-random behavior.
4303         Don't insert an "a=" action, as that leads to incorrect behavior.
4304         (mode_compile, mode_create_from_ref): Return NULL on error instead
4305         of an enum, since now there's only one way to have an error.  All
4306         callers changed.
4307         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4308         at the correct time.  Simplify calculation of "+u" and its ilk.
4309         Don't mishandle "+X".
4310         (mode_free): Remove "register" and localize decls.
4311         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4312         (struct mode_change): Move to modechange.c; callers don't
4313         need to see this stuff.
4314         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4315         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4316         (mode_change, mode_adjust): Reflect the new signatures noted above.
4317         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4318         that might redefine system include files.
4319         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4320         (my_usleep): Use NULL rather than (void *) 0.
4321         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4322         Use siginterrupt to specify that system calls should be interrupted.
4323         (rpl_nanosleep): Move initialization of suspended closer to call of
4324         my_usleep.
4325         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4326         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4327         (desirable_utmp_entry): New function.
4328         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4329         using x2nrealloc, to simplify logic.
4330         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4331         size calculation.  Do not assume utmp file is a regular file.
4332         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4333         (READ_UTMP_CHECK_PIDS): New constant.
4334         * save-cwd.c: Include unistd-safer.h.
4335         (save_cwd): Use fd_safer.
4336         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4337         [!_LIBC] Include "stat-macros.h" instead.
4338         * unistd-safer.h (fd_safer): New decl.
4339
4340 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4341
4342         * byteswap_.h: New file.
4343
4344 2005-04-25  Albert Chin  <china@thewrittenword.com>
4345
4346         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4347         Toolkit C bug.
4348
4349 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4350
4351         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4352         that "UTC +1 second" continues to work.  Problem reported
4353         by Dmitry V. Levin.
4354         (relunit_snumber): New rule.
4355         (relunit): Use it.
4356
4357 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4358
4359         * getdate.y (universal_time_zone_table): New constant.
4360         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4361         universal_time_zone_table.
4362         (lookup_zone): Prefer universal_time_zone_table to
4363         local_time_zone_table, so that "GMT" time stamps are allowed in
4364         London during the summer.  Problem reported by Ian Abbott.
4365
4366 2005-04-12  Jim Meyering  <jim@meyering.net>
4367
4368         * human.c (humblock): Set *options even when returning due to
4369         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4370         warning from gcc-4.
4371
4372 2005-04-09  Jim Meyering  <jim@meyering.net>
4373
4374         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4375         -Wuninitialized: initialize tm0.tm_year.
4376
4377 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4378
4379         * getdate.y (parser_control): rels_seen is now a boolean, not a
4380         count, since there's no maximum.  All uses changed.
4381         Add member dsts_seen.
4382         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4383         not being INT_MAX.
4384         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4385         Use pc_rels_seen to decide whther a date is absolute.
4386
4387         * getdate.y (number): Don't overwrite year.
4388         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4389         check.
4390
4391 2005-04-02  Simon Josefsson  <jas@extundo.com>
4392
4393         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4394         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4395
4396 2005-03-27  Jim Meyering  <jim@meyering.net>
4397
4398         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4399
4400 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4401
4402         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4403         "one's complement" -> "ones' complement" in comment, as per Knuth.
4404         "value of type" -> "type or expression" in comment.
4405         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4406
4407 2005-03-26  Jim Meyering  <jim@meyering.net>
4408
4409         Comment nits.
4410         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4411         Correct typos: s/or/of/.
4412
4413 2005-03-23  Jim Meyering  <jim@meyering.net>
4414
4415         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4416
4417 2005-03-21  Jim Meyering  <jim@meyering.net>
4418
4419         Changes imported from coreutils.
4420
4421         * cycle-check.c: Don't include xalloc.h.
4422
4423         * path-concat.c: Don't include assert.h.
4424         (path_concat): Remove assertion that would have triggered
4425         for ABASE starting with more than one slash.
4426         Reported by Andreas Schwab.
4427
4428         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4429         properly when ABASE is an absolute file name.
4430         Correct the description of this function.
4431         Include <assert.h>.
4432         Add an assertion and a test driver.
4433         This fixes a bug introduced on 2004-07-02.
4434         Andreas Schwab reported the resulting failure of cp --parents:
4435         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4436
4437 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4438
4439         * strftime.c (my_strftime): If the underlying strftime returns 0
4440         (which shouldn't happen), generate nothing instead of returning 0
4441         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4442
4443 2005-03-16  Bruno Haible  <bruno@clisp.org>
4444
4445         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4446
4447 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4448
4449         * strftime.c (my_strftime): Prepend space to format so that we can
4450         reliably distinguish strftime failure from empty output on POSIX
4451         hosts.
4452
4453 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4454
4455         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4456         (iconv_string): Don't guess a size-zero buffer, as that might cause
4457         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4458         result would be 'too large', where 'too large' is (heuristically)
4459         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4460         overflow concerns.  This will prevent some unwanted malloc failures
4461         when the inputs are very large.
4462
4463 2005-03-15  Bruno Haible  <bruno@clisp.org>
4464
4465         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4466         'negate'.
4467
4468         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4469         variable.
4470
4471         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4472
4473 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4474
4475         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4476         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4477         intprops.h.
4478         * strtol.c: Likewise.
4479
4480 2005-03-14  Simon Josefsson  <jas@extundo.com>
4481
4482         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4483         <fx@gnu.org>.
4484
4485 2005-03-14  Jim Meyering  <jim@meyering.net>
4486
4487         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4488         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4489         to be nonzero so that we (and caller) can detect the difference
4490         between a valid zero-length expansion and an error return, even
4491         when the underlying strftime fails before writing anything into
4492         that location.
4493
4494 2005-03-10  Jim Meyering  <jim@meyering.net>
4495
4496         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4497         so that this module works on systems without fchdir.
4498
4499 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4500
4501         Factor int-properties macros into a single file, except for
4502         glibc-related files.
4503         * intprops.h: New file.
4504         * getloadavg.c: Include it instead of limits.h.
4505         (INT_STRLEN_BOUND): Remove.
4506         * human.c: Include intprops.h.
4507         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4508         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4509         * inttostr.h: Include intprops.h instead of limits.h.
4510         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4511         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4512         for consistency with intprops.h.
4513         (time_t_is_integer, twos_complement_arithmetic): Use them.
4514         * sig2str.h: Include <signal.h>, intprops.h.
4515         (INT_STRLEN_BOUND): Remove.
4516         * strftime.c (TYPE_SIGNED): Remove.
4517         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4518         * strtol.c: Adjust comments to match intprops.h.
4519         * userspec.c: Include intprops.h.
4520         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4521         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4522         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4523         instead of rolling our own expressions.
4524         * xstrtol.c: Include xstrtol.h first, to test interface.
4525
4526         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4527         instead of int.
4528         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4529         the right thing even if adding 1900 would overflow.  Similarly
4530         for tm_mon + 1 and tm_yday + 1.
4531         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4532         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4533         (DO_SIGNED_NUMBER): New macro.
4534         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4535
4536 2005-03-07  Bruno Haible  <bruno@clisp.org>
4537
4538         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4539
4540 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4541             Bruno Haible  <bruno@clisp.org>
4542
4543         * pagealign_alloc.h: New file.
4544         * pagealign_alloc.c: New file.
4545
4546 2005-01-28  Bruno Haible  <bruno@clisp.org>
4547
4548         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4549         stpncpy.c uses it.
4550
4551 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4552
4553         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4554         The workaround isn't strictly needed for POSIX conformance, and
4555         it's too much of a pain to configure and maintain.  We'll ask
4556         people to fix their kernels instead.
4557         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4558         (NANOSLEEP_BUG_WORKAROUND): Remove.
4559         (xnanosleep): Remove the workaround.
4560
4561 2005-02-12  Bruno Haible  <bruno@clisp.org>
4562
4563         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4564
4565 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4566
4567         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4568         * timespec.h (gettime): Return void, since it always
4569         succeeds now.  All uses changed.
4570         * gettime.c (gettime) Likewise.
4571         [HAVE_NANOTIME]: Prefer nanotime.
4572         Assume gettimeofday succeeds, as POSIX requires.
4573         Assime time () succeeds, since other code already does.
4574         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4575         (timespec_subtract): Remove.
4576         (NANOSLEEP_BUG_WORKAROUND): New constant.
4577         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4578         things considerably.  Use it only on GNU/Linux hosts, since the
4579         workaround shouldn't be needed elsewhere.
4580
4581 2005-02-24  Bruno Haible  <bruno@clisp.org>
4582
4583         * gettext.h: Update from GNU gettext 0.14.2.
4584
4585 2005-02-24  Bruno Haible  <bruno@clisp.org>
4586
4587         * localcharset.c: Update from GNU gettext 0.14.2.
4588         * config.charset: Update from GNU gettext 0.14.2.
4589
4590 2005-02-22  Simon Josefsson  <jas@extundo.com>
4591
4592         * iconvme.h, iconvme.c: New files, from libc.
4593
4594 2005-02-20  Neil Conway  <neilc@samurai.com>
4595
4596         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4597         returned by OSX/Darwin if the specified buffer is not large
4598         enough for the hostname.
4599
4600 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4601
4602         * memrchr.h: New file.
4603         * chdir-long.c: Include it.
4604         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4605         Don't bother including stddef.h.
4606
4607 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4608
4609         * argp-help.c (__argp_help): Create a fake struct argp_state and
4610         pass it to _help, otherwise the latter coredumps trying to
4611         dereference state.root_argp.
4612
4613 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4614
4615         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4616         inclusion.
4617         Include <sys/types.h>, for dev_t.
4618         (ME_DUMMY, ME_REMOTE): Move from here....
4619         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4620         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4621         Dmitry V. Levin.
4622         Include mountlist.h first, to test the interface.
4623
4624 2005-01-29  Bruno Haible  <bruno@clisp.org>
4625
4626         * progname.c (program_name): Initialize.
4627         Needed when linking statically on MacOS X.
4628
4629 2005-01-28  Bruno Haible  <bruno@clisp.org>
4630
4631         * javacomp.sh.in: New file, from GNU gettext.
4632         * javacomp.h: New file, from GNU gettext.
4633         * javacomp.c: New file, from GNU gettext.
4634
4635 2005-01-26  Bruno Haible  <bruno@clisp.org>
4636
4637         * javaexec.sh.in: New file, from GNU gettext.
4638         * javaexec.h: New file, from GNU gettext.
4639         * javaexec.c: New file, from GNU gettext.
4640
4641 2005-01-26  Simon Josefsson  <jas@extundo.com>
4642
4643         * gai_strerror.c: Use GPL in header.
4644
4645 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4646
4647         * argp-help.c (hol_entry_help): Avoid using non-constant
4648         initializers for struct pentry_state.
4649         (__argp_error): Check return value of __asprintf
4650         (__argp_failure): Translate error message
4651
4652         * argp-parse.c: Removed braces around the expansion of N_()
4653
4654 2005-01-21  Jim Meyering  <jim@meyering.net>
4655
4656         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4657         same value as for Solaris 9.
4658
4659         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4660         component length.  This included changing the parameter to be
4661         of type `char *' rather than `char const *'.
4662         * chdir-long.h (chdir_long): Update prototype.
4663
4664         * openat.c (fdopendir, fstatat): New functions.
4665         * openat.h: Include headers required for use of DIR and struct stat.
4666         [AT_SYMLINK_NOFOLLOW]: Define.
4667         (fdopendir, fstatat): Add prototypes.
4668
4669 2005-01-21  Bruno Haible  <bruno@clisp.org>
4670
4671         * classpath.h: New file, from GNU gettext.
4672         * classpath.c: New file, from GNU gettext.
4673
4674 2005-01-20  Simon Josefsson  <jas@extundo.com>
4675
4676         * version-etc-fsf.c: New file, with version_etc_copyright.
4677         * version-etc.c: Remove version_etc_copyright.
4678         * version-etc.h (version_etc_copyright): Use [] instead of * in
4679         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4680
4681 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4682
4683         * save-cwd.c (save_cwd): Remove code to support the case
4684         where fchdir is missing or flaky.
4685
4686 2005-01-20  Simon Josefsson  <jas@extundo.com>
4687
4688         * base64.h (isbase64): Add.
4689
4690         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4691         using a unsigned prototype, don't inline.
4692         (base64_decode): Use it.
4693
4694 2005-01-19  Bruno Haible  <bruno@clisp.org>
4695
4696         * sh-quote.h: New file, from GNU gettext.
4697         * sh-quote.c: New file, from GNU gettext.
4698
4699 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4700
4701         Merge changes from coreutils, as described below in several
4702         changelogs dated today.
4703
4704         * save-cwd.c: Include "save-cwd.h" before other include files.
4705         (O_DIRECTORY): Remove; not needed here, since "." must be
4706         a directory.  All uses removed.
4707         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4708         universal on Suns, and we also need to test for IRIX.
4709         Revamp code to use 'if' rather than '#if'.
4710         Avoid unnecessary comparison of cwd->desc to 0.
4711
4712         * utimens.c (futimens): Robustify the previous patch, by checking
4713         for known valid error numbers rather than observed invalid ones.
4714
4715 2005-01-18  Jim Meyering  <jim@meyering.net>
4716
4717         * version-etc.c (version_etc_copyright): Update copyright date.
4718
4719         * utimens.c (futimens): Account for the fact that futimes
4720         can also fail with errno == ENOSYS or errno == ENOENT.
4721         Patch from Dmitry V. Levin.
4722
4723         Change the name of the robust chdir function from chdir to chdir_long.
4724         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4725         (restore_cwd): Use chdir_long, not chdir.
4726         * chdir-long.c: Renamed from chdir.c.
4727         * chdir-long.h: Renamed from chdir.h.
4728         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4729         Hurd.
4730
4731 2005-01-18  Bob Proulx  <bob@proulx.com>
4732
4733         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4734         offsetof() macro construct to avoid compile failure with native HP-UX
4735         11.0 ANSI C compiler.
4736
4737 2005-01-06  Bruno Haible  <bruno@clisp.org>
4738
4739         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4740         because stpncpy.m4 takes care of it.
4741
4742 2004-01-24  Bruno Haible  <bruno@clisp.org>
4743
4744         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4745
4746 2003-10-09  Bruno Haible  <bruno@clisp.org>
4747
4748         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4749
4750 2005-01-06  Bruno Haible  <bruno@clisp.org>
4751
4752         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4753         * fwriteerror.c: Include <stdbool.h>.
4754         (fwriteerror): At the end, close the file stream. Record whether
4755         stdout was already closed.
4756
4757 2004-05-27  Bruno Haible  <bruno@clisp.org>
4758
4759         * execute.c (environ): Declare if needed.
4760         * pipe.c (environ): Likewise.
4761         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4762
4763 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4764
4765         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4766         definitions to be after all include files, to avoid collisions.
4767         Problem reported by Bob Proulx.
4768
4769 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4770
4771         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4772         not needed.  This removes a dependency on the gettext module.
4773         [defined _LIBC]: Do not include <libintl.h>; not needed.
4774
4775 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4776
4777         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4778         HAVE_DECL_STRTOLD.
4779
4780 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4781
4782         * argp-parse.c: Include <stddef.h>.
4783         (alignof, alignto): New macros.
4784         (parser_init): Don't assume that void * is aligned sufficiently
4785         for struct option.
4786
4787         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4788         need to extend the stack.
4789         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4790         large.
4791
4792 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4793
4794         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4795
4796 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4797
4798         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4799         Remove now-obsolete comment about AIX.
4800         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4801         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4802         (YYMAXDEPTH): New macro.
4803
4804 2004-12-18  Bruno Haible  <bruno@clisp.org>
4805
4806         * fatal-signal.c (fatal_signals): Make non-const.
4807         (init_fatal_signals): New function.
4808         (uninstall_handlers, install_handlers): Ignore signals that were set to
4809         SIG_IGN.
4810         (at_fatal_signal): Call init_fatal_signals.
4811         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4812         SIG_IGN.
4813         Reported by Paul Eggert.
4814
4815 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4816
4817         * getdate.y (textint): New member "negative".
4818         (time_zone_hhmm): New function.
4819         Expect 14 shift-reduce conflicts, not 13.
4820         (o_colon_minutes): New rule.
4821         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4822         (yylex): Set the "negative" member of signed numbers.
4823
4824 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4825
4826         Changes imported from coreutils.
4827         * hard-locale.c: Assume <locale.h> exists.
4828         Include "strdup.h".
4829         (GLIBC_VERSION): New macro.
4830         (hard_locale): Assume setlocale exists.
4831         Rewrite to avoid #ifdef.
4832         Use strdup rather than malloc + strcpy.
4833         * human.c: Assume <locale.h> exists.
4834         (human_readable): Assume localeconv exists.
4835
4836 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4837
4838         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4839         convert T2, not T.  (Imported from libc.)
4840
4841 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4842
4843         * getcwd.c (is_ENAMETOOLONG): New macro.
4844         (__getcwd.c): Don't restore errno; glibc doesn't.
4845         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4846         first, falling back to our code only if its results look suspicious.
4847         Ensure that the resulting buffer is only as large as necessary.
4848
4849         * readutmp.c: Include readutmp.h first.
4850         Include <errno.h>, since readutmp.h no longer does that.
4851         * readutmp.h: Don't include <errno.h>,
4852         <sys/param.h>, <time.h>; not needed to establish interface.
4853         (errno): Remove decl.
4854         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4855         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4856         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4857
4858 2004-11-28  Simon Josefsson  <jas@extundo.com>
4859
4860         * base64.h, base64.c: New file.
4861
4862 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4863
4864         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4865
4866 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4867
4868         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4869         HP's ANSI C compiler.
4870         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4871         Declaring int functions causes warnings on some modern systems and
4872         shouldn't be needed to compile on ancient ones.
4873         * same.c (MIN) [defined MIN]: Don't define, since it's already
4874         defined.
4875
4876         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4877         with the following changes.
4878         (__set_errno): Parenthesize properly.
4879         Include <stdbool.h>.
4880         (MIN, MAX, MATCHING_INO): New macros.
4881         (__getcwd): Define with prototype, not K&R form.
4882         Use heuristics to allocate default buffer on stack if possible.
4883         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4884         behavior, and to avoid the PATH_MAX limit when computing
4885         ../../../../...
4886         Use MATCHING_INO to compare inode number to file.
4887         Check for arithmetic overflow in size calculations.
4888         Fix bug in reallocation of dot array that caused getcwd to fail
4889         on directories nested deeper than 75.
4890         Be more careful about saving errno on error.
4891         Do not use realloc; use only free+malloc, as this is a bit
4892         more flexible and avoids a needless copy operation.
4893         Do not inspect st_dev and st_ino for symbolic links; POSIX
4894         doesn't specify the latter.
4895         Check for closedir errors.
4896         Avoid needless casts.
4897         Use "#ifdef weak_alias" around weak_alias, to be like other
4898         glibc code.
4899         The following changes to getcwd.c have effect only when used in
4900         gnulib; they have no effect inside glibc proper.
4901         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4902         as alloca isn't used.
4903         (alloca, __alloca): Likewise.
4904         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4905         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4906         unconditionally, as gnulib assumes C89 or better.
4907         Do not include <sys/param.h>.
4908         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4909         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4910         better.
4911         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4912         Include <dirent.h> in a way that is compatible with modern Autoconf.
4913         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4914         New macros, if not already defined.
4915         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4916         Use "_LIBC", not "defined _LIBC", for consistency.
4917         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4918         a mempcpy module.
4919         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4920         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4921         * xgetcwd.c: David MacKenzie's old code was removed, so give
4922         credit only to Jim Meyering and adjust the copyright dates.
4923         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4924         <stdlib.h>, <unistd.h>, "pathmax.h".
4925         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4926         (INITIAL_BUFFER_SIZE): Remove.
4927         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4928
4929 2004-11-23  Jim Meyering  <jim@meyering.net>
4930
4931         * getopt_.h: Remove trailing blanks.
4932
4933 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4934
4935         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4936         (futimens): New function, which uses futimes if available.
4937         (futimens, utimens): Support timespec==NULL, with same semantics
4938         as utime and utimens.
4939         * utimens.h (futimens): New decl.
4940
4941 2004-11-23  Jim Meyering  <jim@meyering.net>
4942
4943         * __fpending.c: Add comment.
4944
4945 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4946
4947         * getopt_.h: Re-addition of __getopt_argv_const caused
4948         redefinition warnings. To avoid them, include the defines
4949         in `#if !defined __need_getopt ... #endif'. The only place
4950         where __getopt_argv_const is used is in definitions
4951         of getopt_long and getopt_long_only below, which are as well
4952         protected by `#ifndef __need_getopt'.
4953         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4954         __need_getopt after including <stdio.h> and <unistd.h> These
4955         headers might have defined it.
4956
4957 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4958
4959         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4960         New macros.
4961         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4962         optopt): Use them instead of invoking ## directly; otherwise, the
4963         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4964
4965 2004-11-19  Bruno Haible  <bruno@clisp.org>
4966
4967         * strtok_r.c: Move comments from here...
4968         * strtok_r.h: ... to here.
4969
4970 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4971
4972         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4973         might fail.  Problem reported by Yoann Vandoorselaere.
4974         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4975         that mishandle size_t overflow.
4976
4977 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4978
4979         * canon-host.c: Include "strdup.h".
4980         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4981         Use strdup instead of malloc/strcpy to duplicate strings.
4982
4983         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4984         (human_space_before_unit): New constant.
4985         * human.c (human_readable): Support it.
4986
4987         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4988         (xgetcwd): Set errno correctly when failing.
4989         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4990         the failure is actually due to a PATH_MAX problem.
4991
4992         Further getopt changes to make it more likely that glibc will
4993         buy the changes back.
4994         * getopt.c (POSIXLY_CORRECT): New constant.
4995         (getopt): Use it, so to preserve glibc semantic
4996         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4997         when compiling for libc.
4998         * getopt_.h (__getopt_argv_const): Bring it back.
4999         (getopt_long, getopt_long_only): Use it.
5000
5001         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5002         New arg POSIXLY_CORRECT.  All callers changed.
5003         (getopt): Argv is now char * const *, as per standard.
5004         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5005         not char *__getopt_argv_const *.
5006         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5007         _getopt_long_only_r): Likewise.
5008         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5009         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5010         _getopt_long_r, _getopt_long_only_r): Likewise.
5011         * getopt_.h (__getopt_argv_const): Remove.
5012         (getopt): Argv is now char * const *, as per standard.
5013
5014         * getdate.y (tORDINAL): New token.
5015         (day, relunit): Allow it for relative times.
5016         (relative_time_table): Use tORDINAL for ordinals.
5017
5018 2004-11-15  Jim Meyering  <jim@meyering.net>
5019
5020         * closeout.c: Include "__fpending.h" once again.
5021         Include <stdbool.h>.
5022         (close_stdout): Don't fail just because stdout was closed initially,
5023         since some programs don't write to stdout in the normal course of
5024         operation (other than --version and --help), and we don't want this
5025         function to make e.g. `touch file >&-' fail.
5026         But do fail if it was closed and someone has tried to write to it.
5027         E.g., `printf foo >&-' must fail.
5028
5029 2004-11-11  Simon Josefsson  <jas@extundo.com>
5030
5031         * strtok_r.h, strtok_r.c: New file.
5032
5033 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5034
5035         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5036         we can stop lying to compilers about the constness of argv when we
5037         are compiled outside glibc.
5038         (getopt, getopt_long, getopt_long_only): Use it.
5039         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5040         getopt): Likewise.
5041         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5042         _getopt_long_only_r): Likewise.
5043         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5044         _getopt_long_only_r): Likewise.
5045
5046         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5047         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5048         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5049         the other external symbols.
5050         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5051         declaration, since the above renaming now works around collisions.
5052
5053 2004-11-11  Jim Meyering  <jim@meyering.net>
5054
5055         * linebreak.c: Remove trailing blanks.
5056         * alloca_.h: Likewise.
5057         * acosl.c: Likewise.
5058         * euidaccess.c: Likewise.
5059         * allocsa.h: Likewise.
5060
5061 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5062
5063         * mktime.c (SHR): New macro, which is a portable
5064         substitute for >> that should work even on Crays.
5065         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5066         Problem reported by Mark D. Baushke in
5067         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5068         * getdate.y (SHR): Likewise.
5069         (tm_diff): Use it.
5070         * strftime.c (SHR): Likewise.
5071         (tm_diff): Use it.
5072         * quotearg.c (struct quoting_options): Use unsigned int for
5073         quote_these_too, so that right shifts are well defined.  All uses
5074         changed.
5075
5076 2004-11-10  Simon Josefsson  <jas@extundo.com>
5077
5078         * getaddrinfo.h, getaddrinfo.c: New files.
5079
5080 2004-11-10  Jim Meyering  <jim@meyering.net>
5081
5082         Ensure that no close failure goes unreported.
5083         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5084         return early when it seems there's nothing to flush.
5085         Don't include __fpending.h.
5086
5087 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5088
5089         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5090
5091 2004-11-05  Bruno Haible  <bruno@clisp.org>
5092
5093         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5094         Reported by Mark D. Baushke <mdb@cvshome.org>.
5095
5096 2004-11-04  Bruno Haible  <bruno@clisp.org>
5097
5098         2004-09-11  Bruno Haible  <bruno@clisp.org>
5099                 * allocsa.valgrind: New file.
5100         2004-02-06  Bruno Haible  <bruno@clisp.org>
5101                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5102                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5103                 Reported by Christopher Seip <chris.seip@hp.com>.
5104
5105 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5106
5107         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5108         with errno == ERANGE if the buffer is too small.
5109         Problem reported by Mark D. Baushke.
5110
5111 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5112
5113         * xreadlink.c (MAXSIZE): New macro.
5114         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5115         size does not exceed MAXSIZE.  Avoid cast.
5116         As suggested by Mark D. Baushke in
5117         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5118         if readlink fails with buffer size just under MAXSIZE, try again
5119         with MAXSIZE.
5120
5121 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5122         and  Paul Eggert  <eggert@cs.ucla.edu>
5123
5124         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5125         (get_date): Overparenthesize to avoid GCC warning.
5126
5127 2004-11-02  Bruno Haible  <bruno@clisp.org>
5128
5129         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5130         function returns void.
5131
5132 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5133
5134         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5135         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5136         already declared.
5137
5138 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5139
5140         * getdate.y: Add support for TZ="foo" within a date string.
5141         Fix some bugs near time_t boundaries.  Reject dates with
5142         out-of-range components, e.g., "Sept 31".
5143         Include <stdlib.h>, "setenv.h", "xalloc.h".
5144         (ISDIGIT_LOCALE): Remove; unused.
5145         Note that the TZ and time functions used here are not reentrant.
5146         (mktime_ok, get_tz): New functions.
5147         (TZBUFSIZE): New constant.
5148         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5149         This requires that we sometimes generate our own TZ="XXX..." setting.
5150
5151 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5152
5153         * mktime.c (not_equal_tm): Remove redundant check.
5154
5155 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5156
5157         * getdate.y: Use Bison 1.875 features, and some minor
5158         code cleanups.  This change does not affect semantics.
5159         Don't include <stdlib.h>; no longer needed.
5160         Don't include unlocked-io.h; only the "#if TEST" code uses
5161         stdio, and performance isn't crucial there.
5162         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5163         Bison 1.875 features as described below.
5164         All uses of "PC." replaced by "pc->".
5165         (YYSTYPE): Add a forward declaration.
5166         (yylex, yyerror): Use full prototypes in forward decls.
5167         Use "%pure-parser" rather than obsolescent "%pure_parser".
5168         Use %parse-param and %lex-param instead of obsolescent
5169         YYPARSE_PARAM and YYLEX_PARAM.
5170         (meridian_table, month_and_day_table, time_units_table,
5171         relative_time_table, time_zone_table, military_table,
5172         lookup_zone, lookup_word, get_date):
5173         Use NULL instead of 0 where appropriate.
5174         (to_hour): Avoid abort (), to avoid a dependency on
5175         stdlib.h.
5176         (yyerror, yylex): Now accepts parser_control * arg.
5177         (main) [TEST]: Use '\0' rather than 0 for char.
5178
5179 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5180
5181         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5182         It's now the caller's responsibility to handle the case where
5183         !HAVE_GETPAGESIZE && !defined getpagesize.
5184
5185         * mktime.c (leapyear): Arg is long int, not int.
5186
5187 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5188
5189         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5190
5191 2004-10-12  Simon Josefsson  <jas@extundo.com>
5192
5193         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5194         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5195         to real functions.
5196
5197 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5198
5199         * vsnprintf.h: New file.
5200         * vsnprintf.c: New file.
5201
5202 2004-10-07  Bruno Haible  <bruno@clisp.org>
5203
5204         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5205         into the provided buffer.
5206
5207 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5208
5209         * diacrit.c, diacrit.h: Add GPL notice.
5210
5211         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5212         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5213         * logl.c (logl): Keep the code as similar to glibc as possible.
5214         This avoids a potential constant-folding bug.
5215
5216 2004-10-05  Bruno Haible  <bruno@clisp.org>
5217
5218         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5219
5220 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5221
5222         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5223         * xmalloc.c (xmemdup): Likewise.
5224         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5225         XFREE): Remove these long-obsolescent macros.
5226         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5227         * xstrdup.c: Remove.
5228
5229         * regex.c (re_comp): Cast gettext return value to char *,
5230         Problem reported by Martin Neitzel via Mark D. Baushke.
5231
5232 2004-10-04  Simon Josefsson  <jas@extundo.com>
5233
5234         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5235         '#ifdef USE_UNLOCKED_IO'.
5236
5237 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5238
5239         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5240         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5241         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5242         regex.c, sha1.c, version-etc.c, yesno.c:
5243         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5244         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5245         the includer's responsibility.
5246
5247         Sync from coreutils.
5248
5249         * modechange.c (mode_compile): Don't decrement a pointer that
5250         points to the start of a string, as the C Standard says the
5251         resulting behavior is undefined.
5252
5253         * backupfile.h (enum backuptype): Rename none -> no_backups,
5254         simple -> simple_backups, numbered_existing ->
5255         numbered_existing_backups, numbered -> numbered_backups
5256         to avoid shadowing problems.  All uses changed.
5257         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5258         * backupfile.c (check_extension, numbered_backup):
5259         Rename locals to avoid shadowing 'basename'.
5260         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5261         once.
5262
5263         * .cppi-disable: Add getopt_.h, getopt_int.h.
5264         * .cvsignore: Add getopt.h.
5265
5266 2004-10-04  Simon Josefsson  <jas@extundo.com>
5267
5268         * memmem.h: New file.
5269         * memmem.c: New file, taken from glibc.
5270
5271 2004-10-02  Jim Meyering  <jim@meyering.net>
5272
5273         * dirfd.h, getpagesize.h: Add copyright notice.
5274
5275 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5276
5277         * snprintf.c: Remove comments as to why each header is needed.
5278
5279 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5280
5281         * strsep.h: New file.
5282         * strsep.c: New file.
5283
5284 2004-10-01  Simon Josefsson  <jas@extundo.com>
5285
5286         * snprintf.c (snprintf): Handle size==0.
5287
5288 2004-10-01  Simon Josefsson  <jas@extundo.com>
5289             Bruno Haible  <bruno@clisp.org>
5290
5291         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5292         (snprintf): Declare 'args'.
5293
5294 2004-09-30  Simon Josefsson  <jas@extundo.com>
5295
5296         * snprintf.h, snprintf.c: New files.
5297
5298 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5299
5300         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5301         (hol_entry_help): Never translate an empty string.
5302         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5303         * argp.h (OPTION_NO_TRANS): New option.
5304
5305 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5306
5307         * xvasprintf.c: Include xalloc.h.
5308         (xvasprintf): Use xalloc_die, not xmalloc_die.
5309
5310 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5311
5312         * dummy.c: Change copyright notice to FSF, and license to GPL.
5313
5314 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5315
5316         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5317         Problem reported by Bruno Haible in:
5318         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5319
5320 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5321
5322         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5323         in case some system header has #define'd it.  Problem reported by
5324         Soeren D. Schulze in
5325         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5326
5327 2004-09-08  Bruno Haible  <bruno@clisp.org>
5328
5329         * stdint_.h: New file, taken from GNU clisp.
5330
5331 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5332
5333         * xvasprintf.h: New file.
5334         * xvasprintf.c: New file.
5335         * xasprintf.c: New file.
5336
5337 2004-09-08  Bruno Haible  <bruno@clisp.org>
5338
5339         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5340         is > INT_MAX.
5341         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5342
5343 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5344
5345         Import from coreutils.
5346         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5347         strings on unbounded length.  alloca's performance benefits aren't
5348         that important here.
5349         (V_STRDUP): Remove.
5350         (parse_with_separator): New function, with most of the internals
5351         of the old parse_user_spec.  Allow user to omit both user and group,
5352         for compatibility with FreeBSD.
5353         Clone only the user name, not the entire spec.
5354         Do not set *uid, *gid unless entirely successful.
5355         Avoid memory leak in some failing cases.
5356         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5357         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5358         (parse_user_spec): Rewrite to use parse_with_separator.
5359
5360 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5361
5362         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5363         its complicated substitute.
5364         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5365         and program_invocation_name.
5366         (__argp_basename) [!_LIBC]: Remove; the only use was
5367         replaced by its body.
5368         (__argp_short_program_name): Change condition from
5369         !defined __argp_short_program_name to
5370         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5371         to match argp-namefrob.h.
5372         (__argp_failure): Don't assume strerror_r returns char *.
5373         * argp-parse.c (N_): Define unconditionally.
5374         (argp_default_options): Fill out initializers with 0 to avoid
5375         gcc warnings.
5376
5377 2004-08-12  Simon Josefsson  <jas@extundo.com>
5378
5379         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5380         * getopt_.h: Renamed from getopt.h.
5381
5382 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5383
5384         Merge from coreutils.
5385
5386         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5387         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5388         for Reliant Unix 5.43.
5389
5390         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5391         (union fooround): Use uintmax_t, not long int.
5392         The rest is a merge from libc:
5393         [defined _LIBC]: Include <shlib-compat.h>.
5394         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5395
5396         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5397
5398         * strverscmp.c: Convert to UTF-8.
5399
5400 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5401
5402         * obstack.h (obstack_empty_p):
5403         Don't assume that chunk->contents is suitably aligned.
5404         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5405         Likewise. Problem reported by Benno in
5406         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5407
5408         * chown.c (rpl_chown): Work even if the file is writeable but not
5409         readable.  This could be improved further but it'd take some work.
5410
5411 2004-08-08  Simon Josefsson  <jas@extundo.com>
5412
5413         * xgethostname.c: Don't include error.h (not used).
5414
5415         * getpass.h: Add.
5416         * getpass.c: Include getpass.h first.
5417
5418 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5419
5420         * xalloc-die.c: New files.
5421         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5422         All uses removed.
5423         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5424         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5425         (_, N_, xalloc_die): Move to xalloc-die.c.
5426         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5427         so that we needn't mess with xalloc_msg_memory_exhausted.
5428
5429         * sha1.h: Renamed from sha.h.
5430         (SHA1_H): Renamed from _SHA_H.
5431         (sha1_ctx): Renamed from sha_ctx.
5432         (sha1_init_ctx): Renamed from sha_init_ctx.
5433         (sha1_process_block): Renamed from sha_process_block.
5434         (sha1_process_bytes): Renamed from sha_process_bytes.
5435         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5436         (sha1_read_ctx): Renamed from sha_read_ctx.
5437         (sha1_stream): Renamed from sha_stream.
5438         (sha1_buffer): Renamed from sha_buffer.
5439         * sha1.c: Likewise; renamed from sha.c.
5440         Do not include <sys/types.h>.
5441         Include <stddef.h> rather than <stdlib.h>.
5442
5443 2004-08-08  Bruno Haible  <bruno@clisp.org>
5444
5445         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5446         FILESYSTEM_PREFIX_LEN.
5447         * progreloc.c: Likewise.
5448         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5449
5450 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5451
5452         Merge from tar.
5453         * argp-help.c (make_hol, hol_append): Don't assume that
5454         SIZE_MAX is a valid preprocessor constant.
5455         (__argp_basename): Change from "#ifndef _LIBC"
5456         to "#ifndef __argp_short_program_name", so that
5457         we don't compile these functions for tar.
5458
5459         More merges from coreutils.
5460         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5461         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5462         yesno.h: New files.
5463         * addext.c: Remove; no longer needed.
5464         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5465         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5466         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5467         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5468         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5469         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5470         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5471         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5472         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5473         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5474         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5475         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5476         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5477         Import changes from coreutils.
5478
5479 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5480
5481         Merge from coreutils.
5482
5483         * .gdb-history: Remove; this doesn't belong here.
5484
5485         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5486         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5487         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5488
5489         * dirname.h: Include <stdbool.h>.
5490         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5491         for consistency with POSIX terminology.  All uses changed.
5492         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5493         (strip_trailing_slashes): Use bool for booleans.
5494         * stripslash.c (strip_trailing_slashes): Likewise.
5495
5496         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5497         sometimes returns a positive errno value even when it succeeds.
5498         (print_errno_message) [!LIBC]: Fall back on strerror if
5499         __strerror_r fails.
5500
5501         * path-concat.c (mempcpy): Don't define if a system header defines it.
5502         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5503         (longest_relative_suffix): New function.
5504         (path_concat): Use it.  Assume first argument is not NULL.
5505         Port to DOS.  Omit redundant separators.
5506         Report an error instead of returning NULL.
5507         Use mempcpy instead of memcpy.
5508         (xpath_concat): Remove: not declared or used.
5509
5510         * same.h: Include <stdbool.h>
5511         (same_name): Return bool, not int.
5512         * same.c (same_name): Likewise.
5513         (errno): Don't declare; we assume C89 or better now.
5514
5515         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5516         if not already defined.
5517
5518         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5519         * dup-safer.c (errno): Likewise.
5520
5521 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5522
5523         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5524         working.
5525
5526 2004-08-03  Simon Josefsson  <jas@extundo.com>
5527
5528         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5529         * progname.h: Don't include stdbool.h.
5530
5531 2004-08-02  Simon Josefsson  <jas@extundo.com>
5532
5533         * getsubopt.h: New file, with comments from Bruno Haible.
5534         * getsubopt.c: New file, from glibc, but slightly modified based on
5535         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5536
5537 2004-08-01  Simon Josefsson  <jas@extundo.com>
5538
5539         * xgetdomainname.c: Include stdlib.h, for free().
5540
5541 2004-07-16  Simon Josefsson  <jas@extundo.com>
5542
5543         * dummy.c: New file.
5544
5545 2004-07-16  Bruno Haible  <bruno@clisp.org>
5546
5547         * backupfile.h: Add extern "C" for C++.
5548         * closeout.h: Likewise.
5549         * copy-file.h: Likewise.
5550         * findprog.h: Likewise.
5551         * full-write.h: Likewise.
5552         * pathname.h: Likewise.
5553         * progname.h: Likewise.
5554         * stpcpy.h: Likewise.
5555         * stpncpy.h: Likewise.
5556         * strcase.h: Likewise.
5557         * strstr.h: Likewise.
5558         * xalloc.h: Likewise.
5559
5560         * mbswidth.h: Add extern "C" for C++.
5561         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5562
5563 2004-07-09  Simon Josefsson  <jas@extundo.com>
5564
5565         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5566         failed without this.)
5567
5568 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5569
5570         * fchown-stub.c: New file.
5571
5572 2004-06-24  Jim Meyering  <jim@meyering.net>
5573
5574         * obstack.h (obstack_base): Cast to (void *), per documentation.
5575
5576 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5577
5578         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5579
5580 2004-06-01  Jim Meyering  <jim@meyering.net>
5581
5582         * calloc.c: New file.
5583
5584 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5585
5586         * getdate.y (yylex): Allow space between sign and number.
5587         Problem reported by Dan Jacobson.
5588
5589 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5590         and  Jim Meyering  <jim@meyering.net>
5591
5592         Merge from coreutils CVS.
5593
5594         * stat-macros.h: New file, with contents from file-type.h
5595         and coreutils' system.h.
5596         * file-type.c: Include "stat-macros.h".
5597         * file-type.h (file_type): Move all macro definitions to new file,
5598         stat-macros.h.
5599
5600         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5601         Wrap old code with this conditional.
5602         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5603         function that does not dereference symlinks.
5604         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5605
5606         * xreadlink.c: Include xreadlink.h first, to catch .h file
5607         dependency problems.
5608         (xreadlink): Accept new arg SIZE, for efficiency.
5609         All decls and uses changed.
5610         * xreadlink.h: Include <stddef.h>, for size_t.
5611
5612         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5613         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5614
5615         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5616
5617 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5618
5619         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5620         macros to be defined.
5621         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5622         the allocator returns NULL because the requested size is zero.
5623
5624 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5625
5626         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5627         var.  Add comment explaining why libc still defines it.  This
5628         merges the following patch from glibc:
5629         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5630
5631 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5632
5633         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5634         present in glibc since revision 1.1 of this file.
5635         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5636         obstack_alignment_mask, obstack_alloc, obstack_base,
5637         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5638         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5639         obstack_grow0, obstack_init, obstack_int_grow,
5640         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5641         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5642         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5643         nonexistent functions.
5644
5645 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5646             Paul Eggert  <eggert@cs.ucla.edu>
5647
5648         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5649
5650 2004-05-14  Bruno Haible  <bruno@clisp.org>
5651
5652         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5653         that consists of a '.' followed by an empty digit string.
5654         Patch by Tor Lillqvist <tml@iki.fi>.
5655
5656 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5657
5658         Port obstack to the AS/400, where pointers are 16 bytes wide and
5659         you cannot cast an integer to a valid pointer.  This patch is
5660         currently waiting to be integrated into glibc; see
5661         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5662
5663         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5664         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5665         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5666         (struct obstack): temp member is now a union of a pointer and
5667         an integer, instead of an integer.  All integer uses changed.
5668         This does not affect the physical layout of struct obstack,
5669         except on hosts (like the AS/400) where the size or alignment of
5670         void * is greater than that of ptrdiff_t.
5671         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5672         __STDC__)]: Store temporary in pointer member of union, not
5673         integer member.
5674         * obstack.c: Include <stddef.h>, for offsetof.
5675         (struct fooalign): Remove; it doesn't need a name.
5676         (union fooround): Change double to long double, and add void *.
5677         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5678         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5679         not a macro.  Hence the values are always int; so remove all
5680         casts-to-int in uses.
5681
5682 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5683             Derek Price  <derek@ximbiot.com>
5684
5685         * alloca.c: Include <alloca.h>, to get our interface.
5686         * alloca_.h: Use __alloca on AIX, so that we don't have to
5687         include <alloca.h> first.  Use C89 prototype for alloca; this
5688         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5689         Use #elif for simplicity, since we can assume C89 now.
5690         Don't try to source the system alloca.h since it will not be found
5691         and to prevent recursively including its replacement.
5692         * fnmatch.c: Include <alloca.h> instead of opencoding.
5693         * regex.c: Likewise.
5694
5695 2004-05-16  Derek Price  <derek@ximbiot.com>
5696             Paul Eggert  <eggert@cs.ucla.edu>
5697
5698         getline cleanup.  This changes the getndelim2 API: both order of
5699         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5700         no delimiter).
5701
5702         * getline.c: Don't include stddef.h or stdio.h, since our
5703         interface does that.
5704         (getline): Always use getdelim, so that we don't have two
5705         copies of this code.
5706         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5707         if available.
5708         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5709         (GETNDELIM2_MAXIMUM): New macro.
5710         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5711         instead of the old practice of delim2==0.  All callers changed.
5712         Return -1 on overflow, instead of returning junk.
5713         Do not set *linesize unless allocation succeeds.
5714         * getndelim2.h: Do not include stddef.h; no longer needed, now
5715         that we include sys/types.h.
5716         * getnline.h: Likewise.
5717         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5718         (getndelim2): Reorder arguments.
5719         * getnline.c (getnline, getndelim):
5720         Don't discard the NMAX argument.
5721         (getnline): Invoke getndelim, to avoid code duplication.
5722         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5723         of (size_t) -1 by callers of the getnline family.
5724
5725 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5726
5727         * nanosleep.c (suspended): Change its type from int to
5728         sig_atomic_t volatile.
5729         (first_call): Make it private to rpl_nanosleep, and have it
5730         be zero initially as that's a bit faster.
5731         (my_usleep): Round up fractional times instead of truncating them,
5732         as this is the usual meaning for 'sleep'.
5733
5734         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5735         doesn't work.
5736         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5737         (ENOSYS): Define if not defined.
5738         (settime): Fall back on stime if it exists and settimeofday fails.
5739         But don't bother with fallbacks if a method fails with errno == EPERM.
5740
5741 2004-05-11  Jim Meyering  <jim@meyering.net>
5742
5743         Prior to this change, the save_cwd caller required read access to the
5744         current directory on most systems (ones with the fchdir function).
5745
5746         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5747         fails, try write-only, and finally, resort to using xgetcwd.
5748
5749 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5750
5751         * obstack.c, obstack.h: Import changes from libc.
5752
5753 2004-04-28  Bruno Haible  <bruno@clisp.org>
5754
5755         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5756         implicitly appends .exe to executables.
5757         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5758         accepts Windows pathnames.
5759         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5760         Cygwin like Windows, since it now accepts Windows pathnames.
5761         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5762         Cygwin like Windows, since it now accepts Windows pathnames.
5763         Reported by Derek Robert Price <derek@ximbiot.com>.
5764
5765 2004-04-20  Jim Meyering  <jim@meyering.net>
5766
5767         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5768
5769 2004-04-20  Jim Meyering  <jim@meyering.net>
5770             Bruno Haible  <bruno@clisp.org>
5771
5772         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5773         memory when realloc fails.
5774
5775 2004-04-18  Jim Meyering  <jim@meyering.net>
5776
5777         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5778         don't leak memory and do call END_UTMP_ENT.
5779
5780 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5781
5782         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5783         (CHAR_BIT): Remove, since we assume C89.
5784         Include <stdint.h> if available, as per current Autoconf CVS advice.
5785
5786 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5787
5788         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5789         not bool, to be more consistent with Unix conventions.
5790         Suggested by Bruno Haible.
5791
5792         Merge from coreutils.
5793
5794         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5795         New files.
5796
5797         * getdate.h: Include stdbool.h, and timespec.h instead of
5798         the usual <time.h> dance.
5799         (get_date): Change signature to support fractional time stamps.
5800         All callers changed.
5801         * getdate.y: Include "getdate.h" first, as we can now
5802         assume C89 and don't need to worry about 'const'.
5803         Similarly, include "unlocked-io.h" near start, not in middle.
5804         Include <limits.h>.
5805         (textint.value): Use long int rather than int.
5806         (textint.digits): Use size_t rather than int.
5807         (BILLION, LOG10_BILLION): New constants.
5808         (parser_control): New member rel_ns.  Members day_ordinal,
5809         time_zone, month, day, hour, minutes, rel_year, rel_month,
5810         rel_day, rel_hour, rel_minutes, rel_seconds
5811         are now long int, not int.  Member seconds is now struct timespec,
5812         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5813         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5814         not int.
5815         (%union.intval): Now long int, not int.
5816         New member timespec.
5817         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5818         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5819         (spec): Now is a timespec or an item list.
5820         (timespec, items): New nonterminals.
5821         (time, rel, relunit, number, get_date):
5822         Add support for fractional seconds.
5823         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5824         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5825         (to_hour): First arg is now long int, not int.
5826         (to_year): Returns long int, not int.
5827         Don't treat year -70 like 70.
5828         (tm_diff): Returns long int, not int.
5829         (lookup_word): Use bool instead of int when appropriate.
5830         (yylex): Use size_t for count, not int.
5831         Detect overflow when parsing large integer constants.
5832         Add support for fractions.
5833         (get_date): Make pointers 'const' if possible.
5834         Use more-portable code to detect integer overflow.
5835         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5836         Don't use ctime; it's not reliable if the year has >4 digits.
5837
5838         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5839         This is for compatibility with BSD.
5840
5841         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5842         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5843         From coreutils' system.h.
5844
5845         * userspec.c: Don't include "posixver.h".
5846         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5847         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5848         compatible extension.  Simplify code by removing a boolean int
5849         that was always nonzero if a string was nonnull.
5850
5851 2004-03-30  Jim Meyering  <jim@meyering.net>
5852
5853         Merge from coreutils.
5854
5855         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5856
5857         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5858         an empty input stream.
5859
5860         * readtokens.c: Include <stdbool.h>.
5861         (readtoken): Use `size_t' rather than int/long.
5862         All callers adjusted.
5863         Use `bool' rather than `int' where appropriate.
5864         Use memset rather than an explicit loop.
5865         Use x2nrealloc rather than xrealloc.
5866         Allow the use of `\0' as a delimiter.
5867         (readtokens): Likewise.
5868         * readtokens.h (readtoken, readtokens): Update prototypes.
5869
5870 2004-03-30  Bruno Haible  <bruno@clisp.org>
5871
5872         * getloadavg.c (getloadavg): Don't assume setlocale returns
5873         nonnull.
5874
5875 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5876
5877         Merge changes to getloadavg.c from coreutils and Emacs.
5878
5879         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5880         Define to an expression, not to the empty string.
5881         Include cloexec.h and xalloc.h.
5882         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5883         Use set_cloexec_flag rather than rolling our own.
5884         * cloexec.c, cloexec.h: New files.
5885
5886 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5887
5888         * getopt.h: Sync with libc CVS.
5889
5890 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5891             Bruno Haible  <bruno@clisp.org>
5892
5893         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5894         not on all platforms that have <wchar.h>.
5895         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5896
5897 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5898
5899         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5900         Sync with libc CVS.
5901         * getopt_int.h: New file, also synced from libc.
5902
5903 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5904
5905         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5906         '#if' expressions.  Unlike the code it replaces, it does not
5907         depend on (defined _SC_PAGESIZE).  However, it does depend on
5908         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5909         first reported by Jason Andrade in
5910         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5911
5912 2004-01-18  Simon Josefsson  <jas@extundo.com>
5913
5914         * strdup.h: New file.
5915         * strdup.c: Include it.
5916         * path-concat.c: Include strdup.h. Drop strdup declaration.
5917         * userspec.c: Include strdup.h. Drop strdup declaration.
5918
5919 2004-02-06  Karl Berry  <karl@gnu.org>
5920
5921         * config.charset: update from gettext 0.14.1.
5922
5923 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5924
5925         Add comments and code, prompted by suggestions from Bruno Haible
5926         for sh-quote.
5927         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5928         describing the enum quoting_style values.
5929         * quotearg.c (quotearg_alloc): New function.
5930         (quotearg_buffer_restyled): Treat lone { and } as special.
5931         Treat = as special.  Work around bug with older shells
5932         that "see" a '\' that is really the 2nd byte of a multibyte char.
5933         Quote empty string with shell_quoting_style.
5934
5935 2004-02-03  Bruno Haible  <bruno@clisp.org>
5936
5937         * pipe.h: New file, from GNU gettext.
5938         * pipe.c: New file, from GNU gettext.
5939
5940 2004-01-27  Bruno Haible  <bruno@clisp.org>
5941
5942         * execute.h: New file, from GNU gettext.
5943         * execute.c: New file, from GNU gettext.
5944         * w32spawn.h: New file, from GNU gettext.
5945
5946 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5947
5948         Exit-status fix from coreutils.
5949
5950         Use exit_failure consistently in place of EXIT_FAILURE,
5951         so that program exit statuses are consistent on failure.
5952
5953         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5954         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5955         * argmatch.h: Comment fix to match the above.
5956         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5957         Now a macro referring to exit_failure, instead of a separate
5958         variable.  Include "exitfail.h" to get it.
5959         * xstrtol.h: Include "exitfail.h".
5960         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5961
5962         * long-options.c (parse_long_options): Use prototype
5963         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5964         for clarity.
5965
5966 2004-01-21  Jim Meyering  <jim@meyering.net>
5967
5968         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5969         so as not to conflict with a different-sized __mktime_internal
5970         function in GNU libc.
5971         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5972         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5973
5974 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5975
5976         Merge from diffutils.
5977
5978         * file-type.c (file_type): Add typed memory objects.
5979         * file-type.h (S_TYPEISTMO): New macro.
5980
5981         * c-stack.h (c_stack_action): Remove argv argument.
5982         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5983         (die): Don't calculate message unless segv_action returns.
5984         (get_stack_location, min_address_from_argv, max_address_from_argv,
5985         volatile stack_base, volatile_stack_size): Remove.
5986         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5987         that every segmentation violation is a stack overflow.  (Ouch!)
5988         See Debian bug 136249 (still outstanding) for more info about why
5989         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5990
5991 2003-11-30  Bruno Haible  <bruno@clisp.org>
5992
5993         Safer stack allocation.
5994         * setenv.c: Include allocsa.h.
5995         (alloca): Remove fallback definition.
5996         (freea): Remove macro.
5997         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5998         instead of freea.
5999
6000 2003-10-17  Bruno Haible  <bruno@clisp.org>
6001
6002         * binary-io.h: Avoid warnings on Cygwin.
6003
6004 2003-12-28  Bruno Haible  <bruno@clisp.org>
6005
6006         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6007         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6008
6009 2003-11-28  Bruno Haible  <bruno@clisp.org>
6010
6011         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6012
6013 2003-11-27  Bruno Haible  <bruno@clisp.org>
6014
6015         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6016
6017 2003-11-17  Bruno Haible  <bruno@clisp.org>
6018
6019         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6020
6021 2003-11-24  Bruno Haible  <bruno@clisp.org>
6022
6023         * xallocsa.h: New file, from GNU gettext.
6024         * xallocsa.c: New file, from GNU gettext.
6025
6026 2003-11-24  Bruno Haible  <bruno@clisp.org>
6027
6028         * allocsa.h: New file, from GNU gettext.
6029         * allocsa.c: New file, from GNU gettext.
6030
6031 2003-11-24  Bruno Haible  <bruno@clisp.org>
6032
6033         * eealloc.h: New file.
6034
6035 2004-01-15  Jim Meyering  <jim@meyering.net>
6036
6037         Merge from coreutils.
6038
6039         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6040         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6041         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6042
6043         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6044         optional configure-time default.
6045
6046         * version-etc.c (version_etc_copyright): Update copyright date.
6047
6048         * xreadlink.c (xreadlink): Correct outdated comment.
6049
6050 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6051
6052         Merge from coreutils.
6053
6054         * posixver.c: Include posixver.h.
6055
6056         * same.c: Include <stdbool.h>, <limits.h>.
6057         (_POSIX_NAME_MAX): Define if not defined.
6058         (MIN): New macro.
6059         (same_name): If file names are silently truncated, report
6060         that the file names are the same if they are the same after
6061         the silent truncation.
6062
6063         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6064         conversion function.
6065         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6066         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6067         longer needed.
6068
6069 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6070
6071         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6072         with like-named macro in fnmatch.c.
6073         (EXT): Use an internal constant instead.
6074
6075         Merge fnmatch patches from glibc.
6076         * fnmatch.c (mbsinit): Remove define.
6077         Add libc_hidden_ver (__fnmatch, fnmatch).
6078         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6079         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6080
6081 2003-12-14  Karl Berry  <karl@gnu.org>
6082
6083         * config.charset: update from gettext-runtime.
6084
6085 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6086
6087         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6088         Bug reported by Alfred M. Szmidt.
6089
6090 2003-11-29  Karl Berry  <karl@gnu.org>
6091
6092         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6093
6094 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6095             Bruno Haible  <bruno@clisp.org>
6096
6097         * printf-parse.h: Don't include sys/types.h.
6098         (ARG_NONE): New macro.
6099         (char_directive): Change type of *arg_index fields to size_t.
6100         * printf-parse.c: Don't include sys/types.h.
6101         (SSIZE_MAX): Remove macro.
6102         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6103         Remove unnecessary overflow check.
6104         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6105         fields.
6106
6107 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6108
6109         * alloca.c: Remove dependency on xalloc module.
6110         (xalloc_die): Remove.
6111         (memory_full) [!defined emacs]: New macro.
6112         [!defined emacs]: Don't include xalloc.h.
6113         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6114         address arithmetic overflows.  Change datatypes a bit to avoid
6115         unnecessary casts.
6116
6117 2003-11-22  Jim Meyering  <jim@meyering.net>
6118
6119         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6120
6121 2003-11-17  Bruno Haible  <bruno@clisp.org>
6122
6123         * vasnprintf.c (alloca): Remove fallback definition.
6124         (freea): Remove definition.
6125         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6126         Reported by Paul Eggert.
6127
6128 2003-11-17  Jim Meyering  <jim@meyering.net>
6129
6130         On systems without utime and without a utimes function capable of
6131         dealing with a NULL struct utimbuf* argument, this utime replacement
6132         could -- in unusual circumstances -- leak a file descriptor.
6133         * utime.c: Include <unistd.h> and <errno.h>.
6134         (utime_null): Be sure to close `fd' and to preserve errno.
6135         Reported by Geoff Collyer via Arnold Robbins.
6136
6137 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6138             Bruno Haible  <bruno@clisp.org>
6139
6140         Protect against address arithmetic overflow.
6141         * printf-args.h: Include stddef.h.
6142         (arguments): Change type of field 'count' to size_t.
6143         * printf-args.c (printf_fetchargs): Use size_t instead of
6144         'unsigned int' where appropriate.
6145         * printf-parse.h: Include sys/types.h.
6146         (char_directive): Change type of *arg_index fields to ssize_t.
6147         (char_directives): Change type of fields 'count', max_*_length to
6148         size_t.
6149         * printf-parse.c: Include sys/types.h and xsize.h.
6150         (SSIZE_MAX): Define fallback value.
6151         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6152         instead of 'int' where appropriate. Check a_allocated, d_allocated
6153         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6154         * vasnprintf.c: Include xsize.h.
6155         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6156         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6157         overflow. Avoid wraparound when converting a width or precision from
6158         decimal to binary.
6159
6160 2003-11-16  Bruno Haible  <bruno@clisp.org>
6161
6162         Update from GNU gettext.
6163         * printf-parse.c: Generalize to it can be compiled for wide strings.
6164         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6165         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6166         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6167         SNPRINTF): New macros.
6168         Don't include <alloca.h> if the file is used inside libintl.
6169         (local_wcslen): New function, for Solaris 2.5.1.
6170         (VASNPRINTF): Use it instead of wcslen.
6171
6172 2003-11-16  Bruno Haible  <bruno@clisp.org>
6173
6174         * xsize.h (xmax): New function.
6175         (xsum, xsum3, xsum4): Declare as "pure" functions.
6176
6177 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6178
6179         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6180         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6181         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6182         heuristic is just as accurate as far as we know, and it removes a
6183         dependency on size_max.m4 and ptrdiff_max.m4.
6184
6185 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6186
6187         * xstrtol.c (__xstrtol): Remove "break" immediately after
6188         "return", to pacify some unknown compiler.  Problem reported
6189         by Joerg Schilling.
6190
6191 2003-11-11  Bruno Haible  <bruno@clisp.org>
6192
6193         * xsize.h (SIZE_MAX): Remove fallback definition.
6194         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6195         defined.
6196
6197 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6198
6199         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6200         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6201         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6202         From Bruno Haible.
6203         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6204         not (size_t) -1, since it's defined here.
6205
6206 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6207
6208         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6209         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6210         Reject sizes of exactly SIZE_MAX bytes.
6211         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6212         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6213
6214 2003-11-05  Bruno Haible  <bruno@clisp.org>
6215
6216         * xsize.h: Include limits.h, to avoid a possible collision with
6217         SIZE_MAX defined in <limits.h> on Solaris.
6218
6219 2003-11-04  Bruno Haible  <bruno@clisp.org>
6220
6221         * xsize.h: New file.
6222         * linebreak.c: Include xsize.h.
6223         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6224         argument for overflow.
6225         Suggested by Paul Eggert.
6226
6227 2003-10-31  Bruno Haible  <bruno@clisp.org>
6228
6229         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6230         to avoid (extremely rare) race condition.
6231         Suggested by Paul Eggert.
6232
6233 2003-11-03  Jim Meyering  <jim@meyering.net>
6234
6235         * userspec.c: Include "userspec.h".
6236         * userspec.h: New file.
6237
6238 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6239
6240         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6241         * mountlist.c (SIZE_MAX): Define if not defined already.
6242         (read_filesystem_list): Set and use me_type_malloced.
6243         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6244         whatever the type happens to be), for brevity and consistency.
6245         Check for size calculation overflow on Alphas running OSF/1.
6246
6247 2003-10-31  Jim Meyering  <jim@meyering.net>
6248
6249         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6250
6251         * linebuffer.c: Include <string.h> for declaration of memset.
6252
6253 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6254             Bruno Haible  <bruno@clisp.org>
6255
6256         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6257         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6258
6259 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6260
6261         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6262         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6263         no longer needed.
6264         * quotearg.c (quotearg_n_options): Use it.
6265         * group-member.c: Include <stdbool.h>.
6266         (free_group_info): Arg is now const *; don't free arg.
6267         (get_group_info): Now returns bool and accepts struct group_info *,
6268         rather than returning a malloc'ed struct group_info *.
6269         All uses changed.  Check for overflow in internal size calculation.
6270
6271         * getusershell.c (readname): Simplify the code by using x2nrealloc
6272         rather than xmalloc/xrealloc.
6273         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6274         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6275         conformance bug: the old code used a pointer after freeing the
6276         storage that it addressed.
6277         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6278         rather than doing it by hand.
6279         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6280         the buffer preserved.  Use free and xmalloc instead.
6281         * quotearg.c (quotearg_n_options): Likewise.
6282         Use a simpler test for size overflow.  Don't use xalloc_oversized
6283         because unsigned int might be wider than size_t (!); this suggests
6284         that we should switch from unsigned int to size_t for slot numbers.
6285
6286 2003-10-27  Bruno Haible  <bruno@clisp.org>
6287
6288         * stdbool_.h: Better support for BeOS.
6289
6290 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6291
6292         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6293         to allocate the returned structure.  Do not allocate a subarray,
6294         as x2nrealloc will do that.
6295         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6296         instead of xnrealloc.
6297         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6298
6299 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6300
6301         * xalloc.h (xalloc_oversized): New static inline function, for
6302         callers that want to do their own size-overflow checking.  Include
6303         <stdbool.h>, since xalloc_oversized returns bool.
6304         * xalloc.c (array_size_overflow): Remove.  All callers changed
6305         to use xalloc_oversized.
6306
6307         Add two functions x2realloc, x2nrealloc, for programs that grow
6308         arrays dynamically by doubling their sizes.
6309         * xalloc.h (x2realloc, x2nrealloc): New decls.
6310         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6311         New functions.
6312
6313         Port to C99 semantics for 'inline' of external functions.
6314         Bug reported by Bruno Haible.
6315         * xmalloc.c (xnmalloc_inline): New static inline function,
6316         with the old contents of xnmalloc.
6317         (xnmalloc, xmalloc): Use it.
6318         (xnrealloc_inline): New static inline function,
6319         with the old contents of xnrealloc.
6320         (xnrealloc, xrealloc): Use it.
6321
6322         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6323
6324 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6325
6326         Fix several address-calculation bugs in the hash modules,
6327         plus some minor code cleanup.
6328
6329         * hash.h: Include <stdbool.h>, for bool.
6330         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6331         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6332         hash_get_n_entries, hash_get_max_bucket_length,
6333         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6334         hash_rehash): Use size_t rather than unsigned.
6335         * hash.c (struct hash_table, hash_get_n_buckets,
6336         hash_get_n_buckets_used, hash_get_n_entries,
6337         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6338         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6339         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6340         Likewise.
6341         (SIZE_MAX): Define if not defined.
6342         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6343         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6344         hash_print):
6345         Use const * when possible.
6346         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6347         (check_tuning): Fix bug: if tuning parameters were very close to
6348         0 or 1, rounding errors could have caused subscript violations.
6349         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6350         (hash_initialize): Add 'fail:' label
6351         to free table and return NULL, and use it to simplify code.
6352         Use calloc rather than clearing the storage ourself.
6353         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6354         buffer size calculations.
6355         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6356         Include <stddef.h>, for size_t.
6357         * hash-pjw.c (hash_pjw): Likewise.
6358         Switch to method described by Bruno Haible.
6359         Include <limits.h>, for CHAR_BIT.
6360         (SIZE_BITS): New macro.
6361
6362 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6363
6364         * getndelim2.c (getndelim2): When size calculation overflows,
6365         ceiling the allocation at NMAX bytes rather than silently
6366         discarding input bytes before NMAX is reached.  This makes
6367         a difference only if NMAX exceeds SIZE_MAX / 2.
6368
6369         * obstack.c: Merge from glibc.
6370         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6371         Add libc_hidden_def (_obstack_newchunk).
6372         (_obstack_free) [! defined _LIBC]: Remove.
6373         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6374         a clone of the function body.
6375         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6376         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6377
6378         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6379         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6380         arg to memcpy.
6381
6382         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6383         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6384         Don't use lvalue casts, as GCC plans to remove support for them
6385         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6386         was also present in the non-GCC version, indicating that this
6387         code had always been buggy and had never been widely used.
6388         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6389         Use the fast variant of each macro, rather than copying the
6390         definiens of the fast variant; that way, we'll be more likely to
6391         catch future bugs in the fast variants.
6392
6393 2003-10-20  Bruno Haible  <bruno@clisp.org>
6394
6395         * wait-process.h: New file, from GNU gettext.
6396         * wait-process.c: New file, from GNU gettext.
6397
6398 2003-10-19  Jim Meyering  <jim@meyering.net>
6399
6400         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6401
6402 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6403
6404         * getgroups.c: Include <errno.h>, <stdlib.h>.
6405         (getgroups): First arg is int, not size_t.
6406         Don't let 'free' mangle errno.
6407
6408 2003-10-16  Jim Meyering  <jim@meyering.net>
6409
6410         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6411
6412 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6413
6414         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6415         (SIZE_MAX): Remove.
6416         (new_exclude, add_exclude_file): Initial size no longer needs to
6417         be a power of 2.
6418         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6419         our own address arithmetic overflow checking.
6420
6421         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6422         (fnmatch): Do not alloca more than 2000 wide characters;
6423         instead, use malloc for large buffers.
6424         Check for address arithmetic overflow, and return -1
6425         with errno set to ENOMEM in that case.
6426         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6427         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6428         instead, return -1.  Check for address arithmetic overflow.
6429
6430 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6431
6432         Handle invalid suffixes and overflow independently, so that
6433         callers can treat them independently as needed.  Fix some bugs in
6434         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6435         suffix for a human-readable blocksize.  The major caller-visible
6436         change is the addition of a new
6437         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6438         that both overflow and suffix chars were found.
6439
6440         * human.c (humblock): Don't check separately for invalid suffix
6441         char; that is xstrtoumax's job (now that its bug is fixed).
6442         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6443         INTMAX_MAX]: New macros.
6444         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6445         TYPE_MAXIMUM): New macros.
6446         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6447         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6448         if overflow occurs, as it's what __strtol does and it's more useful
6449         in practice.
6450         (__xstrtol): If __strtol reports some error other than ERANGE,
6451         reflect it to the caller as LONGINT_INVALID.  If it reports
6452         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6453         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6454         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6455         value.
6456         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6457         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6458         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6459         [defined UINTMAX_MAX]: New macros.
6460
6461 2003-10-14  Bruno Haible  <bruno@clisp.org>
6462
6463         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6464         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6465         Also use volatile where needed.
6466
6467 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6468
6469         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6470         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6471         and define in terms of the other primitives.
6472         * xmalloc.c: Include stdbool.h; do not include exit.h.
6473         (SIZE_MAX): Define if not already defined.
6474         (array_size_overflow): New function.
6475         (xalloc_die): Abort instead of exiting if 'error' returns.
6476         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6477         (xmalloc, xrealloc): Use them.
6478         (xcalloc): Check for address arithmetic overflow.
6479         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6480         a bit faster than strcpy.
6481
6482 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6483
6484         Merge getpass from libc, plus a few fixes.
6485
6486         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6487         Include <stdbool.h>.
6488         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6489         __fsetlocking to empty.
6490         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6491         do include <bits/libc-lock.h>.
6492         Do not include <fcntl.h>; not needed.
6493         [_LIBC]: Include <wchar.h>.
6494         (NOTCANCEL_MODE): New macro.
6495         (flockfile, funlockfile) [_LIBC]: New macros.
6496         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6497         [!_LIBC]: New macros.
6498         (call_fclose): New function.
6499         (getpass): Use it.  Save tty stream separately; this simplifies the
6500         code and makes it more reliable if stdin happens to equal stdout.
6501         Invoke __fsetlocking on tty.
6502         Handle thread cancellation if needed.
6503         Namespace cleanup (use __tcgetattr, __getline).
6504         Use bool for Booleans.
6505         [USE_IN_LIBIO]: Handle wide streams.
6506         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6507         stream might go where.
6508
6509         * unlocked-io.h: Include <stdio.h>, so that the caller
6510         doesn't have to include <stdio.h> before us.
6511         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6512         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6513         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6514         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6515         if not declared, so that we can use getpass.c code from libc without
6516         rewriting it.
6517         (flockfile, ftrylockfile, funlockfile): New macros.
6518
6519 2003-10-06  Bruno Haible  <bruno@clisp.org>
6520
6521         * version-etc-2.h: Remove file.
6522         * version-etc-2.c: Remove file.
6523
6524 2003-09-25  Jim Meyering  <jim@meyering.net>
6525             Bruno Haible  <bruno@clisp.org>
6526
6527         This lets translators provide better translations for the
6528         "Written by ..." part of --version output.
6529         * version-etc.h: Include stdarg.h.
6530         (version_etc_copyright): Declare as readonly.
6531         (version_etc): Make this function variadic with a NULL-terminated list
6532         of author name strings.
6533         (version_etc_va): New declaration.
6534         * version-etc.c: Include stdarg.h, stdlib.h.
6535         (version_etc_copyright): Declare as readonly.
6536         (version_etc_va): New function. Provide a different translatable string
6537         for each possible number of authors < 10. Abbreviate when there are 10
6538         authors or more.
6539         (version_etc): Make this function variadic. Call version_etc_va.
6540         Suggestion from Gary V. Vaughan.
6541
6542         * long-options.h (parse_long_options): Change prototype: the authors
6543         string is moved to the end and becomes variadic.
6544         * long-options.c: Include stdarg.h.
6545         (parse_long_options): Make this function variadic, too.
6546         Call version_etc_va, not version_etc.
6547
6548 2003-10-06  Bruno Haible  <bruno@clisp.org>
6549
6550         * fatal-signal.h: New file, from GNU gettext.
6551         * fatal-signal.c: New file, from GNU gettext.
6552
6553 2003-10-04  Karl Berry  <karl@gnu.org>
6554
6555         * argp*: update from libc.
6556
6557 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6558
6559         * getpass.c (getpass): Use a no-op fseek when switching from input to
6560         output mode on the same stream.
6561
6562 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6563
6564         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6565         Fix arg typo in previous patch.
6566
6567 2003-09-28  Jim Meyering  <jim@meyering.net>
6568
6569         * error.c: Correct cpp indentation.
6570
6571 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6572
6573         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6574         Omit the special code that used __typeof__, since we worry that
6575         it could be more trouble than it's worth.  See:
6576         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6577         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6578
6579         * free.c: New file.
6580
6581 2003-09-26  Jim Meyering  <jim@meyering.net>
6582
6583         * error.c (error_tail): Move some declarations
6584         into inner scope where the local variables are used.
6585
6586 2003-09-26  Bruno Haible  <bruno@clisp.org>
6587
6588         * stpncpy.h (gnu_stpncpy): New declaration.
6589         (stpncpy): Define as alias for gnu_stpncpy.
6590         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6591
6592 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6593
6594         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6595         (error_tail): Do not loop, reallocating temporary buffer, since
6596         the output cannot contain more wide characters than the input
6597         contains bytes, the size must be big enough already.  This avoids
6598         one potential size overflow calculation.  Check for size overflow
6599         when calculating temporary buffer size.  Free temporary buffer
6600         when done, if it was allocated with malloc; this plugs a memory
6601         leak.  Remove casts from void * to pointers, that are no longer
6602         needed now that we're assuming C89 or better.
6603
6604         Merge error changes from glibc.
6605
6606         * error.c, error.h: Update copyright notice header to match glibc.
6607         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6608         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6609         Disable cancellation while printing error.
6610         * error.h: Prepend __ to parameter names.
6611
6612 2003-09-25  Karl Berry  <karl@gnu.org>
6613
6614         * argp-fmtstream.c, argp-help.c: update from libc.
6615
6616 2003-09-25  Bruno Haible  <bruno@clisp.org>
6617
6618         * version-etc-2.h: New file, from version-etc.h with modifications.
6619         * version-etc-2.c: New file, from version-etc.c with modifications.
6620
6621 2003-09-25  Simon Josefsson  <jas@extundo.com>
6622
6623         * xgetdomainname.h: New file.
6624         * xgetdomainname.c: New file.
6625
6626 2003-09-25  Simon Josefsson  <jas@extundo.com>
6627             Bruno Haible  <bruno@clisp.org>
6628
6629         * getdomainname.h: New file.
6630         * getdomainname.c: New file.
6631
6632 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6633
6634         * linebuffer.c (freebuffer): Don't free the argument, just
6635         the buffer associated with the argument.  Bug reported by
6636         Simon Josefsson.
6637
6638 2003-09-19  Karl Berry  <karl@gnu.org>
6639
6640         * argp.h: update from libc.
6641
6642 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6643
6644         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6645         input error, instead of returning NULL the next time we are called
6646         (and therefore losing track of errno).
6647
6648 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6649
6650         * getndelim2.c (getndelim2): Don't trash errno when a read
6651         fails, so that the caller gets the proper errno.
6652
6653         * readutmp.c (read_utmp): Likewise.
6654         Check for fstat error.  Close stream and free storage
6655         when failing.
6656
6657 2003-09-14  Bruno Haible  <bruno@clisp.org>
6658
6659         * fwriteerror.h: New file.
6660         * fwriteerror.c: New file.
6661
6662 2003-09-14  Jim Meyering  <jim@meyering.net>
6663
6664         * getloadavg.c: Correct cpp indentation.
6665         * strdup.c: Likewise.
6666         * vasnprintf.c: Likewise.
6667
6668 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6669
6670         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6671         * obstack.c [!defined _LIBC]: Likewise.
6672         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6673         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6674         * exitfail.c: Don't include stdlib.h; no longer needed.
6675
6676         More changes to assume C89 or better.
6677
6678         * error.c (error_tail): Assume vprintf.
6679
6680         * argmatch.c (getenv): Remove decl.
6681         * progreloc.c (get_full_program_name): Define via prototype.
6682         * setenv.c (clearenv): Likewise.
6683         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6684         needed.
6685         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6686         (malloc, memcpy): Remove decls.
6687         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6688         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6689         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6690         (memcpy): Remove macro.
6691         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6692         (__P): Remove.  All uses removed.
6693         (PTR): Remove.  All uses changed to void *.
6694         (CHAR_BIT, NULL): Remove.
6695         (spaces, zeros, memset_space, memset_zero)
6696         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6697         Remove.
6698         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6699         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6700         Define with prototype.
6701         Remove now-unnecessary prototype decl.
6702         (extra_args_spec): Assume ANSI C.  All uses changed.
6703         (extra_args_spec_iso): Remove.
6704         (my_strftime, emacs_strftimeu): Define via prototype.
6705         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6706         unconditionally.
6707         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6708         * strtoimax.c: Include <stdlib.h> unconditionally.
6709         (strtoul, strtol): Remove decls.
6710         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6711         LONG_MAX): Remove.
6712         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6713         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6714         (LOCALE_PARAM_PROTO): New macro.
6715         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6716         (INTERNAL (strtol), strtol): Define with a prototype.
6717         (PARAMS): Remove.  All uses removed.
6718         * tempname.c: Include <string.h> unconditionally.
6719         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6720         * xgethostname.c (main): Define with a prototype.
6721         * xmalloc.c: Include "xalloc.h" first, to check interface.
6722         Include <stdlib.h> unconditionally.
6723         (calloc, malloc, realloc, free): Remove decls.
6724         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6725         Include <stdlib.h> unconditionally.  Sort include file names.
6726         (strtod): Remove.
6727         (xstrtod): Define with a prototype.
6728         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6729         (strtol, strtoul): Remove decls.
6730
6731 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6732
6733         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6734         Include <stdlib.h>, <string.h> unconditionally.
6735         Remove now-unnecessary cast to char *.
6736         * strnlen.c: Include <string.h> unconditionally.
6737         * yesno.c (yesno): Define with a prototype.
6738
6739 2003-09-10  Bruno Haible  <bruno@clisp.org>
6740
6741         * strcspn.c: Include <string.h> unconditionally.
6742         * strpbrk.c: Include <string.h> unconditionally.
6743         * strstr.c: Include <string.h> unconditionally.
6744         * unicodeio.c: Include <string.h> unconditionally.
6745         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6746         * unsetenv.c: Likewise.
6747         * xreadlink.c: Include <stdlib.h> unconditionally.
6748         * yesno.c: Include <stdlib.h> unconditionally.
6749         (rpmatch): Add prototype.
6750
6751 2003-09-10  Jim Meyering  <jim@meyering.net>
6752
6753         * error.c: Correct indentation of cpp directives.
6754
6755 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6756
6757         More K&R removal.
6758
6759         * acosl.c (main): Use a prototype.
6760         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6761         tanl.c: Likewise.
6762
6763         * getloadavg.c (getloadavg, main): Define via prototypes.
6764
6765         * getopt.h (struct option.name): Assume C89, and use 'const'.
6766         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6767         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6768         with a prototype.
6769         * getopt.c (const): Remove macro.
6770         Include <string.h> unconditionally.
6771         (my_index): Remove; all uses changed to strchr.
6772         (strlen): Remove decl.
6773         (exchange): Remove forward decl; no longer needed.
6774         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6775         Define with prototype.
6776         * getopt1.c (const): Remove macro.
6777         (getopt_long, getopt_long_only, main): Define with prototype.
6778
6779         * getugroups.c: Include <string.h> unconditionally.
6780
6781         * getusershell.c: Include <stdlib.h> unconditionally.
6782         (getusershell, setusershell, endusershell, readname, main):
6783         Define with prototypes.
6784
6785         * group-member.c: Include group-member.h first.
6786         Include <stdlib.h> unconditionally.
6787
6788         * hard-locale.c: Include hard-locale.h first.
6789         Include <stdlib.h>, <string.h> unconditionally.
6790
6791         * hash.c (free, malloc): Remove decls.
6792         Include <stdlib.h> unconditionally.
6793
6794         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6795         (getenv): Do not declare.
6796
6797         * idcache.c: Include <string.h> unconditionally.
6798
6799         * long-options.c: Include long-options.h first, to test interface.
6800         Include <stdlib.h> unconditionally.
6801
6802         * makepath.c: Include makepath.h first, to test interface.
6803         Include <stdlib.h> and <string.h> unconditionally.
6804
6805         * linebuffer.c: Include <stdlib.h>.
6806         (free): Remove decl.
6807
6808         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6809         rpl_malloc returns void *, not char *.
6810         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6811
6812         * md5.h: Include <limits.h> unconditionally.
6813         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6814         (__P): Remove; all uses removed.
6815         * md5.c: Include "md5.h" first.
6816         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6817         md5_buffer, md5_process_bytes, md5_process_block):
6818         Define with prototypes.
6819         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6820         * sha.c: Include "sha.h" first.
6821         Include <stdlib.h>, <string.h> unconditionally.
6822
6823         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6824         * memcmp.c (__ptr_t): Likewise.
6825         * memrchr.c (__ptr_t): Likewise.
6826         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6827         Include <string.h> unconditionally.
6828         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6829         * memchr.c: Include <stdlib.h> unconditionally.
6830         * memchr.c (LONG_MAX): Remove.
6831         * memrchr.c (LONG_MAX): Likewise.
6832         * memchr.c (__memchr): Define via a prototype.
6833         * memrchr.c (__memrchr): Likewise.
6834         * memcmp.c (__P): Remove, and remove all uses.
6835         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6836         Remove forward decls; no longer needed.
6837         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6838         Use types required by C89 in prototype.
6839
6840         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6841         * savedir.c: Likewise.
6842         * mkdir.c (free): Remove decl.
6843         * rmdir.c (rmdir): Define with a prototype.
6844         * savedir.c: Include savedir.h first, to test interface.
6845
6846         * mktime.c (STDC_HEADERS): Remove.
6847         Include <stdlib.h>, <string.h> unconditionally.
6848
6849         * modechange.c: Include <stdlib.h> unconditionally.
6850         (malloc): Remove decl.
6851
6852         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6853         (free): Remove decl.
6854
6855         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6856         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6857         (This type really should be intptr_t, but that's a C99ism.)
6858         (_obstack_memcpy): Remove: all uses changed to memcpy.
6859         Include <string.h> unconditionally.
6860         (struct obstack): Assume __STDC__ for types of members
6861         chunkfun, freefun, extra_arg.
6862         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6863         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6864         obstack_begin, obstack_specify_allocation,
6865         obstack_specify_allocation_with_arg, obstack_chunkfun,
6866         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6867         Remove unprototyped decls and the macros that use them.
6868         * obstack.c (POINTER): Remove.  All uses changed to void *.
6869         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6870         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6871         (defined __STDC__ && __STDC__)]:
6872         Remove nonprototyped code.
6873         Include <stdlib.h> unconditionally.
6874         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6875         _obstack_allocated_p, _obstack_free, obstack_free,
6876         _obstack_memory_used, print_and_abort):
6877         Define using prototypes.
6878         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6879         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6880         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6881         obstack_next_free, obstack_object_size, obstack_room) [0]:
6882         Remove unused, unprototyped code.
6883
6884         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6885
6886         * physmem.c (physmem_total, physmem_available, main): Define
6887         with prototypes.
6888
6889         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6890         (main): Define with a prototype.
6891
6892         * posixver.c (getenv): Remove decl.
6893
6894         * putenv.c (malloc): Returns void *, not char *.
6895         Include <string.h> unconditionally.
6896         (strchr, memcpy, NULL): Do not define.
6897
6898         * readtokens.c: Include readtokens.h first, to test interface.
6899         Include <stdlib.h>, <string.h> unconditionally.
6900         (init_tokenbuffer): Define with a prototype.
6901
6902         * regex.c (PARAMS): Remove.  All uses removed.
6903         All uses of _RE_ARGS removed, too.
6904         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6905         unconditionally.
6906         (bzero): Assume memset exists.
6907         (memcmp, memcpy, NULL): Remove.
6908         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6909         char, or assignments to local vars of type signed char.
6910         (init_syntax_once, PREFIX(extract_number_and_incr),
6911         PREFIX(print_partial_compiled_pattern),
6912         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6913         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6914         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6915         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6916         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6917         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6918         wcs_compile_range, byte_compile_range, truncate_wchar,
6919         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6920         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6921         count_mbs_length, wcs_re_match_2_internal,
6922         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6923         PREFIX(alt_match_null_string_p),
6924         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6925         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6926         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6927         now-unnecessary declaration, if any.
6928         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6929         regcomp, regexec):
6930         Remove now-unnecessary casts among pointer types.
6931         * regex.h (_RE_ARGS): Remove.  All uses removed.
6932
6933         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6934         (free): Remove decl.
6935
6936         * rpmatch.c: Include <stdlib.h> unconditionally.
6937
6938         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6939         (free): Remove decl.
6940
6941         * save-cwd.c: Include <stdlib.h> unconditionally.
6942         * xgetcwd.c: Likewise.
6943
6944         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6945         (free): Remove decl.
6946
6947         * strchrnul.c (strchrnul): Define with a prototype.
6948         Fix bug: c_in was not converted to char before searching.
6949
6950         The following changes are not K&R related:
6951
6952         * group-member.h: Include <sys/types.h>, so that this file is
6953         self-contained.
6954         * makepath.h: Likewise.
6955
6956         * getusershell.c (readname, default_index, line_size, readname):
6957         Use size_t, not int, for sizes.
6958         (readname): If the size overflows, report an error instead of
6959         looping forever.
6960
6961 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6962
6963         * getndelim2.c: Assume stdlib.h per the C89 spec.
6964
6965 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6966
6967         Assume C89 or better; remove K&R cruft.
6968         A few of these changes were first proposed by Derek Robert Price
6969         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6970
6971         * addext.c: Include <string.h> unconditionally.
6972         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6973         Don't declare getenv or malloc.
6974
6975         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6976         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6977         (NULL): Remove.
6978         (find_stack_direction, alloca): Use prototypes.
6979
6980         * atexit.c (atexit): Define using a prototype.
6981
6982         * basename.c, dirname.c, stripslash.c:
6983         Include <string.h> unconditionally.
6984
6985         * bcopy.c: Include <stddef.h>.
6986         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6987
6988         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6989
6990         * error.h (error, error_at_line, error_print_progname)
6991         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6992         * error.c: Include error.h first, to check interface.
6993         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6994         (VA_START): Remove; all uses changeed to va_start.
6995         (exit, strerror): Remove decls.
6996         (error_print_progname): Prototype uncondionally.
6997         Don't include <errno.h>; no longer needed.
6998         (private_strerror): Remove.
6999         (error_tail): Always define.
7000         (error, error_at_line): Assume C89 or better; always use prototypes.
7001         * fatal.c: Include "fatal.h" first, to test interface.
7002         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7003         (VA_START): Remove; all uses changed to va_start.
7004         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7005         this case.
7006         (exit): Remove decl.
7007         (fatal): Prototype unconditionally.  Assume va_start works.
7008         Abort at end, to pacify gcc.
7009
7010         * euidaccess.c (main): Define with a prototype.
7011
7012         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7013
7014         * exitfail.c: Include <stdlib.h> unconditionally.
7015
7016         * fnmatch_.h (__P): Remove.  All uses changed to assume
7017         prototypes.
7018         * fnmatch.c: Include fnmatch.h first, to test interface.
7019         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7020         (getenv): Remove decl.
7021         (fnmatch): Define using a prototype.
7022         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7023         (FCT): Define using a prototype.
7024
7025         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7026
7027         * gethostname.c: Include <stddef.h>.
7028         (gethostname): Define with prototype.  Length is size_t, not int.
7029
7030 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7031
7032         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7033         getversion.c should have been removed then, but was accidentally
7034         preserved.
7035
7036         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7037         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7038
7039 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7040
7041         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7042         copy_tm_result.  Bug reported by Simon Josefsson in
7043         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7044
7045 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7046
7047         * time_r.c, time_r.h: New files.
7048
7049         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7050         __localtime_r.
7051         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7052         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7053
7054         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7055         __gmtime_r.
7056         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7057         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7058         Include <time_r.h>.
7059
7060         * timegm.c: Switch to glibc implementation, with the following changes:
7061         [defined HAVE_CONFIG_H]: Include <config.h>.
7062         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7063         (__mktime_internal) [!defined _LIBC]: New decl.
7064         (__gmtime_r) [!defined _LIBC]: New macro and function.
7065         (timegm): Use a prototype, since gnulib assumes C89.
7066         Do not bother declaring tmp to be const, as it's not really usefu.
7067         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7068         (timegm): Declare only if HAVE_DECL_TIMEGM.
7069
7070 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7071
7072         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7073         Bug reported by Lute Kamstra in
7074         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7075
7076         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7077         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7078         course with correspondingly smaller numbers for tomorrow and
7079         yesterday.  From Tadayoshi Funaba.  Originally installed into
7080         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7081         coreutils merge?).
7082
7083 2003-08-31  Simon Josefsson  <jas@extundo.com>
7084
7085         * timegm.h: New file.
7086         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7087
7088 2003-08-31  Karl Berry  <karl@gnu.org>
7089
7090         * argp.h: update from libc.
7091
7092 2003-08-28  Bruno Haible  <bruno@clisp.org>
7093
7094         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7095         warning on QNX, which defines O_BINARY to 000000.
7096
7097 2003-08-24  Bruno Haible  <bruno@clisp.org>
7098
7099         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7100         MSVC7 <stdio.h> is included later.
7101
7102 2003-08-20  Bruno Haible  <bruno@clisp.org>
7103
7104         * progname.h: New file, from GNU gettext.
7105         * progname.c: New file, from GNU gettext.
7106         * progreloc.c: New file, from GNU gettext.
7107
7108 2003-08-19  Bruno Haible  <bruno@clisp.org>
7109
7110         * xstrdup.c: Assume <string.h> exists.
7111
7112 2003-08-18  Jim Meyering  <jim@meyering.net>
7113
7114         * setenv.h: Indent nested cpp directive.
7115         * vasnprintf.c: Remove trailing blanks.
7116
7117 2003-08-17  Simon Josefsson  <jas@extundo.com>
7118             Bruno Haible  <bruno@clisp.org>
7119
7120         * xstrndup.h: New file.
7121         * xstrndup.c: New file.
7122
7123 2003-08-17  Bruno Haible  <bruno@clisp.org>
7124
7125         * strndup.h: New file.
7126
7127 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7128
7129         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7130         space, undoing this 2003-08-12 change:
7131         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7132
7133 2003-08-16  Jim Meyering  <jim@meyering.net>
7134
7135         Merge from coreutils.
7136         * xstrtoimax.c: #else #if -> #elif.
7137         * xstrtoumax.c: Likewise.
7138
7139 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7140
7141         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7142         rather than tab, after '#' in shell-script copyright notices.
7143         Suggested by Bruno Haible.
7144
7145 2003-08-15  Jim Meyering  <jim@meyering.net>
7146         and Paul Eggert  <eggert@twinsun.com>
7147
7148         Merge from coreutils.
7149         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7150         member but strut utmpx does not.  Needed for AIX 4.3.3.
7151         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7152
7153 2003-08-15  Jim Meyering  <jim@meyering.net>
7154
7155         Merge from coreutils.
7156         * xgethostname.c: Include <stdlib.h>.
7157         (xghostname): Don't exit for anything other than memory-related
7158         failure; just return NULL.
7159         * userspec.c: Include "posixver.h".
7160         (parse_user_spec): Accept `.' as a separator only
7161         in pre-POSIX-200112 mode.
7162         * strtoimax.c: Use #elif rather than #else #if.
7163         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7164         Remove function, now that we can rely on a working tzset function.
7165         [!_LIBC]: Ensure that the required autoconf test has been run.
7166         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7167         Use underlying_strftime for %r.
7168         * sha.c: Merge in some clean-up and optimization changes from glibc.
7169         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7170         Ensure that it is a multiple of 64.
7171         Rearrange loop exit tests so as to avoid performing an
7172         additional fread after encountering an error or EOF.
7173         * realloc.c: Update copyright date.
7174
7175 2003-08-14  Jim Meyering  <jim@meyering.net>
7176
7177         Merge from coreutils.
7178         * obstack.h: Whitespace changes.
7179         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7180         and xcalloc return values.
7181         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7182         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7183         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7184         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7185         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7186         error from mntctl.
7187         Use mntctl's return value to drive the entry-processing loop, since
7188         we can't rely on the value of the vmt_length member in the last
7189         entry.  On some systems doing so could result in exhausting
7190         virtual memory.  Based in part on a patch from Mike Jetzer.
7191
7192 2003-08-14  Jim Meyering  <jim@meyering.net>
7193         and Paul Eggert  <eggert@twinsun.com>
7194
7195         Merges from coreutils, plus other fixes.
7196         * physmem.c: Merge in portability changes from gcc/libiberty
7197         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7198         for credits and details.  Thanks to Kaveh Ghazi for helping
7199         to keep these files in sync.
7200         (ARRAY_SIZE): Define it.
7201         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7202         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7203         (memcasecmp): Don't assume size_t fits in unsigned int.
7204         Remove casts and duplicate code.
7205         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7206         (memcpy): Remove definition.
7207         Merge in some clean-up and optimization changes from glibc.
7208         [BLOCKSIZE]: Move definition to top of file.
7209         Ensure that it is a multiple of 64.
7210         Rearrange loop exit tests so as to avoid performing an
7211         additional fread after encountering an error or EOF.
7212         * md5.h (md5_uintptr): Define.
7213         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7214         return to the initial working directory.  Preserve errno
7215         for caller.
7216         * idcache.c: Include "xalloc.h".
7217         (xmalloc, xrealloc): Remove decls.
7218         (getuser): Remove casts no longer required in C89.
7219         * human.c: Include stdio.h, for sprintf.
7220         * group-member.c: Include "xalloc.h".
7221         (xmalloc, xrealloc): Remove decls.
7222         (get_group_info): Remove casts no longer required in C89.
7223         * getusershell.c (readname): Remove casts no longer required in C89.
7224         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7225         * getline.c: Whitespace fix, from coreutils.
7226
7227 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7228
7229         * exclude.c: Include <ctype.h>
7230         (IN_CTYPE_DOMAIN): New macro.
7231         (is_space): New fn.
7232         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7233         and empty lines.
7234
7235         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7236         Undo previous (whitespace-only) change.
7237
7238 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7239
7240         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7241         Normalize leading white space and remove trailing white space.
7242         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7243         notice, as per ../config/srclist-update.
7244
7245         Merge from coreutils.
7246         * euidaccess.h: New file.
7247         * euidaccess.c: Include it.
7248         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7249         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7250         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7251
7252 2003-08-11  Bruno Haible  <bruno@clisp.org>
7253
7254         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7255         (vasnprintf): Use it instead of wcslen.
7256
7257 2003-08-11  Bruno Haible  <bruno@clisp.org>
7258
7259         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7260         value to ensure that _Bool promotes to int. Use #define for _Bool when
7261         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7262
7263 2003-08-10  Karl Berry  <karl@gnu.org>
7264
7265         * regex.h: update from libc (whitespace fix).
7266
7267 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7268
7269         Merge some files from coreutils.  These changes were
7270         originally made by Jim Meyering.
7271         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7272         many older Unixes require this.
7273         * alloca.c (alloca): Remove cast to argument of free;
7274         no longer needed in C89.
7275         * alloca_.h, regex.h: Fix white space to match
7276         what GNU indent does.
7277
7278 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7279
7280         * bumpalloc.h: Remove.
7281
7282 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7283
7284         * getloadavg.c: Change copyright notice and spacing to conform to
7285         GNU coding style.
7286
7287         Merge from coreutils.
7288         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7289         From glibc.
7290         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7291         from Karl Berry, implemented by Jim Meyering.
7292         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7293         from Dmitry V. Levin.
7294         Remove anachronistic cast of xrealloc.
7295         * fnmatch_.h (__const): Remove.  Use 'const'.
7296         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7297         type. Otherwise, it wouldn't compile with at least /bin/cc on
7298         ymp-cray-unicos9.0.2.X.
7299         Combine two mostly-identical uses of alloca into one.
7300         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7301
7302 2003-08-04  Dave Love <d.love@dl.ac.uk>
7303
7304         [From Emacs.]
7305
7306         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7307         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7308         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7309         obsolete NLIST_NAME_UNION.
7310         [__GNU__]: Undef BSD and FSCALE.
7311         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7312
7313 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7314
7315         * stdbool_.h (_Bool): Make it signed char, instead of
7316         an enum type, so that it's guaranteed to promote to int.  See:
7317         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7318
7319 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7320
7321         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7322         (strerror): Don't assume that a printable int fits in 14 bytes.
7323
7324 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7325             Bruno Haible  <bruno@clisp.org>
7326
7327         * getline.h (getline, getdelim): Change return type to ssize_t.
7328         * getline.c (getline, getdelim): Likewise.
7329         Remove _GNU_SOURCE define; now it's defined in config.h through
7330         m4/getline.m4.
7331
7332 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7333
7334         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7335         over-parenthesization in macros.
7336
7337         Sync with coreutils.
7338
7339         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7340         required by C99.
7341
7342         Use `exit_failure' for xalloc and xmemcoll instead of their own
7343         private exit-failure variables.
7344         * xalloc.h (xalloc_exit_failure): Remove.
7345         * xmalloc.c: Likewise.  Include exitfail.h.
7346         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7347         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7348         * xmemcoll.c: Likewise.  Include exitfail.h.
7349         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7350
7351 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7352
7353         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7354         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7355         to test that it can stand by itself.  Include "exitfail.h".
7356         Clients should set exit_failure instead.
7357         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7358
7359 2003-07-18  Andreas Schwab  <schwab@suse.de>
7360
7361         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7362
7363 2003-07-18  Bruno Haible  <bruno@clisp.org>
7364
7365         * getndelim2.h: New file.
7366         * getndelim2.c: Make into a module of its own. Include config.h,
7367         getndelim2.h.
7368         (getndelim2): Make non-static. Change return type to ssize_t.
7369         * getline.h: Change argument names.
7370         * getline.c: Include getndelim2.h instead of getndelim2.c.
7371         * getnline.c: Include getndelim2.h.
7372
7373 2003-07-17  Bruno Haible  <bruno@clisp.org>
7374
7375         * Makefile.am: Remove file.
7376         * Makefile.in: Remove file.
7377
7378 2003-07-17  Bruno Haible  <bruno@clisp.org>
7379
7380         * getnline.h: New file.
7381         * getnline.c: New file.
7382         * getndelim2.c: New file, extracted from getline.c.
7383         (getndelim2): Renamed from getdelim2, with added nmax argument.
7384         * getline.c: Include getndelim2.c.
7385         (getdelim2): Moved out to getndelim2.c.
7386         (getline, getdelim): Update.
7387
7388 2003-07-15    <karl@gnu.org>
7389
7390         * vasnprintf.c: update from gettext.
7391
7392 2003-07-15  Jim Meyering  <jim@meyering.net>
7393
7394         * makepath.c (make_path): Enclose diagnostic in _(...).
7395
7396 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7397
7398         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7399         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7400         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7401         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7402         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7403         updated automatically by ../config/srclist-update.  This changes
7404         their license from LPGL to GPL.
7405
7406 2003-07-14  Jim Meyering  <jim@meyering.net>
7407
7408         Don't emit diagnostics.  Let callers do that.
7409         * save-cwd.c: Don't include "error.h".
7410         (save_cwd): Don't call error.  Ensure that errno is valid
7411         when returning nonzero.
7412
7413         * save-cwd.h (restore_cwd): Update prototype.
7414         * save-cwd.c (restore_cwd): Remove two parameters.
7415         Simplify.  Don't call error upon failure.  Let callers do that.
7416         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7417         when auditing is enabled.  But don't bother updating the #if.
7418
7419 2003-07-14  Simon Josefsson  <jas@extundo.com>
7420
7421         * mempcpy.h: New file.
7422         * mempcpy.c: New file.
7423
7424 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7425
7426         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7427         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7428         unicodeio.c, unicodeio.h, unlocked-io.h:
7429         Switch from LGPL to GPL.
7430
7431 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7432
7433         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7434         it breaks C++ compilation.
7435         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7436
7437 2003-07-10  Jim Meyering  <jim@meyering.net>
7438
7439         * vasnprintf.c: Remove trailing blanks.
7440         Make cpp indentation consistent.
7441
7442 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7443
7444         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7445         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7446         Switch from LGPL to GPL.
7447
7448 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7449
7450         * mktime.c: Fix some boundary cases and remove need for floating point.
7451
7452         Issue a compile-time diagnostic if time_t is floating point, or if
7453         two's complement arithmetic is not in effect, or if arithmetic
7454         right shift does not propagate the sign.  These assumptions were
7455         all in the original code but they weren't checked.
7456
7457         (TIME_T_MIDPOINT, verify): New macros.
7458         (__isleap): Remove; it has integer overflow problems.
7459         (leapyear): New function, without those problems.
7460         (ydhms_tm_diff): Remove; splitting into two parts.
7461         (ydhms_diff): New function, containing the arithmetic part of
7462         the old ydhms_tm_diff function.  Issue a compile-time
7463         diagnostic if we are not using C99 integer division.
7464         Avoid casts when possible.
7465         (guess_time_tm): New function, containing the checking part of
7466         the old ydhms_tm_diff function.  Return the new value, rather than
7467         the difference between it and the old.  Accept a new argument T
7468         so that *T specifies the old value.  Check for overflow in the result.
7469
7470         (__mktime_internal): Use a time_t offset, not a long int offset.
7471         This undoes the 2003-06-04 change, which is no longer needed now
7472         that we have better overflow checking.
7473         (localtime_offset): Likewise.
7474
7475         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7476         and long are 64-bit but int is only 32-bit.
7477         (ydhms_diff): Use long int to store year1 and yday1.
7478         Issue a compile-time diagnostic if long int is not wide enough.
7479
7480         (__mktime_internal): Use long int to store adjusted year and yday.
7481         Use plain C rather than preprocessor commands, if that doesn't
7482         affect efficiency.
7483         Check for overflow (and try to repair) after each probe
7484         rather than checking only at the very end.  This avoids some bugs
7485         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7486         does not equal GMT offset at maximum time).
7487         Use integer to check for overflow rather than floating point; this
7488         is more portable to non-IEEE hosts, and is a tad faster.
7489         When we detect that we are oscillating between two values,
7490         don't check whether tm_isdst has the requested value, since
7491         we already know the answer.  When tm_isdst has the wrong value,
7492         use a different heuristic to find the right one, based on the
7493         extreme values actually observed in practice in tz2003a,
7494         rather than the (overly optimistic) "previous 3 calendar quarters".
7495
7496         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7497         "T const" to accommodate glibc style.
7498         (check_result): Use less-confusing report format.  "long" -> "long int.
7499         (main): Likewise.
7500         Don't loop if the iteration overflows time_t.
7501         Allow a negative step in the iteration.
7502
7503 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7504
7505         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7506         having it depend on HAVE_SYS_TYPES_H.
7507
7508 2003-06-25  Bruno Haible  <bruno@clisp.org>
7509
7510         * readlink.c: New file.
7511
7512 2003-06-20  Bruno Haible  <bruno@clisp.org>
7513
7514         Assume C89, so PARAMS isn't needed.
7515         * unicodeio.h (PARAMS): Remove.
7516         * unicodeio.c: Don't use PARAMS.
7517
7518 2003-06-18  Jim Meyering  <jim@meyering.net>
7519
7520         Merge changes from coreutils.
7521         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7522         Remove explicit declarations of xmalloc and realloc.
7523         Include xalloc.h.
7524         (read_utmp): Remove anachronistic cast of xmalloc.
7525
7526 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7527
7528         Assume C89, so PARAMS isn't needed.
7529         * backupfile.h (PARAMS): Remove.  All uses removed.
7530         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7531         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7532         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7533         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7534         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7535         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7536         xstrtol.h: Likewise.
7537         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7538         same.h, strverscmp.h: Do not include config.h; no longer needed.
7539         Anyway, config.h should always be included before any other file.
7540
7541 2003-06-11  Simon Josefsson  <jas@extundo.com>
7542
7543         * sysexit_.h: New file.
7544
7545 2003-05-20  Derek Price  <derek@ximbiot.com>
7546
7547         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7548
7549 2003-06-10  Simon Josefsson  <jas@extundo.com>
7550
7551         * strchrnul.h: New file.
7552         * strchrnul.c: New file.
7553
7554 2003-06-10  Simon Josefsson <jas@extundo.com>
7555
7556         * argp.h: New file, from glibc.
7557         * argp-ba.c: New file, from glibc.
7558         * argp-eexst.c: New file, from glibc.
7559         * argp-fmtstream.c: New file, from glibc.
7560         * argp-fmtstream.h: New file, from glibc.
7561         * argp-fs-xinl.c: New file, from glibc.
7562         * argp-help.c: New file, from glibc.
7563         * argp-namefrob.h: New file, from glibc.
7564         * argp-parse.c: New file, from glibc.
7565         * argp-pv.c: New file, from glibc.
7566         * argp-pvh.c: New file, from glibc.
7567         * argp-xinl.c: New file, from glibc.
7568
7569 2003-06-07  Jim Meyering  <jim@meyering.net>
7570
7571         * readtokens.h: Put `Free Software Foundation, Inc.'
7572         in place of my name in the copyright comment.
7573         Remove definition and uses of __P.
7574
7575         From coreutils.
7576         * stat.c: Don't declare xmalloc explicitly.
7577         Instead, include "xalloc.h".
7578         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7579         xrealloc, and xcalloc return values.
7580         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7581         Improve comment.
7582         * xgetcwd.h: Remove definition/uses of PARAMS.
7583
7584 2003-06-06  Jim Meyering  <jim@meyering.net>
7585
7586         * stdbool_.h: Renamed from stdbool.h.in.
7587
7588 2003-06-06  Jim Meyering  <jim@meyering.net>
7589
7590         Merge from coreutils.
7591         * same.c: (same_name): Declare *_basename locals to be `const'.
7592         Consolidate declarations and initializations of *_base* locals.
7593
7594         Merge from coreutils.
7595         This avoids a core dump on systems without GNU putenv,
7596         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7597         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7598         (unsetenv): New static function, from GNU libc.
7599         (rpl_putenv): Use it.
7600
7601         * modechange.c: Remove trailing blanks.
7602
7603         Merge from coreutils.
7604         * fsusage.c: Remove declaration of statfs.
7605         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7606
7607         * posixtm.c: Include <stdbool.h> unconditionally.
7608
7609 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7610
7611         * mktime.c (__mktime_internal): When resolving a tm_isdst
7612         mismatch, look in future quarters as well as past.  This fixes a
7613         bug when processing fall-backwards gaps immediately after a long
7614         period of daylight-saving time.
7615
7616         * mktime.c: Assume freestanding C89 or better.
7617         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7618         (__P): Remove; not used.
7619         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7620         (mktime, not_equal_tm, print_tm, check_result,
7621         main): Use prototypes.  Use const * where appropriate.
7622         (main): Fix typo in testing code that uncovered by above changes.
7623         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7624
7625 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7626
7627         * mktime.c: Fix Debian bug 177940
7628         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7629         (localtime_offset): Now long int, not time_t, because we want it
7630         to be guaranteed to be signed.  All uses changed.
7631         (__mktime_internal): If overflow would occur when adding offset,
7632         don't add it.
7633
7634         Merge 'human' changes from coreutils.  Rewrite to support
7635         locale-specific notations like thousands separators.
7636         * human.c: Simplify authorship notice.
7637         Include human.h immediately after config.h.
7638         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7639         <limits.h>: Do not include, since human.h does.
7640         (SIZE_MAX, UINTMAX_MAX): New macros.
7641         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7642         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7643         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7644         (power_letter): Renamed from suffixes.
7645         (generate_suffix_backwards): Remove.
7646         (adjust_value): Now takes int style (because of human.h changes)
7647         and long double value (for greater precision on some platforms).
7648         (group_number): New function.
7649         (human_readable): Use it.  Use integer options, not enum.
7650         Put the options before the sizes in the arg list.
7651         Support all the new options.
7652         The old human_readable function has been removed;
7653         use inttostr.h instead.
7654         (human_readable, default_block_size, humblock):
7655         Use uintmax_t, not int, for block sizes.
7656         (human_readable_inexact, block_size_types): Remove.
7657         (block_size_opts): New constant.
7658         (human_options): Renamed from human_block_size, with new signature
7659         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7660         * human.h: Add copyright and authorship notice.
7661         Include <limits.h> and <stdbool.h> unconditionally.
7662         (PARAMS): Remove.  All uses removed.
7663         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7664         (enum human_inexact_style): Remove tag; now a nameless enum.
7665         (human_floor, human_ceiling, human_round_to_even): Now have
7666         values 2, 0, 1 rather than -1, 1, 0.
7667         (human_group_digits, human_suppress_point_zero, human_autoscale,
7668         human_base_1024, human_SI, human_B): New constants.
7669         (human_readable_inexact, human_block_size): Remove.
7670         (human_readable): Size args are now uintmax_t, not int.
7671         (human_options): New decl.
7672
7673         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7674         unnecessary now that we assume C89 or better.  This change
7675         imported from coreutils.
7676
7677         * mktime.c (__mktime_internal): Do not reject negative timestamps
7678         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7679         in the 2003-05-30 sync from glibc.
7680
7681         .h files should stand alone, but we shouldn't include <sys/types.h>
7682         if we can get away with just <stddef.h>.
7683
7684         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7685         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7686         rather than <sys/types.h>, as we merely need size_t.
7687         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7688         to get size_t.
7689         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7690         Include <stdio.h>, to get FILE.
7691         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7692         memcasecmp.h has included <stddef.h> and all we need is size_t.
7693         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7694         our interface, instead of including <sys/types.h>
7695
7696 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7697
7698         [from coreutils]
7699         Fix some minor time-related bugs with POSIX time arguments.
7700         Some valid time stamps were being rejected (notably -1, and
7701         time stamps before 1900 on 64-bit hosts).  And some invalid
7702         time stamps were being accepted, e.g. September 31.
7703
7704         * posixtm.h (posixtime): Return bool instead of time_t, so
7705         that we can return (time_t) -1 successfully.
7706         * posixtm.c: Likewise.
7707         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7708         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7709         (t): Remove static var.
7710         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7711         of static var.  All uses changed.
7712         (year): Do not reject years before 1900; they can occur with
7713         64-bit time_t.
7714         (posix_time_parse): Do not check for out-of-range components;
7715         that is now the caller's responsibility, since our checks were
7716         only approximations.
7717         (posixtime): Use mktime to check for out-of-range components,
7718         since it knows them exactly.
7719         If mktime returns (time_t) -1, check whether an error actually occurred
7720         by invoking localtime on -1.
7721         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7722         posixtime failures better.
7723         Improve the test data (in comments only).
7724
7725 2003-05-30    <karl@gnu.org>
7726
7727         * mktime.c: update from libc.
7728
7729 2003-05-30  Bruno Haible  <bruno@clisp.org>
7730
7731         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7732         * localcharset.h: Likewise.
7733         * localcharset.c: Likewise.
7734
7735 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7736
7737         Assume the headers required for C89 freestanding compilers.
7738         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7739         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7740         without checking for HAVE_LIMITS_H.
7741         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7742         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7743         to do that.
7744         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7745         * exclude.c: Include <stdbool.h> unconditionally.
7746         * tempname.c: Include <stddef.h> unconditionally.
7747         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7748         * modechange.c, rpmatch.c (NULL): Don't define, since
7749         <stddef.h> does that.
7750         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7751         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7752         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7753         * xstrtol.c: Likewise.
7754         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7755         * savedir.c: Include <stddef.h> instead of defining NULL.
7756
7757         * addext.c (addext): Use assignment rather than cast, to avoid
7758         warnings on some platforms.
7759
7760         * mktime.c (__mktime_internal): Do not reject negative timestamps
7761         arbitrarily.
7762
7763 2003-05-10  Bruno Haible  <bruno@clisp.org>
7764
7765         * linebreak.c (iconv_string_length): Don't return -1 just because the
7766         string is longer than 4 KB.
7767
7768 2003-05-12  Jim Meyering  <jim@meyering.net>
7769
7770         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7771         the space-padded-by-default conversion specifiers, %e, %k, %l.
7772
7773 2003-05-03  Bruno Haible  <bruno@clisp.org>
7774
7775         Upgrade to Unicode-4.0.
7776         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7777         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7778         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7779         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7780         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7781         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7782         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7783         Change width of U+E0100..U+E01EF from 1 to 0.
7784
7785 2003-04-25  Bruno Haible  <bruno@clisp.org>
7786
7787         * copy-file.c: Include <stddef.h>, for size_t.
7788
7789 2003-04-25  Jim Meyering  <jim@meyering.net>
7790
7791         * copy-file.c (copy_file_preserving): Declare buf_size to be
7792         of type size_t, not int.
7793
7794 2003-04-11  Jim Meyering  <jim@meyering.net>
7795
7796         Merge changes from Coreutils.
7797
7798         2003-03-22  Jim Meyering  <jim@meyering.net>
7799
7800         * strftime.c (widen): Cast alloca return value to proper type.
7801
7802         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7803
7804         From GNU libc.
7805         * strftime.c (my_strftime): Handle very large width
7806         specifications for numeric values correctly.  Improve checks for
7807         overflow.
7808
7809         2003-01-19  Jim Meyering  <jim@meyering.net>
7810
7811         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7812         (nl_get_alt_digit) [! defined my_strftime]: Define.
7813         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7814         _nl_get_alt_digit and _nl_get_walt_digit.
7815
7816         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7817         These changes have no effect outside of _LIBC.
7818
7819 2003-04-10  Bruno Haible  <bruno@clisp.org>
7820
7821         * findprog.h: New file, from GNU gettext.
7822         * findprog.c: New file, from GNU gettext.
7823
7824 2003-04-05  Jim Meyering  <jim@meyering.net>
7825
7826         Merge changes from Coreutils.
7827
7828         * exclude.h (PARAMS): Remove definition and uses.
7829         * exclude.c: Remove uses of `PARAMS'.
7830
7831         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7832         Add test-cases for DOS filenames. Declare program_name.
7833         (main): Set up program_name.  Patch by Rich Dawe.
7834
7835         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7836         error from mntctl.
7837         Use mntctl's return value to drive the entry-processing loop, since
7838         we can't rely on the value of the vmt_length member in the last
7839         entry.  On some systems doing so could result in exhausting
7840         virtual memory.  Based in part on a patch from Mike Jetzer.
7841
7842 2003-04-04  Bruno Haible  <bruno@clisp.org>
7843
7844         * linebreak.h: New file, from GNU gettext.
7845         * linebreak.c: New file, from GNU gettext with slight modifications.
7846         * lbrkprop.h: New file, from GNU gettext.
7847
7848 2003-04-03  Bruno Haible  <bruno@clisp.org>
7849
7850         * utf8-ucs4.h: New file, from GNU gettext.
7851         * utf16-ucs4.h: New file, from GNU gettext.
7852         * ucs4-utf8.h: New file, from GNU gettext.
7853         * ucs4-utf16.h: New file, from GNU gettext.
7854
7855 2003-04-02  Bruno Haible  <bruno@clisp.org>
7856
7857         * binary-io.h: New file, from GNU gettext.
7858
7859 2003-04-01  Bruno Haible  <bruno@clisp.org>
7860
7861         * pathname.h: New file, from GNU gettext.
7862         * concatpath.c: New file, from GNU gettext.
7863
7864 2003-03-30  Bruno Haible  <bruno@clisp.org>
7865
7866         * copy-file.c (copy_file_preserving): Don't set owner if the function
7867         chown() doesn't exist.
7868
7869 2003-03-28  Bruno Haible  <bruno@clisp.org>
7870
7871         * copy-file.h: New file, from GNU gettext.
7872         * copy-file.c: New file, from GNU gettext.
7873
7874 2003-03-18  Jim Meyering  <jim@meyering.net>
7875
7876         * quote.c (quote_n): Fix typo in comment.
7877
7878 2003-03-14  Jim Meyering  <jim@meyering.net>
7879
7880         Merge changes from Coreutils.
7881         * obstack.h (obstack_object_size): Declare temporary, __o,
7882         to be const, in order to avoid warnings.
7883         (obstack_room): Likewise.
7884         (obstack_empty_p): Likewise.
7885
7886 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7887
7888         Merge changes from Bison.
7889         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7890         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7891         when compiling Bison 1.875's `bitset bset = obstack_alloc
7892         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7893         * hash.c: Include <stdbool.h> unconditionally.
7894
7895 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7896
7897         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7898         Reported by Bruce Becker; see:
7899         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7900
7901 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7902             Bruno Haible  <bruno@clisp.org>
7903
7904         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7905         Reported by John Hughes, see
7906         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7907
7908 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7909
7910         * poll_.h: New file.
7911         * poll.c: New file.
7912
7913 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7914
7915         * mathl.h: New file.
7916         * acosl.c: New file.
7917         * asinl.c: New file.
7918         * atanl.c: New file.
7919         * ceill.c: New file.
7920         * cosl.c: New file.
7921         * expl.c: New file.
7922         * floorl.c: New file.
7923         * frexpl.c: New file.
7924         * ldexpl.c: New file.
7925         * logl.c: New file.
7926         * sincosl.c: New file.
7927         * sinl.c: New file.
7928         * sqrtl.c: New file.
7929         * tanl.c: New file.
7930         * trigl.c: New file.
7931         * trigl.h: New file.
7932
7933 2003-02-17  Bruno Haible  <bruno@clisp.org>
7934
7935         * mkdtemp.h: New file, from GNU gettext.
7936         * mkdtemp.c: New file, from GNU gettext.
7937
7938 2003-01-31  Bruno Haible  <bruno@clisp.org>
7939
7940         * rename.c: #undef rename before defining rpl_rename.
7941         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7942
7943 2003-01-30  Bruno Haible  <bruno@clisp.org>
7944
7945         * printf-args.h: New file, from GNU gettext.
7946         * printf-args.c: New file, from GNU gettext.
7947         * printf-parse.h: New file, from GNU gettext.
7948         * printf-parse.c: New file, from GNU gettext.
7949         * vasnprintf.h: New file, from GNU gettext.
7950         * vasnprintf.c: New file, from GNU gettext.
7951         * asnprintf.c: New file, from GNU gettext.
7952         * vasprintf.h: New file, from GNU gettext with modifications.
7953         * vasprintf.c: New file, from GNU gettext.
7954         * asprintf.c: New file, from GNU gettext.
7955
7956 2003-01-29  Bruno Haible  <bruno@clisp.org>
7957
7958         * stpncpy.h: New file, from GNU gettext with modifications.
7959         * stpncpy.c: New file, from GNU gettext with modifications.
7960
7961 2003-01-28  Bruno Haible  <bruno@clisp.org>
7962
7963         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7964         Paul Eggert.
7965         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7966         Paul Eggert.
7967
7968 2003-01-27  Bruno Haible  <bruno@clisp.org>
7969
7970         * xsetenv.h: New file, from GNU gettext.
7971         * xsetenv.c: New file, from GNU gettext.
7972
7973 2003-01-23  Bruno Haible  <bruno@clisp.org>
7974
7975         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7976
7977 2003-01-22  Bruno Haible  <bruno@clisp.org>
7978
7979         * exit.h: New file, from GNU gettext.
7980
7981 2003-01-11  Bruno Haible  <bruno@clisp.org>
7982
7983         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7984         * strcase.h (strcasecmp, strncasecmp): Likewise.
7985
7986 2003-01-14  Jim Meyering  <jim@meyering.net>
7987
7988         * same.c (same_name): Tweak a comment.
7989
7990 2003-01-11  Bruno Haible  <bruno@clisp.org>
7991
7992         * same.c (same_name): Reorder tests so as to avoid calling stat()
7993         when a string comparison is sufficient.
7994
7995 2003-01-11  Bruno Haible  <bruno@clisp.org>
7996
7997         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7998         'unsigned int'.
7999
8000 2003-01-11  Bruno Haible  <bruno@clisp.org>
8001
8002         * hash-pjw.c: Add comment about low quality of this function.
8003
8004 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8005
8006         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8007         to avoid collisions with libcurses and libreadline.
8008
8009         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8010         * getstr.h, getstr.c: Remove.
8011         * getline.c: Include "getline.h", to check interface.
8012         Move body of old getstr.c here: this defines MIN_CHUNK and
8013         declares getdelim2, which is renamed from getstr.
8014         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8015
8016         * linebuffer.c (readlinebuffer): Renamed from readline.
8017         All uses changed.
8018         * linebuffer.h: Likewise.
8019         (readline): Remove backward-compatibility macro.
8020
8021 2003-01-12  Jim Meyering  <jim@meyering.net>
8022
8023         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8024
8025 2003-01-10  Bruno Haible  <bruno@clisp.org>
8026
8027         * alloca_.h: New file.
8028         * getdate.y: Unconditionally include alloca.h.
8029         * makepath.c: Likewise.
8030         * setenv.c: Likewise.
8031         * userspec.c: Likewise.
8032
8033 2003-01-09  Bruno Haible  <bruno@clisp.org>
8034
8035         * stdbool.h.in: New file.
8036
8037 2003-01-08  Bruno Haible  <bruno@clisp.org>
8038
8039         * safe-read.c: Include specification header first, to ensure its
8040         selfcontainedness.
8041         * full-write.c: Likewise.
8042
8043 2003-01-08  Jim Meyering  <jim@meyering.net>
8044
8045         * full-write.c: Undefine and define-away `const' after inclusion
8046         of errno.h, not before.  Suggestion from Bruno Haible.
8047
8048 2003-01-07  Jim Meyering  <jim@meyering.net>
8049
8050         * full-write.c: Rework so that it may serve to define full_read, too.
8051         * full-read.c: Simply #define FULL_READ and include full-write.c.
8052
8053 2003-01-06  Jim Meyering  <jim@meyering.net>
8054
8055         * version-etc.c: Update year in translatable copyright string.
8056
8057 2002-12-25  Bruno Haible  <bruno@clisp.org>
8058
8059         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8060         * xstrtol.h: Likewise.
8061         * xstrtoimax.c: Likewise.
8062         * xstrtoumax.c: Likewise.
8063         * human.h: Likewise.
8064
8065         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8066         on systems that have <inttypes.h> but not <stdint.h>.
8067
8068 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8069
8070         * memcoll.c (memcoll): Fall back on a simple algorithm using
8071         memcmp if strcoll doesn't work.
8072
8073 2002-12-23  Bruno Haible  <bruno@clisp.org>
8074
8075         * localcharset.h: New file.
8076         * localcharset.c: Include it.
8077         * unicodeio.c: Likewise.
8078
8079 2002-12-22  Bruno Haible  <bruno@clisp.org>
8080
8081         * utime.c (utime_null): No need to call ftruncate if the file was
8082         nonempty.
8083
8084 2002-12-23  Bruno Haible  <bruno@clisp.org>
8085
8086         * memcoll.c (STRCOLL): New macro.
8087         (memcoll): Use it.
8088
8089 2002-12-22  Bruno Haible  <bruno@clisp.org>
8090
8091         * getstr.h (getstr): Define, to avoid clash with libcurses.
8092         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8093
8094 2002-12-22  Bruno Haible  <bruno@clisp.org>
8095
8096         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8097
8098 2002-12-23  Bruno Haible  <bruno@clisp.org>
8099
8100         * getline.h: Include <stddef.h>, for size_t.
8101
8102         * unicodeio.h: Include <stddef.h>, for size_t.
8103         * unicodeio.c: Don't include <stddef.h>.
8104
8105 2002-12-17  Bruno Haible  <bruno@clisp.org>
8106
8107         * canon-host.c (strdup): Remove unused declaration.
8108
8109         * fsusage.c: Include full_read.h.
8110         (get_fs_usage): Use full_read instead of safe_read.
8111
8112         * utime.c (utime_null): Use SAFE_READ_ERROR.
8113
8114 2002-12-11  Bruno Haible  <bruno@clisp.org>
8115
8116         * setenv.h: Rewritten to cope with systems that have setenv() but not
8117         unsetenv().
8118         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8119         modifications:
8120
8121         2002-12-11  Bruno Haible  <bruno@clisp.org>
8122
8123                 * setenv.c (alloca): Fall back to malloc.
8124                 (freea): New macro.
8125                 (setenv): Use freea() to free memory allocated with alloca().
8126
8127         2002-11-13  Bruno Haible  <bruno@clisp.org>
8128
8129                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8130                 function declarations.
8131                 * unsetenv.c (unsetenv): Likewise.
8132
8133         2002-03-04  Bruno Haible  <bruno@clisp.org>
8134
8135                 Portability to AIX 4.3.3.
8136                 * unsetenv.c: New file, extracted from setenv.c.
8137                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8138
8139         2001-12-20  Bruno Haible  <bruno@clisp.org>
8140
8141                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8142                 use malloc instead. For SunOS 4.
8143
8144         2001-12-11  Bruno Haible  <bruno@clisp.org>
8145
8146                 * setenv.c: Declare alloca.
8147                 (compar_fn_t): New typedef.
8148                 (KNOWN_VALUE, STORE_VALUE): Use it.
8149
8150         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8151         setenv.h.
8152
8153 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8154
8155         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8156         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8157         Choose values that are less likely to collide with system fnmatch
8158         options.
8159         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8160         defined (e.g., a pure POSIX system).
8161         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8162         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8163
8164 2002-12-06  Jim Meyering  <jim@meyering.net>
8165
8166         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8167
8168         Merge in changes from libc's misc/error.c, in preparation
8169         for the merge of gnulib's changes back into libc.
8170
8171         * error.c (_): Define only if not already defined.
8172         Move definition to follow all #include directives.
8173         Include unlocked-io.h only if !_LIBC.
8174         [_LIBC]: Include <libio/libioP.h>.
8175         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8176         (fflush): Tweak definition to use INTUSE.
8177         (putc): Define.
8178
8179 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8180
8181         * alloca.c [defined emacs]: Include "lisp.h".
8182         (xalloc_die) [defined emacs]: New macro.
8183         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8184         [! defined emacs]: Include <xalloc.h>.
8185         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8186         (pointer): Typedef to POINTER_TYPE *.
8187         (malloc): Remove decl; we now always use xmalloc.
8188         (alloca): Use old-style definition, since Emacs needs this.
8189         Check for arithmetic overflow when computing combined size.
8190
8191 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8192
8193         Do not generate unlocked-io.h automatically, since it's easier to
8194         maintain it by hand.
8195
8196         * unlocked-io.h: New file, from GNU diffutils,
8197         but with proper copyright notice and attribution.
8198         * gen-uio: Remove.
8199         * Makefile.am: Add copyright notice.
8200         (libfetish_a_SOURCES): Add unlocked-io.h.
8201         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8202         (DISTCLEANFILES, io_functions): Remove macros.
8203         (EXTRA_DIST): Remove gen_uio.
8204         (unlocked-io.h): Remove rule.
8205
8206 2002-12-04  Jim Meyering  <jim@meyering.net>
8207
8208         Reflect the fact that stat.c and lstat.c are no longer generated.
8209         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8210         (DISTCLEANFILES): Likewise.
8211         (EXTRA_DIST): Likewise.
8212         (all_local): Don't depend on stat.c or lstat.c.
8213         (stat.c, lstat.c): Remove rules.
8214         (EXTRA_DIST): Remove xstat.in.
8215
8216         * xstat.in: Remove file.  Contents moved into stat.c.
8217         * stat.c: New file.  Contents mostly from xstat.in.
8218         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8219         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8220
8221         * safe-read.c: Rework so that it may serve to define safe_write, too.
8222         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8223
8224 2002-12-03  Jim Meyering  <jim@meyering.net>
8225
8226         * safe-read.c, safe-write.c: Change variable names and comments, but
8227         not semantics, to minimize the differences between these two files.
8228         (safe_read): Change comment to mention SAFE_READ_ERROR.
8229
8230         * safe-read.c (IS_EINTR): Define.
8231         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8232
8233 2002-12-02  Bruno Haible  <bruno@clisp.org>
8234
8235         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8236         Define, taken from safe-read.c.
8237         (INT_MAX): Provide fallback.
8238         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8239         * safe-write.h (SAFE_WRITE_ERROR): Define.
8240
8241         * safe-read.c (EINTR): Remove definition.
8242         (safe_read): Don't use EINTR if it is absent.
8243
8244 2002-12-02  Jim Meyering  <jim@meyering.net>
8245
8246         * safe-read.c (EINTR): Define.
8247         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8248         (INT_MAX): Provide fallback.
8249         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8250
8251         * safe-read.h (SAFE_READ_ERROR): Define.
8252
8253 2002-12-01  Jim Meyering  <jim@meyering.net>
8254
8255         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8256         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8257
8258 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8259
8260         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8261         hash_rehash): Replace `if (limit <= value) abort ();' with
8262         `if (! (value < limit)) abort ();', for readability.
8263
8264 2002-11-26    <karl@gnu.org>
8265
8266         * strdup.c: copy from libc again, with jim's ok.
8267         * .cppi-disable: re-add strdup.c
8268
8269 2002-11-25    <karl@gnu.org>
8270
8271         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8272         instead of "strtol.c".
8273
8274 2002-11-25  Jim Meyering  <jim@meyering.net>
8275
8276         * mktime.c: Sync from libc, now that it has the latest fix.
8277
8278 2002-11-24    <karl@gnu.org>
8279
8280         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8281         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8282
8283 2002-11-24  Jim Meyering  <jim@meyering.net>
8284
8285         Update from coreutils:
8286
8287         * mktime.c: Merge in changes from libc.
8288
8289         Avoid a link-time failure on some Linux systems.
8290         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8291         (__mon_yday): Declare with the STATIC attribute.
8292         (__mktime_internal): Likewise.
8293         Based on a report from Greg Schafer.
8294
8295 2002-11-23  Jim Meyering  <jim@meyering.net>
8296
8297         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8298         Use `unsigned', not `int', as type of index.
8299
8300         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8301
8302         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8303
8304 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8305
8306         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8307         hint that one should use `if (! x) abort ();' rather than `assert
8308         (x);', and anyway it's one less thing to worry about configuring.
8309         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8310         hash_rehash, hash_insert): Use abort rather than assert.
8311
8312 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8313
8314         * quotearg.h: Allow multiple inclusion by surrounding with
8315         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8316         so that we can be included first.
8317         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8318         * quotearg.c: Include quotearg.h immediately after config.h.
8319         No need to include stddef.h or sys/types.h any more.
8320         Surround local include files with "", not "<>".
8321         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8322         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8323         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8324         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8325         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8326         (ISPRINT): Remove; no longer needed now that we assume C89.
8327
8328         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8329         Preserve errno.
8330
8331         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8332         quotearg_char): Use SIZE_MAX rather than
8333         (size_t) -1 when we are talking about "infinity".
8334
8335         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8336
8337 2002-11-22  Bruno Haible  <bruno@clisp.org>
8338
8339         * safe-read.h: Assume C89. Add comments.
8340         (safe_read): Change return type to size_t.
8341         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8342         counts > SSIZE_MAX correctly.
8343         * safe-write.h: New file.
8344         * safe-write.c: New file.
8345         * full-read.h: New file.
8346         * full-read.c: New file.
8347         * full-write.h: Assume C89. Add comments.
8348         * full-write.c: Include safe-write.h.
8349         (full_write): Rewritten to use safe_write.
8350         Suggested by Jim Meyering and Paul Eggert.
8351
8352 2002-11-21  Bruno Haible  <bruno@clisp.org>
8353
8354         Remove case insensitive option matching.
8355         * argmatch.h (argcasematch): Remove declaration.
8356         (ARGCASEMATCH): Remove macro.
8357         (__xargmatch_internal): Remove case_sensitive argument.
8358         (XARGMATCH): Update.
8359         (XARGCASEMATCH): Remove macro.
8360         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8361         case_sensitive argument.
8362         (argcasematch): Remove function.
8363         (__xargmatch_internal): Remove case_sensitive argument.
8364         (main): Use XARGMATCH instead of XARGCASEMATCH.
8365
8366         * xmalloc.c: Change compile-time error message. Add comment about
8367         required autoconf version.
8368
8369 2002-11-21  Jim Meyering  <jim@meyering.net>
8370
8371         * strdup.c (strdup): Tweak comment and initial #if/#include.
8372
8373         Merge in changes from the coreutils.
8374
8375         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8376         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8377         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8378         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8379         int.  Work more efficiently if X is the same width as uintmax_t.
8380         Do not compare X to -1, to avoid bogus compiler warning.
8381         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8382         Don't assume that f_frsize and f_bsize are the same type.
8383
8384         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8385         on FreeBSD.
8386
8387         * makepath.c (make_path): Restore umask *before* creating the final
8388         component.
8389         (make_path): Minor reformatting.
8390
8391         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8392         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8393
8394         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8395         ones.  At least on GNU/Linux systems, `auto' means something else.
8396         From Michael Stone.
8397
8398 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8399
8400         Merge argmatch cleanups from Bison.  Assume C89.
8401
8402         * argmatch.c: Include config.h here, not in argmatch.h.
8403         Include stdlib.h, for EXIT_FAILURE.
8404         Always include <string.h>, since we assume C89.
8405         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8406         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8407         Include <stddef.h> instead, since it's all we need for size_t.
8408         (PARAMS): Remove.  All uses removed.
8409         (ARRAY_CARDINALITY): Do not bother to #undef.
8410         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8411         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8412         Remove unnecessary parentheses.
8413         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8414         Insert necessary parentheses.
8415         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8416         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8417
8418 2002-11-19  Bruno Haible  <bruno@clisp.org>
8419
8420         * mbswidth.c: Include mbswidth.h right at the beginning.
8421         * mbswidth.h: Include <stddef.h>, for size_t.
8422
8423         * mbswidth.h (PARAMS): Remove macro.
8424         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8425         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8426
8427         * gcd.h (PARAMS): Remove macro.
8428         (gcd): Use ANSI C function declarations.
8429         * gcd.c (gcd): Likewise.
8430
8431 2002-11-15  Bruno Haible  <bruno@clisp.org>
8432
8433         * strcspn.c: Include <stddef.h>.
8434         (strcspn): Use ANSI C function declaration. Change return type to
8435         size_t. Use NULL.
8436         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8437         (strpbrk): Use NULL.
8438         * strpbrk.h (PARAMS): Remove macro.
8439         (strpbrk): Use ANSI C function declaration.
8440         * strstr.c: Don't include <sys/types.h>.
8441         * strstr.h (PARAMS): Remove macro.
8442         (strstr): Use ANSI C function declarations.
8443
8444 2002-11-06  Bruno Haible  <bruno@clisp.org>
8445
8446         * gcd.h (gcd): Change argument type to 'unsigned long'.
8447         * gcd.c (gcd): Likewise.
8448
8449 2002-11-05  Bruno Haible  <bruno@clisp.org>
8450
8451         * gcd.h: New file, from gettext-0.11.5.
8452         * gcd.c: New file, from gettext-0.11.5.
8453
8454 2002-11-05  Bruno Haible  <bruno@clisp.org>
8455
8456         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8457         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8458         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8459         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8460
8461         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8462         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8463
8464         * closeout.c: Include gettext.h instead of <libintl.h>.
8465         * human.c: Include gettext.h instead of <libintl.h>.
8466         * quotearg.c: Include gettext.h instead of <libintl.h>.
8467         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8468         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8469         * userspec.c: Include gettext.h instead of <libintl.h>.
8470         * version-etc.c: Include gettext.h instead of <libintl.h>.
8471         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8472         (textdomain): Remove definition.
8473         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8474
8475         * long-options.c: Remove include of <libintl.h> and definition of _.
8476         * same.c: Remove include of <libintl.h> and definition of _.
8477
8478 2002-11-04  Bruno Haible  <bruno@clisp.org>
8479
8480         * stpcpy.h: New file, from GNU gettext-0.11.5.
8481         * strcase.h: New file, from GNU gettext-0.11.5.
8482         * strpbrk.h: New file, from GNU gettext-0.11.5.
8483         * strstr.h: New file, from GNU gettext-0.11.5.
8484         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8485
8486 2002-05-09  Bruno Haible  <bruno@clisp.org>
8487
8488         * config.charset: Update for newest glibc. Add canonical names
8489         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8490
8491 2002-05-09  Bruno Haible  <bruno@clisp.org>
8492
8493         * localcharset.c (get_charset_aliases): Add more Windows specific
8494         aliases.
8495
8496 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8497
8498         * config.charset: A few additions for Solaris.
8499
8500 2001-12-05  Bruno Haible  <bruno@clisp.org>
8501
8502         * localcharset.c (locale_charset): Don't return an empty string.
8503
8504 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8505
8506         * config.charset: msdos in uk_UA uses CP1125.
8507
8508 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8509
8510         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8511         * localcharset.c (locale_charset): Declare as extern "C".
8512
8513 2002-02-15  Bruno Haible  <bruno@clisp.org>
8514
8515         * config.charset [msdosdjgpp]: For Russian, use CP866.
8516
8517 2002-02-11  Bruno Haible  <bruno@clisp.org>
8518
8519         * config.charset: Add support for NetBSD.
8520
8521 2002-09-25    <karl@gnu.org>
8522
8523         * strdup.c: copy from libc/string (via ../config/srclist*).
8524         * getopt*: copy from libc/posix.
8525         * gettext.h: copy from gettext.
8526         * .cppi-disable: add strdup.c, gettext.h.
8527
8528 2002-07-01  Jim Meyering  <meyering@lucent.com>
8529
8530         * c-stack.c: Include sys/time.h.
8531         From Volker Borchert.
8532
8533 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8534
8535         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8536         New macro.  Use it uniformly instead of
8537         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8538         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8539         reported by Vin Shelton.
8540
8541 2002-06-22  Jim Meyering  <meyering@lucent.com>
8542
8543         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8544         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8545
8546 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8547
8548         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8549         Do not assume SA_SIGINFO behavior.
8550         Bug reported by Jim Meyering on NetBSD 1.5.2.
8551
8552 2002-06-22  Jim Meyering  <meyering@lucent.com>
8553
8554         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8555
8556         * exitfail.c, exitfail.h: Likewise.
8557         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8558
8559         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8560         of fnmatch.h.
8561         (EXTRA_DIST): Add fnmatch_loop.c.
8562         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8563
8564         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8565         * fnmatch.c: Update from diffutils-2.8.2.
8566         * fnmatch_.h: New file.  From diffutils-2.8.2.
8567         * fnmatch.h: Remove file.
8568
8569 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8570
8571         * file-type.h: Report an error if neither S_ISREG nor
8572         S_IFREG is defined, instead of using a test specific to glibc
8573         2.2.  This should be safe, since POSIX requires S_ISREG and
8574         Unix Version 7 had S_IFREG.  We don't need to check for
8575         <sys/types.h> since we don't use any symbols that it defines.
8576
8577 2002-06-15  Jim Meyering  <meyering@lucent.com>
8578
8579         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8580         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8581         have been included before this file.
8582
8583 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8584
8585         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8586         so that each temporary file name is unique and valid in the first
8587         8 characters, for operation under DOS.
8588
8589 2002-06-15  Jim Meyering  <meyering@lucent.com>
8590
8591         Work even with DJGPP 2.03, which lacks support for symlinks.
8592         From Richard Dawe.
8593         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8594         is defined.
8595         * lchown.c (S_ISLNK): Likewise.
8596
8597 2002-06-14  Jim Meyering  <meyering@lucent.com>
8598
8599         * file-type.h: Use the version from diffutils-2.8.2.
8600         * file-type.c: Likewise.
8601
8602 2002-05-27  Jim Meyering  <meyering@lucent.com>
8603
8604         Fix a problem seen only on nonconforming systems whereby ls.c's
8605         use of localtime, and then of gettimeofday would cause trouble:
8606         the localtime call used to initialize rpl_gettimeofday's save
8607         mechanism would clobber ls's current local time information so
8608         that in any long listing the first file would always be listed
8609         with date 1970-01-01.  Analysis by Volker Borchert.
8610
8611         * gettimeofday.c (localtime): Undefine.
8612         (rpl_localtime): New function.
8613
8614 2002-05-22  Jim Meyering  <meyering@lucent.com>
8615
8616         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8617         * file-type.h: New file.
8618         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8619
8620 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8621
8622         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8623
8624 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8625
8626         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8627         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8628         of 127, since 64 is the largest conceivable number for ancient
8629         nonstandard hosts.
8630         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8631
8632 2002-04-28  Jim Meyering  <meyering@lucent.com>
8633
8634         * sig2str.c (WTERMSIG): Remove definition (unused).
8635
8636 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8637
8638         * sig2str.h, sig2str.c: New files.
8639         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8640
8641 2002-04-24  Jim Meyering  <meyering@lucent.com>
8642
8643         * gettext.h: New file, from Gettext.
8644         * Makefile.am (INCLUDES): Remove -I../intl.
8645         (libfetish_a_SOURCES): Add gettext.h.
8646
8647 2002-04-16  Jim Meyering  <meyering@lucent.com>
8648
8649         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8650         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8651         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8652
8653 2002-04-12  Jim Meyering  <meyering@lucent.com>
8654
8655         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8656
8657 2002-03-10  Jim Meyering  <meyering@lucent.com>
8658
8659         * makepath.c (make_path): Remove a comma from a diagnostic.
8660         Suggestion from Santiago Vila.
8661
8662 2002-03-08  Jim Meyering  <meyering@lucent.com>
8663
8664         * rename.c: Mention that this wrapper is needed also on
8665         mips-dec-ultrix4.4 systems.
8666
8667 2002-03-02  Jim Meyering  <meyering@lucent.com>
8668
8669         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8670         not HAVE_CLOCK_SETTIME.
8671
8672 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8673
8674         * nanosleep.h: Rename to....
8675         * timespec.h: New name for nanosleep.h.  All uses changed.
8676
8677         * gettime.c: New file.
8678         * settime.c: New file.
8679         * stime.c: Remove.
8680
8681         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8682         timespec.h.  Remove nanosleep.h.
8683
8684 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8685
8686         * acl.c, acl.h: New files.
8687         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8688
8689 2002-02-24  Jim Meyering  <meyering@lucent.com>
8690
8691         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8692         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8693         cause trouble.  Reported by Nelson Beebe.
8694
8695 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8696
8697         * path-concat.c (xpath_concat): Reorder code to pacify
8698         compilers that don't know that xalloc_die never returns.
8699
8700 2002-02-20  Jim Meyering  <meyering@lucent.com>
8701
8702         * getdate.c: Regenerate using bison-1.33.
8703
8704 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8705
8706         * posixver.c, posixver.h: New files.
8707         * Makefile.am (libfetish_a_SOURCES): Add them.
8708
8709 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8710             Bruno Haible  <bruno@clisp.org>
8711
8712         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8713         (fwrite_success_callback): New declaration.
8714         * unicodeio.c (unicode_to_mb): New function, extracted from
8715         print_unicode_char. Call failure callback instead of error.
8716         (fwrite_success_callback): New function.
8717         (exit_failure_callback): New function.
8718         (fallback_failure_callback): New function.
8719         (print_unicode_char): Call unicode_to_mb.
8720
8721 2002-01-26  Jim Meyering  <meyering@lucent.com>
8722
8723         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8724
8725 2002-01-22  Jim Meyering  <meyering@lucent.com>
8726
8727         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8728         Otherwise, some versions of automake would omit the rule that makes
8729         Makefile from Makefile.in.
8730
8731 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8732
8733         * xmemcoll.h, xmemcoll.c: New files.
8734         * Makefile.am (libfetish_a_SOURCES): Add them.
8735         * memcoll.c: Include errno.h, and declare errno if not defined.
8736         (memcoll): Set errno to zero if there is no error.
8737
8738         * quotearg.c (quotearg_buffer_restyled):
8739         Fix bug with quoting buffers containing NUL when backslashing escapes.
8740         This bug was exposed by the other changes in this patch.
8741         (quotearg_n_options): New arg ARGSIZE.
8742         All callers changed.
8743         (quoting_options_from_style): New function.
8744         (quotearg_n_style): Use it.
8745         (quotearg_n_style_mem): New function.
8746
8747         * quotearg.h (quotearg_n_style_mem): New function.
8748
8749 2002-01-16  Jim Meyering  <meyering@lucent.com>
8750
8751         * getdate.y: Add three semicolons, each just before a closing brace.
8752         Bison (as of version 1.31) no longer papers over that mistake.
8753
8754 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8755
8756         * backupfile.c (ISDIGIT): Comment fix.
8757         * getdate.y (ISDIGIT): Likewise.
8758         * posixtm.c (ISDIGIT, year): Likewise.
8759         * strverscmp.c (ISDIGIT): Likewise.
8760         * userspec.c (ISDIGIT): Likewise.
8761
8762 2002-01-05  Jim Meyering  <meyering@lucent.com>
8763
8764         * version-etc.c (version_etc_copyright): Update copyright year.
8765
8766 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8767
8768         * closeout.c (close_stdout_status): If ferror (stdout), do
8769         not silently exit merely because the output buffer happens to
8770         have nothing pending.
8771
8772 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8773
8774         See the big note in ../ChangeLog.
8775         * human.c (suffixes): Prefer K to k for 1024.
8776         (generate_suffix_backwards): New function.
8777         (human_readable_inexact): Use it.
8778         * xstrtol.c (__xstrtol): If there is no number but there
8779         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8780         Accept 'K' as well as 'k'.
8781
8782 2001-12-15  Jim Meyering  <meyering@lucent.com>
8783
8784         * regex.h (__restrict_arr): Update from libc.
8785
8786         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8787         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8788         (STREQ): Define.
8789
8790 2001-12-10  Jim Meyering  <meyering@lucent.com>
8791
8792         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8793         Instead, include "xalloc.h".
8794         (initbuffer): Don't cast xmalloc return value to char*.
8795         (readline): Reword comment.
8796         Don't cast xrealloc return value to char*
8797         Return NULL, not 0.
8798
8799 2001-12-09  Jim Meyering  <meyering@lucent.com>
8800
8801         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8802         `signed and unsigned type in conditional expression'.
8803         * posixtm.c (posix_time_parse): Likewise.
8804
8805         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8806
8807         * readtokens.c (readtoken): Declare an index to be of type unsigned
8808         to avoid a pedantic warning.
8809
8810         * getstr.c: Don't include assert.h.
8811         (getstr): Remove warning-evoking assertions.
8812         Return -1 if offset parameter is out of bounds.
8813         Change the type of a local from int to size_t.
8814
8815         * strftime.c (my_strftime_localtime_r): Include this function
8816         definition in the `#if ! HAVE_TM_GMTOFF' block.
8817
8818         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8819         Include xalloc.h instead.
8820
8821 2001-12-02  Jim Meyering  <meyering@lucent.com>
8822
8823         * tempname.c: Don't declare getenv, thus reverting the change of
8824         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8825         included.
8826
8827         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8828         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8829
8830 2001-11-30  Akim Demaille  <akim@epita.fr>
8831
8832         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8833         before being defined.
8834
8835 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8836
8837         * quotearg.h (quotearg_n, quotearg_n_style):
8838         First arg is int, not unsigned.
8839         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8840         (SIZE_MAX, UINT_MAX): New macros.
8841         (quotearg_n_options): Abort if N is negative.
8842         Avoid overflow check on hosts where size_t is 64 bits and int
8843         is 32 bits, as overflow is impossible there.
8844         Fix off-by-one typo that caused unnecessary reallocation.
8845
8846 2001-11-27  Jim Meyering  <meyering@lucent.com>
8847
8848         * tempname.c: Merge with version from libc.
8849         * regex.c: Likewise.
8850
8851         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8852         for which STDC_HEADERS is 0, it was not included, resulting in a
8853         warning about an integer-to-pointer conversion problem with getenv.
8854         Reported by Volker Borchert.
8855
8856 2001-11-26  Jim Meyering  <meyering@lucent.com>
8857
8858         * gtod.h: Remove file.
8859         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8860         * gettimeofday.c: Don't include gtod.h.
8861         (GTOD_init): Remove function.
8862         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8863         Suggestion from Volker Borchert.
8864
8865 2001-11-23  Jim Meyering  <meyering@lucent.com>
8866
8867         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8868         * hash.c (struct hash_table): Define it here instead.
8869
8870 2001-11-22  Jim Meyering  <meyering@lucent.com>
8871
8872         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8873
8874 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8875
8876         * tempname.c (TMP_MAX): Remove; no longer needed.
8877         (TEMPORARIES): New macro.
8878         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8879         removes an artificial limitation (e.g. HP-UX 10.20, where
8880         TMP_MAX is 17576).
8881
8882 2001-11-18  Jim Meyering  <meyering@lucent.com>
8883
8884         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8885         on SunOS 4.
8886
8887         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8888         files will be created before anything else.
8889
8890 2001-11-17  Jim Meyering  <meyering@lucent.com>
8891
8892         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8893         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8894         rather than group writable.  Patch by Juan F. Codagnone.
8895
8896         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8897         Instead, include "xalloc.h".
8898
8899         * mountlist.c: Include unlocked-io.h after all system headers.
8900         Remove explicit declarations of xmalloc, xrealloc,
8901         and xstrdup.  Instead, include "xalloc.h".
8902
8903         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8904         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8905         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8906
8907         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8908         Reported by Padraig Brady.
8909
8910         * mkstemp.c: #undef mkstemp.
8911         Include config.h.
8912         (rpl_mkstemp): Rename from mkstemp.
8913         Protoize.
8914
8915 2001-11-16  Jim Meyering  <meyering@lucent.com>
8916
8917         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8918         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8919         determine the amount of total physical memory, use pstat_getstatic.
8920         HPUX-11 doesn't define _SC_PHYS_PAGES.
8921         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8922         If sysconf couldn't be used to determine the amount of available
8923         physical memory, use both pstat_getstatic and pstat_getdynamic.
8924         Based on a patch from Bob Proulx.
8925
8926 2001-11-05  Jim Meyering  <meyering@lucent.com>
8927
8928         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8929
8930 2001-11-03  Jim Meyering  <meyering@lucent.com>
8931
8932         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8933         in argmatch_to_argument call.
8934
8935         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8936         argument.
8937
8938         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8939         e.g., a fault due to an attempt to free a NULL pointer.
8940
8941 2001-11-01  Jim Meyering  <meyering@lucent.com>
8942
8943         * dirfd.c, dirfd.h: New files.
8944         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8945
8946         * hash.c (hash_print) [TESTING]: Clean up.
8947
8948 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8949
8950         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8951         to avoid a warning if -Wall.
8952
8953 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8954
8955         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8956
8957 2001-10-21  Jim Meyering  <meyering@lucent.com>
8958
8959         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8960         this code would end up calling gettext even in packages built
8961         with --disable-nls.
8962         * getopt.c (_): Likewise.
8963         * regex.c (_): Likewise.
8964
8965 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8966
8967         * error.c (strerror_r): Do not declare unless !_LIBC.
8968         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8969         Use strerror_r that is only a macro, even if it is not a function.
8970         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8971         (private_strerror): Use prototypes, not old-style function definition.
8972         (print_errno_message): New function.
8973         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8974         char*-flavored one.
8975         (error_tail, error, error_at_line): Use it.
8976
8977 2001-10-11  Jim Meyering  <meyering@lucent.com>
8978
8979         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8980         and quote_n (1, ... to avoid clobbering a buffer.
8981
8982 2001-10-05  Jim Meyering  <meyering@lucent.com>
8983
8984         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8985         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8986         * hash-pjw.h: New file.
8987
8988 2001-09-30  Jim Meyering  <meyering@lucent.com>
8989
8990         * mountlist.c [MOUNTED_GETFSSTAT]:
8991         Include <sys/ucred.h>, for Apple Darwin.
8992         Include sys/mount.h and sys/fs_types.h only if available.
8993         (FS_TYPE): Define.
8994         (read_filesystem_list): Use FS_TYPE.
8995
8996 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8997
8998         * exclude.c (excluded_filename): 0 -> false, since it's
8999         a boolean context.
9000
9001 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9002
9003         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9004         #defines strtoimax.  Also treat the other strto* functions
9005         like strtoimax.
9006
9007         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9008         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9009         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9010
9011 2001-09-26  Jim Meyering  <meyering@lucent.com>
9012
9013         Most macros in unlocked-io.h had the wrong number of arguments.
9014         * gen-uio: New script.
9015         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9016         * unlocked-io.hin: Remove file.
9017         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9018         rather than trying to embed it here.
9019         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9020         Reported by Padraig Brady.
9021
9022 2001-09-25  Volker Borchert  <bt@teknon.de>
9023
9024         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9025
9026 2001-09-23  Jim Meyering  <meyering@lucent.com>
9027
9028         * mountlist.c: Remove useless parentheses in #if directives.
9029         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9030         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9031
9032 2001-09-22  Jim Meyering  <meyering@lucent.com>
9033
9034         * localcharset.c: Update from latest gettext.
9035         * config.charset: Likewise.
9036
9037 2001-09-20  Jim Meyering  <meyering@lucent.com>
9038
9039         * xstrtol.c (strtoimax): Guard declaration with
9040         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9041         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9042         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9043         (strtoumax): Likewise, for completeness (it wasn't necessary).
9044
9045 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9046
9047         * strtoimax.c (HAVE_LONG_LONG):
9048         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9049         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9050         to work around bug in IBM C compiler.
9051
9052 2001-09-16  Jim Meyering  <meyering@lucent.com>
9053
9054         * mkdir.c: New file.
9055
9056 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9057
9058         * xgetcwd.c: Revert some of the previous change; intead,
9059         fix the HAVE_GETCWD_NULL code to behave more like the
9060         !HAVE_GETCWD_NULL code used to.
9061
9062         Include "xalloc.h".
9063         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9064         invoke xalloc_die.
9065
9066 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9067
9068         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9069         Use ssize_t, not int, to store result of readlink.
9070         Check for ssize_t overflow as well as size_t overflow,
9071         as POSIX says the result of readlink is implementation-defined
9072         when ssize_t overflows.
9073         Remove unnecessary cast to char*.
9074         Use free+malloc instead of realloc, as the storage doesn't need
9075         to be preserved and it's clearer and can be more efficient that way.
9076         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9077         * xreadlink.h (xreadlink): Update prototype.
9078
9079 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9080
9081         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9082         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9083         spotted by Jim Meyering.
9084
9085 2001-09-03  Jim Meyering  <meyering@lucent.com>
9086
9087         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9088
9089 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9090
9091         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9092         like the HAVE_GETCWD_NULL code.
9093         Include pathmax.h if not HAVE_GETCWD.
9094         Do not include xalloc.h.
9095         (INITIAL_BUFFER_SIZE): New symbol.
9096         Do not use xmalloc / xrealloc, since the caller is responsible for
9097         handling errors.  Preserve errno around `free' during failure.
9098         Do not overrun buffer when using getwd.
9099
9100 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9101
9102         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9103         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9104
9105 2001-09-02  Jim Meyering  <meyering@lucent.com>
9106
9107         * error.c: Update from GNU libc.
9108
9109 2001-09-01  Jim Meyering  <meyering@lucent.com>
9110
9111         * xreadlink.c: New file.
9112         * xreadlink.h: New file.
9113         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9114
9115         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9116         doesn't conflict with sparc Solaris 7's definition in
9117         /usr/include/sys/int_types.h.
9118
9119         * exclude.c: Use `""', not `<>' to #include non-system header files.
9120         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9121         and strncasecmp as r-values.  Unixware didn't have declarations.
9122
9123 2001-08-31  Jim Meyering  <meyering@lucent.com>
9124
9125         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9126         Use an initial, malloc'd, buffer of length 128 rather than
9127         a statically allocated one of length 1024.
9128
9129 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9130
9131         * xgetcwd.c: Don't include pathmax.h.
9132         Include stdlib.h and unistd.h if available.
9133         Include xalloc.h.
9134         (xmalloc, xstrdup, free): Remove decls.
9135         (xgetcwd): Don't assume sizes fit in unsigned.
9136         Check for overflow when computing sizes.
9137         Simplify reallocation code.
9138
9139 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9140
9141         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9142
9143         * strtoimax.c: Renamed from strtoxmax.c, removing the
9144         old strtoimax.c.
9145
9146         Also, make the following further changes to make this file's
9147         configuration more similar to that of strtol.c:
9148         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9149         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9150         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9151         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9152         changed to signed values.
9153
9154         And make the following changes as well:
9155         Fix copyright notice, as 1999 was missing.
9156         (verify): New macro.
9157         (strtoimax): Check sizes at compile-time, not run-time.
9158         Prefer strtol to strtoll if both work.
9159         (main): Remove; it was not that useful and was a pain to maintain.
9160
9161         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9162
9163 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9164
9165         * savedir.c (savedir): Remove size parameter, as POSIX says that
9166         a directory's st_size can have an arbitrary value, so the old
9167         usage could waste an arbitrary amount of memory.  All uses
9168         changed.
9169         * savedir.h: Update prototype.
9170
9171 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9172
9173         * xstrtol.c (strtoimax): New decl.
9174
9175 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9176
9177         * xstrtol.h: Add copyright notice.
9178         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9179         LONGINT_INVALID_SUFFIX_CHAR.
9180
9181 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9182
9183         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9184         tm to be declared.
9185
9186 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9187
9188         * hash.c: Remove '2001' from copyright notice.
9189
9190 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9191
9192         * full-write.h: New file.
9193         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9194         * full-write.c: Correct credits, as cccp.c no longer
9195         exists and anyway it was so heavily changed from the old cccp
9196         code as to be unrecognizable.  Include full-write.h.
9197         (full_write) Return size_t, with short writes meaning failure.
9198         All callers changed.  This fixes a bug with large buffers
9199         on 64-bit hosts.
9200         * utime.c: Include full-write.h.
9201
9202 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9203
9204         Merge 'exclude' changes from tar 1.13.22.
9205         This fixes one or two unlikely storage allocation overflow bugs,
9206         but doesn't change user-visible behavior otherwise.
9207
9208 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9209
9210         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9211         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9212         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9213         Include if available.
9214         (<xalloc.h>): Include
9215         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9216         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9217         collide with FNM macros.
9218         (struct patopts): New struct.
9219         (struct exclude): Use it, as exclude patterns now come with options.
9220         (new_exclude): Support above changes.
9221         (new_exclude, add_exclude_file):
9222         Initial size must now be a power of two to simplify overflow checking.
9223         (free_exclude, fnmatch_no_wildcards): New function.
9224         (excluded_filename): No longer requires options arg, as the options
9225         are determined by add_exclude.  Now returns bool, not int.
9226         (excluded_filename, add_exclude):
9227         Add support for the fancy new exclusion options.
9228         (add_exclude, add_exclude_file): Now takes int options arg.
9229         Check for arithmetic overflow when computing sizes.
9230         (add_exclude_file): xrealloc might modify errno, so don't
9231         realloc until after errno might be used.
9232
9233         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9234         New macros.
9235         (free_exclude): New decl.
9236         (add_exclude, add_exclude_file): Now takes int options arg.
9237         (excluded_filename): No longer requires options arg, as the options
9238         are determined by add_exclude.  Now returns bool, not int.
9239
9240 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9241
9242         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9243
9244 2001-08-27  Jim Meyering  <meyering@lucent.com>
9245
9246         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9247
9248         * version-etc.c (N_): Remove definition.
9249         Revert most of last change.
9250         Instead, simply don't mark the `Copyright...' string for translation.
9251         Based on advice from Paul Eggert.
9252
9253         * strtoxmax.c: Tweak comment.
9254
9255 2001-08-26  Jim Meyering  <meyering@lucent.com>
9256
9257         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9258         of copyright with `%s' so translators don't get an untranslated
9259         message in 2002.
9260         (COPYRIGHT_YEAR): Define.
9261         (version_etc): Use fprintf rather than fputs.
9262         Suggestion from Ulrich Drepper.
9263
9264         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9265
9266         * strtoll.c: New file, from GNU libc.
9267         * xstrtoimax.c: New file.
9268
9269         * xstrtol.h: Add xstrtoimax.
9270         * strtoumax.c: New file.  Simply include "strtoumax.c".
9271         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9272
9273         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9274         * strtoxmax.c: ... then renamed to this.
9275
9276 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9277
9278         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9279         Port to Solaris 8, where 'sed' requires a space after the 'r'
9280         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9281         Redirect output to $tmp just once.
9282
9283 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9284
9285         * addext.c (<errno.h>): Include.
9286         (errno): Declare if not defined.
9287         (addext): Work correctly when pathconf returns -1 and leaves
9288         errno alone because there is no limit.  Also, work even if
9289         pathconf returns a value greater than SIZE_MAX.
9290
9291 2001-08-12  Jim Meyering  <meyering@lucent.com>
9292
9293         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9294         Simply `return getcwd (NULL, 0);'.
9295         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9296         Use 1300 as initial value for length, not PATH_MAX.
9297
9298         * pathmax.h: Clean up cpp syntax.
9299
9300 2001-08-12  Jim Meyering  <meyering@lucent.com>
9301
9302         * gettimeofday.c: New file.
9303         * gtod.h: New file.
9304         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9305
9306 2001-08-04  Jim Meyering  <meyering@lucent.com>
9307
9308         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9309         to get in sync with glibc.
9310
9311 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9312
9313         The following changes are from gettext 0.10.39 as maintained by
9314         Bruno Haible.
9315
9316         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9317         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9318         with inverted sense.  All uses changed.
9319
9320         * mbswidth.c: Don't include <limits.h>.
9321         Include <stdlib.h> and <string.h> unconditionally.
9322         (iswcntrl, mbsinit, ISCNTRL): New macros.
9323         (mbsnwidth): Use K&R style function declarations.
9324         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9325         can optimize it when MB_CUR_MAX == 1.
9326         The width of control characters is zero, not 1.
9327
9328 2001-07-15  Jim Meyering  <meyering@lucent.com>
9329
9330         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9331         (BUILT_SOURCES): Add unlocked-io.h.
9332         (io_functions): Define.
9333         (unlocked-io.h): New rule.
9334         (DISTCLEANFILES): Add unlocked-io.h.
9335         (all-local): Depend on unlocked-io.h, to ensure it is created.
9336
9337         * unlocked-io.hin: New file
9338
9339         * regex.c: Update from glibc.
9340
9341 2001-07-05  Jim Meyering  <meyering@lucent.com>
9342
9343         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9344         recommendation.
9345         (libfetish_a_SOURCES): Put all .h files here instead.
9346         Remove a thus-exposed (better checks in automake) duplicate and
9347         two unnecessary .h files.
9348
9349 2001-06-11  Jim Meyering  <meyering@lucent.com>
9350
9351         * regex.c: Update from GNU libc.
9352
9353 2001-05-27  Jim Meyering  <meyering@lucent.com>
9354
9355         * readutmp.h (UT_TYPE): Define.
9356
9357 2001-05-24  Jim Meyering  <meyering@lucent.com>
9358
9359         * argmatch.c: Include "quote.h".
9360         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9361         quote function.  Reported by Göran Uddeborg.
9362
9363 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9364
9365         * dirname.c (dir_name): Compute append_dot using path, not newpath
9366         which is not yet declared.
9367
9368 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9369
9370         * Makefile.am (libfetish_a_SOURCES):
9371         Add strftime.c, since we now compile it on all hosts.
9372
9373         * strftime.c (my_strftime):
9374         Define to nstrftime if emacs, but only if my_strftime is not defined.
9375         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9376         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9377         Add one more extra argument: a nanoseconds value.
9378         All uses changed.
9379         (ns): New macro.
9380         (my_strftime function): Add %N format.
9381         (emacs_strftimeu): Renamed from emacs_strftime,
9382         with extra ut argument.
9383
9384 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9385
9386         dirname code cleanup.  base_name now behaves more compatibly
9387         with POSIX basename when given file names that have trailing
9388         slashes, and similarly for dir_name.  Add new primitives
9389         base_len and dir_len.  Put the directory-name-related decls
9390         into dirname.h.
9391
9392         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9393         * backupfile.c (base_name): Likewise.
9394         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9395         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9396         * makepath.c (strip_trailing_slashes): Likewise.
9397         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9398         Likewise.
9399         * rename.c (strip_trailing_slashes): Likewise.
9400         * same.c (base_name): Likewise.
9401         * stripslash.c (ISSLASH): Likewise.
9402
9403         * addext.c: Include <dirname.h> after size_t is defined.
9404         * backupfile.c: Likewise.
9405
9406         * addext.c (addext): Use base_len to trim redundant
9407         trailing slashes instead of doing it ourselves.
9408         But do not trim the last slash if it is not redundant.
9409
9410         * backupfile.c (find_backup_file_name,
9411         max_backup_version): Use base_len instead of rolling it ourselves.
9412         Handle the case of "" and (on DOS) "C:" correctly.
9413
9414         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9415         Include <string.h>, <dirname.h>.
9416         (base_name): Allow file names ending in slashes, other than names
9417         that are all slashes.  In this case, return the basename followed
9418         by the slashes.  This is more general, and can be used in places
9419         where the original base_name purposely had an assertion failure.
9420         (base_len): New function.
9421
9422         * dirname.c: Include <string.h> instead of <stdlib.h>.
9423         Do not include <assert.h>; no longer needed.
9424         Include xalloc.h.
9425         (memrchr): Remove decl.
9426         (dir_name_r): Remove.
9427         (dir_len): Renamed from dirlen.  All callers changed.
9428         Rewrite in terms of base_name, for simplicity and consistency.
9429         (dir_name): Never return NULL.  All callers changed.
9430         Do not include <stdlib.h> in test program; no longer needed.
9431         return 0; is fine for test program.
9432
9433         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9434         New macros.
9435         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9436
9437         * path-concat.c (path_concat): Use base_len to compute
9438         base length, not strlen; this means we cannot rely on memcpy
9439         to null-terminate.
9440
9441         * same.c (STREQ): Remove.
9442         (same_name): Handle the case where the basename ends in trailing '/'.
9443
9444         * stripslash.c (strip_trailing_slashes): Return nonzero if
9445         a slash was stripped.  Do not strip the last slash after a
9446         file system prefix.
9447
9448 2001-04-08  Jim Meyering  <meyering@lucent.com>
9449
9450         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9451         recomputed; that's necessary when the offset spans a DST transition.
9452         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9453
9454 2001-04-02  Jim Meyering  <meyering@lucent.com>
9455
9456         * regex.h, regex.c: Update from GNU libc.
9457
9458 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9459
9460         * version-etc.c (version_etc_copyright): Update to 2001.
9461
9462 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9463
9464         * tempname.c (uint64_t): Define to uintmax_t if
9465         not defined, and if UINT64_MAX is not defined.
9466         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9467         Reported by John David Anglin.
9468
9469 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9470
9471         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9472         alias if codeset is empty.
9473         * config.charset (BeOS): Use wildcard syntax.
9474
9475 2001-03-13  Jim Meyering  <meyering@lucent.com>
9476
9477         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9478         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9479         From Bruno Haible.
9480
9481 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9482
9483         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9484         Don't return NULL.
9485         * unicodeio.c (print_unicode_char): Simplify accordingly.
9486
9487 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9488
9489         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9490         support for DOS/DJGPP.
9491
9492 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9493
9494         * Makefile.am (libfetish_a_SOURCES):
9495         Add dup-safer.c, fopen-safer.c.
9496         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9497
9498         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9499
9500 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9501
9502         The mkstemp replacement is taken from glibc 2.2.2, with some
9503         portability fixes for use outside glibc, as follows:
9504
9505         * tempname.c (struct_stat64): New macro.
9506         (direxists, __gen_tempname): Use it.
9507         This avoids a portability problem with Solaris 8.
9508
9509         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9510         (<stddef.h>, <stdint.h>, <string.h>):
9511         Include only if STDC_HEADERS || _LIBC.
9512         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9513         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9514         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9515         (__set_errno): Define this macro if <errno.h> doesn't.
9516         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9517         Define these macros if <stdio.h> doesn't.
9518         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9519         Define these macros if <sys/stat.h>
9520         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9521         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9522         __xstat64): Define if not _LIBC.
9523         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9524         (__gen_tempname): Invoke gettimeofday only if
9525         HAVE_GETTIMEOFDAY || _LIBC;
9526         otherwise, fall back on plain "time".
9527         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9528
9529         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9530
9531         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9532
9533 2001-02-17  Jim Meyering  <meyering@lucent.com>
9534
9535         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9536         around included file name.
9537
9538         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9539
9540         * strftime.c: Update from GNU libc (the only changes were to comments).
9541
9542 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9543
9544         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9545
9546 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9547
9548         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9549         Remove workaround macros for hosts that have mbrtowc but not
9550         mbstate_t, as we now insist on proper declarations for both
9551         before using mbrtowc.
9552
9553 2001-02-17  Jim Meyering  <meyering@lucent.com>
9554
9555         * regex.c: Update from libc.
9556
9557 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9558
9559         * alloca.c (malloc): Undef before defining, since stdlib.h
9560         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9561         Reported by Mark Hounschell via Paul Eggert.
9562
9563 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9564
9565         * config.charset: Update for FreeBSD 4.2.
9566
9567 2001-01-26  Jim Meyering  <meyering@lucent.com>
9568
9569         * quotearg.c: Include stddef.h.
9570         * quote.c: Include stddef.h.
9571         Reported by Axel Kittenberger.
9572
9573         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9574         line in double quotes so that it evokes a better diagnostic.
9575         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9576         Reported by Axel Kittenberger.
9577
9578 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9579
9580         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9581         to avoid a warning.  Add back 'const' to inptr.
9582
9583 2001-01-16  Jim Meyering  <meyering@lucent.com>
9584
9585         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9586         From Bruno Haible.
9587
9588 2001-01-14  Jim Meyering  <meyering@lucent.com>
9589
9590         * rename.c: New file.  From Volker Borchert.
9591         Include stdlib.h, string.h or strings.h, and xalloc.h.
9592         Use strip_trailing_slashes rather than open-coding it.
9593
9594 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9595
9596         * strftime.c: Sync with glibc time/strftime.c 1.81.
9597
9598 2001-01-03  Jim Meyering  <meyering@lucent.com>
9599
9600         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9601         local `inptr' to avoid warning with some system declarations of iconv.
9602
9603 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9604
9605         * modechange.c: Do not assume that mode_t uses the
9606         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9607         the other-execute bit of FOO even if S_IXOTH != 1.
9608
9609         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9610         WOTH, XOTH, ALLM): New macros.
9611         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9612          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9613         Use them.
9614         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9615         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9616         (mode_compile):
9617         No need to use uintmax_t; unsigned long is long enough.
9618         Don't bother to get suffix since we don't use it.
9619
9620 2000-12-24  Jim Meyering  <meyering@lucent.com>
9621
9622         * hash.c (is_prime): Return explicit boolean values.
9623         (hash_get_first): Return NULL to appease Irix5.6's 89.
9624         Reported by Nelson Beebe.
9625
9626 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9627
9628         * localcharset.c (locale_charset): Add support for Win32.
9629
9630 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9631
9632         * physmem.h, physmem.c: New files.
9633
9634         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9635         (noinst_HEADERS): Add physmem.h.
9636
9637         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9638         't' for compatibility with Solaris 8 sort.
9639
9640 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9641
9642         * config.charset: Add support for BeOS.
9643
9644 2000-12-16  Jim Meyering  <meyering@lucent.com>
9645
9646         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9647         SHELLS_FILE to a file name that's useful on djgpp systems.
9648         Include stdlib.h.
9649         (ADDITIONAL_DEFAULT_SHELLS): Define.
9650         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9651         Based mostly on a patch from Prashant TR.
9652
9653 2000-12-16  Jim Meyering  <meyering@lucent.com>
9654
9655         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9656         N and M) would have treated it like `chown N:N FILE'.
9657
9658         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9659
9660 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9661
9662         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9663         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9664         to the list of canonical encodings. Rename EUC-CN to GB2312.
9665
9666 2000-12-08  Andreas Schwab  <schwab@suse.de>
9667
9668         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9669         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9670
9671 2000-12-07  Jim Meyering  <meyering@lucent.com>
9672
9673         * stripslash.c (ISSLASH): Define.
9674         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9675         From Prashant TR.
9676
9677         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9678         (dir_name_r): Declare this function as static.
9679         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9680         manifest itself on a name containing a mix of slashes and
9681         backslashes.
9682         Make this function work with names starting with a DOS-style
9683         drive letter and colon prefix.
9684         (dir_name): Append `.' if necessary.
9685         Based mostly on patches from Prashant TR and Eli Zaretskii.
9686
9687         * dirname.h (dir_name_r): Remove prototype.
9688
9689 2000-12-05  Jim Meyering  <meyering@lucent.com>
9690
9691         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9692
9693 2000-12-04  Jim Meyering  <meyering@lucent.com>
9694
9695         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9696         Also include memory.h, stdlib.h, unistd.h if appropriate.
9697         Reported by Andreas Jaeger (conflicting declaration of malloc).
9698
9699 2000-12-02  Jim Meyering  <meyering@lucent.com>
9700
9701         * closeout.h: Make idempotent, to avoid some obscure warnings.
9702
9703 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9704
9705         * memrchr.c: Include <config.h> before any system include file.
9706
9707 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9708
9709         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9710
9711 2000-11-26  Jim Meyering  <meyering@lucent.com>
9712
9713         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9714
9715 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9716
9717         * strftime.c (my_strftime): Do not invoke mbrlen with a
9718         size of (size_t) -1; it's not portable.
9719
9720 2000-11-17  Akim Demaille  <akim@epita.fr>
9721
9722         * obstack.h: Formatting changes.
9723         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9724         prevent type checking.
9725         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9726         cast the value to (void *): assigning a `foo *' to a `void *'
9727         variable is valid.
9728         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9729
9730 2000-11-17  Jim Meyering  <meyering@lucent.com>
9731
9732         * strstr.c: Update from GNU libc.
9733
9734 2000-11-16  Jim Meyering  <meyering@lucent.com>
9735
9736         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9737
9738 2000-11-11  Jim Meyering  <meyering@lucent.com>
9739
9740         * error.c: Add a couple #includes, merging from GNU libc version.
9741
9742 2000-11-10  Jim Meyering  <meyering@lucent.com>
9743
9744         * obstack.h: Update from GNU libc.
9745         * obstack.c: Likewise.
9746
9747 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9748
9749         * getusershell.c (setusershell): Use rewind rather than
9750         fseek/fseeko, to avoid configuration hassles with fseeko.
9751         Don't bother opening SHELLS_FILE if shellstream is NULL;
9752         it's not necessary.
9753
9754 2000-11-05  Jim Meyering  <meyering@lucent.com>
9755
9756         * makepath.h (make_dir): Declare.
9757         * makepath.c (make_dir): Remove `static' attribute.
9758         Tweak a comment.
9759
9760 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9761
9762         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9763         last one in a bucket, advance to the next bucket.
9764
9765 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9766
9767         * fnmatch.c: Do not comment out all the code if we are using
9768         the GNU C library, because in some cases we are replacing buggy
9769         code in the GNU C library itself.
9770
9771 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9772
9773         * error.h, getline.h, modechange.h:
9774         Remove "2000" from Copyright line, as the file hasn't been
9775         changed this year other than in the copyright notice.
9776
9777         * xalloc.h: Add "2000" to Copyright line, as this file
9778         was changed this year.
9779
9780 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9781
9782         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9783         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9784         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9785
9786 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9787
9788         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9789         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9790         doesn't define __restrict_arr.
9791
9792 2000-10-29  Jim Meyering  <meyering@lucent.com>
9793
9794         * xstat.in: Fix grammar in comment.
9795
9796 2000-10-28  Jim Meyering  <meyering@lucent.com>
9797
9798         * memchr.c: Update from libc.
9799         Adjust for portability:
9800         [HAVE_STDLIB_H]: Include stdlib.h.
9801         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9802         Undef __memchr, too.
9803         [!weak_alias]: Define __memchr to memchr.
9804
9805         * regex.c: Update from libc.
9806         * regex.h: Likewise.
9807         * getopt1.c: Likewise.
9808         * memcmp.c: Likewise.
9809
9810         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9811         Avoid using fseek, when possible -- it's broken by design.
9812         Patch by Ulrich Drepper.
9813
9814 2000-10-26  Jim Meyering  <meyering@lucent.com>
9815
9816         * strftime.c: Update from libc.
9817
9818 2000-10-25  Jim Meyering  <meyering@lucent.com>
9819
9820         * obstack.c: Update from libc.
9821
9822 2000-10-23  Jim Meyering  <meyering@lucent.com>
9823
9824         * hard-locale.c (hard_locale): Revert last change -- it was simply
9825         wrong.  That set_locale call must not have any side effects.
9826         From Paul Eggert.
9827
9828 2000-10-22  Jim Meyering  <meyering@lucent.com>
9829
9830         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9831         [CYCLIC]: Remove now-unused definition.
9832
9833         * save-cwd.c (O_DIRECTORY): Define, if needed.
9834         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9835         Suggestion from Ulrich Drepper.
9836
9837 2000-10-21  Jim Meyering  <meyering@lucent.com>
9838
9839         * dirname.c (dir_name_r): New function, factored out of dir_name.
9840         (dir_name): Use dir_name_r.
9841         * dirname.h (dir_name_r): Declare it.
9842
9843 2000-10-21  Jim Meyering  <meyering@lucent.com>
9844
9845         * dirname.c (memrchr): Declare if necessary.
9846         (dir_name): Remove the restriction that there be no
9847         trailing slashes.  Now, this code skips past them, effectively
9848         ignoring them.
9849         [TEST_DIRNAME] (main): New unit tests.
9850
9851         * memrchr.c: New file from GNU libc.
9852         Undef __memrchr, too.
9853         [!weak_alias]: Define __memrchr to memrchr.
9854         Guard weak_alias use with `#ifdef weak_alias'.
9855
9856 2000-10-17  Jim Meyering  <meyering@lucent.com>
9857
9858         * quote.h (PARAMS): Define and use.
9859         Reported by Akim Demaille.
9860
9861         * getopt.c: Update from libc.
9862
9863 2000-10-16  Jim Meyering  <meyering@lucent.com>
9864
9865         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9866         From Jan Fedak.
9867
9868 2000-09-25  Jim Meyering  <meyering@lucent.com>
9869
9870         * md5.h (rol): Define (from GnuPG).
9871
9872         * sha.c: Give credit (GnuPG) where due.
9873         (M): Use rol rather than open-coding it.
9874         Add a FIXME comment.
9875
9876 2000-09-21  Jim Meyering  <meyering@lucent.com>
9877
9878         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9879         Reported by Michael Stone.
9880
9881 2000-09-20  Jim Meyering  <meyering@lucent.com>
9882
9883         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9884         (noinst_HEADERS): Add sha.h.
9885         Based on code from Scott G. Miller and from GnuPG.
9886
9887 2000-09-15  Jim Meyering  <meyering@lucent.com>
9888
9889         * regex.c: Update from libc.
9890
9891 2000-09-10  Jim Meyering  <meyering@lucent.com>
9892
9893         * getopt.c (_getopt_internal): Update from glibc.
9894
9895 2000-09-09  Jim Meyering  <meyering@lucent.com>
9896
9897         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9898         think it should be used as a general replacement for isascii.
9899         * fnmatch.c: Likewise.
9900         * mbswidth.c: Likewise
9901         * regex.c: Likewise.
9902
9903         Don't use atoi.
9904         * userspec.c: Include sys/param.h and limits.h.
9905         Include xstrtol.h.
9906         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9907         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9908         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9909         UID, GID.  Check range.
9910
9911 2000-09-06  Jim Meyering  <meyering@lucent.com>
9912
9913         * getopt.c (_getopt_internal): Update from glibc.
9914
9915 2000-08-30  Jim Meyering  <meyering@lucent.com>
9916
9917         * strftime.c: Merge in changes from GNU libc.
9918
9919 2000-08-26  Jim Meyering  <meyering@lucent.com>
9920
9921         * closeout.c: Include "__fpending.h".
9922         (close_stdout_status): Return right away if there's nothing to flush.
9923
9924         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9925         * __fpending.c: New file.
9926         * __fpending.h: New file.
9927
9928 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9929
9930         Standardize on "memory exhausted" instead of "Memory exhausted"
9931         or "virtual memory exhausted".
9932         * obstack.c (print_and_abort): Use "memory exhausted", not
9933         "virtual memory exhausted".
9934         * same.c (same_name): Invoke xalloc_die instead of printing
9935         our own message.
9936         * userspec.c (parse_user_spec): Likewise.
9937         * bumpalloc.h: comment fix
9938         * same.c, userspec.c: Include xalloc.h.
9939
9940         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9941         not char *const and pointing to a constant array.
9942         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9943         (xrealloc): Comment fix.
9944
9945         * userspec.c (parse_user_spec):
9946         Don't translate a message until just before returning,
9947         to avoid unnecessary translation.
9948
9949 2000-08-07  Jim Meyering  <meyering@lucent.com>
9950
9951         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9952         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9953         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9954         getgroups.c, gethostname.c, getopt.h, group-member.c,
9955         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9956         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9957         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9958         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9959         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9960         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9961         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9962         yesno.c: Back out Copyright date changes for each file with no change
9963         this year.  This eases coordination with other programs using the same
9964         source code modules.  From Paul Eggert.
9965
9966 2000-08-03  Greg McGary  <greg@mcgary.org>
9967
9968         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9969         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9970         (EXTEND_BUFFER): Use them.
9971
9972 2000-08-01  Jim Meyering  <meyering@lucent.com>
9973
9974         * dirname.c (ISSLASH): Define.
9975         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9976         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9977         both `\' and `/' may be use as path separators.
9978         Based on a patch from Prashant TR.
9979
9980 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9981
9982         * quotearg.c (quotearg_n_options): Don't make the initial
9983         slot vector a constant, since it might get modified.
9984
9985 2000-07-31  Jim Meyering  <meyering@lucent.com>
9986
9987         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9988         * obstack.c (print_and_abort): Likewise.
9989
9990 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9991
9992         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9993         buffer, so that the caller can always quote one small
9994         component of a "memory exhausted" message in slot 0.
9995         From a suggestion by Jim Meyering.
9996
9997 2000-07-30  Jim Meyering  <meyering@lucent.com>
9998
9999         * makepath.c (make_path): Quote the other instance, too.
10000
10001         * quotearg.c (N_STATIC_SLOTVECS): Define.
10002         (STATIC_BUF_SIZE): Define.
10003         (quotearg_n_options): Use only statically allocated storage when
10004         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10005         than STATIC_BUF_SIZE.
10006
10007 2000-07-29  Jim Meyering  <meyering@lucent.com>
10008
10009         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10010         * dirname.c (dir_name): Likewise.
10011
10012         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10013
10014         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10015         (dir_name): Assert that there are no trailing slashes.
10016
10017 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10018
10019         * mbswidth.h (mbswidth): Add a flags argument.
10020         (mbswidth): New declaration.
10021         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10022         * mbswidth.c (mbswidth): Add a flags argument.
10023         (mbsnwidth): New function.
10024
10025 2000-07-24  Jim Meyering  <meyering@lucent.com>
10026
10027         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10028
10029 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10030
10031         * mbswidth.c (_XOPEN_SOURCE):
10032         Don't define; this causes problems on Solaris 7.
10033         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10034
10035 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10036
10037         * quotearg.c:
10038         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10039         so that mbstate_t is always defined.
10040
10041         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10042         be 1 in at least one GCC installation, and this configuration
10043         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10044         performance on hosts that have mbrtowc but have only unibyte
10045         locales, but I assume these hosts are rare.
10046
10047 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10048
10049         * quotearg.c: Streamline by invoking multibyte code only if needed.
10050         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10051         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10052         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10053         invoke multibyte primitives.
10054
10055 2000-07-23  Jim Meyering  <meyering@lucent.com>
10056
10057         * basename.c (base_name): Add an assertion.
10058
10059 2000-07-15  Bruno Haible  <clisp.cons.org>
10060
10061         * quotearg.c: When the system forces us to redefine mbstate_t,
10062         shadow its mbsinit function.
10063
10064 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10065
10066         * mbswidth.h: New file.
10067         * mbswidth.c: New file.
10068         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10069         (noinst_HEADERS): Add mbswidth.h.
10070
10071 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10072
10073         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10074         and IRIX 6.
10075
10076 2000-07-15  Jim Meyering  <meyering@lucent.com>
10077
10078         * makepath.c: Include quote.h.
10079         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10080         corresponding argument in a `quote (...)' call.
10081         Give better diagnostics.
10082
10083         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10084         (noinst_HEADERS): Add quote.h.
10085
10086         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10087         from tar's src/misc.c.
10088         * quote.h: New file.  Prototypes for same.
10089
10090 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10091
10092         From a suggestion by Bruno Haible.
10093         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10094         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10095         to decide whether to define the BeOS workaround macro;
10096         this adjusts to the change to AC_MBSTATE_T.
10097
10098 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10099
10100         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10101
10102         * quotearg.c (quoting_style_args, quoting_style_vals,
10103         quotearg_buffer_restyled): Add support for
10104         clocale_quoting_style.  Undo previous change to
10105         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10106         and "{RIGHT QUOTATION MARK}" msgids.
10107
10108 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10109
10110         The old behavior of quoting `like this' doesn't look good with
10111         newer, ISO-style fonts.  See:
10112         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10113
10114         Instead, quote "like this" by default.  Let the translator
10115         tailor the locale-specific quoting behavior by providing
10116         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10117
10118         * quotearg.c (N_): New macro.
10119         (gettext_default): New function.
10120         (quotearg_buffer_restyled): Use
10121         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10122         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10123
10124 2000-07-09  Jim Meyering  <meyering@lucent.com>
10125
10126         * Most files: Update copyright dates to include 2000.
10127
10128 2000-07-08  Jim Meyering  <meyering@lucent.com>
10129
10130         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10131         if not defined.
10132         (xgethostname): Remove now-unnecessary #ifdef.
10133         Move declaration of `err' into loop where it's used.
10134
10135 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10136
10137         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10138         by allocating a larger buffer. Test the gethostname return value for
10139         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10140         returns an error and ENAMETOOLONG isn't defined.
10141
10142 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10143         and Bruno Haible  <haible@clisp.cons.org>
10144
10145         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10146
10147 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10148
10149         * quotearg.c (struct quoting_options): Simplify quote_these_too
10150         dimension.
10151
10152 2000-07-03  Jim Meyering  <meyering@lucent.com>
10153
10154         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10155         Reported by Bruno Haible.
10156
10157 2000-07-04  Jim Meyering  <meyering@lucent.com>
10158
10159         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10160         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10161         lacks mbrtowc.
10162
10163 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10164         and Bruno Haible  <haible@clisp.cons.org>
10165
10166         * quotearg.c (mbrtowc):
10167         Assign to *pwc, and return 1 only if result is nonzero.
10168         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10169
10170 2000-07-03  Jim Meyering  <meyering@lucent.com>
10171
10172         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10173         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10174         From Bob Proulx.
10175
10176 2000-07-02  Jim Meyering  <meyering@lucent.com>
10177
10178         * quotearg.c (mbstate_t): Don't define here.
10179
10180 2000-07-02  Jim Meyering  <meyering@lucent.com>
10181
10182         * nanosleep.c (SIGCONT): Define if not already defined.
10183
10184 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10185
10186         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10187         per change in ../m4/ls-mntd-fs.m4.
10188         (read_filesystem_list): Ignore symbolic links.
10189
10190 2000-06-29  Jim Meyering  <meyering@lucent.com>
10191
10192         * same.c: Include <string.h> or <strings.h>, as appropriate,
10193         for declaration of strcmp.
10194
10195         * long-options.c: Include <stdlib.h>, for declaration of exit.
10196
10197         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10198         Avoid warning by casting result to `char *' to remove `const'.
10199
10200 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10201
10202         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10203
10204 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10205
10206         savedir now sets errno on failure and invokes xmalloc to get memory.
10207         Fix a couple of other minor bugs while we're at it.
10208
10209         * savedir.c (<unistd.h>): Do not include; there's no need.
10210         (NAMLEN): Remove macro.
10211         (malloc, realloc): Remove decls.
10212         (stpcpy): Likewise.
10213         ("xalloc.h"): Include.
10214         (NAME_SIZE_DEFAULT): New macro.
10215         (savedir): Use xmalloc / xrealloc to allocate memory.
10216         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10217         Skip "" directory entries.
10218         Use strlen to calculate directory entry length, since the old method
10219         is rarely used these days and isn't worth supporting.
10220         Don't use a pointer after freeing it.
10221         Check for integer overflow when calculating allocation size.
10222         Use memcpy to copy entries, instead of stpcpy.
10223         Set errno properly when returning NULL.
10224         Check for readdir error.
10225
10226 2000-06-26  Jim Meyering  <meyering@lucent.com>
10227
10228         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10229
10230 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10231
10232         * getusershell.c (xmalloc, xrealloc): Remove functions.
10233         Include xalloc.h.
10234         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10235
10236 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10237
10238         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10239
10240 2000-06-24  Jim Meyering  <meyering@lucent.com>
10241
10242         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10243
10244 2000-06-21  Jim Meyering  <meyering@lucent.com>
10245
10246         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10247
10248 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10249
10250         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10251         (mbrtowc, mbstate_t): Define substitutes if
10252         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10253         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10254         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10255
10256 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10257
10258         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10259         than 1024, return a memory chunk of least possible size, instead
10260         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10261         Use free/xmalloc instead of xrealloc to avoid copying for very long
10262         paths.
10263
10264 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10265
10266         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10267         address, not strdup.  Include <stdlib.h> and don't declare free().
10268
10269 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10270
10271         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10272         the empty string.
10273
10274 2000-06-21  Jim Meyering  <meyering@lucent.com>
10275
10276         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10277         (noinst_HEADERS): Add getstr.h.
10278
10279         * getline.c (getstr): Move into a separate file.
10280         * getstr.c (getstr): New file, extracted from getline.c, with
10281         the following changes: new parameter, delim2; both delim[12]
10282         parameters have type `int', not `char'.  The latter would lose
10283         with 8-bit delimiters.
10284         * getstr.h: New file.
10285
10286 2000-06-19  Jim Meyering  <meyering@lucent.com>
10287
10288         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10289
10290 2000-06-18  Jim Meyering  <meyering@lucent.com>
10291
10292         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10293         Besides, these days every porting target provides a mkdir function.
10294
10295         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10296         (this snippet comes from src/system.h).
10297
10298 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10299
10300         * human.c (adjust_value): New function.
10301         (human_readable_inexact): Apply rounding style even when
10302         printing approximate values.
10303
10304 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10305
10306         * human.c (human_readable_inexact): Allow an input block
10307         size that is not a multiple of the output block size, and vice versa.
10308         Reported by Piergiorgio Sartor.
10309
10310 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10311
10312         * getdate.y (get_date): Apply relative times after time
10313         zone indicator, not before.  Reported by Todd A. Jacobs.
10314
10315 2000-06-13  Jim Meyering  <meyering@lucent.com>
10316
10317         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10318
10319         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10320
10321 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10322
10323         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10324
10325 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10326
10327         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10328
10329 2000-06-04  Jim Meyering  <meyering@lucent.com>
10330
10331         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10332         SunOS 4.1.4 for which gid_t is an unsigned type.
10333
10334 2000-06-03  Jim Meyering  <meyering@lucent.com>
10335
10336         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10337
10338 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10339
10340         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10341         newer, don't install charset.alias.
10342         * config.charset: Change the Linux/glibc rules so they become empty
10343         on glibc-2.1 or newer.
10344
10345 2000-06-02  Jim Meyering  <meyering@lucent.com>
10346
10347         * mountlist.c: Back out last change.  Instead, do this...
10348         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10349         member using the same `ignore'-testing code.
10350         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10351         fs_type strings.
10352         From Mark D. Roth.
10353
10354 2000-05-29  Jim Meyering  <meyering@lucent.com>
10355
10356         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10357         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10358
10359 2000-05-22  Jim Meyering  <meyering@lucent.com>
10360
10361         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10362
10363 2000-05-18  Jim Meyering  <meyering@lucent.com>
10364
10365         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10366         back, too, since it may have been modified by allocate_entry.
10367         (hash_delete): Rewrite to use neither the assignment operator
10368         nor the comma operator in an if-expression.
10369
10370 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10371
10372         * closeout.c:
10373         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10374         Remove; no longer needed.
10375         "quotearg.h": Add include.
10376         (file_name): Do not bother to explicitly initialize to NULL; it's less
10377         efficient on some hosts.
10378         (close_stdout_status): Remove test as to whether stdout was already
10379         closed; it breaks for the case "echo x | sort >&-".
10380         Quote file name colons.
10381         Do not assume that _("write error") lacks format strings.
10382
10383 2000-05-15  Jim Meyering  <meyering@lucent.com>
10384
10385         * version-etc.c (version_etc_copyright): Update the copyright string
10386         used in all --version output.
10387
10388 2000-05-14  Jim Meyering  <meyering@lucent.com>
10389
10390         * closeout.c (close_stdout_set_file_name): New function.
10391         (close_stdout_status): Use new file-scoped global.
10392         Return right away if fstat says the stdout file descriptor is invalid.
10393         * closeout.h (close_stdout_set_file_name): Declare.
10394
10395 2000-05-10  Jim Meyering  <meyering@lucent.com>
10396
10397         * closeout.c [default_exit_status]: New file-scoped variable.
10398         (close_stdout_set_status): New function.
10399         * closeout.h (close_stdout_set_status): Declare.
10400
10401 2000-05-08  Jim Meyering  <meyering@lucent.com>
10402
10403         * long-options.c: Don't include closeout.h.
10404         (parse_long_options): Don't call close_stdout for --version.
10405
10406 2000-05-06  Jim Meyering  <meyering@lucent.com>
10407
10408         * strnlen.c: Undefine __strnlen and strnlen.
10409         [!weak_alias]: Define __strnlen to strnlen.
10410
10411         * atexit.c: New file, from libiberty.
10412
10413 2000-05-06  Jim Meyering  <meyering@lucent.com>
10414
10415         * closeout.c (close_stdout_status): Also check for errors on the
10416         stderr stream.
10417
10418 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10419
10420         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10421         instead of xmalloc, xrealloc, path_concat.
10422         (locale_charset): Treat empty environment variables as absent.
10423         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10424
10425 2000-05-04  Jim Meyering  <meyering@lucent.com>
10426
10427         * getopt.c: Update from glibc.
10428         * obstack.c: Likewise.
10429         * obstack.h: Likewise.
10430         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10431
10432         * regex.h: Likewise.
10433         * strndup.c: Likewise.
10434         * strnlen.c: New file, from glibc.
10435
10436 2000-05-01  Jim Meyering  <meyering@lucent.com>
10437
10438         * full-write.c (full_write): Remove `FIXME' part of comment.
10439
10440 2000-04-29  Jim Meyering  <meyering@lucent.com>
10441
10442         * path-concat.c: Declare strdup only if it's not defined.
10443         * canon-host.c: Likewise.
10444
10445 2000-04-28  Jim Meyering  <meyering@lucent.com>
10446
10447         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10448         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10449         included first, then limits.h is included by locale.h by libintl.h.
10450         From John David Anglin.
10451
10452 2000-04-25  Jim Meyering  <meyering@lucent.com>
10453
10454         * makepath.c (S_IRWXUGO): Define.
10455         (make_path): Always perform explicit chmod if MODE specifies any
10456         of the `special' permission bits.  Prompted by a bug report against
10457         install from Mate Wierdl and Joost van Baal.
10458
10459 2000-04-18  Jim Meyering  <meyering@lucent.com>
10460
10461         * README: New file.
10462
10463         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10464         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10465
10466 2000-04-17  Jim Meyering  <meyering@lucent.com>
10467
10468         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10469         the definition of it to rpl_strftime also defined-away the system's
10470         declaration.
10471
10472 2000-04-15  Jim Meyering  <meyering@lucent.com>
10473
10474         Use `C' to denote so-called `contiguous' files, the same way
10475         that tar does.
10476         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10477         (ftypelet): Use S_ISCTG.
10478         From Michael Deutschmann.
10479
10480 2000-04-14  Jim Meyering  <meyering@lucent.com>
10481
10482         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10483
10484 2000-04-08  Jim Meyering  <meyering@lucent.com>
10485
10486         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10487         names don't conflict.  Reported by Eli Zaretskii.
10488
10489 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10490
10491         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10492         bug.  Deal with the different error behavior of Irix iconv.
10493
10494 2000-04-07  Jim Meyering  <meyering@lucent.com>
10495
10496         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10497         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10498
10499 2000-04-05  Jim Meyering  <meyering@lucent.com>
10500
10501         Portability tweaks required for ultrix4.3.
10502         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10503         * readutmp.c: Include sys/types.h before sys/stat.h.
10504         * canon-host.c: Declare strdup.
10505         * path-concat.c: Likewise.
10506         From John David Anglin.
10507
10508 2000-04-04  Jim Meyering  <meyering@lucent.com>
10509
10510         Be more DOS 8.3-friendly.
10511         * ref-add.sin: Renamed from ref-add.sed.in.
10512         * ref-del.sin: Renamed from ref-del.sed.in.
10513         * Makefile.am: Reflect renaming.
10514         Reported by Eli Zaretskii.
10515
10516         Use a temporary file name that won't clash with `charset.alias'
10517         in the DOS 8.3 name space.
10518         * Makefile.am (charset_tmp): Define.
10519         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10520         (uninstall-local): Likewise.
10521         Reported by Eli Zaretskii.
10522
10523 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10524
10525         * time/strftime.c (my_strftime): Make sure we call the system
10526         strftime, not ourselves, when invoking the underlying strftime.
10527
10528 2000-03-24  Jim Meyering  <meyering@lucent.com>
10529
10530         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10531         (charset_alias): Define.
10532         (install-exec-local): Factor out common code.
10533         (uninstall-local): Split lines longer than 80.
10534         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10535         (SUFFIXES): Define.
10536         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10537         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10538
10539 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10540
10541         * config.charset: Output a line containing "Packages using this file".
10542         * ref-add.sed.in, ref-del.sed.in: New files.
10543         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10544         ref-del.sed): New rules.
10545
10546 2000-03-17  Jim Meyering  <meyering@lucent.com>
10547
10548         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10549         Otherwise, include <strings.h>
10550
10551 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10552
10553         * unicodeio.c (utf8_wctomb): New function.
10554         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10555         format instead of in UCS-4 with platform dependent endianness.
10556
10557 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10558
10559         * savedir.c (savedir): Work even if directory size is
10560         negative; this can happen with some screwy NFS configurations.
10561
10562 2000-03-06  Jim Meyering  <meyering@lucent.com>
10563
10564         * localcharset.c (get_charset_aliases): Don't try to free file_name
10565         if it's NULL (because we ran out of memory).  From Bruno Haible.
10566
10567 2000-03-05  Jim Meyering  <meyering@lucent.com>
10568
10569         * localcharset.c ("path-concat.h"): Include.
10570         (get_charset_aliases): Use path_concat instead of ANSI string
10571         concatenation.
10572
10573         * unicodeio.h (PARAMS): Define.
10574         Use it to guard prototype.
10575
10576 2000-03-04  Jim Meyering  <meyering@lucent.com>
10577
10578         * Makefile.am (install-exec-local): Create $(libdir) before installing
10579         into it.
10580         (uninstall-local): Uncomment this rule so `make distcheck' works
10581         once again.
10582
10583         * unicodeio.c (<errno.h>): Include it.
10584         (errno): Declare if not defined.
10585
10586         * localcharset.c: Add Bruno's comment justifying use of volatile.
10587
10588         * config.charset: New version, incorporating remarks from a linux
10589         i18n mailing list.  From Bruno Haible.
10590
10591 2000-03-02  Jim Meyering  <meyering@lucent.com>
10592
10593         * Makefile.am (EXTRA_DIST): Add config.charset.
10594
10595 2000-03-01  Jim Meyering  <meyering@lucent.com>
10596
10597         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10598         * unicodeio.c: Likewise.
10599
10600 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10601
10602         * config.charset: New file.
10603         * localcharset.c: New file.
10604         * unicodeio.h, unicodeio.c: New files.
10605         * Makefile.am (DEFS): Add -DLIBDIR=...
10606         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10607         (noinst_HEADERS): Add unicodeio.h.
10608         (all-local, install-exec-local, charset.alias): New targets.
10609
10610 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10611
10612         * quotearg.c (ALERT_CHAR): New macro.
10613         (quotearg_buffer_restyled): Use it.
10614
10615 2000-02-27  Jim Meyering  <meyering@lucent.com>
10616
10617         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10618         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10619
10620         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10621         not `#if STDC_HEADERS'.
10622         Declare malloc if needed.
10623
10624         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10625         now that autoconf always defines the HAVE_DECL_ symbols.
10626         * human.c: Likewise.
10627         * same.c: Likewise.
10628         * strtoumax.c: Likewise.
10629
10630         * backupfile.c: Arrange for cpp to fail if the configure-time
10631         declaration check was not run.
10632         * hash.c: Likewise.
10633         * human.c: Likewise.
10634         * same.c: Likewise.
10635         * strtoumax.c: Likewise.
10636
10637         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10638         then first look up the entire `.'-containing string as a login name.
10639
10640 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10641
10642         * getdate.y: Handle two-digit years with leading zeros correctly.
10643         (textint): New typedef.
10644         (parser_control): Member year changed from int to textint.
10645         All uses changed.
10646         (YYSTYPE): Removed; replaced by %union with int and textint members.
10647         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10648         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10649         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10650         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10651         (date, number, to_year): Use width of number in digits, not its value,
10652         to determine whether it's a 2-digit year, or a 2-digit time.
10653         (yylex): Store number of digits of numeric tokens.
10654         Reported by John Kendall.
10655
10656         (parser_control): Changed from struct parser_control to typedef (for
10657         consistency).  All uses changed.
10658
10659         (tID): Removed; not used.
10660         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10661
10662 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10663
10664         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10665         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10666
10667 2000-02-12  Jim Meyering  <meyering@lucent.com>
10668
10669         * userspec.c (ISDIGIT): Define it.
10670         (isdigit): Remove definition.
10671         (is_number): Use ISDIGIT, not isdigit.
10672         <libintl.h>: Include.
10673         (_ and N_): Define.
10674         (parse_user_spec): Mark translatable strings.
10675
10676 2000-02-10  Jim Meyering  <meyering@lucent.com>
10677
10678         With these changes, nanosleep.[ch] are finally enough like the other
10679         lib/* replacement files to compile on a few more losing systems.
10680
10681         * nanosleep.h: Don't include config.h.
10682         Remove prototype from declaration of nanosleep.
10683         (PARAMS): Remove now-unneeded definition.
10684         * nanosleep.c: #undef nanosleep.
10685         (rpl_nanosleep): Rename from nanosleep.
10686
10687 2000-02-03  Jim Meyering  <meyering@lucent.com>
10688
10689         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10690         rather than with `#if HAVE_UTMPNAME'.
10691
10692 2000-02-01  Jim Meyering  <meyering@lucent.com>
10693
10694         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10695
10696 2000-01-31  Jim Meyering  <meyering@lucent.com>
10697
10698         * nanosleep.h (nanosleep): Guard declaration with
10699         `#if ! HAVE_DECL_NANOSLEEP'.
10700         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10701         the declaration in that vendor's sys/timers.h.
10702         Reported by Christian Krackowizer.
10703
10704         * quotearg.c (ISASCII): Add #undef and move definition to follow
10705         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10706         (ISPRINT): Likewise.
10707         Reported by Tom Tromey.
10708
10709 2000-01-30  Jim Meyering  <meyering@lucent.com>
10710
10711         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10712         uses of ->ut_name.  The latter doesn't work with new Linux header files
10713         where only utmpx.ut_user is declared.
10714
10715         * readutmp.h (UT_USER): Define.
10716
10717 2000-01-23  Jim Meyering  <meyering@lucent.com>
10718
10719         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10720         obstack.c.
10721
10722 2000-01-22  Jim Meyering  <meyering@lucent.com>
10723
10724         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10725         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10726         Required for some AIX systems.  Reported by Christian Krackowizer.
10727         [TESTING] (main): New function.
10728
10729         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10730         * dirname.c (dir_name): Support for DOS-style file names with drive
10731         letters.
10732
10733         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10734
10735         * strverscmp.c (ISDIGIT): Define.
10736         (strverscmp): Use ISDIGIT, not isdigit.
10737
10738 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10739
10740         * nanosleep.c (nanosleep):
10741         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10742         POSIX.1 doesn't require SA_INTERRUPT and some systems
10743         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10744         it's been part of POSIX.1 since day 1 (in 1988).
10745
10746 2000-01-17  Jim Meyering  <meyering@lucent.com>
10747
10748         * interlock: Remove unused file.  Reported by François Pinard.
10749
10750 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10751
10752         * quotearg.c (quotearg_buffer_restyled): Do not quote
10753         alert, backslash, formfeed, and vertical tab unnecessarily in
10754         shell quoting style.
10755
10756
10757 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10758 Free Software Foundation, Inc.
10759 Copying and distribution of this file, with or without modification,
10760 are permitted provided the copyright notice and this notice are preserved.