* lib/dirchownmod.c: Don't include fcntl.h; no longer needed.
[gnulib.git] / lib / ChangeLog
1 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * dirchownmod.c: Don't include fcntl.h; no longer needed.
4         (dirchownmod): New arg FD.  All callers changed.
5         Use FD rather than opening the directory ourself, as opening is
6         now the caller's responsibility.
7         * dirchownmod.h: Likewise.
8         * mkancesdirs.c: Include <sys/types.h>, for portability to older
9         hosts that require <sys/types.h> before <sys/stat.h>.  Include
10         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
11         (test_dir): Remove.
12         (mkancesdirs): Return length of prefix of FILE that has already
13         been made, or -2 if there is a child doing the work.  Redo
14         algorithm so that it is O(N) rather than O(N**2).  Optimize away
15         ".", and treat ".." specially since it might stray back into
16         already-created areas.  Use a subprocess if necessary.  New arg
17         WD; all users changed.  MAKE_DIR function should now return 1
18         if it creates a directory that is not readable.  Return -2 if
19         a child process is spun off.
20         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
21         Adjust signature to match code.
22         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
23         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
24         all users changed.
25         * savewd.c, savewd.h: New files.
26
27 2006-09-15  Jim Meyering  <jim@meyering.net>
28
29         * rename-dest-slash.c (has_trailing_slash): Use
30         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
31         (rpl_rename_dest_slash): Perform the cheaper trailing slash
32         test before testing whether SRC is a directory.
33         Suggestions from Bruno Haible.
34
35         Avoid a warning about an unused variable.
36         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
37         into the #ifdef block where it's used.
38
39         * rename-dest-slash.c: New file.
40
41 2006-09-14  Bruno Haible  <bruno@clisp.org>
42
43         * allocsa.c: Include <config.h> unconditionally.
44         * asnprintf.c: Likewise.
45         * asprintf.c: Likewise.
46         * c-strcasecmp.c: Likewise.
47         * c-strcasestr.c: Likewise.
48         * c-strncasecmp.c: Likewise.
49         * c-strstr.c: Likewise.
50         * classpath.c: Likewise.
51         * clean-temp.c: Likewise.
52         * concatpath.c: Likewise.
53         * copy-file.c: Likewise.
54         * csharpcomp.c: Likewise.
55         * csharpexec.c: Likewise.
56         * execute.c: Likewise.
57         * fatal-signal.c: Likewise.
58         * findprog.c: Likewise.
59         * fwriteerror.c: Likewise.
60         * gl_array_list.c: Likewise.
61         * gl_array_oset.c: Likewise.
62         * gl_avltree_list.c: Likewise.
63         * gl_avltree_oset.c: Likewise.
64         * gl_avltreehash_list.c: Likewise.
65         * gl_carray_list.c: Likewise.
66         * gl_linked_list.c: Likewise.
67         * gl_linkedhash_list.c: Likewise.
68         * gl_list.c: Likewise.
69         * gl_oset.c: Likewise.
70         * gl_rbtree_list.c: Likewise.
71         * gl_rbtree_oset.c: Likewise.
72         * gl_rbtreehash_list.c: Likewise.
73         * imaxabs.c: Likewise.
74         * imaxdiv.c: Likewise.
75         * javacomp.c: Likewise.
76         * javaexec.c: Likewise.
77         * javaversion.c: Likewise.
78         * linebreak.c: Likewise.
79         * localcharset.c: Likewise.
80         * lock.c: Likewise.
81         * mbchar.c: Likewise.
82         * mbswidth.c: Likewise.
83         * mkdtemp.c: Likewise.
84         * pipe.c: Likewise.
85         * printf-args.c: Likewise.
86         * printf-parse.c: Likewise.
87         * progname.c: Likewise.
88         * progreloc.c: Likewise.
89         * readlink.c: Likewise.
90         * sh-quote.c: Likewise.
91         * stpcpy.c: Likewise.
92         * stpncpy.c: Likewise.
93         * strcasecmp.c: Likewise.
94         * strcasestr.c: Likewise.
95         * strcspn.c: Likewise.
96         * striconv.c: Likewise.
97         * strncasecmp.c: Likewise.
98         * strnlen1.c: Likewise.
99         * strstr.c: Likewise.
100         * strtok_r.c: Likewise.
101         * tls.c: Likewise.
102         * tmpdir.c: Likewise.
103         * unicodeio.c: Likewise.
104         * unsetenv.c: Likewise.
105         * vasnprintf.c: Likewise.
106         * vasprintf.c: Likewise.
107         * wait-process.c: Likewise.
108         * xallocsa.c: Likewise.
109         * xsetenv.c: Likewise.
110         * xstriconv.c: Likewise.
111
112 2006-09-13  Eric Blake  <ebb9@byu.net>
113
114         * getopt.c: Fix typo in last commit.
115
116 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
117
118         * _fpending.c: Include <config.h> unconditionally, since we no
119         longer worry about uses that don't define HAVE_CONFIG_H.
120         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
121         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
122         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
123         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
124         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
125         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
126         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
127         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
128         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
129         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
130         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
131         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
132         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
133         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
134         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
135         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
136         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
137         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
138         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
139         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
140         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
141         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
142         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
143         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
144         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
145         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
146         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
147         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
148         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
149         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
150         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
151         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
152         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
153         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
154         Likewise.
155
156 2006-09-12  Jim Meyering  <jim@meyering.net>
157
158         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
159         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
160         Reported by Nelson H. F. Beebe.
161
162 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
163
164         * argp-help.c (argp_doc): Make sure NULL is not passed to
165         dgettext.
166
167 2006-09-10  Bruno Haible  <bruno@clisp.org>
168
169         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
170
171 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
172
173         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
174         program_invocation_name and program_invocation_short_name are
175         initialized.
176         * argp-namefrob.h: Move declarations of program_invocation_name
177         and program_invocation_short_name to argp.h, so they are visible
178         to user programs.
179         * argp.h: Likewise
180
181 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
182
183         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
184         convention.  Text proposed by Bruno Haible.
185         (struct argp_option): Document the use of N_() wrappers.
186
187         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
188         and translate the two parts separately, instead of feeding
189         the whole string to gettext.  This allows to exclude
190         '\v' from the strings visible to the translator by writing doc
191         strings as N_("..") "\v" N_("..").
192
193 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
194
195         * mktime.c (guess_time_tm): Fix bug where mktime
196         returned the maximum time_t value rather than (time_t) -1.
197         Problem originally reported by William Bardwell
198         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
199
200         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
201         Moved to here ...
202         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
203         ... from here.
204
205 2006-09-06  Bruno Haible  <bruno@clisp.org>
206
207         * striconv.h: New file.
208         * striconv.c: New file, merging iconvme.c with GNU gettext's
209         iconvstring.c.
210         * xstriconv.h: New file.
211         * xstriconv.c: New file.
212
213 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
214
215         * argz_.h: Sync from Libtool.
216
217         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
218                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
219
220         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
221
222 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
223
224         * trim.h: New file.
225         * trim.c: New file.
226
227 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
228
229         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
230         Problem reported by Ralf Wildenhues in
231         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
232
233         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
234         HAVE_STRUCT_STATFS_F_FSTYPENAME.
235
236 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
237
238         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
239         or stdbool.h, because they might not exist while configuring.
240
241         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
242         Don't include unistd.h or limits.h; not needed, since chdir-long.h
243         does that for us.
244         (O_DIRECTORY): Remove.
245
246 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
247
248         Work around a bug in both the Linux and SunOS 64-bit kernels:
249         nanosleep mishandles sleeps for longer than 2**31 seconds.
250         Problem reported by Frank v Waveren in
251         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
252         * nanosleep.c (BILLION): New constant.
253         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
254         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
255
256 2006-08-30  Jim Meyering  <jim@meyering.net>
257
258         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
259         the parameter.
260
261 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
262
263         * isapipe.c, isapipe.h: New files.
264
265 2006-08-29  Eric Blake  <ebb9@byu.net>
266
267         * error.c (error_at_line, print_errno_message): Match libc, after
268         resolution of upstream bug 3044.
269
270 2006-08-29  Bruno Haible  <bruno@clisp.org>
271
272         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
273
274 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
275
276         Sync from Libtool:
277
278         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
279
280         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
281         sharing with gnulib.  Report by Eric Blake.
282
283 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
284
285         * fcntl_.h: New file.
286         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
287         the fcntl module.
288         * dirchownmod.c: Likewise.
289         * fts.c: Likewise.
290
291         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
292         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
293         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
294         just before including <inttypes.h>, to avoid circular inclusion.
295
296 2006-08-28  Bruno Haible  <bruno@clisp.org>
297
298         * inttypes_.h (SCNX*): Remove definitions.
299         Reported by Eric Blake.
300
301 2006-08-26  Bruno Haible  <bruno@clisp.org>
302
303         * vasnprintf.c (EOVERFLOW): Remove definition.
304         (VASNPRINTF): Return a string of length > INT_MAX without failing.
305         * vasprintf.c: Include errno.h, limits.h.
306         (EOVERFLOW): New fallback definition.
307         (vasprintf): Test here whether the string length is > INT_MAX.
308         * vsnprintf.c: Include errno.h, limits.h.
309         (EOVERFLOW): New fallback definition.
310         (vsnprintf): Fix bug when generated string was too long for the buffer.
311         Test here whether the string length is > INT_MAX.
312
313 2006-08-26  Bruno Haible  <bruno@clisp.org>
314             Simon Josefsson  <jas@extundo.com>
315
316         BeOS portability.
317         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
318
319 2006-08-28  Bruno Haible  <bruno@clisp.org>
320
321         * c-strstr.h: New file, from GNU gettext.
322         * c-strstr.c: New file, from GNU gettext.
323
324 2006-08-26  Bruno Haible  <bruno@clisp.org>
325
326         * inttypes_.h: New file.
327         * inttypes.h: Remove file.
328         * stdint_.h: Include <inttypes.h> through its absolute filename.
329
330         * imaxabs.c: New file.
331
332         * imaxdiv.c: New file.
333
334 2006-08-22  Bruno Haible  <bruno@clisp.org>
335
336         * readutmp.h: Skip most definitions if neither <utmp.h> nor
337         <utmpx.h> exists.
338
339 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
340
341         BeOS portability.
342         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
343         Problem reported by Bruno Haible.
344
345 2006-08-21  Bruno Haible  <bruno@clisp.org>
346
347         BeOS portability.
348         * mbchar.h: Include <wctype.h> only if it exists.
349
350 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
351
352         * cycle-check.h: Include <stdint.h> unconditionally, since we
353         now assume the stdint module.  Do not include inttypes.h.
354         * fsusage.h: Likewise.
355         * getndelim2.c: Likewise.
356         * human.h: Likewise.
357         * inttostr.h: Likewise.
358         * obstack.c: Likewise.
359         * regex_internal.h: Likewise.
360         * tempname.c: Likewise.
361         * utimecmp.c: Likewise.
362         * xstrtol.h: Likewise.
363
364         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
365
366         * strtoimax.c: Adjust to macro name changes in Autoconf,
367         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
368         * xtime.h: Likewise.
369
370 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
371
372         * fchmodat.c: New file, from coreutils.  This was inadvertently
373         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
374
375 2006-08-18  Bruno Haible  <bruno@clisp.org>
376
377         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
378         (ME_DUMMY): Treat "kernfs" as a dummy.
379         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
380
381 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
382
383         Update from coreutils.
384
385         * __fpending.h: Add copyright notice.
386         * fprintftime.h: Likewise.
387         * savedir.c: Use (C) in copyright notice.
388         * savedir.h: Likewise.
389
390         2006-08-15  Jim Meyering  <jim@meyering.net>
391
392         * at-func.c: New file, with the logic of all emulated at-functions.
393         * openat-priv.h: Include <errno.h> and define ENOSYS,
394         in support of the EXPECTED_ERRNO macro.
395         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
396         Instead, define the appropriate symbols and include "at-func.c".
397         * mkdirat.c (mkdirat): Likewise.
398         * fchmodat.c (fchmodat): Likewise.
399         (ENOSYS): Remove definition.
400         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
401         Don't include "unistd--.h" -- it wasn't ever used.
402
403         2006-01-17  Jim Meyering  <jim@meyering.net>
404
405         Rewrite fts.c not to change the current working directory,
406         by using openat, fstatat, fdopendir, etc..
407
408         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
409         (HAVE_OPENAT_SUPPORT): Define.
410         [_LIBC] (fchdir): Don't undef or define; no longer used.
411         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
412         Now, this `function' always succeeds, and consumes its file descriptor
413         parameter -- so callers must not close such FDs.  Update callers.
414         (diropen_fd, opendirat, cwd_advance_fd): New functions.
415         (diropen): Add parameter, SP.  Adjust all callers.
416         Implement using diropen_fd, rather than open.
417         (fts_open): Initialize new member, fts_cwd_fd.
418         Remove fts_rft-setting code.
419         (fts_close): Close fts_cwd_fd, if necessary.
420         (__opendir2): Define in terms of opendir or opendirat,
421         depending on whether the FST_NOCHDIR flag is set.
422         (fts_build): Since fts_safe_changedir consumes its FD, and since
423         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
424         and close the dup'd file descriptor upon failure.
425         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
426         (fts_safe_changedir): Tweak semantics to reflect that this function
427         now calls cwd_advance_fd and hence consumes its FD argument.
428         * fts_.h [struct FTS] (fts_cwd_fd): New member.
429         [struct FTS] (fts_rft): Remove now-unused member.
430         [struct FTS] (fts_cycle.state): Improve comment.
431
432         * openat.c (openat_needs_fchdir): New function.
433         * openat.h (openat_needs_fchdir): Declare it.
434
435 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
436
437         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
438         Problem and fix reported by Pádraig Brady in
439         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
440
441 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
442
443         * memcoll.c (memcoll): Optimize for the common case where the
444         arguments are bytewise equal.
445
446 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
447
448         Change copyright notice from LGPL 2 to GPL 2, since that's the
449         standard form used in the gnulib repository.
450         * lock.c: LGPL -> GPL.
451         * lock.h: Likewise.
452         * strnlen1.c: Likewise.
453         * strnlen1.h: Likewise.
454         * tls.c: Likewise.
455         * tls.h: Likewise.
456         * tmpdir.c: Likewise.
457
458         * TODO: Remove; this belongs only in coreutils.
459
460 2006-08-14  Eric Blake  <ebb9@byu.net>
461
462         Import the following change from libc:
463
464         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
465
466         Upstream bug 2997.
467         * misc/error.c: Add space between program name and message if file
468         name is missing.
469
470 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
471
472         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
473         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
474
475         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
476         in wchar_t.  Problem reported by Eric Blake.
477
478         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
479         LEN is smaller than SIZE.  Suggested by Bruno Haible.
480         Also, help the compiler to keep LEN in a register.
481
482 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
483
484         * .cppi-disable: Add snprintf.h, socket_.h.
485         * snprintf.c: Include <errno.h> and <limits.h>.
486         (EOVERFLOW): Define if the system does not.
487         Do not include "minmax.h"; it wasn't used.
488         (snprintf): Don't assume size_t promotes to an unsigned type.
489         Fix bug when generated string was too long for the buffer: the
490         buffer's contents are supposed to be the initial prefix of the
491         output.  Don't assume vasnprintf returns EOVERFLOW if the size
492         exceeds INT_MAX; do the check ourselves.
493
494         Import the following changes from libc:
495
496         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
497
498         * posix/regex_internal.c (re_string_skip_chars): If no character has
499         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
500         to the byte which couldn't be converted.
501         (re_string_reconstruct): Don't clear valid_raw_len before calling
502         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
503         tip_context using re_string_context_at.
504
505         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
506
507         * posix/regex.h: g++ still cannot handled [restrict].
508
509         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
510
511         * posix/regex.h: Remove special handling for VMS.
512
513 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
514
515         Sync from coreutils.
516
517         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
518
519         * mountlist.c [ME_REMOTE]: Filter out cifs.
520         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
521
522 2006-08-08  Eric Blake  <ebb9@byu.net>
523
524         * verror.c (verror_at_line): Work around glibc bug 2997, so that
525         verror_at_line output complies with GNU Coding Standards even when
526         file is NULL.
527
528 2006-08-08  Eric Blake  <ebb9@byu.net>
529
530         * verror.h, verror.c: New files.
531
532 2006-08-07  Bruno Haible  <bruno@clisp.org>
533
534         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
535         versions of AIX.
536         Reported by Ralf Wildenhues.
537
538 2006-08-06  Eric Blake  <ebb9@byu.net>
539
540         * error.h: Fold in some upstream changes from glibc.
541         * error.c: Likewise.
542
543 2006-07-29  Bruno Haible  <bruno@clisp.org>
544
545         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
546
547 2006-07-29  Bruno Haible  <bruno@clisp.org>
548
549         * setenv.c: Undo unintended modification done on 2006-02-27.
550
551 2006-07-28  Eric Blake  <ebb9@byu.net>
552
553         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
554         macro expansion.
555
556 2006-07-28  Simon Josefsson  <jas@extundo.com>
557
558         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
559         #include's.
560
561 2006-07-28  Simon Josefsson  <jas@extundo.com>
562
563         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
564         #include's.
565
566 2006-07-28  Bruno Haible <bruno@clisp.org>
567
568         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
569
570 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
571
572         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
573         arpa/inet.h.
574
575 2006-07-28  Bruno Haible  <bruno@clisp.org>
576
577         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
578         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
579         fallbacks.
580         Avoids link error on FreeBSD 4.x.
581         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
582
583         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
584         encoding.
585         * mbswidth.c (iswcntrl): Likewise.
586
587 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
588
589         * modechange.c (mode_compile): Numeric modes now affect setuid and
590         setgid on directories only if they set these bits.
591         * modechange.h: Remove obsolete comment about masks.
592
593 2006-07-27  Bruno Haible  <bruno@clisp.org>
594
595         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
596         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
597         defined.
598
599 2006-07-26  Eric Blake  <ebb9@byu.net>
600
601         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
602         like mingw that lack mkstemp.
603         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
604         avoid compilation warning on mingw.
605
606 2006-07-25  Bruno Haible  <bruno@clisp.org>
607
608         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
609         <stdarg.h> or config.h.
610
611 2006-07-24  Bruno Haible  <bruno@clisp.org>
612
613         * clean-temp.h: New file, from GNU gettext.
614         * clean-temp.c: New file, from GNU gettext.
615
616 2006-07-24  Bruno Haible  <bruno@clisp.org>
617
618         * tmpdir.h: New file, from GNU gettext.
619         * tmpdir.c: New file, from GNU gettext.
620
621 2006-07-23  Bruno Haible  <bruno@clisp.org>
622
623         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
624         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
625         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
626         gl_linked_remove_at): Use it.
627
628 2006-07-23  Eric Blake  <ebb9@byu.net>
629
630         * tmpfile-safer.c: New file.
631         * stdio-safer.h (fopen_safer): Add prototype.
632         * stdio--.h (tmpfile): Make safer.
633
634 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
635
636         * close-stream.c, close-stream.h: New files.
637
638 2006-07-22  Bruno Haible  <bruno@clisp.org>
639
640         Merge from GNU gettext 0.15.
641
642         2005-07-05  Bruno Haible  <bruno@clisp.org>
643
644                 * printf-args.c (printf_fetchargs): Work around broken
645                 definition of wint_t on mingw.
646
647         2005-02-12  Bruno Haible  <bruno@clisp.org>
648
649                 * xallocsa.h: Add extern "C" for C++.
650
651         2006-05-17  Bruno Haible  <bruno@clisp.org>
652
653                 Cygwin portability.
654                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
655
656         2006-04-30  Bruno Haible  <bruno@clisp.org>
657
658                 * progreloc.c: Include <mach-o/dyld.h> if available.
659                 (find_executable): Use _NSGetExecutablePath when possible.
660
661         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
662
663                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
664                 function.
665
666         2005-12-29  Bruno Haible  <bruno@clisp.org>
667
668                 * progreloc.c (set_program_name_and_installdir): Fix
669                 compilation error.
670
671         2005-12-04  Bruno Haible  <bruno@clisp.org>
672
673                 Cygwin portability.
674                 * progreloc.c: Include <windows.h> also on Cygwin.
675                 (find_executable): Add support for Cygwin.
676                 (set_program_name_and_installdir): Handle also platforms with
677                 nonempty EXEEXT.
678
679         2006-07-11  Bruno Haible  <bruno@clisp.org>
680
681                 * javacomp.c: Fix a comment.
682                 Reported by Jim Meyering.
683
684         2006-04-30  Bruno Haible  <bruno@clisp.org>
685
686                 * javacomp.h (compile_java_class): Add source_version,
687                 target_version arguments.
688                 * javacomp.c: Rewritten to choose only a compiler that
689                 respects the specified source_version and target_version.
690
691         2006-06-27  Bruno Haible  <bruno@clisp.org>
692
693                 Assume correct S_ISDIR macro.
694                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
695
696         2006-07-22  Bruno Haible  <bruno@clisp.org>
697
698                 * javaversion.h: New file, from GNU gettext.
699                 * javaversion.c: New file, from GNU gettext.
700                 * javaversion.java: New file, from GNU gettext.
701                 * javaversion.class: New file, from GNU gettext.
702
703         2006-05-17  Bruno Haible  <bruno@clisp.org>
704
705                 Cygwin portability.
706                 * javaexec.c (execute_java_class): Test for jview program
707                 also on Cygwin.
708
709         2006-04-09  Bruno Haible  <bruno@clisp.org>
710
711                 * fatal-signal.c: Don't include string.h.
712                 (at_fatal_signal): Use a copying loop instead of memcpy.
713
714         2005-12-04  Bruno Haible  <bruno@clisp.org>
715
716                 * csharpexec.c: Add support for 'clix' launcher (untested).
717                 (execute_csharp_using_sscli): New function.
718                 (execute_csharp_program): Call it.
719
720         2006-06-21  Bruno Haible  <bruno@clisp.org>
721
722                 Avoid warnings from recent versions of mcs.
723                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
724                 -o, -L, -r any more. Use options documented since mcs-1.0
725                 instead. Similarly for -g.
726
727         2005-07-09  Bruno Haible  <bruno@clisp.org>
728
729                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
730                 add a .dll suffix.
731                 Reported by Mark Junker <mjscod@gmx.de>.
732
733         2006-06-17  Bruno Haible  <bruno@clisp.org>
734
735                 * config.charset: Update for NetBSD 3.0.
736
737         2006-05-17  Bruno Haible  <bruno@clisp.org>
738
739                 Cygwin portability.
740                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
741
742         2006-05-16  Bruno Haible  <bruno@clisp.org>
743
744                 * localcharset.c [CYGWIN]: Include <windows.h>.
745                 (get_charset_aliases): For Cygwin, return the same CPxxx
746                 aliases list as under WIN32.
747                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
748                 the environment variables. Fall back to GetACP().
749
750         2006-04-05  Bruno Haible  <bruno@clisp.org>
751
752                 * config.charset: Update Juan Manuel Guerrero's address.
753
754         2005-02-12  Bruno Haible  <bruno@clisp.org>
755
756                 * allocsa.h: Add extern "C" for C++.
757
758         2005-02-10  Bruno Haible  <bruno@clisp.org>
759
760                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
761                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
762
763         2006-07-22  Bruno Haible  <bruno@clisp.org>
764
765                 * gettext.h: Update to GNU gettext-0.15.
766
767 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
768         and Simon Josefsson <jas@extundo.com>
769
770         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
771
772         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
773
774 2006-07-21  Eric Blake  <ebb9@byu.net>
775
776         * stdlib-safer.h: New file from coreutils, required by
777         stdlib--.h.
778
779 2006-07-19  Derek R. Price  <derek@ximbiot.com>
780
781         * getaddrinfo.h: Don't define unimplemented AI_* flags.
782         Reindent and repaginate.
783
784 2006-07-17  Bruno Haible  <bruno@clisp.org>
785
786         * gl_list.h: New file.
787         * gl_list.c: New file.
788         * gl_array_list.h: New file.
789         * gl_array_list.c: New file.
790         * gl_carray_list.h: New file.
791         * gl_carray_list.c: New file.
792         * gl_linked_list.h: New file.
793         * gl_linked_list.c: New file.
794         * gl_anylinked_list1.h: New file.
795         * gl_anylinked_list2.h: New file.
796         * gl_avltree_list.h: New file.
797         * gl_avltree_list.c: New file.
798         * gl_anyavltree_list1.h: New file.
799         * gl_anyavltree_list2.h: New file.
800         * gl_rbtree_list.h: New file.
801         * gl_rbtree_list.c: New file.
802         * gl_anyrbtree_list1.h: New file.
803         * gl_anyrbtree_list2.h: New file.
804         * gl_anytree_list1.h: New file.
805         * gl_anytree_list2.h: New file.
806         * gl_linkedhash_list.h: New file.
807         * gl_linkedhash_list.c: New file.
808         * gl_anyhash_list1.h: New file.
809         * gl_anyhash_list2.h: New file.
810         * gl_avltreehash_list.h: New file.
811         * gl_avltreehash_list.c: New file.
812         * gl_rbtreehash_list.h: New file.
813         * gl_rbtreehash_list.c: New file.
814         * gl_anytreehash_list1.h: New file.
815         * gl_anytreehash_list2.h: New file.
816
817         * gl_oset.h: New file.
818         * gl_oset.c: New file.
819         * gl_array_oset.h: New file.
820         * gl_array_oset.c: New file.
821         * gl_avltree_oset.h: New file.
822         * gl_avltree_oset.c: New file.
823         * gl_rbtree_oset.h: New file.
824         * gl_rbtree_oset.c: New file.
825         * gl_anytree_oset.h: New file.
826
827 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
828
829         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
830         New files.
831         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
832         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
833         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
834         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
835         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
836         callers changed.  Revamp internals significantly, by not
837         attempting to create directories that are temporarily more
838         permissive than the final results.  Do not attempt to use
839         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
840         This removes some race conditions, fixes some bugs, and simplifies
841         things.  Use new dirchownmod function to do owner and mode changes.
842         * mkdir-p.h: Likewise.
843         * modechange.c (octal_to_mode): New function.
844         (struct mode_change): New member mentioned.
845         (make_node_op_equals): New arg mentioned.  All callers changed.
846         (mode_compile): Keep track of which mode bits the user has explicitly
847         mentioned.
848         (mode_adjust): New arg DIR, so that we implement the X op correctly.
849         New arg PMODE_BITS, to keep track of which mode bits the user
850         mentioned; it treats S_ISUID and S_ISGID speciall.
851         All callers changed.
852         * modechange.h: Likewise.
853
854 2006-07-11  Derek R. Price  <derek@ximbiot.com>
855
856         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
857
858 2006-07-10  Derek R. Price  <derek@ximbiot.com>
859
860         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
861         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
862         macros into the GNU _D_EXACT_NAMLEN.
863         * savedir.c:  Likewise.
864         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
865
866 2006-07-09  Jim Meyering  <jim@meyering.net>
867
868         * argp-pv.c: Remove a doubled word in a comment.
869         * check-version.c (check_version): Likewise.
870         * javacomp.c (compile_java_class): Likewise.
871
872 2006-07-08  Jim Meyering  <jim@meyering.net>
873
874         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
875
876 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
877
878         * getaddrinfo.c: Changes to compile under MSVC6: changed
879         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
880         brackets.  Other minor changes to suppress some compiler
881         warnings.
882
883 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
884
885         * getloadavg.c: Use __VMS, not VMS.
886         * getopt.c: Likewise.
887         * getpagesize.h: Likewise.
888         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
889         probably does not work.
890
891 2006-07-06  Derek R. Price  <derek@ximbiot.com>
892         and Paul Eggert  <eggert@cs.ucla.edu>
893
894         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
895         Don't worry about this obsolete case any more.
896         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
897         directories.
898         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
899         worry about this obsolete case any more.
900         * fts.c: Likewise.
901         * getcwd.c: Likewise.
902         * glob.h: Likewise.
903         * savedir.c: Likewise.
904
905 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
906
907         * .cppi-disable: Add wcwidth.
908         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
909         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
910         (ISGRAPH): Remove.  All uses changed to isgraph.
911         (FOLD) [!defined _LIBC]: Remove special case.
912         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
913         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
914         HAVE_ISBLANK.
915         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
916
917 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
918
919         * strtod.c (strtod): cast the argument of tolower to unsigned char.
920
921 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
922
923         * memcasecmp.c: Include <limits.h>.
924         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
925         * strtod.c (strtod): Don't assume isspace works on negative chars.
926         Don't assume isdigit succeeds only on '0' through '9'.
927
928 2006-07-05  Derek R. Price  <derek@ximbiot.com>
929
930         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
931         All uses of is_space replaced by isspace.
932         * exit.h: Don't talk about STDC_HEADERS.
933         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
934         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
935         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
936         replaced by isprint etc.
937         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
938         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
939         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
940         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
941         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
942         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
943
944 2006-07-05  Eric Blake  <ebb9@byu.net>
945
946         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
947         missing from netdb.h.
948         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
949
950 2006-06-27  Bruno Haible  <bruno@clisp.org>
951
952         Assume ANSI C header files and <ctype.h> functions.
953         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
954         (mbsnwidth): Use isprint, iscntrl instead.
955
956 2006-07-03  Jim Meyering  <jim@meyering.net>
957
958         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
959         macro is used before the first cycle_check call.
960
961 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
962
963         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
964         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
965         reported by Mark D. Baushke, one in
966         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
967
968         Merge from coreutils.
969
970         * .cppi-disable: Add stdint_.h.
971         * .cvsignore: Add stdint.h.
972
973         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
974
975         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
976         both double and long double versions.
977         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
978         * xstrtold.c: New file.
979         * xstrtod.h (xstrtold): New decl.
980
981         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
982
983         * filemode.c (setst): Remove.
984         (strmode): Rewrite to avoid setst.  This makes the code shorter,
985         (arguably) clearer, and the generated code is a bit smaller on my
986         Debian GNU/Linux stable x86 host.
987
988         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
989
990         * filemode.c: Include "filemode.h" first, to test the interface.
991         Assume that filemode.h includes sys/types.h and sys/stat.h.
992         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
993         (ftypelet): Reorder to put common cases first, for efficiency.
994         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
995         to do 'M'.
996         (strmode): Renamed from mode_string, and now stores 12 bytes instead
997         of 10, for compatibility with FreeBSD.  All callers changed.
998         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
999         that can't be deduced solely from st_mode.  First arg is now a const
1000         pointer.
1001         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1002         (strmode): Renamed from mode_string.
1003         (filemodestring): New decl.
1004         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1005         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1006         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1007
1008         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1009
1010         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1011         fsusage.h now does that.  Include fsusage.h first, to test interface.
1012         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1013         at most one method (the old code could have generated decls that
1014         didn't conform to C89, not that this was ever exercised).
1015         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1016
1017         2006-03-19  Jim Meyering  <jim@meyering.net>
1018
1019         Work even in a chroot where d_ino values for entries in "/"
1020         don't match the stat.st_ino values for the same names.
1021         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1022         number, iterate through all entries again, using lstat instead.
1023         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1024         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1025
1026         * getcwd.c (__getcwd): Clarify a comment.
1027         Use memcpy in place of a call to strcpy.
1028
1029         2006-03-12  Jim Meyering  <jim@meyering.net>
1030
1031         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1032         that of the current directory (which we're about to chdir ".." out of),
1033         then save the dev-ino of the parent, instead.
1034
1035         * same-inode.h (SAME_INODE): New file/macro.
1036         * chdir-safer.c (SAME_INODE): Remove definition.
1037         Include "same-inode.h", instead.
1038         * same.c: Likewise.
1039         * cycle-check.h: Include "same-inode.h".
1040         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1041         * cycle-check.c (SAME_INODE): Remove definition.
1042         * root-dev-ino.h: Include "same-inode.h".
1043
1044         2006-03-11  Eric Blake  <ebb9@byu.net>
1045
1046         * same.c (same_name): s/base_name/last_component/
1047         * backupfile.c (check_extension, numbered_backup): Likewise.
1048         * filenamecat.c (file_name_concat): Likewise.
1049
1050         2006-03-11  Eric Blake  <ebb9@byu.net>,
1051                     Paul Eggert  <eggert@cs.ucla.edu>
1052
1053         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1054         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1055         drive prefix.
1056         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1057         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1058         (last_component): New method.
1059         * dirname.c (dir_len): Determine when drive letters need a
1060         subsequent slash.  Preserve // when it is special.
1061         (dir_name): Don't append dot when drive letter is absolute.
1062         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1063         * basename.c (base_name): New semantics - malloc the result.
1064         Preserve // when it is special.  Preserve relative files that look
1065         like drive letters.
1066         (base_len): Preserve // when it is special.
1067         (last_component): New method, similar to old base_name semantics.
1068         * stripslash.c (strip_trailing_slashes): Use last_component, not
1069         base_name.  Strip redundant slashes from ///.
1070
1071 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1072
1073         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1074         both are 64 bits, since this seems to be the tradition, and this
1075         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1076         we ever run into a host that prefers long long to long in this
1077         case, we'll need another configure-time test.  Problem reported by
1078         Jim Meyering.
1079
1080 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1081
1082         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1083         possible collision with system files.
1084         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1085         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1086         WCHAR_MIN and WCHAR_MAX in this case.
1087         (<stddef.h>): Do not include; no longer needed.
1088         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1089         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1090         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1091         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1092         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1093         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1094         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1095         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1096         !defined(__c99))]: Include in this case too, since it's harmless
1097         now.
1098         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1099         dangerous to do so.
1100         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1101         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1102         (_STDINT_MIN, _STDINT_MAX): New macros.
1103         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1104         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1105         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1106         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1107         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1108         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1109         macros, not typedefs; this simplifies things quite a bit.
1110         Use long int for all types narrower than int64_t.
1111         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1112         Define in terms of long long int or int64_t or long int,
1113         not int64_t or int32_t.  This saves some compile-time testing.
1114         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1115         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1116         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1117         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1118         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1119         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1120         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1121         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1122         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1123         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1124         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1125         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1126         undef any previous version and define our own version, for
1127         simplicity and consistency with the new macros for types.
1128         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1129         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1130         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1131         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1132         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1133         @WINT_T_SUFFIX@ to keep things simple here.
1134         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1135         Simplify by assuming typical 8/16/32/64 host, since we're
1136         already doing that elsewhere anyway.
1137         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1138         and assume long long int is 64 bits if available.  This
1139         speeds up 'configure'.
1140
1141 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1142
1143         * getaddrinfo.c: fixed typo
1144
1145 2006-06-29  Eric Blake  <ebb9@byu.net>
1146
1147         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1148         unused static function.
1149
1150 2006-06-29  Eric Blake  <ebb9@byu.net>
1151
1152         * stat_.h: New file.
1153
1154 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1155
1156         * strftime.c: Assume strftime() exists.
1157
1158 2006-06-28  Bruno Haible  <bruno@clisp.org>
1159
1160         * getaddrinfo.h: Fix POSIX URL.
1161         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1162         (use_win32_p): Make static.
1163         (getaddrinfo): Reject service name if it is empty or does not consist
1164         solely of decimal digits, or if its value is > 65535.
1165         (getnameinfo): Remove useless casts.
1166
1167 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1168
1169         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1170         Autoconf 2.60 says this stuff was obsolete.
1171
1172 2006-05-12  Bruno Haible  <bruno@clisp.org>
1173
1174         * mkdtemp.c [MINGW]: Include <io.h>.
1175         (mkdir): Define using _mkdir.
1176
1177 2006-06-28  Bruno Haible  <bruno@clisp.org>
1178
1179         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1180         declaration for wcwidth.
1181         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1182
1183 2006-06-28  Eric Blake  <ebb9@byu.net>
1184
1185         * xvasprintf.h: Fix comments.
1186
1187 2006-06-28  Eric Blake  <ebb9@byu.net>
1188
1189         * mbchar.h (wcwidth): Include wcwidth.h.
1190         * mbswidth.c (wcwidth): Move from here...
1191         * wcwidth.h: ...to this new file.
1192
1193 2006-06-28  Simon Josefsson  <jas@extundo.com>
1194
1195         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1196         functions there.  It will succeed on Windows XP, but on Windows
1197         2000 and (presumably) earlier, it will fail, and use the internal
1198         re-implementation.
1199         (use_win32_p): New function.
1200         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1201         Support AI_NUMERICSERV to disable getservbyname.
1202         (getnameinfo): New function, only supports
1203         NI_NUMERICHOST|NI_NUMERICSERV for now.
1204
1205         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1206         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1207         getnameinfo.
1208
1209 2006-06-27  Bruno Haible  <bruno@clisp.org>
1210
1211         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1212
1213 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1214
1215         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1216         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1217         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1218
1219 2006-06-26  Bruno Haible  <bruno@clisp.org>
1220
1221         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1222         WCHAR_MAX.
1223         Reported by Mark D. Baushke and Larry Jones.
1224
1225 2006-06-26  Bruno Haible  <bruno@clisp.org>
1226
1227         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1228         in pre-C99 mode.
1229         Suggested by Mark D. Baushke and Larry Jones.
1230
1231 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1232
1233         * stdint_.h: Treat BSD/OS like OpenBSD.
1234
1235 2006-06-23  Bruno Haible  <bruno@clisp.org>
1236
1237         * stdint_.h: Treat IRIX like OpenBSD.
1238
1239 2006-06-23  Bruno Haible  <bruno@clisp.org>
1240
1241         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1242         ISO C 99 Technical Corrigendum 1.
1243
1244 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1245
1246         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1247         Some compiler complained about some of them.  Problem reported by
1248         Larry Jones in
1249         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1250
1251 2006-06-21  Simon Josefsson  <jas@extundo.com>
1252
1253         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1254         variable.
1255
1256         * socket_.h: Don't define WINVER.
1257
1258         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1259         slightly modified to work in gnulib.
1260
1261 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1262
1263         * read-file.c (fread_file): Start with buffer allocation of
1264         0 bytes rather than 1 byte; this simplifies the code.
1265         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1266         code to free buffer and save/restore errno.
1267         (internal_read_file): Remove unused local.
1268
1269 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1270
1271         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1272         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1273         Problem reported by Denis Excoffier in
1274         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1275
1276 2006-06-19  Simon Josefsson  <jas@extundo.com>
1277
1278         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1279
1280 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1281
1282         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1283
1284 2006-06-17  Bruno Haible  <bruno@clisp.org>
1285
1286         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1287
1288 2006-06-17  Bruno Haible  <bruno@clisp.org>
1289
1290         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1291         problem on Solaris 2.5.1.
1292
1293 2006-06-16  Eric Blake  <ebb9@byu.net>
1294
1295         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1296         * unicodeio.c [!defined errno]: Likewise.
1297         * strtol.c [!defined errno]: Likewise.
1298         * strtod.c [!defined errno]: Likewise.
1299
1300 2006-06-15  Bruno Haible  <bruno@clisp.org>
1301
1302         * stdint_.h: Rewritten to be fully auto-configured.
1303         Fixes bug on HP-UX/IA64.
1304
1305 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1306
1307         * getdate.y (__attribute__): Don't define if already defined.
1308         Problem reported by Larry Jones.
1309         * utimens.c (__attribute__): Likewise.
1310
1311 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1312
1313         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1314         reported by Andreas Schwab.
1315
1316 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1317             Bruno Haible  <bruno@clisp.org>
1318
1319         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1320
1321 2006-05-26  Martin Lambers  <marlam@marlam.de>
1322
1323         * getpass.c: Updates the test for the native W32 API, and adds
1324         missing includes, thus fixing compilation warnings.
1325
1326 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1327
1328         * tempname.c (small_open, large_open): New macros.
1329         (__open, __open64) [!_LIBC]: Remove.
1330         (__gen_tempname): Use small_open and large_open instead of __open
1331         and __open64.  This fixes a portability bug on HP-UX 11.11i
1332         reported by Simon Wing-Tang in
1333         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1334
1335 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1336
1337         * exclude.c (exclude_fnmatch): New function.
1338         (excluded_file_name): Call exclude_fnmatch.
1339         * exclude.h (excluded_file_name): New prototype
1340
1341 2006-05-24  Bruno Haible  <bruno@clisp.org>
1342
1343         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1344         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1345         Reported by Thorsten Maerz <torte@netztorte.de> via
1346         Aaron Stone <aaron@serendipity.cx>.
1347
1348 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1349
1350         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1351         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1352         (my_usleep): Don't mishandle maximum value.
1353
1354 2006-05-19  Jim Meyering  <jim@meyering.net>
1355
1356         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1357
1358 2006-05-17  Bruno Haible  <bruno@clisp.org>
1359
1360         Cygwin portability.
1361         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1362
1363 2006-05-17  Bruno Haible  <bruno@clisp.org>
1364
1365         * stdint_.h: Fix recognition of Cygwin.
1366
1367 2006-05-11  Jim Meyering  <jim@meyering.net>
1368
1369         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1370
1371 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1372
1373         * crc.c (crc32_update): Remove unnecessary L suffix.
1374         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1375         unwanted sign propagation, e.g., on hosts with 64-bit int.
1376         There still are some problems with reeelly weird theoretical hosts
1377         (e.g., 33-bit int) but it's not worth worrying about now.
1378         * sha1.c (rol): Likewise.
1379         (K1, K2, K3, K4): Remove unnecessary L suffix.
1380
1381 2006-05-10  Bruno Haible  <bruno@clisp.org>
1382
1383         * des.c: Cast to avoid warnings.
1384
1385 2006-05-10  Simon Josefsson  <jas@extundo.com>
1386
1387         * md4.c: Typo fix, update copyright years.
1388         (K1, K2): Don't use L because it turn computations into 64-bit on
1389         64-bit platforms.
1390
1391 2006-05-09  Bruno Haible  <bruno@clisp.org>
1392
1393         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1394         (EOVERFLOW): Define fallback value.
1395         (xstrcat): New function.
1396         (xvasprintf): Recognize the special case of a string concatenation.
1397
1398 2006-05-01  Bruno Haible  <bruno@clisp.org>
1399
1400         * stdint_.h: Shorter URL.
1401         * inttypes.h: Likewise.
1402
1403 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1404
1405         * verify.h: Document the internals better.  Most of this change
1406         was written by Bruno Haible.
1407
1408 2006-04-29  Bruno Haible  <bruno@clisp.org>
1409
1410         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1411         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1412
1413 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1414
1415         * getdate.y (get_date): When adding relative date, start with the
1416         initial time, not with the result of the first mktime call.
1417
1418 2006-04-23  Bruno Haible  <bruno@clisp.org>
1419
1420         * copy-file.c: Include <unistd.h> unconditionally.
1421         * execute.c: Likewise.
1422         * fatal-signal.c: Likewise.
1423         * findprog.c: Likewise.
1424         * mkdtemp.c: Likewise.
1425         * pipe.h: Likewise.
1426         * pipe.c: Likewise.
1427         * wait-process.h: Likewise.
1428
1429 2006-04-23  Bruno Haible  <bruno@clisp.org>
1430
1431         * fwriteerror.c (fwriteerror): Call fclose also when an error
1432         condition was already detected.
1433         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1434
1435 2006-04-19  Derek Price  <derek@ximbiot.com>
1436             Eric Blake  <ebb9@byu.net>
1437
1438         * inttypes.h: Correct grammar in comment.
1439
1440 2006-04-18  Derek Price  <derek@ximbiot.com>
1441             Paul Eggert  <eggert@cs.ucla.edu>
1442
1443         * inttypes.h: New file.
1444         * strtoimax.c: Assume <inttypes.h>.
1445
1446 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1447
1448         * utimens.c (futimens): glibc futimesat messes up if /proc
1449         isn't mounted.  Problem reported by Kir Kolyshkin.
1450
1451 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1452
1453         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1454         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1455         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1456
1457 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1458
1459         Merge regex changes from libc, removing some of our
1460         POSIX-conformance changes that were rejected and redoing them in a
1461         less-intrusive way.
1462
1463         * regcomp.c (re_compile_internal, init_dfa):
1464         Length arg is now size_t, not Idx.  All uses changed.
1465         (peek_token): Forward decl now says internal_function.
1466         (__re_error_msgid, __re_error_msgid_idx):
1467         Now static rather than extern with attribute_hidden.
1468         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1469         For some reason libc prefers K&R style defns for external functions.
1470         (regerror) [!defined _LIBC]: Likewise.
1471         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1472         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1473         (build_range_exp, build_collating_symbol):
1474         Use K&R-style defn.
1475         (re_compile_fastmap): Use '\0' to memset, not 0.
1476         (utf8_sb_map): Make the calculations more obvious.
1477         (init_dfa, parse_bracket_exp, build_charclass_op):
1478         Call calloc and cast result, as glibc does.
1479         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1480         (build_range_exp, build_collating_symbol):
1481         Now internal functions.
1482
1483         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1484
1485         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1486         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1487         Don't depend on VMS; depend on __VMS instead, for POSIX
1488         namespace cleanness.
1489         (regoff_t): Define to ssize_t, not long int.
1490
1491         Remove the REG_ macros named below.  Instead, make the old names
1492         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1493         __USE_GNU_REGEX.
1494         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1495         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1496         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1497         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1498         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1499         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1500         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1501         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1502         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1503         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1504         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1505         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1506         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1507         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1508         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1509         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1510         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1511         (REG_NREGS):
1512         Remove.  All uses replaced by the old RE_* names.
1513         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1514         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1515         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1516         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1517         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1518         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1519         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1520         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1521         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1522         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1523         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1524         Don't bother having these macros be independent of each others'
1525         values, since they no longer exist in the POSIX name space.
1526
1527         Rename the following member names back to their old names,
1528         unless !__USE_GNU_REGEX.  All uses changed back.
1529         (buffer): Renamed from re_buffer.
1530         (allocated): Renamed from re_allocated.
1531         (used): Renamed from re_used.
1532         (syntax): Renamed from re_syntax.
1533         (fastmap): Renamed from re_fastmap.
1534         (translate): Renamed from re_translate.
1535         (can_be_null): Renamed from re_can_be_null.
1536         (regs_allocated): Renamed from re_regs_allocated.
1537         (fastmap_accurate): Renamed from re_fastmap_accurate.
1538         (no_sub): Renamed from re_no_sub.
1539         (not_bol): Renamed from re_not_bol.
1540         (not_eol): Renamed from re_not_eol.
1541         (newline_anchor): Renamed from re_newline_anchor.
1542         (num_regs): Renamed from rm_num_regs.
1543         (start): Renamed from rm_start.
1544         (end): Renamed from rm_end.
1545
1546         (free_state): Move up a bit.
1547
1548         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1549         #define to be empty.
1550         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1551         when that is what is intended.
1552         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1553         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1554         (MAX): New macro.
1555         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1556         All uses changed back to re_malloc, etc.  It's now the caller's
1557         responsibility to check for overflow; all callers changed.
1558         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1559         (re_x2nrealloc): Remove.
1560         (free_state): Remove decl.
1561
1562         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1563         (re_set_registers, re_exec):
1564         Use K&R-style defn.
1565
1566         2006-01-31  Roland McGrath  <roland@redhat.com>
1567
1568         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1569         Reported by Mike Frysinger <vapier@gentoo.org>.
1570
1571         2006-01-15  Andreas Jaeger  <aj@suse.de>
1572
1573         [BZ #1950]
1574         * regex_internal.c (re_string_reconstruct): Adjust for
1575         build_wcs_upper_buffer change.
1576         (build_wcs_upper_buffer): Change return type.
1577
1578         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1579
1580         * regex_internal.h: Include <stdint.h> if available.
1581
1582         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1583
1584         * regex_internal.h (SIZE_MAX): Provide a default definition.
1585
1586         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1587
1588         * regcomp.c: Adjust for changed secondary hash function.
1589
1590         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1591
1592         * regex.h: Pretty printing.
1593         Clean up namespace a bit.
1594
1595         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1596
1597         * regexec.c (update_cur_sifted_state, check_arrival,
1598         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1599
1600         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1601                     Ulrich Drepper  <drepper@redhat.com>
1602
1603         [BZ #1302]
1604         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1605         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1606
1607         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1608
1609         [BZ #281]
1610         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1611         * regcomp.c: Remove unnecessary uses of
1612         unsigned RE_TRANSLATE_TYPE.
1613         * regex_internal.h: Likewise.
1614         * regex_internal.c: Likewise.
1615         * regexec.c: Likewise.
1616         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1617
1618         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1619
1620         * regexec.c (find_recover_state): Remove unnecessary
1621         initialization.
1622         (transit_state_bkref): Make DFA a const pointer.
1623         (get_subexp): Likewise.
1624         (check_arrival): Likewise.
1625         (update_cur_sifted_state): Likewise.
1626         (re_search_internal): Likewise.
1627         (prune_impossible_nodes): Likewise.
1628         (acquire_init_state_context): Likewise.
1629         (proceed_next_node): Likewise.
1630         (set_regs): Likewise.
1631         (free_fail_stack_return): Likewise.
1632         (check_arrival_expand_ecl): Mark DFA parameter as const.
1633         (check_arrival_expand_ecl_sub): Likewise.
1634         (check_subexp_limits): Likewise.
1635         (sub_epsilon_src_nodes):  Likewise.
1636         (add_epsilon_src_nodes):  Likewise.
1637         (merge_state_array): Likewise.
1638         (update_regs): Likewise.
1639         (build_trtable): Likewise.
1640         (sift_states_backward): Mark MCTX parameter as const.
1641         (build_sifted_states): Likewise.
1642         (update_cur_sifted_state): Likewise.
1643         (sift_states_mkref): Likewise.
1644         (check_arrival_expand_ecl): Mark eclosure as const.
1645         (check_dst_limits_calc_pos_1): Likewise.
1646         * regex_internal.h (re_match_context_t): Make dfa a const
1647         pointer.
1648
1649         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1650
1651         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1652         (transit_state_sb): Likewise.
1653         (transit_state_mb): Likewise.
1654         (sift_states_iter_mb): Likewise.
1655         (check_arrival_add_next_nodes): Likewise.
1656         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1657         [_LIBC] (re_search_2_stub): Use mempcpy.
1658
1659         * regex_internal.c (re_string_reconstruct): Avoid calling
1660         mbrtowc for very simple UTF-8 case.
1661
1662         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1663         a pointer-to-const.
1664         (re_acquire_state_context): Likewise.
1665         * regex_internal.h: Adjust prototypes.
1666
1667         * regex.c: Prevent using C++ compilers.
1668
1669         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1670         (re_acquire_state_context): Likewise.
1671
1672 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1673             Bruno Haible  <bruno@clisp.org>
1674
1675         * stdint_.h: On OpenBSD, don't redefine types already included in
1676         <sys/types.h> and <inttypes.h>.
1677
1678 2006-03-24  Eric Blake  <ebb9@byu.net>
1679
1680         * time_r.c (copy_string_result): Remove, as it is no longer used.
1681
1682 2006-03-24  Simon Josefsson  <jas@extundo.com>
1683
1684         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1685         including some doc fixes.
1686         (base64_encode_alloc): Fix +1 bug on allocation failures.
1687
1688 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1689
1690         * base64.c (base64_encode): Do not read past end of array with
1691         unsanitized input on systems with CHAR_BIT > 8.
1692
1693 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1694
1695         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1696         Typedef to long int, not to off_, as POSIX will likely change
1697         in that direction.
1698
1699 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1700
1701         * argp-help.c (validate_uparams): Fix typo
1702         * argp-parse.c (argp_default_options): Consistently begin help
1703         messages with a lowercase letter.
1704
1705 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1706
1707         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1708         overrun buffers and shouldn't be used (much as gets shouldn't be
1709         used).
1710         * time_r.c (asctime_r, ctime_r): Likewise.
1711
1712 2006-03-08  Simon Josefsson  <jas@extundo.com>
1713
1714         * gc-gnulib.c (randomize): Don't open files called 'no', they
1715         signal that configure disabled the device.
1716
1717 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1718
1719         * c-stack.c: Include unistd.h unconditionally, since we now assume
1720         the unistd module.
1721         * getlogin_r.c: Likewise.
1722         * getlogin_r.h: Likewise.
1723         * glob.c: Likewise.
1724         * pagealign_alloc.c: Likewise.
1725         * unistd_.h: Remove; no longer needed.
1726
1727 2006-03-07  Simon Josefsson  <jas@extundo.com>
1728
1729         * unistd_.h: New file.
1730
1731 2006-03-07  Simon Josefsson  <jas@extundo.com>
1732
1733         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1734
1735 2006-03-01  Simon Josefsson  <jas@extundo.com>
1736
1737         * readline.c: Fix typo, tiny patch from Stepan Kasal
1738         <kasal@ucw.cz>.
1739
1740 2006-02-28  Simon Josefsson  <jas@extundo.com>
1741
1742         * getopt.c: Protect #include of unistd.h, for MSVS.
1743
1744 2006-02-27  Simon Josefsson  <jas@extundo.com>
1745
1746         * base64.h: Indent #define's.  From Jim Meyering
1747         <jim@meyering.net>.
1748
1749 2006-02-27  Jim Meyering  <jim@meyering.net>
1750
1751         Revert the change of 2006-02-24, so these files can continue
1752         to be sync'd from gettext.
1753         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1754         of `config.h'.
1755
1756 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1757
1758         * glob.c: Say "invalid" rather than "illegal" in comments.
1759
1760 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1761
1762         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1763
1764 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1765
1766         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1767         AT_FDCWD exceeds INT_MAX.
1768         * openat.h (AT_FDCWD): Likewise.
1769
1770 2006-02-14  Jim Meyering  <jim@meyering.net>
1771
1772         Sync from coreutils.
1773
1774         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1775         failure on deficient systems, and simplify gnulib lgpl dependencies.
1776         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1777         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1778
1779         * xalloc-die.c: Remove unused definition of N_.
1780
1781 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1782
1783         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1784
1785 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1786
1787         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1788         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1789
1790 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1791
1792         * argp-namefrob.h: Restore changes accidentally lost during the
1793         "autoupdate" on 2005-12-12.
1794
1795 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1796
1797         * fnmatch.c (L_): Renamed from L, to work around a bug in
1798         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1799         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1800         All uses changed.
1801
1802 2006-01-26  Simon Josefsson  <jas@extundo.com>
1803
1804         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1805         prototype is visible on mingw32.
1806
1807         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1808         for mingw32.
1809
1810         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1811         mingw32).
1812
1813 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1814
1815         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1816         attempt to open for write; this always fails, at least on POSIX
1817         hosts.  This reinstates the 2006-01-09 change, which was
1818         inadvertently removed.
1819
1820 2006-01-26  Bruno Haible  <bruno@clisp.org>
1821             Paul Eggert  <eggert@cs.ucla.edu>
1822
1823         * stdbool_.h (_Bool)
1824         [(! (defined __cplusplus || defined __BEOS__)
1825           && !defined __GNUC__
1826           && !(defined __HP_cc || defined __xlc__
1827                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1828                || defined __sgi))]:
1829         #define to signed char in these cases too; this simplifies
1830         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1831         etc., separately) and makes it more conservative.
1832
1833 2006-01-21  Jim Meyering  <jim@meyering.net>
1834
1835         Sync from the stable (b5) branch of coreutils:
1836
1837         * fts.c (fts_children): Don't let close() clobber errno from
1838         failed fchdir().
1839
1840         * fts.c (fts_stat): When following a symlink-to-directory,
1841         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1842         a dangling symlink.  That can also happen at least for ELOOP.
1843         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1844         FYI, this bug predates the inclusion of fts.c in coreutils.
1845
1846         * fts.c (fts_open): Put new maxarglen declaration and uses
1847         in their own block, so pre-c99 compilers don't object.
1848
1849         Avoid the double-free (first in fts_read, second in fts_close) that
1850         would occur when an `active' directory is made inaccessible (e.g.,
1851         via chmod a-x) during a traversal.
1852         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1853         before returning.  Reproduce this failure by
1854         mkdir -p a/b; cd a; chmod a-x . b
1855         Reported by Stavros Passas.
1856
1857 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1858
1859         * argp-namefrob.h: Bugfix. Remove stray #
1860
1861 2006-01-25  Bruno Haible  <bruno@clisp.org>
1862
1863         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1864         warnings.
1865         Reported by Paul Eggert.
1866
1867 2006-01-25  Jim Meyering  <jim@meyering.net>
1868
1869         * fileblocks.c: Remove more useless parentheses.
1870         * readutmp.h: Likewise.
1871
1872 2006-01-24  Bruno Haible  <bruno@clisp.org>
1873
1874         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1875         has it.
1876         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1877         2005-11-26.
1878
1879         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1880         to avoid problems with the built-in _Bool type.
1881         Reported by Paul Eggert on 2005-11-26.
1882
1883 2006-01-24  Jim Meyering  <jim@meyering.net>
1884
1885         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1886
1887 2006-01-24  Simon Josefsson  <jas@extundo.com>
1888
1889         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1890         Bruno.
1891
1892 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1893
1894         Work around porting bugs reported by Dieter in
1895         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1896         * getopt.c (_NOPROTO): Remove; no longer needed.
1897         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1898         Include "getopt.h" first, to check interface.
1899         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1900         !HAVE_DECL_GETENV.
1901         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1902         (__strndup): Revert to K&R-style function dfns, the glibc style.
1903         * strnlen.c: Don't claim it's taken from glibc; it's not.
1904         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1905         Include strnlen.h first, to get prototype properly.
1906         (strnlen): Renamed from __strnlen.
1907         Remove weak alias.
1908
1909 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1910
1911         These changes imported from libc.
1912         * getopt.c: Use __fxprintf instead of inline stream orientation
1913         test and two separate function calls.
1914         * strndup.c (__strndup): Add libc_hidden_def.
1915
1916 2006-01-22  Bruno Haible  <bruno@clisp.org>
1917
1918         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1919         temporary buffer for sprintf, take into account the precision also
1920         for 'd', 'i', 'u', 'o', 'x', 'X'.
1921
1922 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1923
1924         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1925         to pacify gcc -Wswitch-default.
1926
1927 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1928
1929         * argp-help.c (usage_long_opt): Do not print DOC options.
1930         (__argp_base_name): Removed
1931         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1932         typo.
1933         (__argp_base_name): Provide macro definition or extern declaration
1934         depending on the configuration
1935
1936 2006-01-20  Simon Josefsson  <jas@extundo.com>
1937
1938         * inet_ntop.h: Unconditionally include sys/socket.h.
1939
1940 2006-01-19  Simon Josefsson  <jas@extundo.com>
1941
1942         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1943
1944 2006-01-12  Simon Josefsson  <jas@extundo.com>
1945
1946         * base64.c: Fix warning, reported by Bruno Haible
1947         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1948
1949 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1950
1951         Sync from coreutils.
1952         * md5.c: Fix commentary typos.
1953         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1954         * md5.h (__attribute__): Remove; unused.
1955         * sha1.c: Fix commentary to match md5 better.
1956         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1957         so that we don't need to worry about alignment.  All uses changed.
1958         This merges the 2005-10-28 md5 change into sha1.
1959
1960 2006-01-11  Jim Meyering  <jim@meyering.net>
1961
1962         Sync from coreutils.
1963         * md5.c (OP): Fix spacing.
1964
1965 2006-01-11  Simon Josefsson  <jas@extundo.com>
1966
1967         * stdint_.h (SIZE_MAX): Add missing (.
1968
1969 2006-01-10  Bruno Haible  <bruno@clisp.org>
1970
1971         * argp.h (__const): Remove macro. Use const instead.
1972         * argp-fmtstream.h (__const): Likewise.
1973         * glob_.h (__const): Remove macro.
1974         * glob-libc.h: Use const instead of __const.
1975
1976 2006-01-10  Jim Meyering  <jim@meyering.net>
1977
1978         Avoid the double-free (first in fts_read, second in fts_close) that
1979         would occur when an `active' directory is made inaccessible (e.g.,
1980         via chmod a-x) during a traversal.
1981         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1982         before returning.  Reproduce this failure by
1983         mkdir -p a/b; cd a; chmod a-x . b
1984         Reported by Stavros Passas.
1985
1986         Sync from coreutils.
1987         * sha1.c: Tweak grammar in a comment.
1988
1989 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1990
1991         * regex_internal.h (BITSET_WORD_BITS):
1992         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1993         preprocessor mishandles large unsigned values as if they were signed.
1994         Problem reported by Claudio Fontana in
1995         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1996
1997 2006-01-10  Simon Josefsson  <jas@extundo.com>
1998
1999         * socket_.h: New file.
2000
2001 2006-01-10  Bruno Haible  <bruno@clisp.org>
2002
2003         * localcharset.c: Update from GNU gettext.
2004
2005 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2006
2007         Sync from coreutils.
2008         * chdir-long.c (cdb_free): Don't bother trying to open directory
2009         for write access: POSIX says that must fail.
2010         * fts.c (diropen): Likewise.
2011         * save-cwd.c (save_cwd): Likewise.
2012         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2013         well, for minor improvements on hosts that lack O_DIRECTORY.
2014         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2015         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2016         Fall back on chown if open failed with EACCES.
2017
2018         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2019         Report an error at compile-time if only a 1-second nominal clock
2020         resolution is found.
2021
2022         * lchmod.h: New file.
2023         * mkdir-p.c: Include lchmod.h, lchown.h.
2024         (make_dir_parents): Use lchown rather than chown, and
2025         lchmod rather than chmod.
2026
2027         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2028         too.  Problem with "none" reported by Bob Proulx.  Problem with
2029         "proc" reported by n0dalus.
2030
2031         * mountlist.c: Include <limits.h>.
2032         (dev_from_mount_options)
2033         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2034         New function.  It no longer assumes "dev=" has the System V meaning
2035         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2036         (read_file_system_list)
2037         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2038         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2039         dev= in that case.
2040
2041         * posixtm.h (PDS_PRE_2000): New macro.
2042         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2043         All usages changed.  Reject dates outside the range 1969-1999 if
2044         PDS_PRE_2000 is used.
2045
2046 2006-01-09  Jim Meyering  <jim@meyering.net>
2047
2048         Sync from coreutils.
2049
2050         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2051
2052         * chdir-safer.h, chdir-safer.c: New files.
2053
2054         * modechange.c (mode_compile): Reject an invalid mode string
2055         that starts with an octal digit.  From Andreas Gruenbacher.
2056
2057         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2058         and dup to open_safer and dup_safer, respectively.
2059         (openat_permissive): Fix typo in comment.
2060
2061         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2062         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2063         (_): Remove; no longer needed.
2064         (openat): Renamed from rpl_openat; no need for rpl_openat
2065         since openat.h renames openat for us.
2066         Replace most of the body with a call to openat_permissive,
2067         to avoid duplicate code.
2068         Port to (probably hypothetical) environments were mode_t is
2069         wider than int.
2070         (openat_permissive): Require mode arg, so that we can check
2071         types better.  Put it just after flags.  Change cwd failure
2072         indicator from pointer-to-bool to pointer-to-errno-value.
2073         All callers changed.
2074         Invoke openat_save_fail and/or openat_restore_fail if
2075         cwd_errno is null, so that openat can call us.
2076         (openat_permissive, fdopendir, fstatat, unlinkat):
2077         Simplify errno handling to avoid some duplicate code,
2078         as it's OK to set errno on success.
2079         * openat.h: Revamp code so that function macros depend on
2080         __OPENAT_PREFIX only, not also on AT_FDCWD.
2081         (openat_ro): Remove.  Caller changed to use openat_permissive.
2082         (openat_permissive): Now a macro, if not a function.
2083         (openat_restore_fail, openat_save_fail): Now always functions,
2084         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2085
2086         * openat-priv.h: New file, defining macros used by mkdirat.c
2087         and openat.c.
2088         * mkdirat.c: Include openat-priv.h.
2089         Remove definitions of macros defined therein.
2090         * openat.c: Likewise.
2091
2092         * mkdirat.c (mkdirat): New file and function.
2093         * openat.h (mkdirat): Declare.
2094
2095         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2096
2097         * openat.h (openat_permissive): Declare.
2098         (openat_ro): Define.
2099
2100         * openat.c (EXPECTED_ERRNO): New macro.
2101         (openat_permissive): New function -- used in remove.c rewrite.
2102         (all functions): Set errno just before returning, only if there
2103         was an actual failure.
2104         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2105
2106         Emulate openat-family functions using Linux's procfs, if possible.
2107         Idea and some code based on Ulrich Drepper's glibc changes.
2108
2109         * openat.c: (BUILD_PROC_NAME): New macro.
2110         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2111         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2112         before falling back on save_cwd and restore_cwd.
2113         (fdopendir, fstatat, unlinkat): Likewise.
2114
2115         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2116         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2117
2118         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2119         as second argument to va_arg.  Otherwise, some versions of gcc
2120         warn that `if this code is reached, the program will abort'.
2121
2122 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2123
2124         Sync from coreutils.
2125
2126         Add POSIX ACL support
2127         * acl.h (copy_acl, set_acl): Add declarations.
2128         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2129         systems other than Linux.
2130         (chmod_or_fchmod): New function: use fchmod when possible,
2131         and chmod otherwise.
2132         (file_has_acl): Add a POSIX ACL implementation, with a
2133         Linux-specific subcase.
2134         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2135         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2136         acls are unsupported.
2137         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2138         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2139         are unsupported.
2140
2141 2006-01-09  Bruno Haible  <bruno@clisp.org>
2142
2143         * sysexit_.h (EX_OK): New macro.
2144         Suggested by Martin Lambers <marlam@marlam.de>.
2145
2146 2006-01-09  Bruno Haible  <bruno@clisp.org>
2147
2148         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2149         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2150         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2151         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2152
2153 2006-01-09  Bruno Haible  <bruno@clisp.org>
2154
2155         * stdint_.h (SIZE_MAX): Write the value without involving negative
2156         numbers.
2157
2158 2005-10-16  Bruno Haible  <bruno@clisp.org>
2159
2160         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2161         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2162
2163 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2164
2165         * strftime.c (tzname): Don't declare if it is already #defined.
2166         Problem reported for Mingw by Mark Junker.
2167
2168 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2169
2170         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2171         long int, not int, for nanosecond counts, so that people who are
2172         used to POSIX struct timespec won't be surprised.  Reported by Jim
2173         Meyering.
2174
2175 2005-12-16  Jim Meyering  <jim@meyering.net>
2176
2177         * fprintftime.c, fprintftime.h: New files.
2178
2179 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2180
2181         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2182         * argp-help.c (fill_in_uparams): Check if the constructed
2183         struct uparams is valid. Fall back to the default values if it is
2184         not.
2185
2186 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2187
2188         * argp-help.c (__argp_base_name): New function
2189         (__argp_short_program_name): Rewrite using __argp_base_name
2190         * argp-namefrob.h: Define program_invocation_name and
2191         program_invocation_short_name if requested
2192         (__argp_base_name): Add prototype
2193         * argp-parse.c (argp_def): Use gettext wrappers
2194         (argp_default_parser): Use __argp_base_name
2195         * argp-pin.c: New file. Defines program_invocation_name and
2196         program_invocation_short_name on systems that lack them.
2197
2198 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2199
2200         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2201         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2202         porting problem reported by Georg Schwarz in
2203         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2204
2205 2005-07-09  Bruno Haible  <bruno@clisp.org>
2206
2207         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2208         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2209         Reported by Mark Junker <mjscod@gmx.de>.
2210
2211 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2212
2213         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2214         (uintmax_t) [defined uintmax_t]: Do not declare.
2215         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2216         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2217         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2218         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2219         sake of portability to weird hosts that C allows (though we don't
2220         know of any practical examples).
2221
2222         * savedir.h (fdsavedir): New decl.
2223         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2224         contains most of the former guts of savedir.
2225         (savedir): Use savedirstream.
2226         Include "openat.h".
2227
2228 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2229
2230         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2231         coreutils no longer futzes with rounding modes.
2232
2233 2005-11-14  Jim Meyering  <jim@meyering.net>
2234
2235         * mkstemp-safer.c: Include <config.h>, required for possible
2236         replacement of mkstemp.
2237
2238 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2239
2240         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2241         business.
2242         (gethrxtime) [! (HAVE_NANOUPTIME
2243         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2244         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2245         our own approximation.
2246
2247 2005-11-10  Simon Josefsson  <jas@extundo.com>
2248
2249         * readline.c: Remove EOL.
2250
2251 2005-11-08  Eric Blake  <ebb9@byu.net>
2252
2253         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2254
2255 2005-11-08  Eric Blake  <ebb9@byu.net>
2256
2257         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2258
2259 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2260
2261         Fix porting problem reported by Theodoros V. Kalamatianos.
2262         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2263         Don't assume that futimes failing means we must fail.
2264
2265 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2266
2267         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2268         leave errno alone.  Problem reported by Dmitry V. Levin.
2269
2270 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2271
2272         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2273         errno alone.  Problem reported by Frederic Jolliton.
2274
2275 2005-10-28  Simon Josefsson  <jas@extundo.com>
2276
2277         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2278         "restrict" keywords, as per POSIX.  Protect the function
2279         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2280         Don't use K&R prototypes.  Check the sprintf return values.
2281         Re-define EAFNOSUPPORT if not present.  Indent.
2282
2283         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2284         suggested by Bruno Haible <bruno@clisp.org>.
2285
2286         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2287
2288         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2289
2290         * gc-libgcrypt.c: Add MD2 (which is not available through
2291         libgcrypt).
2292
2293         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2294
2295         * md2.h, md2.c: New files.
2296
2297 2005-10-24  Simon Josefsson  <jas@extundo.com>
2298
2299         * md4.h: Shrink buffer size, now that we changed the type.
2300
2301 2005-10-22  Simon Josefsson  <jas@extundo.com>
2302
2303         * arcfour.h, arcfour.c: Use fixed size indices in the
2304         arcfour_context struct (simplify test vector testing in GNU
2305         Shishi).
2306
2307 2005-10-22  Simon Josefsson  <jas@extundo.com>
2308
2309         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2310         suggested by Bruno Haible <bruno@clisp.org>.
2311
2312 2005-10-22  Simon Josefsson  <jas@extundo.com>
2313
2314         * crc.h: Include stddef.h, for size_t.
2315
2316 2005-10-21  Simon Josefsson  <jas@extundo.com>
2317
2318         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2319         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2320
2321 2005-10-21  Simon Josefsson  <jas@extundo.com>
2322
2323         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2324         block.
2325
2326 2005-10-21  Simon Josefsson  <jas@extundo.com>
2327
2328         * gc-gnulib.c: Support ARCTWO in CBC mode.
2329
2330 2005-10-21  Simon Josefsson  <jas@extundo.com>
2331
2332         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2333         <bruno@clisp.org>.
2334
2335         * hmac-sha1.c (hmac_sha1): Likewise.
2336
2337         * crc.c (crc32_update): Actually use crc parameter, suggested by
2338         Bruno Haible <bruno@clisp.org>.
2339
2340         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2341         <bruno@clisp.org>.
2342
2343 2005-10-21  Simon Josefsson  <jas@extundo.com>
2344
2345         * des.h, des.c: New files.
2346
2347         * gc-gnulib.c: Support DES.c
2348
2349 2005-10-21  Simon Josefsson  <jas@extundo.com>
2350
2351         * arctwo.h, arctwo.c: New files.
2352
2353         * gc-gnulib.c: Support ARCTWO.
2354
2355 2005-10-21  Simon Josefsson  <jas@extundo.com>
2356
2357         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2358
2359 2005-10-19  Simon Josefsson  <jas@extundo.com>
2360
2361         * gc-gnulib.c: Support ARCFOUR.
2362
2363 2005-10-19  Simon Josefsson  <jas@extundo.com>
2364
2365         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2366         support.
2367
2368         * gc.h: Add ECB enum type.
2369
2370         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2371
2372 2005-10-19  Simon Josefsson  <jas@extundo.com>
2373
2374         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2375
2376 2005-10-18  Simon Josefsson  <jas@extundo.com>
2377
2378         * md4.h, md4.c: New files, based on md5.?.
2379
2380 2005-10-17  Simon Josefsson  <jas@extundo.com>
2381
2382         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2383
2384         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2385
2386 2005-10-17  Simon Josefsson  <jas@extundo.com>
2387
2388         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2389
2390 2005-10-17  Simon Josefsson  <jas@extundo.com>
2391
2392         * gc.h, gc-libgcrypt.c: Add ciphers.
2393
2394 2005-10-17  Simon Josefsson  <jas@extundo.com>
2395
2396         * sha1.c: Use uint32_t instead of md5_uint32.t
2397
2398         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2399         md5.h.
2400
2401         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2402
2403         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2404
2405 2005-10-15  Simon Josefsson  <jas@extundo.com>
2406
2407         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2408
2409         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2410
2411 2005-10-14  Simon Josefsson  <jas@extundo.com>
2412
2413         * arcfour.h, arcfour.c: New files.
2414
2415 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2416
2417         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2418         include <wchar.h>; no longer needed.
2419
2420 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2421         and  Ulrich Drepper  <drepper@redhat.com>
2422
2423         Import from libc.
2424         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2425         instead of inline stream orientation test and two separate
2426         function calls.  Pay no attention to USE_IN_LIBIO.
2427
2428 2005-10-14  Roland McGrath  <roland@redhat.com>
2429
2430         Import from libc.  [BZ #1331]
2431         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2432         macro argument.
2433         Reported by Matej Vela <vela@debian.org>.
2434
2435 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2436
2437         * mkdir-p.c (make_dir_parents): Don't report an error if an
2438         intermediate directory is in a read-only file system.  Problem
2439         reported by Eric Blake.
2440
2441 2005-10-13  Simon Josefsson  <jas@extundo.com>
2442
2443         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2444         Move memory allocation outside of loop.
2445
2446 2005-10-12  Simon Josefsson  <jas@extundo.com>
2447
2448         * gc-pbkdf2-sha1.c: New file.
2449
2450         * gc.h: Add gc_pbkdf2_sha1 prototype.
2451
2452 2005-10-12  Simon Josefsson  <jas@extundo.com>
2453
2454         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2455         suggested by Bruno Haible <bruno@clisp.org>.
2456
2457 2005-10-12  Simon Josefsson  <jas@extundo.com>
2458
2459         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2460
2461         * gc-gnulib.c (gc_hmac_sha1): New function.
2462
2463 2005-10-12  Simon Josefsson  <jas@extundo.com>
2464
2465         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2466
2467 2005-10-12  Simon Josefsson  <jas@extundo.com>
2468
2469         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2470         GC_USE_HMAC_MD5, respectively.
2471
2472         * gc-libgcrypt.c (gc_md5): Fix assert call.
2473         (gc_md5): Fix typo.
2474
2475         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2476
2477         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2478
2479         * gc-gnulib.c (gc_hash_buffer): Ditto.
2480
2481 2005-10-11  Bruno Haible  <bruno@clisp.org>
2482
2483         * c-strcasestr.h: New file, from GNU gettext.
2484         * c-strcasestr.c: New file, from GNU gettext.
2485
2486 2005-10-11  Bruno Haible  <bruno@clisp.org>
2487
2488         * c-strcase.h: New file, from GNU gettext.
2489         * c-strcasecmp.c: New file, from GNU gettext.
2490         * c-strncasecmp.c: New file, from GNU gettext.
2491
2492 2005-10-11  Simon Josefsson  <jas@extundo.com>
2493
2494         * crc.h, crc.c: New files.
2495
2496         * gc.h (gc_hash_buffer): Add doc.
2497
2498 2005-10-08  Simon Josefsson  <jas@extundo.com>
2499
2500         * gc.h: Add gc_hash and gc_hash_buffer.
2501
2502         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2503
2504         * gc-libgcrypt.c (gc_hash_buffer): Add.
2505
2506 2005-10-11  Bruno Haible  <bruno@clisp.org>
2507
2508         * strcasecmp.c: Include limits.h.
2509         (strcasecmp): Avoid integer overflow on exotic platforms.
2510         * strncasecmp.c: Include limits.h.
2511         (strncasecmp): Avoid integer overflow on exotic platforms.
2512         Reported by Paul Eggert.
2513
2514 2005-10-06  Simon Josefsson  <jas@extundo.com>
2515
2516         * hmac-md5.c: New file.
2517
2518         * hmac.h: New file.
2519
2520 2005-10-06  Simon Josefsson  <jas@extundo.com>
2521
2522         * memxor.c (memxor): Avoid casts and warnings.
2523
2524 2005-10-05  Derek Price  <derek@ximbiot.com>
2525
2526         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2527
2528 2005-10-05  Simon Josefsson  <jas@extundo.com>
2529
2530         * memxor.c (memxor): Fix compiler error.
2531
2532         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2533         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2534
2535         * memxor.h, memxor.c: New files.
2536
2537         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2538         we assume all systems have it, suggested by Jim Meyering
2539         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2540         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2541         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2542         same reasons.
2543
2544 2005-10-04  Bruno Haible  <bruno@clisp.org>
2545
2546         * verify.h (verify_true): Provide alternative definition for C++.
2547
2548 2005-10-04  Simon Josefsson  <jas@extundo.com>
2549
2550         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2551         D. Baushke" <mdb@gnu.org>.
2552
2553 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2554
2555         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2556         (SSIZE_MAX): New macro, if not already defined.
2557         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2558         than 2 GiB.
2559
2560 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2561
2562         * exclude.c: Include verify.h.
2563         (verify): Remove.  All callers changed to use verify.h's version.
2564         * strtoimax.c: Likewise.
2565         * utimecmp.c: Likewis.e
2566
2567         Sync from coreutils.
2568         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2569         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2570         * .cvsignore: Add fts.h, search.h, t-fpending.
2571         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2572         bother returning ENOSYS if settimeofday or stime fails; just let
2573         them return whatever errno they want to return.
2574         * utimens.c: Include unistd.h, for dup2.
2575         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2576         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2577
2578 2005-10-02  Jim Meyering  <jim@meyering.net>
2579
2580         Sync from coreutils.
2581         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2582         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2583         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2584         Remove AT_FDCWD test.
2585         Do not consume the fd unless successful.
2586         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2587         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2588         block, so that we don't even try to compile it if settimeofday is
2589         available.  This works around a compilation failure on OSF1 V5.1,
2590         due to stime requiring a `long int*' while tv_sec is `int'.
2591
2592 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2593
2594         * getdelim.c (getdelim): Remove unused variables.
2595
2596 2005-10-01  Simon Josefsson  <jas@extundo.com>
2597
2598         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2599         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2600         AI_* and EAI_* definitions.  Protect function declarations.
2601
2602 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2603
2604         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2605         so that the code works even with ancient cpp.  Portability problem
2606         with GCC 2.7.2.1 reported by Thomas M.Ott.
2607
2608 2005-09-27  Jim Meyering  <jim@meyering.net>
2609
2610         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2611
2612         * intprops.h (signed_type_or_expr__): Define.
2613         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2614         for unsigned types.
2615
2616 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2617
2618         * verify.h (verify_expr): Remove, replacing with:
2619         (verify_true): New macro that returns true instead of void.
2620         (verify_type__): Remove.
2621         (verify): Use verify_true rather than verify_type__.
2622
2623 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2624
2625         * utimens.c (ENOSYS): Define if not already defined.
2626         (futimens): Support having a null PATH if the file descriptor
2627         is nonnegative.
2628
2629         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2630         Remove.
2631         (__attribute): Define to empty unless GCC 3.1 or later.
2632         This works around a core dump on OpenBSD 3.4, which has GCC
2633         2.95.3, which dumps core when given __attribute__(()).  It also
2634         simplifies other tests, since we really don't want to bother with
2635         worrying about which ancient version of GCC supported what.
2636         Original problem reported by Yoann Vandoorselaere, with part of
2637         the fix suggested by Derek Price.
2638
2639 2005-09-24  Jim Meyering  <jim@meyering.net>
2640
2641         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2642         so we can once again use a positive bitfield width of 1 -- now we
2643         don't have to explain why we were using a bitfield width of 2.
2644
2645 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2646
2647         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2648         Problem reported by Eric Blake.
2649         (getaddrinfo): Initialize se so that it's not garbage.
2650         Redo internal storage allocation so that it doesn't make unportable
2651         assumptions about alignment.
2652         Fix a memory leak.
2653
2654         * utimens.c (futimens): Use futimesat if available.
2655         Prefer it to futimes since it doesn't have the futimes bug.
2656
2657         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2658         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2659         Instead, declare a function that returns a pointer to an array,
2660         and use verify_type__ to declare the size of the array.
2661         Problem and germ of a solution reported by Bruno Haible.
2662         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2663         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2664
2665 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2666
2667         Sync from coreutils.
2668
2669         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2670         stat-time.h.
2671         * argmatch.h: Include verify.h
2672         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2673         (ARGMATCH_ASSERT): Remove; unused.
2674         * canonicalize.c: Assume STDC_HEADERS.
2675         * exclude.c: Include "strcase.h".
2676         * regex_internal.h [!defined _LIBC]: Likewise.
2677         * getusershell.c: Include stdio--.h rather than stdio.h
2678         and stdio-safer.h.
2679         (getusershell): Call fopen, not fopen_safer.
2680         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2681         Do not include unistd-safer.h.
2682         (save_cwd): Don't call fd_safer; no longer needed
2683         now that we include fcntl--.h.
2684
2685         * getdate.y (relative_time): New type.
2686         (RELATIVE_TIME_0): New constant.
2687         (parser_control): Use relative_time instead of doing it ourselves.
2688         (%union): Add new relative_time rel member.
2689         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2690         Now typeless.
2691         (relunit, relunit_snumber): Now of type rel.
2692         (zone, rel, relunit, get_date): Adjust to above changes.
2693
2694         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2695         Do not include unistd-safer.h.
2696         (getloadavg): Don't call fd_safer; no longer needed
2697         now that we include fcntl--.h.
2698
2699         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2700         (make_dir_parents): Treat ENOSYS like EEXIST.
2701
2702         Improve quality of diagnostics on restore_cwd failure.
2703         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2704         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2705         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2706         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2707         each time through the loop.  Do not diagnose restore_cwd failure;
2708         that is the caller's job (and perhaps the caller does not care).
2709
2710         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2711         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2712         If the file already exists but is not a directory, don't bother
2713         to try to make its parents.
2714         Close potential file descriptor leak if we can't chdir("/") (!).
2715         Don't always return true if chdir($PWD) fails; return true only
2716         if the requested action was done successfully (except for the
2717         chdir($PWD)).
2718         Don't log final directory unless we actually made it.
2719         Refactor to avoid duplicate code to fix up permissions.
2720         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2721
2722         * strftime.c (my_strftime): Rewrite the previous change slightly,
2723         to make it a bit faster and (I hope) clearer.
2724         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2725         Fix bug in formats like %2N.
2726
2727         * verify.h: New file.
2728
2729 2005-09-22  Jim Meyering  <jim@meyering.net>
2730
2731         Sync from coreutils.
2732
2733         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2734
2735         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2736         the .tm_year member, since otherwise gcc-4.0 would now warn about
2737         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2738
2739         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2740         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2741
2742         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2743         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2744         when run in a time zone for which daylight savings time is in effect
2745         for the starting date.
2746
2747         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2748         stop us from restricting permissions of just-created absolute-named
2749         directories.
2750         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2751         to restore initial working directory.
2752         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2753         to tell caller if/when we change the working directory and are
2754         unable to return to the initial one.
2755         * mkdir-p.h (make_dir_parents): Update prototype.
2756         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2757         `return false'.  This fixes a bug introduced on 2004-07-30.
2758
2759         * openat.c (fdopendir): Be sure to close the supplied
2760         file descriptor before returning.  This makes our replacement
2761         implementation a little closer to Solaris's, where fdopendir
2762         ties the file descriptor to the returned DIR* pointer.
2763         * openat.c (unlinkat): New function.
2764         * openat.h (unlinkat): Add prototype.
2765         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2766         (openat_restore_fail): Rename from openat_restore_die.
2767         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2768
2769         Provide an alternative to exiting immediately upon save_cwd or
2770         restore_cwd failure.  Now, an application can arrange e.g.,
2771         to perform a longjump in that case.
2772         * openat.c: Include dirname.h.
2773         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2774         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2775         and openat_restore_die rather than calling error directly.
2776         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2777
2778         * openat-die.c (openat_save_die, openat_restore_die): New file.
2779         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2780
2781         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2782         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2783                             int utc, int nanoseconds);
2784         Background:
2785         date should not have to allocate a megabyte of virtual memory to
2786         handle a format argument like +%1048575T.  When implemented with
2787         strftime, it must allocate such a buffer, use strftime to fill it
2788         in, print it, then free it.
2789         With fprintftime, it simply prints everything and exits.
2790         With no need for memory allocation, that's one fewer way to fail.
2791         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2792         optional field width, not before, so we accept %9:z, not %:9z.
2793         (my_strftime): Be sure to use L_('x') for literals.
2794
2795         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2796         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2797         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2798         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2799         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2800         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2801         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2802         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2803         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2804
2805         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2806         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2807         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2808         and don't include <sys/file.h>).
2809
2810 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2811
2812         Sync from coreutils.
2813
2814         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2815         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2816         [!LDAV_DONE]: Avoid unused variable warning.
2817
2818 2005-09-21  Bruno Haible  <bruno@clisp.org>
2819
2820         * unicodeio.h (unicode_to_mb): New declaration.
2821
2822 2005-09-20  Derek Price  <derek@ximbiot.com>
2823
2824         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2825
2826 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2827
2828         Use a consistent style for including <config.h>.
2829         * __fpending.c, acl.c, argmatch.c,
2830         argp-help.c, argp-parse.c,
2831         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2832         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2833         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2834         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2835         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2836         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2837         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2838         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2839         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2840         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2841         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2842         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2843         modechange.c, mountlist.c, open-safer.c, physmem.c,
2844         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2845         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2846         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2847         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2848         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2849         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2850         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2851         userspec.c, utimecmp.c, version-etc-fsf.c,
2852         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2853         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2854         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2855         Standardize inclusion of config.h.
2856         * __fpending.h, dirfd.h, getdate.h, human.h,
2857         inttostr.h:  Removed inclusion of config.h from header files.
2858         * inttostr.c:  Adjusted in-tree users.
2859         * timespec.h: Remove superfluous warning to include config.h.
2860         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2861         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2862         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2863         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2864
2865 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2866
2867         * stat-time.h: New file.
2868         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2869         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2870         in a different way.
2871         (timespec_cmp): New function.
2872         * utimecmp.c: Include stat-time.h.
2873         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2874         members exist, not on the obsolescent ST_MTIM_NSEC.
2875         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2876
2877 2005-09-15  Derek Price  <derek@ximbiot.com>
2878             Paul Eggert  <eggert@cs.ucla.edu>
2879
2880         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2881         changes, consolidating in...
2882         * regex_internal.h: ...this file.
2883
2884 2005-09-15  Derek Price  <derek@ximbiot.com>
2885
2886         * regex_internal.h: Blank `pure' for GNUC < 3.
2887         * regex_internal.c: Ditto, using this...
2888         (__GNUC_PREREQ): ...new macro.
2889         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2890         (__GNUC_PREREQ): ...this new macro.
2891
2892         * strstr.h: Include string.h. Define strstr as a macro here.
2893
2894 2005-09-13  Derek Price  <derek@ximbiot.com>
2895
2896         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2897         failure.
2898         Reported by Jim Meyering  <jim@meyering.net>.
2899
2900 2005-09-13  Jim Meyering  <jim@meyering.net>
2901
2902         * canon-host.c: Filter through gnu indent and reword comments slightly.
2903         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2904
2905 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2906
2907         * base64.c: Typo.
2908         (base64_encode): Put b64str in initialized data section.
2909
2910 2005-09-12  Derek Price  <derek@ximbiot.com>
2911
2912         Return usable errors from canon-host.
2913         * canon-host.h: New file.
2914         * canon-host.c (canon_host): Wrap...
2915         (canon_host_r): ...this new function, which now relies exclusively on
2916         getaddrinfo.
2917         (ch_strerror): New function.
2918         (last_cherror): New global.
2919         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2920         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2921         void *.
2922         (freeaddrinfo): Free ai->ai_canonname when set.
2923
2924 2005-09-12  Derek Price  <derek@ximbiot.com>
2925             Paul Eggert  <eggert@cs.ucla.edu>
2926
2927         * glob-libc.h: Renamed from glob_.h.  The new version is
2928         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2929         protecting things that should be done only in gnulib contexts.
2930         * glob_.h: New file, containing only the glob things needed for
2931         gnulib.
2932         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2933         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2934         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2935         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2936         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2937         and to respect the namespace rules better.
2938
2939 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2940
2941         Merge glibc and coreutils changes into gnulib, plus a few
2942         extra fixes.
2943         * md5.c: Use #error rather than a string.
2944         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2945         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2946         (__attribute__): Define to empty for non recent-GCC.
2947         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2948         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2949         Renamed from their non-__ counterparts, with new macros replacing
2950         them if not _LIBC.  Add __THROW attribute.
2951         (rol): Remove.
2952         (struct md5_ctx): Align buffer if using GCC.
2953         * sha1.h (struct sha1_ctx): Likewise.
2954         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2955         The old name was backwards.
2956         (NOTSWAP): Remove; not used.
2957         (rol): New macro, moved here from md5.h.
2958         (sha1_process_block): Remove a FIXME that doesn't make sense.
2959
2960 2005-09-12  Derek Price  <derek@ximbiot.com>
2961
2962         * gai_strerror.c: Include config.h when available.  Include
2963         getaddrinfo.h before other headers to test interface.
2964         Reported by Larry Jones <lawrence.jones@ugs.com>.
2965
2966 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2967
2968         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2969         definitions, since that's the preferred style in glibc.
2970         Fix a minor spacing issue, and update copyright notice to match glibc's.
2971
2972 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2973
2974         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2975
2976 2005-09-06  Simon Josefsson  <jas@extundo.com>
2977
2978         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2979         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2980
2981 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2982
2983         Change bitset word type from unsigned int to unsigned long int,
2984         as this has better performance on typical 64-bit hosts.
2985         Port bitset code to hosts with unusual word sizes.
2986         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2987         (build_collating_symbol):
2988         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2989         argument is a bitset.  This is merely a style issue, but it makes
2990         it clearer that an entire array is expected.
2991         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2992         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2993         Port to the case where bitset_word is not the same as unsigned int.
2994         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2995         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2996         Likewise.
2997         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2998         (build_trtable, group_nodes_into_DFAstates):
2999         Likewise.
3000         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3001         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3002         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3003         * regexec.c (group_nodes_into_DFAstates): Likewise.
3004         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3005         * regcomp.c (optimize_subexps, lower_subexp):
3006         Work even if bitset_word has holes in its bitwise representation.
3007         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3008         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3009         Likewise.
3010         * regex_internal.c (re_string_reconstruct):
3011         Don't assume UCHAR_MAX == 255.
3012         * regex_internal.h (bitset_set_all): Likewise.
3013         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3014         All uses changed.
3015         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3016         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3017         All uses changed.
3018         (BITSET_WORD_MAX): New macro.
3019         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3020         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3021         (bitset_empty, bitset_copy):
3022         Prefer sizeof (bitset) to multiplying it out ourselves.
3023         (bitset_not_merge): Remove; unused.
3024         (bitset_contain): Return bool, not unsigned int with one bit on.
3025         All callers changed.
3026         * regexec.c (build_trtable): Don't assume bitset has no stricter
3027         alignment than re_node_set; do this by defining a new internal
3028         type struct dests_alloc and using it to allocate memory.
3029
3030 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3031
3032         Check for arithmetic overflow when calculating sizes, to prevent
3033         some buffer-overflow issues.  These patches are conservative, in the
3034         sense that when I couldn't determine whether an overflow was possible,
3035         I inserted a run-time check.
3036         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3037         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3038         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3039         (re_xnrealloc, re_x2nrealloc): New inline functions.
3040         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3041         (build_equiv_class, build_charclass): Check for arithmetic overflow
3042         in size expression calculations.
3043         * regex_internal.c (re_string_realloc_buffers):
3044         (build_wcs_upper_buffer, re_node_set_add_intersect):
3045         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3046         (re_dfa_add_node, register_state): Likewise.
3047         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3048         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3049         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3050         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3051
3052 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3053
3054         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3055         to avoid a collision with bits/local_lim.h in glibc.
3056         All uses changed.  Problem reported by Dmitry V. Levin in
3057         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3058
3059         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3060         bugs in int versus size_t comparisons.
3061         (re_string_context_at): Fix bug where the code assumed that
3062         Idx is signed.
3063
3064         Use bool where appropriate.
3065         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3066         All callers changed.
3067         (calc_eclosure_iter): Likewise, for ROOT arg.
3068         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3069         (build_charclass_op): Likewise, for NON_MATCH arg.
3070         * regex_internal.c (re_string_allocate, re_string_construct):
3071         (re_string_construct_common): Likewise, for ICASE arg.
3072         * regexec.c (re_search_2_stub, re_search_stub):
3073         Likewise, for RET_LEN arg.
3074         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3075         (set_regs): Likewise, for FL_BACKTRACK arg.
3076         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3077         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3078         (calc_eclosure_iter, parse_bracket_exp):
3079         Use bool for internal variables that are booleans.
3080         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3081         (set_regs, build_sifted_states, sift_states_bkref):
3082         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3083         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3084         (find_collation_sequence_value):
3085         Likewise.
3086         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3087         (re_node_set_compare):
3088         Return bool, not int. All callers changed.
3089         * regexec.c (check_halt_node_context, check_dst_limits):
3090         (build_trtable, check_node_accept): Likewise.
3091         * regex_internal.h: Include stdbool.h.
3092
3093         Fix bugs uncovered when converting to bool.
3094         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3095         failure instead of charging ahead blindly.
3096         * regex_internal.c (register_state): Likewise.
3097         * regexec.c (re_search_2_stub): Use simpler method than boolean
3098         for freeing internal storage.
3099         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3100         bitset pieces used as boolean, to avoid undefined behavior
3101         on hosts that do int overflow checking.
3102
3103 2005-08-31  Derek Price  <derek@ximbiot.com>
3104
3105         * getdelim.c (getdelim): Return EOF on EOF.
3106         Reported by Larry Jones <lawrence.jones@ugs.com>.
3107
3108 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3109
3110         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3111         lengths fit in regoff_t; this isn't true if regoff_t is the same
3112         width as size_t.
3113         * regex.c (re_search_internal): 5th arg is LAST_START
3114         (= START + RANGE) instead of RANGE.  This avoids overflow
3115         problems when regoff_t is the same width as size_t.
3116         All callers changed.
3117         (re_search_2_stub): Check for overflow when adding the
3118         sizes of the two strings.
3119         (re_search_stub): Check for overflow when adding START
3120         to RANGE; if it occurs, substitute the extreme value.
3121
3122 2005-08-31  Jim Meyering  <jim@meyering.net>
3123
3124         * regcomp.c (search_duplicated_node): Make first pointer arg
3125         a pointer-to-const.
3126         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3127         (register_state): Likewise.
3128         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3129         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3130         (group_nodes_into_DFAstates): Likewise.
3131
3132 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3133
3134         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3135         old glibc regex code mishandles strings longer than 2**31 bytes.
3136         This patch fixes this when the regex code is used in gnulib
3137         (i.e., outside glibc).
3138
3139         This patch should not affect the use of the regex code inside
3140         glibc.  No doubt this problem also needs to be handled for glibc
3141         as well, but the result will be an incompatible change to the
3142         glibc ABI, and the old ABI will have to be supported too.  That
3143         can be the the subject for another patch.
3144
3145         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3146         governing whether the rest of this patch is active.  By default,
3147         the macro is disabled and the patch has no effect.
3148         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3149         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3150         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3151         (re_match_2, re_set_registers): Use the new types.
3152         * regex_internal.h (Idx, re_hashval_t): New types.
3153         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3154         New macros.
3155         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3156         (re_string_context_at, bin_tree_t, re_dfastate_t):
3157         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3158         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3159         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3160         (re_string_char_size_at, re_string_wchar_at):
3161         (re_string_elem_size_at):
3162         Use the new types and macros to port to 64-bit hosts.
3163         Use unsigned types for internal values, so that the code
3164         mostly works even for arrays larger than SSIZE_MAX.
3165         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3166         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3167         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3168         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3169         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3170         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3171         (calc_inveclosure, parse_dup_op, build_range_exp):
3172         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3173         (fetch_number, create_token_tree, mark_opt_subexp):
3174         Likewise.
3175         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3176         (create_cd_newstate, re_string_allocate, re_string_construct):
3177         (re_string_realloc_buffers, build_wcs_upper_buffer):
3178         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3179         (re_string_reconstruct, re_string_peek_byte_case):
3180         (re_string_fetch_byte_case, re_string_context_at):
3181         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3182         (re_node_set_init_copy, re_node_set_add_intersect):
3183         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3184         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3185         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3186         (re_acquire_state, re_acquire_state_context, register_state):
3187         Likewise.
3188         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3189         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3190         (re_search_internal, re_search_2_stub, re_search_stub)
3191         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3192         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3193         (update_cur_sifted_state, check_dst_limits):
3194         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3195         (check_subexp_limits, sift_states_bkref, merge_state_array):
3196         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3197         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3198         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3199         (expand_bkref_cache, check_node_accept_bytes):
3200         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3201         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3202         (acquire_init_state_context, check_halt_node_context):
3203         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3204         (sift_states_backward, clean_state_log_if_needed):
3205         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3206         (find_recover_state, transit_state_sb, transit_state_mb):
3207         (transit_state_bkref, build_trtable, match_ctx_clean):
3208         Likewise.
3209         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3210         to work around an assumption that REG_MISSING is negative.
3211
3212         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3213         (seek_collating_symbol_entry) [defined _LIBC]:
3214         (lookup_collation_sequence_value) [defined _LIBC]:
3215         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3216         Use prototypes rather than old-style function definitions.
3217         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3218         (transit_state_sb) [0]:
3219         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3220
3221         * regexec.c (re_search_internal): Simplify update of rm_so and
3222         rm_eo.
3223
3224         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3225         (optimize_subexps, lower_subexp):
3226         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3227         since the signed shift might overflow.  Use 1u<<31 instead.
3228         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3229         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3230         Likewise.
3231
3232         * regcomp.c (optimize_subexps, lower_subexp):
3233         Use CHAR_BIT rather than 8, for clarity.
3234         * regexec.c (check_dst_limits_calc_pos_1):
3235         (check_subexp_matching_top): Likewise.
3236         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3237         have to worry about portability issues when shifting it left.
3238         Remove no-longer-needed test for table_size > 0.
3239         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3240         in a word, as the resulting behavior is undefined.
3241         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3242         in one case, a <= should have been an <, and in another case the
3243         whole test was missing.
3244         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3245         the standard name CHAR_BIT.
3246         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3247         this is not true on one's complement and signed-magnitude hosts.
3248
3249         * regex_internal.h (re_sub_match_top_t): Remove unused member
3250         next_last_offset.
3251         (struct re_dfa_t): Remove unused member states_alloc.
3252         * regcomp.c (init_dfa): Don't initialize unused members.
3253
3254 2005-08-31  Bruno Haible  <bruno@clisp.org>
3255
3256         * strstr.c: Include <stddef.h>, for NULL.
3257         * strcasestr.c: Likewise.
3258         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3259
3260 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3261
3262         * iconvme.h: Add prototype for iconv_alloc.
3263
3264 2005-08-29  Simon Josefsson  <jas@extundo.com>
3265
3266         * iconvme.c: Fix errno.
3267
3268 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3269
3270         * iconvme.c: Split iconv_string into iconv_alloc.
3271
3272 2005-08-27  Jim Meyering  <jim@meyering.net>
3273
3274         * fopen-safer.c: Merge minor changes from coreutils.
3275         * dup-safer.c: Likewise.
3276         * fd-safer.c: Likewise.
3277
3278         Merge from coreutils.
3279         * stdio--.h: New file.
3280         * stdlib--.h: New file.
3281         * mkstemp-safer.c: New file.
3282
3283         GNU tar needs these.
3284         * pipe-safer.c: New file.
3285         * creat-safer.c: New file.
3286         * fcntl--.h (creat): Define to creat_safer.
3287         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3288         * unistd--.h (pipe): Define to pipe_safer.
3289         * unistd-safer.h: Declare pipe_safer.
3290
3291 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3292
3293         * regex_internal.h: Remove all references to
3294         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3295         or better.
3296         (bitset_not, bitset_merge, bitset_not_merge):
3297         (bitset_mask, re_string_allocate, re_string_construct):
3298         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3299         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3300         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3301         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3302         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3303         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3304         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3305         (re_acquire_state_context):
3306         Remove unnecessary forward decls.
3307         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3308         Put __attribute at function definition,
3309         now that the function decl has been removed.
3310         * regex_internal.c (re_string_peek_byte_case):
3311         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3312         Likewise.
3313
3314 2005-08-26  Simon Josefsson  <jas@extundo.com>
3315
3316         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3317         Haible <bruno@clisp.org>.
3318
3319 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3320
3321         * regexec.c (set_regs): Don't alloca with an unbounded size.
3322
3323         alloca modernization/simplification for regex.
3324         * regex.c: Remove portability cruft for alloca.  This no longer
3325         needs to be at the start of the file, and can be moved into
3326         regex_internal.h and simplified.
3327         * regex_internal.h: Include <alloca.h>.
3328         (__libc_use_alloca) [!defined _LIBC]: New macro.
3329         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3330         now works outside glibc.
3331
3332 2005-08-24  Simon Josefsson  <jas@extundo.com>
3333
3334         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3335         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3336         GLIBC specific code.
3337
3338 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3339
3340         Make regex safe for g++.  This fixes one real bug (an "err"
3341         that should have been "*err").  g++ problem reported by
3342         Sam Steingold.
3343         * regex_internal.h (re_calloc): New macro, consistent with
3344         re_malloc etc.  All callers of calloc changed to use re_calloc.
3345         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3346         not int.  All callers changed.
3347         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3348         just use an array of size MB_LEN_MAX.
3349         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3350         (find_recover_state): Change "err" to "*err"; this fixes what
3351         appears to be a real bug.
3352         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3353         versus int.
3354
3355 2005-08-25  Jim Meyering  <jim@meyering.net>
3356
3357         * open-safer.c: Include <config.h>.
3358         Otherwise, we'd lose LARGEFILE support in any file using
3359         e.g. "fcntl--.h"
3360
3361 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3362
3363         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3364         * regex.h (regerror): Likewise.
3365
3366         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3367         requires this.  (The code never needed it.)
3368
3369         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3370         All uses of recently-renamed identifiers changed to use the new,
3371         POSIX-compliant names.  The code will build and run just fine
3372         without these changes, but it's better to eat our own dog food
3373         and use the standard-conforming names.
3374
3375         * regex.h: Fix a multitude of POSIX name space violations.
3376         These changes have an effect only for programs that define
3377         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3378         do not change anything for programs compiled in the normal way.
3379         Also, there is no effect on the ABI.
3380
3381         (_REGEX_SOURCE): New macro.
3382         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3383         defined and _GNU_SOURCE is not; this fixes a name space violation.
3384
3385         Rename the following macros to obey POSIX requirements.
3386         The old names are still visible as macros if _REGEX_SOURCE is defined.
3387         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3388         RE_BACKSLASH_ESCAPE_IN_LISTS.
3389         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3390         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3391         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3392         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3393         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3394         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3395         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3396         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3397         (REG_INTERVALS): renamed from RE_INTERVALS.
3398         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3399         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3400         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3401         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3402         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3403         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3404         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3405         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3406         RE_UNMATCHED_RIGHT_PAREN_ORD.
3407         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3408         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3409         (REG_DEBUG): renamed from RE_DEBUG.
3410         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3411         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3412         unusual, since we can't clash with the POSIX REG_ICASE.
3413         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3414         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3415         (REG_NO_SUB): renamed from RE_NO_SUB.
3416         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3417         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3418         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3419         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3420         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3421         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3422         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3423         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3424         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3425         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3426         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3427         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3428         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3429         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3430         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3431         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3432         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3433         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3434         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3435         (REG_FIXED): Renamed from REGS_FIXED.
3436         (REG_NREGS): Renamed from RE_NREGS.
3437
3438         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3439         of other REG_* macros, since POSIX says the user is allowed to
3440         #undef these macros selectively.
3441
3442         (reg_errcode_t): Update comment stating what other tables need
3443         to be consistent.
3444
3445         Rename the following enum values to obey POSIX requirements.
3446         The old names are still visible as macros.
3447         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3448         is not defined, since GNU is supposed to be a superset of POSIX as
3449         much as possible, and since we want reg_errcode_t to be a signed
3450         type for implementation consistency.
3451         (_REG_NOERROR): Renamed from REG_NOERROR.
3452         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3453         (_REG_BADPAT): Renamed from REG_BADPAT.
3454         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3455         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3456         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3457         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3458         (_REG_EBRACK): Renamed from REG_EBRACK.
3459         (_REG_EPAREN): Renamed from REG_EPAREN.
3460         (_REG_EBRACE): Renamed from REG_EBRACE.
3461         (_REG_BADBR): Renamed from REG_BADBR.
3462         (_REG_ERANGE): Renamed from REG_ERANGE.
3463         (_REG_ESPACE): Renamed from REG_ESPACE.
3464         (_REG_BADRPT): Renamed from REG_BADRPT.
3465         (_REG_EEND): Renamed from REG_EEND.
3466         (_REG_ESIZE): Renamed from REG_ESIZE.
3467         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3468         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3469         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3470         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3471         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3472
3473         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3474         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3475         changed.  But support the old name if the new one is not defined
3476         and if _REGEX_SOURCE.
3477
3478         Change the following member names in struct re_pattern_buffer.
3479         The old names are still supported if !_REGEX_SOURCE.
3480         The new names are always supported, regardless of _REGEX_SOURCE.
3481         (re_buffer): Renamed from buffer.
3482         (re_allocated): Renamed from allocated.
3483         (re_used): Renamed from used.
3484         (re_syntax): Renamed from syntax.
3485         (re_fastmap): Renamed from fastmap.
3486         (re_translate): Renamed from translate.
3487         (re_can_be_null): Renamed from can_be_null.
3488         (re_regs_allocated): Renamed from regs_allocated.
3489         (re_fastmap_accurate): Renamed from fastmap_accurate.
3490         (re_no_sub): Renamed from no_sub.
3491         (re_not_bol): Renamed from not_bol.
3492         (re_not_eol): Renamed from not_eol.
3493         (re_newline_anchor): Renamed from newline_anchor.
3494
3495         Change the following member names in struct re_registers.
3496         The old names are still supported if !_REGEX_SOURCE.
3497         The new names are always supported, regardless of _REGEX_SOURCE.
3498         (rm_num_regs): Renamed from num_regs.
3499         (rm_start): Renamed from start.
3500         (rm_end): Renamed from end.
3501
3502         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3503         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3504         Prepend __ to parameter names.
3505
3506         Undo yesterday's changes.
3507
3508 2005-08-24  Jim Meyering  <jim@meyering.net>
3509
3510         Sync from coreutils.
3511         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3512
3513 2005-08-21  Bruno Haible  <bruno@clisp.org>
3514
3515         * lock.h: Add multiple inclusion guard.
3516         * tls.h: Add multiple inclusion guard.
3517
3518 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3519
3520         * regex.h (REG_NOSYS)
3521         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3522         Define, since POSIX requires it as of 2001.
3523         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3524         New private symbol, used to keep the enum signed in all cases.
3525         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3526         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3527
3528         * regex_internal.c (re_string_skip_chars, register_state):
3529         (calc_state_hash):
3530         Remove forward decls; no longer needed now that we use prototypes.
3531         * regexec.c (acquire_init_state_context, check_halt_node_context):
3532         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3533         (clean_state_log_if_needed): Likewise.
3534
3535 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3536
3537         Fix problems reported by Sam Steingold in
3538         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3539         * regexec.c (sift_states_bkref): Fix portability bug: the code
3540         assumed that reg_errcode_t is a signed type, which is not
3541         necessarily true if _XOPEN_SOURCE is not defined.
3542         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3543         some compilers warn about it otherwise.
3544
3545 2005-08-20  Jim Meyering  <jim@meyering.net>
3546
3547         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3548         of unused local, dfa.
3549
3550 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3551
3552         * regcomp.c (create_initial_state): Remove duplicate decl.
3553         (init_word_char, create_initial_state, duplicate_node_closure):
3554         (fetch_token, peek_token_bracket, build_range_exp):
3555         (build_collating_symbol): Remove forward decls; no longer needed
3556         now that we use prototypes.
3557
3558         * regcomp.c:
3559         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3560         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3561         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3562         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3563         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3564         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3565         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3566         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3567         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3568         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3569         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3570         (build_charclass, build_charclass_op, fetch_number, create_tree):
3571         (create_token_tree, mark_opt_subexp, duplicate_tree):
3572         Use prototypes rather than old-style definitions.
3573
3574         * regex_internal.c:
3575         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3576         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3577         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3578         (re_string_reconstruct, re_string_peek_byte_case):
3579         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3580         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3581         (re_node_set_init_copy, re_node_set_add_intersect):
3582         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3583         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3584         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3585         (re_acquire_state, re_acquire_state_context, register_state):
3586         (create_ci_newstate, create_cd_newstate, free_state):
3587         Likewise.
3588         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3589         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3590         (re_search_internal, prune_impossible_nodes):
3591         (acquire_init_state_context, check_matching, static):
3592         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3593         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3594         (update_regs, sift_states_backward, build_sifted_states):
3595         (clean_state_log_if_needed, merge_state_array):
3596         (update_cur_sifted_state, add_epsilon_src_nodes):
3597         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3598         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3599         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3600         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3601         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3602         (check_arrival, check_arrival_add_next_nodes):
3603         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3604         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3605         (check_node_accept_bytes, check_node_accept, extend_buffers):
3606         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3607         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3608         (sift_ctx_init):
3609         Likewise.
3610
3611         * regex_internal.h:
3612         (re_string_allocate, re_string_construct, re_string_reconstruct):
3613         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3614         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3615         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3616         (re_string_context_at, re_string_peek_byte_case):
3617         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3618         is defined, since we now use prototypes always.
3619
3620         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3621         C89 or better.  All uses removed.
3622
3623 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3624
3625         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3626         [defined lint]: Suppress bogus uninitialized-variable warnings.
3627
3628         * regcomp.c (duplicate_node): Return new index, not an error code,
3629         and let the caller return REG_ESPACE if out of space.  This
3630         removes an uninitialied-variable warning with GCC 4.0.1, and also
3631         avoids taking the address of a local variable.  All callers
3632         changed.
3633
3634 2005-08-19  Jim Meyering  <jim@meyering.net>
3635
3636         * regexec.c (proceed_next_node): Redo local variables to
3637         avoid GCC shadowing warnings.
3638
3639 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3640
3641         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3642         (re_node_set_insert_last, re_dfa_add_node):
3643         Rename local variables to avoid GCC shadowing warnings.
3644
3645 2005-08-18  Bruno Haible  <bruno@clisp.org>
3646
3647         * strstr.c (strstr): Fix return value in multibyte case.
3648         * strcasestr.c (strcasestr): Likewise.
3649
3650 2005-08-17  Jim Meyering  <jim@meyering.net>
3651
3652         Make the %s format (seconds since the epoch) work for a negative
3653         number and when used with a zero-padded field width, e.g. %015s.
3654
3655         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3656         label so that it precedes the code to set `digits'.  Otherwise,
3657         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3658         print `00-22'.  Now, it prints `-0022', as it should.
3659
3660 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3661
3662         * regex.h: Remove useless space-before-tab.  From coreutils.
3663
3664 2005-08-17  Bruno Haible  <bruno@clisp.org>
3665
3666         * strcasestr.h: New file.
3667         * strcasestr.c: New file.
3668
3669 2005-08-17  Bruno Haible  <bruno@clisp.org>
3670
3671         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3672         * strstr.c: Completely rewritten, with multibyte locale support.
3673
3674 2005-08-17  Bruno Haible  <bruno@clisp.org>
3675
3676         * strcasecmp.c: Use mbuiter.h.
3677
3678 2005-08-17  Bruno Haible  <bruno@clisp.org>
3679
3680         * mbuiter.h: New file.
3681
3682 2005-08-16  Bruno Haible  <bruno@clisp.org>
3683
3684         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3685         (mbi_init): Update.
3686         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3687         NUL byte, not after it.
3688
3689 2005-08-16  Bruno Haible  <bruno@clisp.org>
3690
3691         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3692         the valid ones. Makes the comparison operations transitive:
3693         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3694         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3695
3696 2005-08-16  Bruno Haible  <bruno@clisp.org>
3697
3698         * strcase.h (strcasecmp): Add note in comments.
3699         * strncasecmp.c: Use code from strcasecmp.c.
3700         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3701         (strcasecmp): Work correctly in multibyte locales.
3702
3703 2005-08-16  Bruno Haible  <bruno@clisp.org>
3704
3705         * strnlen1.h: New file.
3706         * strnlen1.c: New file.
3707
3708 2005-08-16  Bruno Haible  <bruno@clisp.org>
3709
3710         * mbfile.h: New file.
3711
3712 2005-08-16  Bruno Haible  <bruno@clisp.org>
3713
3714         * mbiter.h: New file.
3715
3716 2005-08-16  Bruno Haible  <bruno@clisp.org>
3717
3718         * mbchar.h: New file.
3719         * mbchar.c: New file.
3720
3721 2005-08-16  Bruno Haible  <bruno@clisp.org>
3722
3723         * tls.h: New file, from GNU gettext.
3724         * tls.c: New file, from GNU gettext.
3725
3726 2005-08-15  Bruno Haible  <bruno@clisp.org>
3727
3728         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3729         is defined.
3730
3731 2005-08-14  Jim Meyering  <jim@meyering.net>
3732
3733         Sync from coreutils.
3734
3735         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3736         Use the hash-table-based cycle-detection code not just when
3737         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3738         Reported by James Youngman in
3739         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3740         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3741         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3742         This lets us compile with -DFTS_DEBUG, once again.
3743         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3744         * fts.c (fd_safer): Remove decl.
3745         Include fcntl--.h rather than unistd-safer.h
3746         (fts_safe_changedir): Don't call fd_safer; no longer needed
3747         now that we include fcntl--.h.
3748
3749 2005-08-11  Simon Josefsson  <jas@extundo.com>
3750
3751         * readline.h, readline.c: New file.
3752
3753 2005-08-11  Bruno Haible  <bruno@clisp.org>
3754
3755         * strnlen.h (strnlen): Change parameter name to match comment.
3756
3757 2005-08-10  Simon Josefsson  <jas@extundo.com>
3758
3759         * strndup.c: Use strnlen.h.
3760
3761         * strnlen.h: New file.
3762
3763 2005-08-02  Simon Josefsson  <jas@extundo.com>
3764
3765         * getline.h, getline.c: Rewrite.
3766
3767         * getdelim.h, getdelim.c: New files, ported from glibc.
3768
3769 2005-07-31  Bruno Haible  <bruno@clisp.org>
3770
3771         * lock.h (gl_lock_initializer): New macro.
3772         (gl_lock_define_initialized): Use it.
3773         (gl_rwlock_initializer): New macro.
3774         (gl_rwlock_define_initialized): Use it.
3775         (gl_recursive_lock_initializer): New macro.
3776         (gl_recursive_lock_define_initialized): Use it.
3777
3778 2005-07-26  Bruno Haible  <bruno@clisp.org>
3779
3780         * lock.h: Update from GNU gettext.
3781         * lock.c: Update from GNU gettext.
3782
3783 2005-07-18  Bruno Haible  <bruno@clisp.org>
3784
3785         * lock.h (gl_once_t): New type.
3786         (gl_once_define, gl_once): New macros.
3787         * lock.c (fresh_once): New variable.
3788         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3789         functions.
3790
3791 2005-07-18  Simon Josefsson  <jas@extundo.com>
3792
3793         * check-version.c (check_version): Accept identical versions too.
3794
3795 2005-07-18  Bruno Haible  <bruno@clisp.org>
3796
3797         * lock.h: New file, from GNU gettext.
3798         * lock.c: New file, from GNU gettext.
3799
3800 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3801
3802         * quotearg.c: Add translator comment suggested by Bruno Haible,
3803         with a minor change.
3804
3805 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3806
3807         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3808         copyright symbol and the year.
3809         * version-etc.c (COPYRIGHT_YEAR): New constant.
3810         (version_etc_va): Use parameterized copyright notice.
3811         Reword to conform to the current GNU coding standards.
3812
3813 2005-07-11  Simon Josefsson  <jas@extundo.com>
3814
3815         * size_max.h: New file.
3816
3817 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3818
3819         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3820         block of defines.
3821
3822 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3823        and  Paul Eggert  <eggert@cs.ucla.edu>
3824
3825         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3826         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3827
3828 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3829
3830         * regex.c, regex.h: Sync from libc.
3831         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3832         New files, synced from libc, except that regex_internal.h
3833         currently has a small porting fix.
3834
3835 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3836
3837         Remove the dependency of the strftime module on the tzset module.
3838         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3839         Copy the input structure, to work around some of the bug with
3840         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3841         Solaris releases, you should also use the tzset module, but we won't
3842         require it as a dependency any more since we don't want LGPLed code
3843         to depend on GPLed code.
3844
3845 2005-07-02  Jim Meyering  <jim@meyering.net>
3846
3847         * backupfile.c (backup_args): Change a `0' to NULL.
3848
3849 2005-07-01  Jim Meyering  <jim@meyering.net>
3850
3851         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3852         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3853         * save-cwd.c, tempname.c:
3854         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3855         and don't include <sys/file.h>).
3856
3857 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3858
3859         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3860         declares only 'struct timespec;' (!).
3861
3862 2005-06-29  Jim Meyering  <jim@meyering.net>
3863
3864         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3865         type name.  Use the variable name instead.
3866         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3867
3868 2005-06-28  Simon Josefsson  <jas@extundo.com>
3869
3870         * check-version.h, check-version.c: New files.
3871
3872 2005-06-28  Simon Josefsson  <jas@extundo.com>
3873
3874         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3875         collision with global variable.  Better indentation.  Don't
3876         increment buffer pointer beyond buffer end.  Based on comments
3877         from Paul Eggert <eggert@cs.ucla.edu>.
3878
3879         * base64.h: Indent.
3880
3881 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3882
3883         * canon-host.c (canon-host): Append trailing "," to 0 in
3884         initializer of struct addrinfo, as an indication that we don't
3885         care how many members the structure has.
3886
3887 2005-06-24  Derek Price  <derek@ximbiot.com>
3888         and Bruno Haible  <bruno@clisp.org>
3889
3890         Remove stat module & update lstat.
3891         * stat.c: Remove this file...
3892         (slash_aware_lstat): ...moving this content and its support...
3893         * lstat.c (rpl_lstat): ...into here.
3894         * lstat.h: New file.
3895
3896 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3897
3898         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3899         (ranged_convert): Don't save conversion in a temporary struct.
3900         This causes a warning with GCC 4.0.0, and anyway in the typical
3901         case it's not worth the extra 100 bytes or so of code.
3902         (ranged_convert, __mktime_internal): When calling a function via a
3903         pointer P, use P () rather than (*P) (), as we now assume C89 or
3904         better.
3905
3906 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3907
3908         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3909         "who -r" failed to give output.  Problem reported by Tim Waugh.
3910
3911         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3912         (xcalloc): Use it to avoid needless tests.
3913         Problem reported by Jim Meyering.
3914
3915 2005-06-16  Jim Meyering  <jim@meyering.net>
3916
3917         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3918         when either N or S is zero.
3919
3920 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3921
3922         * argp.h (__option_is_short): Check upper limit of
3923         __key. Isprint() requires its argument to have the value
3924         of an unsigned char or EOF.
3925
3926 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3927
3928         * fnmatch.c (fnmatch): If there is an encoding error in a
3929         multibyte string or pattern, fall back on unibyte matching.
3930         Problem reported by James Youngman.
3931
3932 2005-06-08  Bruno Haible  <bruno@clisp.org>
3933
3934         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3935         warning on mingw.
3936
3937 2005-06-08  Bruno Haible  <bruno@clisp.org>
3938
3939         * csharpcomp.h: New file, from GNU gettext.
3940         * csharpcomp.c: New file, from GNU gettext.
3941         * csharpcomp.sh.in: New file, from GNU gettext.
3942
3943 2005-06-07  Derek Price  <derek@ximbiot.com>
3944
3945         Sync from CVS.
3946         * glob_.h: Indent nested #ifdef.
3947
3948 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3949
3950         Sync from coreutils.
3951         Use "file name" when talking about file names, instead of "filename"
3952         or "path", as per the GNU coding standards.
3953         * mkdir-p.c: Renamed from makepath.c.
3954         (make_dir_parents): Renamed from make_path.  All callers changed.
3955         * mkdir-p.h: Likewise.  All includers changed.
3956         * filenamecat.c: Renamed from path-concat.c.
3957         (file_name_concat): Renamed from path_concat.  All callers changed.
3958         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3959         * filenamecat.h: Likewise.  All includers changed.
3960         * acl.c: Don't use "path" or "filename" to mean "file name"
3961         in comments or local variable names.
3962         * basename.c: Likewise.
3963         * canonicalize.c, canonicalize.h: Likewise.
3964         * dirname.c, dirname.h: Likewise.
3965         * euidaccess.c: Likewise.
3966         * exclude.c: Likewise
3967         * fnmatch_.h, fnmatch_loop.c: Likewise.
3968         * fsusage.c, fsuage.h: Likewise.
3969         * fts.c, fts_.h: Likewise.
3970         * getcwd.c: Likewise.
3971         * getloadavg.c: Likewise.
3972         * mkstemp.c: Likewise.
3973         * mountlist.c, mountlist.h: Likewise.
3974         * openat.c, openat.h: Likewise.
3975         * readlink-stub.c: Likewise.
3976         * readutmp.c, readutmp.h: Likewise.
3977         * rename.c: Likewise.
3978         * rmdir.c: Likewise.
3979         * same.c: Likewise.
3980         * savedir.c: Likewise.
3981         * stripslash.c: Likewise.
3982         * tempname.c: Likewise.
3983         * xreadlink.c: Likewise.
3984         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3985         All uses changed.
3986         * exclude.h: Likewise.
3987
3988         * euidaccess.c (getuid, getgid, getuid, getegid)
3989         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3990         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3991         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3992         * pathmax.h: Include <limits.h> unconditionally, since other
3993         files have been getting away with it for years (MORE/BSD 4.3
3994         is extinct now).
3995         * userspec.c (getpwnam, getgrnam, getgrgid)
3996         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3997
3998         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3999         Define to 256, not 255, as per modern POSIX.
4000
4001 2005-06-01  Bruno Haible  <bruno@clisp.org>
4002
4003         * csharpexec.h: New file, from GNU gettext.
4004         * csharpexec.c: New file, from GNU gettext.
4005         * csharpexec.sh.in: New file, from GNU gettext.
4006
4007 2005-05-31  Derek Price  <derek@ximbiot.com>
4008             Paul Eggert  <eggert@cs.ucla.edu>
4009
4010         Sync from cvs.
4011         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4012
4013 2005-05-29  Derek Price  <derek@ximbiot.com>
4014             Paul Eggert  <eggert@cs.ucla.edu>
4015
4016         * glob_.h, glob.c: New files.
4017
4018 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4019
4020         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4021
4022         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4023         the configuration hassle isn't worth it.
4024         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4025         (LONGEST_MODIFIER, PRIuMAX): Remove.
4026
4027 2005-05-27  Bruno Haible  <bruno@clisp.org>
4028
4029         * getlogin_r.h: Remove second include of <stddef.h>.
4030
4031 2005-05-25  Bruno Haible  <bruno@clisp.org>
4032             Derek Price  <derek@ximbiot.com>
4033
4034         * getlogin_r.h: Simplify API documentation.
4035
4036 2005-05-25  Derek Price  <derek@ximbiot.com>
4037             Paul Eggert  <eggert@cs.ucla.edu>
4038
4039         * getlogin_r.c, getlogin_r.h: New files.
4040
4041 2005-05-22  Bruno Haible  <bruno@clisp.org>
4042
4043         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4044         Also include <sys/param.h> if it defines MIN, MAX.
4045         Based on a patch by Derek Price <derek@ximbiot.com>.
4046
4047 2005-05-22  Bruno Haible  <bruno@clisp.org>
4048
4049         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4050         (INT64_MIN): Fix definition.
4051         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4052
4053         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4054         NEED_SIGNED_INT_TYPES.
4055
4056         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4057         HAVE_SYSTEM_INTTYPES.
4058
4059 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4060
4061         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4062         so that unistd-safer.h (GPL'ed code) need not be included.
4063
4064 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4065
4066         New fts module.
4067         * fts.c: Don't include "cycle-check.h" or "hash.h".
4068         (setup_dir, free_dir): New functions.
4069         (enter_dir, leave_dir): Define trivial
4070         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4071         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4072         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4073         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4074         Move to fts-cycle.c.
4075         (fts_open): Use setup_dir.
4076         (fts_close): Use free_dir.
4077         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4078         This adds a label and some gotos, but the alternatives were messier.
4079         Check for memory allocation failure when entering a dir.
4080         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4081         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4082         (FTS): New member fts_cycle, that is a union that contains the
4083         old active_dir_ht and cycle_state.  All uses changed to mention
4084         fts_cycle.ht and fts_cycle.state.
4085         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4086         fts.c, with the following changes:
4087         (setup_dir, free_dir): New functions.
4088         (enter_dir): Now returns bool.  Return true if successful, false
4089         if memory exhausted.  All callers changed.
4090         Do not bother partly cleaning up on
4091         memory allocation failure; that is free_dir's job.
4092         However, free ad if hash_insert fails, to avoid memory leak.
4093         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4094         fts->fts_options to see which union member to use.
4095
4096 2005-05-20  Jim Meyering  <jim@meyering.net>
4097
4098         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4099         Now a macro, to pacify GCC.
4100
4101 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4102
4103         * chown.c (rpl_chown): Return -1 on failure.
4104
4105 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4106
4107         * canonicalize.c: Include canonicalize.h first, to test interface.
4108         Include <stddef.h> unconditionally, since we assume C89 now.
4109         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4110         * fts.c: Include fts_.h first, to check interface.
4111         Do not include intprops.h; no longer needed.
4112         Include cycle-check.h and hash.h, since fts_.h no longer does.
4113         Remove unnecessary casts of closedir to void.
4114         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4115         decide whether to decrement nlinks.
4116         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4117         (FTS): Use struct hash_table * instead of Hash_table, so that
4118         we no longer need to include hash.h here.
4119
4120 2005-05-17  Jim Meyering  <jim@meyering.net>
4121
4122         * fts.c, fts_.h: New files, from coreutils.
4123
4124 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4125
4126         Sync from coreutils.
4127         * unlinkdir.c, unlinkdir.h: New files.
4128         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4129         regex.h, unlocked-io.h, xtime.h:
4130         White space changes only.
4131         * makepath.c (make_path): Port to hosts where leading "//" is special.
4132         * yesno.c: Include getline.h, not ctype.h.
4133         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4134         Use getline to remove arbitrary restriction on response length.
4135
4136 2005-05-13  Bruno Haible  <bruno@clisp.org>
4137
4138         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4139         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4140         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4141         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4142         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4143         Add support for 64-bit integers in the MSVC compiler.
4144
4145 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4146
4147         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4148         Change the initial comment to refer to GPL, not LGPL.
4149         gnulib-tool will change it to LGPL as needed.
4150
4151         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4152         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4153         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4154         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4155         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4156         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4157         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4158         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4159         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4160         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4161         concatpath.c, config.charset, copy-file.c, copy-file.h,
4162         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4163         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4164         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4165         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4166         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4167         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4168         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4169         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4170         full-read.c, full-read.h, full-write.c, full-write.h,
4171         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4172         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4173         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4174         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4175         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4176         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4177         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4178         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4179         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4180         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4181         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4182         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4183         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4184         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4185         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4186         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4187         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4188         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4189         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4190         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4191         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4192         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4193         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4194         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4195         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4196         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4197         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4198         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4199         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4200         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4201         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4202         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4203         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4204         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4205         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4206         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4207         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4208         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4209         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4210         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4211         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4212         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4213         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4214         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4215         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4216         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4217         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4218         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4219         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4220         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4221         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4222         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4223         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4224         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4225         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4226         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4227         Update FSF postal mail address.
4228
4229 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4230
4231         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4232         specified in ai_socktype. Fix invalid ai_protocol
4233         check. ai_protocol is usually set to 0 or depending on
4234         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4235         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4236         ai_socktype / ai_protocol in the returned addrinfo structure.
4237
4238 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4239             Bruno Haible  <bruno@clisp.org>
4240
4241         * inet_ntop.h: New file.
4242         * inet_ntop.c: New file, from glibc with modifications.
4243
4244 2005-05-08  Jim Meyering  <jim@meyering.net>
4245
4246         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4247
4248 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4249
4250         Merge from coreutils.  Among other things,
4251         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4252         * fd-safer.c: New file.
4253         * fcntl-safer.h, open-safer.c: Remove.
4254         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4255         * dup-safer.c: Include unistd-safer.h first.
4256         Don't include errno.h.
4257         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4258         * file-type.h: Don't assume invoker included sys/stat.h first.
4259         * file-type.c: Rely on file-type.h change.
4260         * getloadavg.c: Include unistd-safer.h.
4261         (getloadavg): Use safer open.
4262         * getusershell.c: Include "stdio-safer.h".
4263         (getusershell): Use safer fopen.
4264         * long-options.c (long_options): Use NULL rather than 0.
4265         * modechange.h (mode_free): Remove; all callers changed to invoke
4266         'free'.
4267         * modechange.c: Likewise.
4268         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4269         (MODE_DONE): New constant.
4270         (struct mode_change): Remove 'next' member.
4271         (make_node_op_equals): New function; like the old one of the
4272         same name, except it allocates an array.
4273         (mode_compile, mode_create_from_ref): Use it.
4274         (mode_compile): Allocate result as an array, not a linked list.
4275         Parse octal string ourself, so that we catch mistakes like "+0".
4276         (mode_adjust): Arg is an array, not a linked list.
4277         * modechange.c: Include stat-macros.h, xalloc.h.
4278         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4279         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4280         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4281         Remove.  This is now stat-macros.h's job.
4282         (talloc): Remove.  All callers replaced by xalloc, so that
4283         our invokers don't have to worry about reporting memory failures.
4284         (make_node_op_equals): Remove.
4285         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4286         New constants.
4287         (struct mode_change): Moved here from modechange.h.
4288         (mode_append_entry): Remove.
4289         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4290         apps to have incorrect behavior.  Use simpler algorithm for head
4291         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4292         Detect more invalid usages rather than having somewhat-random behavior.
4293         Don't insert an "a=" action, as that leads to incorrect behavior.
4294         (mode_compile, mode_create_from_ref): Return NULL on error instead
4295         of an enum, since now there's only one way to have an error.  All
4296         callers changed.
4297         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4298         at the correct time.  Simplify calculation of "+u" and its ilk.
4299         Don't mishandle "+X".
4300         (mode_free): Remove "register" and localize decls.
4301         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4302         (struct mode_change): Move to modechange.c; callers don't
4303         need to see this stuff.
4304         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4305         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4306         (mode_change, mode_adjust): Reflect the new signatures noted above.
4307         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4308         that might redefine system include files.
4309         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4310         (my_usleep): Use NULL rather than (void *) 0.
4311         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4312         Use siginterrupt to specify that system calls should be interrupted.
4313         (rpl_nanosleep): Move initialization of suspended closer to call of
4314         my_usleep.
4315         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4316         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4317         (desirable_utmp_entry): New function.
4318         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4319         using x2nrealloc, to simplify logic.
4320         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4321         size calculation.  Do not assume utmp file is a regular file.
4322         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4323         (READ_UTMP_CHECK_PIDS): New constant.
4324         * save-cwd.c: Include unistd-safer.h.
4325         (save_cwd): Use fd_safer.
4326         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4327         [!_LIBC] Include "stat-macros.h" instead.
4328         * unistd-safer.h (fd_safer): New decl.
4329
4330 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4331
4332         * byteswap_.h: New file.
4333
4334 2005-04-25  Albert Chin  <china@thewrittenword.com>
4335
4336         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4337         Toolkit C bug.
4338
4339 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4340
4341         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4342         that "UTC +1 second" continues to work.  Problem reported
4343         by Dmitry V. Levin.
4344         (relunit_snumber): New rule.
4345         (relunit): Use it.
4346
4347 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4348
4349         * getdate.y (universal_time_zone_table): New constant.
4350         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4351         universal_time_zone_table.
4352         (lookup_zone): Prefer universal_time_zone_table to
4353         local_time_zone_table, so that "GMT" time stamps are allowed in
4354         London during the summer.  Problem reported by Ian Abbott.
4355
4356 2005-04-12  Jim Meyering  <jim@meyering.net>
4357
4358         * human.c (humblock): Set *options even when returning due to
4359         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4360         warning from gcc-4.
4361
4362 2005-04-09  Jim Meyering  <jim@meyering.net>
4363
4364         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4365         -Wuninitialized: initialize tm0.tm_year.
4366
4367 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4368
4369         * getdate.y (parser_control): rels_seen is now a boolean, not a
4370         count, since there's no maximum.  All uses changed.
4371         Add member dsts_seen.
4372         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4373         not being INT_MAX.
4374         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4375         Use pc_rels_seen to decide whther a date is absolute.
4376
4377         * getdate.y (number): Don't overwrite year.
4378         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4379         check.
4380
4381 2005-04-02  Simon Josefsson  <jas@extundo.com>
4382
4383         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4384         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4385
4386 2005-03-27  Jim Meyering  <jim@meyering.net>
4387
4388         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4389
4390 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4391
4392         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4393         "one's complement" -> "ones' complement" in comment, as per Knuth.
4394         "value of type" -> "type or expression" in comment.
4395         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4396
4397 2005-03-26  Jim Meyering  <jim@meyering.net>
4398
4399         Comment nits.
4400         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4401         Correct typos: s/or/of/.
4402
4403 2005-03-23  Jim Meyering  <jim@meyering.net>
4404
4405         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4406
4407 2005-03-21  Jim Meyering  <jim@meyering.net>
4408
4409         Changes imported from coreutils.
4410
4411         * cycle-check.c: Don't include xalloc.h.
4412
4413         * path-concat.c: Don't include assert.h.
4414         (path_concat): Remove assertion that would have triggered
4415         for ABASE starting with more than one slash.
4416         Reported by Andreas Schwab.
4417
4418         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4419         properly when ABASE is an absolute file name.
4420         Correct the description of this function.
4421         Include <assert.h>.
4422         Add an assertion and a test driver.
4423         This fixes a bug introduced on 2004-07-02.
4424         Andreas Schwab reported the resulting failure of cp --parents:
4425         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4426
4427 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4428
4429         * strftime.c (my_strftime): If the underlying strftime returns 0
4430         (which shouldn't happen), generate nothing instead of returning 0
4431         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4432
4433 2005-03-16  Bruno Haible  <bruno@clisp.org>
4434
4435         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4436
4437 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4438
4439         * strftime.c (my_strftime): Prepend space to format so that we can
4440         reliably distinguish strftime failure from empty output on POSIX
4441         hosts.
4442
4443 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4444
4445         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4446         (iconv_string): Don't guess a size-zero buffer, as that might cause
4447         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4448         result would be 'too large', where 'too large' is (heuristically)
4449         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4450         overflow concerns.  This will prevent some unwanted malloc failures
4451         when the inputs are very large.
4452
4453 2005-03-15  Bruno Haible  <bruno@clisp.org>
4454
4455         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4456         'negate'.
4457
4458         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4459         variable.
4460
4461         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4462
4463 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4464
4465         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4466         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4467         intprops.h.
4468         * strtol.c: Likewise.
4469
4470 2005-03-14  Simon Josefsson  <jas@extundo.com>
4471
4472         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4473         <fx@gnu.org>.
4474
4475 2005-03-14  Jim Meyering  <jim@meyering.net>
4476
4477         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4478         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4479         to be nonzero so that we (and caller) can detect the difference
4480         between a valid zero-length expansion and an error return, even
4481         when the underlying strftime fails before writing anything into
4482         that location.
4483
4484 2005-03-10  Jim Meyering  <jim@meyering.net>
4485
4486         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4487         so that this module works on systems without fchdir.
4488
4489 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4490
4491         Factor int-properties macros into a single file, except for
4492         glibc-related files.
4493         * intprops.h: New file.
4494         * getloadavg.c: Include it instead of limits.h.
4495         (INT_STRLEN_BOUND): Remove.
4496         * human.c: Include intprops.h.
4497         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4498         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4499         * inttostr.h: Include intprops.h instead of limits.h.
4500         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4501         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4502         for consistency with intprops.h.
4503         (time_t_is_integer, twos_complement_arithmetic): Use them.
4504         * sig2str.h: Include <signal.h>, intprops.h.
4505         (INT_STRLEN_BOUND): Remove.
4506         * strftime.c (TYPE_SIGNED): Remove.
4507         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4508         * strtol.c: Adjust comments to match intprops.h.
4509         * userspec.c: Include intprops.h.
4510         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4511         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4512         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4513         instead of rolling our own expressions.
4514         * xstrtol.c: Include xstrtol.h first, to test interface.
4515
4516         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4517         instead of int.
4518         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4519         the right thing even if adding 1900 would overflow.  Similarly
4520         for tm_mon + 1 and tm_yday + 1.
4521         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4522         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4523         (DO_SIGNED_NUMBER): New macro.
4524         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4525
4526 2005-03-07  Bruno Haible  <bruno@clisp.org>
4527
4528         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4529
4530 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4531             Bruno Haible  <bruno@clisp.org>
4532
4533         * pagealign_alloc.h: New file.
4534         * pagealign_alloc.c: New file.
4535
4536 2005-01-28  Bruno Haible  <bruno@clisp.org>
4537
4538         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4539         stpncpy.c uses it.
4540
4541 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4542
4543         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4544         The workaround isn't strictly needed for POSIX conformance, and
4545         it's too much of a pain to configure and maintain.  We'll ask
4546         people to fix their kernels instead.
4547         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4548         (NANOSLEEP_BUG_WORKAROUND): Remove.
4549         (xnanosleep): Remove the workaround.
4550
4551 2005-02-12  Bruno Haible  <bruno@clisp.org>
4552
4553         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4554
4555 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4556
4557         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4558         * timespec.h (gettime): Return void, since it always
4559         succeeds now.  All uses changed.
4560         * gettime.c (gettime) Likewise.
4561         [HAVE_NANOTIME]: Prefer nanotime.
4562         Assume gettimeofday succeeds, as POSIX requires.
4563         Assime time () succeeds, since other code already does.
4564         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4565         (timespec_subtract): Remove.
4566         (NANOSLEEP_BUG_WORKAROUND): New constant.
4567         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4568         things considerably.  Use it only on GNU/Linux hosts, since the
4569         workaround shouldn't be needed elsewhere.
4570
4571 2005-02-24  Bruno Haible  <bruno@clisp.org>
4572
4573         * gettext.h: Update from GNU gettext 0.14.2.
4574
4575 2005-02-24  Bruno Haible  <bruno@clisp.org>
4576
4577         * localcharset.c: Update from GNU gettext 0.14.2.
4578         * config.charset: Update from GNU gettext 0.14.2.
4579
4580 2005-02-22  Simon Josefsson  <jas@extundo.com>
4581
4582         * iconvme.h, iconvme.c: New files, from libc.
4583
4584 2005-02-20  Neil Conway  <neilc@samurai.com>
4585
4586         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4587         returned by OSX/Darwin if the specified buffer is not large
4588         enough for the hostname.
4589
4590 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4591
4592         * memrchr.h: New file.
4593         * chdir-long.c: Include it.
4594         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4595         Don't bother including stddef.h.
4596
4597 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4598
4599         * argp-help.c (__argp_help): Create a fake struct argp_state and
4600         pass it to _help, otherwise the latter coredumps trying to
4601         dereference state.root_argp.
4602
4603 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4604
4605         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4606         inclusion.
4607         Include <sys/types.h>, for dev_t.
4608         (ME_DUMMY, ME_REMOTE): Move from here....
4609         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4610         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4611         Dmitry V. Levin.
4612         Include mountlist.h first, to test the interface.
4613
4614 2005-01-29  Bruno Haible  <bruno@clisp.org>
4615
4616         * progname.c (program_name): Initialize.
4617         Needed when linking statically on MacOS X.
4618
4619 2005-01-28  Bruno Haible  <bruno@clisp.org>
4620
4621         * javacomp.sh.in: New file, from GNU gettext.
4622         * javacomp.h: New file, from GNU gettext.
4623         * javacomp.c: New file, from GNU gettext.
4624
4625 2005-01-26  Bruno Haible  <bruno@clisp.org>
4626
4627         * javaexec.sh.in: New file, from GNU gettext.
4628         * javaexec.h: New file, from GNU gettext.
4629         * javaexec.c: New file, from GNU gettext.
4630
4631 2005-01-26  Simon Josefsson  <jas@extundo.com>
4632
4633         * gai_strerror.c: Use GPL in header.
4634
4635 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4636
4637         * argp-help.c (hol_entry_help): Avoid using non-constant
4638         initializers for struct pentry_state.
4639         (__argp_error): Check return value of __asprintf
4640         (__argp_failure): Translate error message
4641
4642         * argp-parse.c: Removed braces around the expansion of N_()
4643
4644 2005-01-21  Jim Meyering  <jim@meyering.net>
4645
4646         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4647         same value as for Solaris 9.
4648
4649         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4650         component length.  This included changing the parameter to be
4651         of type `char *' rather than `char const *'.
4652         * chdir-long.h (chdir_long): Update prototype.
4653
4654         * openat.c (fdopendir, fstatat): New functions.
4655         * openat.h: Include headers required for use of DIR and struct stat.
4656         [AT_SYMLINK_NOFOLLOW]: Define.
4657         (fdopendir, fstatat): Add prototypes.
4658
4659 2005-01-21  Bruno Haible  <bruno@clisp.org>
4660
4661         * classpath.h: New file, from GNU gettext.
4662         * classpath.c: New file, from GNU gettext.
4663
4664 2005-01-20  Simon Josefsson  <jas@extundo.com>
4665
4666         * version-etc-fsf.c: New file, with version_etc_copyright.
4667         * version-etc.c: Remove version_etc_copyright.
4668         * version-etc.h (version_etc_copyright): Use [] instead of * in
4669         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4670
4671 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4672
4673         * save-cwd.c (save_cwd): Remove code to support the case
4674         where fchdir is missing or flaky.
4675
4676 2005-01-20  Simon Josefsson  <jas@extundo.com>
4677
4678         * base64.h (isbase64): Add.
4679
4680         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4681         using a unsigned prototype, don't inline.
4682         (base64_decode): Use it.
4683
4684 2005-01-19  Bruno Haible  <bruno@clisp.org>
4685
4686         * sh-quote.h: New file, from GNU gettext.
4687         * sh-quote.c: New file, from GNU gettext.
4688
4689 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4690
4691         Merge changes from coreutils, as described below in several
4692         changelogs dated today.
4693
4694         * save-cwd.c: Include "save-cwd.h" before other include files.
4695         (O_DIRECTORY): Remove; not needed here, since "." must be
4696         a directory.  All uses removed.
4697         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4698         universal on Suns, and we also need to test for IRIX.
4699         Revamp code to use 'if' rather than '#if'.
4700         Avoid unnecessary comparison of cwd->desc to 0.
4701
4702         * utimens.c (futimens): Robustify the previous patch, by checking
4703         for known valid error numbers rather than observed invalid ones.
4704
4705 2005-01-18  Jim Meyering  <jim@meyering.net>
4706
4707         * version-etc.c (version_etc_copyright): Update copyright date.
4708
4709         * utimens.c (futimens): Account for the fact that futimes
4710         can also fail with errno == ENOSYS or errno == ENOENT.
4711         Patch from Dmitry V. Levin.
4712
4713         Change the name of the robust chdir function from chdir to chdir_long.
4714         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4715         (restore_cwd): Use chdir_long, not chdir.
4716         * chdir-long.c: Renamed from chdir.c.
4717         * chdir-long.h: Renamed from chdir.h.
4718         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4719         Hurd.
4720
4721 2005-01-18  Bob Proulx  <bob@proulx.com>
4722
4723         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4724         offsetof() macro construct to avoid compile failure with native HP-UX
4725         11.0 ANSI C compiler.
4726
4727 2005-01-06  Bruno Haible  <bruno@clisp.org>
4728
4729         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4730         because stpncpy.m4 takes care of it.
4731
4732 2004-01-24  Bruno Haible  <bruno@clisp.org>
4733
4734         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4735
4736 2003-10-09  Bruno Haible  <bruno@clisp.org>
4737
4738         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4739
4740 2005-01-06  Bruno Haible  <bruno@clisp.org>
4741
4742         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4743         * fwriteerror.c: Include <stdbool.h>.
4744         (fwriteerror): At the end, close the file stream. Record whether
4745         stdout was already closed.
4746
4747 2004-05-27  Bruno Haible  <bruno@clisp.org>
4748
4749         * execute.c (environ): Declare if needed.
4750         * pipe.c (environ): Likewise.
4751         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4752
4753 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4754
4755         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4756         definitions to be after all include files, to avoid collisions.
4757         Problem reported by Bob Proulx.
4758
4759 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4760
4761         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4762         not needed.  This removes a dependency on the gettext module.
4763         [defined _LIBC]: Do not include <libintl.h>; not needed.
4764
4765 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4766
4767         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4768         HAVE_DECL_STRTOLD.
4769
4770 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4771
4772         * argp-parse.c: Include <stddef.h>.
4773         (alignof, alignto): New macros.
4774         (parser_init): Don't assume that void * is aligned sufficiently
4775         for struct option.
4776
4777         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4778         need to extend the stack.
4779         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4780         large.
4781
4782 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4783
4784         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4785
4786 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4787
4788         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4789         Remove now-obsolete comment about AIX.
4790         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4791         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4792         (YYMAXDEPTH): New macro.
4793
4794 2004-12-18  Bruno Haible  <bruno@clisp.org>
4795
4796         * fatal-signal.c (fatal_signals): Make non-const.
4797         (init_fatal_signals): New function.
4798         (uninstall_handlers, install_handlers): Ignore signals that were set to
4799         SIG_IGN.
4800         (at_fatal_signal): Call init_fatal_signals.
4801         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4802         SIG_IGN.
4803         Reported by Paul Eggert.
4804
4805 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4806
4807         * getdate.y (textint): New member "negative".
4808         (time_zone_hhmm): New function.
4809         Expect 14 shift-reduce conflicts, not 13.
4810         (o_colon_minutes): New rule.
4811         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4812         (yylex): Set the "negative" member of signed numbers.
4813
4814 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4815
4816         Changes imported from coreutils.
4817         * hard-locale.c: Assume <locale.h> exists.
4818         Include "strdup.h".
4819         (GLIBC_VERSION): New macro.
4820         (hard_locale): Assume setlocale exists.
4821         Rewrite to avoid #ifdef.
4822         Use strdup rather than malloc + strcpy.
4823         * human.c: Assume <locale.h> exists.
4824         (human_readable): Assume localeconv exists.
4825
4826 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4827
4828         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4829         convert T2, not T.  (Imported from libc.)
4830
4831 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4832
4833         * getcwd.c (is_ENAMETOOLONG): New macro.
4834         (__getcwd.c): Don't restore errno; glibc doesn't.
4835         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4836         first, falling back to our code only if its results look suspicious.
4837         Ensure that the resulting buffer is only as large as necessary.
4838
4839         * readutmp.c: Include readutmp.h first.
4840         Include <errno.h>, since readutmp.h no longer does that.
4841         * readutmp.h: Don't include <errno.h>,
4842         <sys/param.h>, <time.h>; not needed to establish interface.
4843         (errno): Remove decl.
4844         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4845         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4846         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4847
4848 2004-11-28  Simon Josefsson  <jas@extundo.com>
4849
4850         * base64.h, base64.c: New file.
4851
4852 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4853
4854         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4855
4856 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4857
4858         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4859         HP's ANSI C compiler.
4860         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4861         Declaring int functions causes warnings on some modern systems and
4862         shouldn't be needed to compile on ancient ones.
4863         * same.c (MIN) [defined MIN]: Don't define, since it's already
4864         defined.
4865
4866         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4867         with the following changes.
4868         (__set_errno): Parenthesize properly.
4869         Include <stdbool.h>.
4870         (MIN, MAX, MATCHING_INO): New macros.
4871         (__getcwd): Define with prototype, not K&R form.
4872         Use heuristics to allocate default buffer on stack if possible.
4873         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4874         behavior, and to avoid the PATH_MAX limit when computing
4875         ../../../../...
4876         Use MATCHING_INO to compare inode number to file.
4877         Check for arithmetic overflow in size calculations.
4878         Fix bug in reallocation of dot array that caused getcwd to fail
4879         on directories nested deeper than 75.
4880         Be more careful about saving errno on error.
4881         Do not use realloc; use only free+malloc, as this is a bit
4882         more flexible and avoids a needless copy operation.
4883         Do not inspect st_dev and st_ino for symbolic links; POSIX
4884         doesn't specify the latter.
4885         Check for closedir errors.
4886         Avoid needless casts.
4887         Use "#ifdef weak_alias" around weak_alias, to be like other
4888         glibc code.
4889         The following changes to getcwd.c have effect only when used in
4890         gnulib; they have no effect inside glibc proper.
4891         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4892         as alloca isn't used.
4893         (alloca, __alloca): Likewise.
4894         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4895         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4896         unconditionally, as gnulib assumes C89 or better.
4897         Do not include <sys/param.h>.
4898         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4899         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4900         better.
4901         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4902         Include <dirent.h> in a way that is compatible with modern Autoconf.
4903         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4904         New macros, if not already defined.
4905         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4906         Use "_LIBC", not "defined _LIBC", for consistency.
4907         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4908         a mempcpy module.
4909         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4910         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4911         * xgetcwd.c: David MacKenzie's old code was removed, so give
4912         credit only to Jim Meyering and adjust the copyright dates.
4913         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4914         <stdlib.h>, <unistd.h>, "pathmax.h".
4915         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4916         (INITIAL_BUFFER_SIZE): Remove.
4917         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4918
4919 2004-11-23  Jim Meyering  <jim@meyering.net>
4920
4921         * getopt_.h: Remove trailing blanks.
4922
4923 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4924
4925         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4926         (futimens): New function, which uses futimes if available.
4927         (futimens, utimens): Support timespec==NULL, with same semantics
4928         as utime and utimens.
4929         * utimens.h (futimens): New decl.
4930
4931 2004-11-23  Jim Meyering  <jim@meyering.net>
4932
4933         * __fpending.c: Add comment.
4934
4935 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4936
4937         * getopt_.h: Re-addition of __getopt_argv_const caused
4938         redefinition warnings. To avoid them, include the defines
4939         in `#if !defined __need_getopt ... #endif'. The only place
4940         where __getopt_argv_const is used is in definitions
4941         of getopt_long and getopt_long_only below, which are as well
4942         protected by `#ifndef __need_getopt'.
4943         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4944         __need_getopt after including <stdio.h> and <unistd.h> These
4945         headers might have defined it.
4946
4947 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4948
4949         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4950         New macros.
4951         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4952         optopt): Use them instead of invoking ## directly; otherwise, the
4953         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4954
4955 2004-11-19  Bruno Haible  <bruno@clisp.org>
4956
4957         * strtok_r.c: Move comments from here...
4958         * strtok_r.h: ... to here.
4959
4960 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4961
4962         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4963         might fail.  Problem reported by Yoann Vandoorselaere.
4964         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4965         that mishandle size_t overflow.
4966
4967 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4968
4969         * canon-host.c: Include "strdup.h".
4970         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4971         Use strdup instead of malloc/strcpy to duplicate strings.
4972
4973         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4974         (human_space_before_unit): New constant.
4975         * human.c (human_readable): Support it.
4976
4977         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4978         (xgetcwd): Set errno correctly when failing.
4979         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4980         the failure is actually due to a PATH_MAX problem.
4981
4982         Further getopt changes to make it more likely that glibc will
4983         buy the changes back.
4984         * getopt.c (POSIXLY_CORRECT): New constant.
4985         (getopt): Use it, so to preserve glibc semantic
4986         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4987         when compiling for libc.
4988         * getopt_.h (__getopt_argv_const): Bring it back.
4989         (getopt_long, getopt_long_only): Use it.
4990
4991         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4992         New arg POSIXLY_CORRECT.  All callers changed.
4993         (getopt): Argv is now char * const *, as per standard.
4994         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4995         not char *__getopt_argv_const *.
4996         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4997         _getopt_long_only_r): Likewise.
4998         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4999         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5000         _getopt_long_r, _getopt_long_only_r): Likewise.
5001         * getopt_.h (__getopt_argv_const): Remove.
5002         (getopt): Argv is now char * const *, as per standard.
5003
5004         * getdate.y (tORDINAL): New token.
5005         (day, relunit): Allow it for relative times.
5006         (relative_time_table): Use tORDINAL for ordinals.
5007
5008 2004-11-15  Jim Meyering  <jim@meyering.net>
5009
5010         * closeout.c: Include "__fpending.h" once again.
5011         Include <stdbool.h>.
5012         (close_stdout): Don't fail just because stdout was closed initially,
5013         since some programs don't write to stdout in the normal course of
5014         operation (other than --version and --help), and we don't want this
5015         function to make e.g. `touch file >&-' fail.
5016         But do fail if it was closed and someone has tried to write to it.
5017         E.g., `printf foo >&-' must fail.
5018
5019 2004-11-11  Simon Josefsson  <jas@extundo.com>
5020
5021         * strtok_r.h, strtok_r.c: New file.
5022
5023 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5024
5025         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5026         we can stop lying to compilers about the constness of argv when we
5027         are compiled outside glibc.
5028         (getopt, getopt_long, getopt_long_only): Use it.
5029         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5030         getopt): Likewise.
5031         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5032         _getopt_long_only_r): Likewise.
5033         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5034         _getopt_long_only_r): Likewise.
5035
5036         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5037         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5038         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5039         the other external symbols.
5040         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5041         declaration, since the above renaming now works around collisions.
5042
5043 2004-11-11  Jim Meyering  <jim@meyering.net>
5044
5045         * linebreak.c: Remove trailing blanks.
5046         * alloca_.h: Likewise.
5047         * acosl.c: Likewise.
5048         * euidaccess.c: Likewise.
5049         * allocsa.h: Likewise.
5050
5051 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5052
5053         * mktime.c (SHR): New macro, which is a portable
5054         substitute for >> that should work even on Crays.
5055         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5056         Problem reported by Mark D. Baushke in
5057         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5058         * getdate.y (SHR): Likewise.
5059         (tm_diff): Use it.
5060         * strftime.c (SHR): Likewise.
5061         (tm_diff): Use it.
5062         * quotearg.c (struct quoting_options): Use unsigned int for
5063         quote_these_too, so that right shifts are well defined.  All uses
5064         changed.
5065
5066 2004-11-10  Simon Josefsson  <jas@extundo.com>
5067
5068         * getaddrinfo.h, getaddrinfo.c: New files.
5069
5070 2004-11-10  Jim Meyering  <jim@meyering.net>
5071
5072         Ensure that no close failure goes unreported.
5073         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5074         return early when it seems there's nothing to flush.
5075         Don't include __fpending.h.
5076
5077 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5078
5079         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5080
5081 2004-11-05  Bruno Haible  <bruno@clisp.org>
5082
5083         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5084         Reported by Mark D. Baushke <mdb@cvshome.org>.
5085
5086 2004-11-04  Bruno Haible  <bruno@clisp.org>
5087
5088         2004-09-11  Bruno Haible  <bruno@clisp.org>
5089                 * allocsa.valgrind: New file.
5090         2004-02-06  Bruno Haible  <bruno@clisp.org>
5091                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5092                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5093                 Reported by Christopher Seip <chris.seip@hp.com>.
5094
5095 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5096
5097         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5098         with errno == ERANGE if the buffer is too small.
5099         Problem reported by Mark D. Baushke.
5100
5101 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5102
5103         * xreadlink.c (MAXSIZE): New macro.
5104         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5105         size does not exceed MAXSIZE.  Avoid cast.
5106         As suggested by Mark D. Baushke in
5107         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5108         if readlink fails with buffer size just under MAXSIZE, try again
5109         with MAXSIZE.
5110
5111 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5112         and  Paul Eggert  <eggert@cs.ucla.edu>
5113
5114         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5115         (get_date): Overparenthesize to avoid GCC warning.
5116
5117 2004-11-02  Bruno Haible  <bruno@clisp.org>
5118
5119         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5120         function returns void.
5121
5122 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5123
5124         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5125         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5126         already declared.
5127
5128 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5129
5130         * getdate.y: Add support for TZ="foo" within a date string.
5131         Fix some bugs near time_t boundaries.  Reject dates with
5132         out-of-range components, e.g., "Sept 31".
5133         Include <stdlib.h>, "setenv.h", "xalloc.h".
5134         (ISDIGIT_LOCALE): Remove; unused.
5135         Note that the TZ and time functions used here are not reentrant.
5136         (mktime_ok, get_tz): New functions.
5137         (TZBUFSIZE): New constant.
5138         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5139         This requires that we sometimes generate our own TZ="XXX..." setting.
5140
5141 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5142
5143         * mktime.c (not_equal_tm): Remove redundant check.
5144
5145 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5146
5147         * getdate.y: Use Bison 1.875 features, and some minor
5148         code cleanups.  This change does not affect semantics.
5149         Don't include <stdlib.h>; no longer needed.
5150         Don't include unlocked-io.h; only the "#if TEST" code uses
5151         stdio, and performance isn't crucial there.
5152         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5153         Bison 1.875 features as described below.
5154         All uses of "PC." replaced by "pc->".
5155         (YYSTYPE): Add a forward declaration.
5156         (yylex, yyerror): Use full prototypes in forward decls.
5157         Use "%pure-parser" rather than obsolescent "%pure_parser".
5158         Use %parse-param and %lex-param instead of obsolescent
5159         YYPARSE_PARAM and YYLEX_PARAM.
5160         (meridian_table, month_and_day_table, time_units_table,
5161         relative_time_table, time_zone_table, military_table,
5162         lookup_zone, lookup_word, get_date):
5163         Use NULL instead of 0 where appropriate.
5164         (to_hour): Avoid abort (), to avoid a dependency on
5165         stdlib.h.
5166         (yyerror, yylex): Now accepts parser_control * arg.
5167         (main) [TEST]: Use '\0' rather than 0 for char.
5168
5169 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5170
5171         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5172         It's now the caller's responsibility to handle the case where
5173         !HAVE_GETPAGESIZE && !defined getpagesize.
5174
5175         * mktime.c (leapyear): Arg is long int, not int.
5176
5177 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5178
5179         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5180
5181 2004-10-12  Simon Josefsson  <jas@extundo.com>
5182
5183         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5184         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5185         to real functions.
5186
5187 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5188
5189         * vsnprintf.h: New file.
5190         * vsnprintf.c: New file.
5191
5192 2004-10-07  Bruno Haible  <bruno@clisp.org>
5193
5194         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5195         into the provided buffer.
5196
5197 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5198
5199         * diacrit.c, diacrit.h: Add GPL notice.
5200
5201         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5202         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5203         * logl.c (logl): Keep the code as similar to glibc as possible.
5204         This avoids a potential constant-folding bug.
5205
5206 2004-10-05  Bruno Haible  <bruno@clisp.org>
5207
5208         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5209
5210 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5211
5212         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5213         * xmalloc.c (xmemdup): Likewise.
5214         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5215         XFREE): Remove these long-obsolescent macros.
5216         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5217         * xstrdup.c: Remove.
5218
5219         * regex.c (re_comp): Cast gettext return value to char *,
5220         Problem reported by Martin Neitzel via Mark D. Baushke.
5221
5222 2004-10-04  Simon Josefsson  <jas@extundo.com>
5223
5224         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5225         '#ifdef USE_UNLOCKED_IO'.
5226
5227 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5228
5229         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5230         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5231         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5232         regex.c, sha1.c, version-etc.c, yesno.c:
5233         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5234         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5235         the includer's responsibility.
5236
5237         Sync from coreutils.
5238
5239         * modechange.c (mode_compile): Don't decrement a pointer that
5240         points to the start of a string, as the C Standard says the
5241         resulting behavior is undefined.
5242
5243         * backupfile.h (enum backuptype): Rename none -> no_backups,
5244         simple -> simple_backups, numbered_existing ->
5245         numbered_existing_backups, numbered -> numbered_backups
5246         to avoid shadowing problems.  All uses changed.
5247         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5248         * backupfile.c (check_extension, numbered_backup):
5249         Rename locals to avoid shadowing 'basename'.
5250         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5251         once.
5252
5253         * .cppi-disable: Add getopt_.h, getopt_int.h.
5254         * .cvsignore: Add getopt.h.
5255
5256 2004-10-04  Simon Josefsson  <jas@extundo.com>
5257
5258         * memmem.h: New file.
5259         * memmem.c: New file, taken from glibc.
5260
5261 2004-10-02  Jim Meyering  <jim@meyering.net>
5262
5263         * dirfd.h, getpagesize.h: Add copyright notice.
5264
5265 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5266
5267         * snprintf.c: Remove comments as to why each header is needed.
5268
5269 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5270
5271         * strsep.h: New file.
5272         * strsep.c: New file.
5273
5274 2004-10-01  Simon Josefsson  <jas@extundo.com>
5275
5276         * snprintf.c (snprintf): Handle size==0.
5277
5278 2004-10-01  Simon Josefsson  <jas@extundo.com>
5279             Bruno Haible  <bruno@clisp.org>
5280
5281         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5282         (snprintf): Declare 'args'.
5283
5284 2004-09-30  Simon Josefsson  <jas@extundo.com>
5285
5286         * snprintf.h, snprintf.c: New files.
5287
5288 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5289
5290         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5291         (hol_entry_help): Never translate an empty string.
5292         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5293         * argp.h (OPTION_NO_TRANS): New option.
5294
5295 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5296
5297         * xvasprintf.c: Include xalloc.h.
5298         (xvasprintf): Use xalloc_die, not xmalloc_die.
5299
5300 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5301
5302         * dummy.c: Change copyright notice to FSF, and license to GPL.
5303
5304 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5305
5306         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5307         Problem reported by Bruno Haible in:
5308         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5309
5310 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5311
5312         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5313         in case some system header has #define'd it.  Problem reported by
5314         Soeren D. Schulze in
5315         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5316
5317 2004-09-08  Bruno Haible  <bruno@clisp.org>
5318
5319         * stdint_.h: New file, taken from GNU clisp.
5320
5321 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5322
5323         * xvasprintf.h: New file.
5324         * xvasprintf.c: New file.
5325         * xasprintf.c: New file.
5326
5327 2004-09-08  Bruno Haible  <bruno@clisp.org>
5328
5329         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5330         is > INT_MAX.
5331         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5332
5333 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5334
5335         Import from coreutils.
5336         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5337         strings on unbounded length.  alloca's performance benefits aren't
5338         that important here.
5339         (V_STRDUP): Remove.
5340         (parse_with_separator): New function, with most of the internals
5341         of the old parse_user_spec.  Allow user to omit both user and group,
5342         for compatibility with FreeBSD.
5343         Clone only the user name, not the entire spec.
5344         Do not set *uid, *gid unless entirely successful.
5345         Avoid memory leak in some failing cases.
5346         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5347         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5348         (parse_user_spec): Rewrite to use parse_with_separator.
5349
5350 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5351
5352         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5353         its complicated substitute.
5354         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5355         and program_invocation_name.
5356         (__argp_basename) [!_LIBC]: Remove; the only use was
5357         replaced by its body.
5358         (__argp_short_program_name): Change condition from
5359         !defined __argp_short_program_name to
5360         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5361         to match argp-namefrob.h.
5362         (__argp_failure): Don't assume strerror_r returns char *.
5363         * argp-parse.c (N_): Define unconditionally.
5364         (argp_default_options): Fill out initializers with 0 to avoid
5365         gcc warnings.
5366
5367 2004-08-12  Simon Josefsson  <jas@extundo.com>
5368
5369         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5370         * getopt_.h: Renamed from getopt.h.
5371
5372 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5373
5374         Merge from coreutils.
5375
5376         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5377         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5378         for Reliant Unix 5.43.
5379
5380         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5381         (union fooround): Use uintmax_t, not long int.
5382         The rest is a merge from libc:
5383         [defined _LIBC]: Include <shlib-compat.h>.
5384         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5385
5386         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5387
5388         * strverscmp.c: Convert to UTF-8.
5389
5390 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5391
5392         * obstack.h (obstack_empty_p):
5393         Don't assume that chunk->contents is suitably aligned.
5394         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5395         Likewise. Problem reported by Benno in
5396         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5397
5398         * chown.c (rpl_chown): Work even if the file is writeable but not
5399         readable.  This could be improved further but it'd take some work.
5400
5401 2004-08-08  Simon Josefsson  <jas@extundo.com>
5402
5403         * xgethostname.c: Don't include error.h (not used).
5404
5405         * getpass.h: Add.
5406         * getpass.c: Include getpass.h first.
5407
5408 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5409
5410         * xalloc-die.c: New files.
5411         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5412         All uses removed.
5413         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5414         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5415         (_, N_, xalloc_die): Move to xalloc-die.c.
5416         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5417         so that we needn't mess with xalloc_msg_memory_exhausted.
5418
5419         * sha1.h: Renamed from sha.h.
5420         (SHA1_H): Renamed from _SHA_H.
5421         (sha1_ctx): Renamed from sha_ctx.
5422         (sha1_init_ctx): Renamed from sha_init_ctx.
5423         (sha1_process_block): Renamed from sha_process_block.
5424         (sha1_process_bytes): Renamed from sha_process_bytes.
5425         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5426         (sha1_read_ctx): Renamed from sha_read_ctx.
5427         (sha1_stream): Renamed from sha_stream.
5428         (sha1_buffer): Renamed from sha_buffer.
5429         * sha1.c: Likewise; renamed from sha.c.
5430         Do not include <sys/types.h>.
5431         Include <stddef.h> rather than <stdlib.h>.
5432
5433 2004-08-08  Bruno Haible  <bruno@clisp.org>
5434
5435         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5436         FILESYSTEM_PREFIX_LEN.
5437         * progreloc.c: Likewise.
5438         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5439
5440 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5441
5442         Merge from tar.
5443         * argp-help.c (make_hol, hol_append): Don't assume that
5444         SIZE_MAX is a valid preprocessor constant.
5445         (__argp_basename): Change from "#ifndef _LIBC"
5446         to "#ifndef __argp_short_program_name", so that
5447         we don't compile these functions for tar.
5448
5449         More merges from coreutils.
5450         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5451         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5452         yesno.h: New files.
5453         * addext.c: Remove; no longer needed.
5454         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5455         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5456         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5457         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5458         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5459         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5460         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5461         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5462         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5463         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5464         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5465         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5466         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5467         Import changes from coreutils.
5468
5469 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5470
5471         Merge from coreutils.
5472
5473         * .gdb-history: Remove; this doesn't belong here.
5474
5475         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5476         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5477         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5478
5479         * dirname.h: Include <stdbool.h>.
5480         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5481         for consistency with POSIX terminology.  All uses changed.
5482         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5483         (strip_trailing_slashes): Use bool for booleans.
5484         * stripslash.c (strip_trailing_slashes): Likewise.
5485
5486         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5487         sometimes returns a positive errno value even when it succeeds.
5488         (print_errno_message) [!LIBC]: Fall back on strerror if
5489         __strerror_r fails.
5490
5491         * path-concat.c (mempcpy): Don't define if a system header defines it.
5492         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5493         (longest_relative_suffix): New function.
5494         (path_concat): Use it.  Assume first argument is not NULL.
5495         Port to DOS.  Omit redundant separators.
5496         Report an error instead of returning NULL.
5497         Use mempcpy instead of memcpy.
5498         (xpath_concat): Remove: not declared or used.
5499
5500         * same.h: Include <stdbool.h>
5501         (same_name): Return bool, not int.
5502         * same.c (same_name): Likewise.
5503         (errno): Don't declare; we assume C89 or better now.
5504
5505         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5506         if not already defined.
5507
5508         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5509         * dup-safer.c (errno): Likewise.
5510
5511 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5512
5513         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5514         working.
5515
5516 2004-08-03  Simon Josefsson  <jas@extundo.com>
5517
5518         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5519         * progname.h: Don't include stdbool.h.
5520
5521 2004-08-02  Simon Josefsson  <jas@extundo.com>
5522
5523         * getsubopt.h: New file, with comments from Bruno Haible.
5524         * getsubopt.c: New file, from glibc, but slightly modified based on
5525         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5526
5527 2004-08-01  Simon Josefsson  <jas@extundo.com>
5528
5529         * xgetdomainname.c: Include stdlib.h, for free().
5530
5531 2004-07-16  Simon Josefsson  <jas@extundo.com>
5532
5533         * dummy.c: New file.
5534
5535 2004-07-16  Bruno Haible  <bruno@clisp.org>
5536
5537         * backupfile.h: Add extern "C" for C++.
5538         * closeout.h: Likewise.
5539         * copy-file.h: Likewise.
5540         * findprog.h: Likewise.
5541         * full-write.h: Likewise.
5542         * pathname.h: Likewise.
5543         * progname.h: Likewise.
5544         * stpcpy.h: Likewise.
5545         * stpncpy.h: Likewise.
5546         * strcase.h: Likewise.
5547         * strstr.h: Likewise.
5548         * xalloc.h: Likewise.
5549
5550         * mbswidth.h: Add extern "C" for C++.
5551         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5552
5553 2004-07-09  Simon Josefsson  <jas@extundo.com>
5554
5555         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5556         failed without this.)
5557
5558 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5559
5560         * fchown-stub.c: New file.
5561
5562 2004-06-24  Jim Meyering  <jim@meyering.net>
5563
5564         * obstack.h (obstack_base): Cast to (void *), per documentation.
5565
5566 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5567
5568         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5569
5570 2004-06-01  Jim Meyering  <jim@meyering.net>
5571
5572         * calloc.c: New file.
5573
5574 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5575
5576         * getdate.y (yylex): Allow space between sign and number.
5577         Problem reported by Dan Jacobson.
5578
5579 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5580         and  Jim Meyering  <jim@meyering.net>
5581
5582         Merge from coreutils CVS.
5583
5584         * stat-macros.h: New file, with contents from file-type.h
5585         and coreutils' system.h.
5586         * file-type.c: Include "stat-macros.h".
5587         * file-type.h (file_type): Move all macro definitions to new file,
5588         stat-macros.h.
5589
5590         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5591         Wrap old code with this conditional.
5592         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5593         function that does not dereference symlinks.
5594         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5595
5596         * xreadlink.c: Include xreadlink.h first, to catch .h file
5597         dependency problems.
5598         (xreadlink): Accept new arg SIZE, for efficiency.
5599         All decls and uses changed.
5600         * xreadlink.h: Include <stddef.h>, for size_t.
5601
5602         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5603         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5604
5605         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5606
5607 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5608
5609         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5610         macros to be defined.
5611         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5612         the allocator returns NULL because the requested size is zero.
5613
5614 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5615
5616         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5617         var.  Add comment explaining why libc still defines it.  This
5618         merges the following patch from glibc:
5619         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5620
5621 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5622
5623         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5624         present in glibc since revision 1.1 of this file.
5625         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5626         obstack_alignment_mask, obstack_alloc, obstack_base,
5627         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5628         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5629         obstack_grow0, obstack_init, obstack_int_grow,
5630         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5631         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5632         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5633         nonexistent functions.
5634
5635 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5636             Paul Eggert  <eggert@cs.ucla.edu>
5637
5638         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5639
5640 2004-05-14  Bruno Haible  <bruno@clisp.org>
5641
5642         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5643         that consists of a '.' followed by an empty digit string.
5644         Patch by Tor Lillqvist <tml@iki.fi>.
5645
5646 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5647
5648         Port obstack to the AS/400, where pointers are 16 bytes wide and
5649         you cannot cast an integer to a valid pointer.  This patch is
5650         currently waiting to be integrated into glibc; see
5651         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5652
5653         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5654         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5655         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5656         (struct obstack): temp member is now a union of a pointer and
5657         an integer, instead of an integer.  All integer uses changed.
5658         This does not affect the physical layout of struct obstack,
5659         except on hosts (like the AS/400) where the size or alignment of
5660         void * is greater than that of ptrdiff_t.
5661         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5662         __STDC__)]: Store temporary in pointer member of union, not
5663         integer member.
5664         * obstack.c: Include <stddef.h>, for offsetof.
5665         (struct fooalign): Remove; it doesn't need a name.
5666         (union fooround): Change double to long double, and add void *.
5667         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5668         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5669         not a macro.  Hence the values are always int; so remove all
5670         casts-to-int in uses.
5671
5672 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5673             Derek Price  <derek@ximbiot.com>
5674
5675         * alloca.c: Include <alloca.h>, to get our interface.
5676         * alloca_.h: Use __alloca on AIX, so that we don't have to
5677         include <alloca.h> first.  Use C89 prototype for alloca; this
5678         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5679         Use #elif for simplicity, since we can assume C89 now.
5680         Don't try to source the system alloca.h since it will not be found
5681         and to prevent recursively including its replacement.
5682         * fnmatch.c: Include <alloca.h> instead of opencoding.
5683         * regex.c: Likewise.
5684
5685 2004-05-16  Derek Price  <derek@ximbiot.com>
5686             Paul Eggert  <eggert@cs.ucla.edu>
5687
5688         getline cleanup.  This changes the getndelim2 API: both order of
5689         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5690         no delimiter).
5691
5692         * getline.c: Don't include stddef.h or stdio.h, since our
5693         interface does that.
5694         (getline): Always use getdelim, so that we don't have two
5695         copies of this code.
5696         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5697         if available.
5698         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5699         (GETNDELIM2_MAXIMUM): New macro.
5700         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5701         instead of the old practice of delim2==0.  All callers changed.
5702         Return -1 on overflow, instead of returning junk.
5703         Do not set *linesize unless allocation succeeds.
5704         * getndelim2.h: Do not include stddef.h; no longer needed, now
5705         that we include sys/types.h.
5706         * getnline.h: Likewise.
5707         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5708         (getndelim2): Reorder arguments.
5709         * getnline.c (getnline, getndelim):
5710         Don't discard the NMAX argument.
5711         (getnline): Invoke getndelim, to avoid code duplication.
5712         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5713         of (size_t) -1 by callers of the getnline family.
5714
5715 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5716
5717         * nanosleep.c (suspended): Change its type from int to
5718         sig_atomic_t volatile.
5719         (first_call): Make it private to rpl_nanosleep, and have it
5720         be zero initially as that's a bit faster.
5721         (my_usleep): Round up fractional times instead of truncating them,
5722         as this is the usual meaning for 'sleep'.
5723
5724         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5725         doesn't work.
5726         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5727         (ENOSYS): Define if not defined.
5728         (settime): Fall back on stime if it exists and settimeofday fails.
5729         But don't bother with fallbacks if a method fails with errno == EPERM.
5730
5731 2004-05-11  Jim Meyering  <jim@meyering.net>
5732
5733         Prior to this change, the save_cwd caller required read access to the
5734         current directory on most systems (ones with the fchdir function).
5735
5736         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5737         fails, try write-only, and finally, resort to using xgetcwd.
5738
5739 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5740
5741         * obstack.c, obstack.h: Import changes from libc.
5742
5743 2004-04-28  Bruno Haible  <bruno@clisp.org>
5744
5745         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5746         implicitly appends .exe to executables.
5747         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5748         accepts Windows pathnames.
5749         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5750         Cygwin like Windows, since it now accepts Windows pathnames.
5751         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5752         Cygwin like Windows, since it now accepts Windows pathnames.
5753         Reported by Derek Robert Price <derek@ximbiot.com>.
5754
5755 2004-04-20  Jim Meyering  <jim@meyering.net>
5756
5757         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5758
5759 2004-04-20  Jim Meyering  <jim@meyering.net>
5760             Bruno Haible  <bruno@clisp.org>
5761
5762         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5763         memory when realloc fails.
5764
5765 2004-04-18  Jim Meyering  <jim@meyering.net>
5766
5767         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5768         don't leak memory and do call END_UTMP_ENT.
5769
5770 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5771
5772         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5773         (CHAR_BIT): Remove, since we assume C89.
5774         Include <stdint.h> if available, as per current Autoconf CVS advice.
5775
5776 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5777
5778         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5779         not bool, to be more consistent with Unix conventions.
5780         Suggested by Bruno Haible.
5781
5782         Merge from coreutils.
5783
5784         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5785         New files.
5786
5787         * getdate.h: Include stdbool.h, and timespec.h instead of
5788         the usual <time.h> dance.
5789         (get_date): Change signature to support fractional time stamps.
5790         All callers changed.
5791         * getdate.y: Include "getdate.h" first, as we can now
5792         assume C89 and don't need to worry about 'const'.
5793         Similarly, include "unlocked-io.h" near start, not in middle.
5794         Include <limits.h>.
5795         (textint.value): Use long int rather than int.
5796         (textint.digits): Use size_t rather than int.
5797         (BILLION, LOG10_BILLION): New constants.
5798         (parser_control): New member rel_ns.  Members day_ordinal,
5799         time_zone, month, day, hour, minutes, rel_year, rel_month,
5800         rel_day, rel_hour, rel_minutes, rel_seconds
5801         are now long int, not int.  Member seconds is now struct timespec,
5802         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5803         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5804         not int.
5805         (%union.intval): Now long int, not int.
5806         New member timespec.
5807         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5808         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5809         (spec): Now is a timespec or an item list.
5810         (timespec, items): New nonterminals.
5811         (time, rel, relunit, number, get_date):
5812         Add support for fractional seconds.
5813         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5814         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5815         (to_hour): First arg is now long int, not int.
5816         (to_year): Returns long int, not int.
5817         Don't treat year -70 like 70.
5818         (tm_diff): Returns long int, not int.
5819         (lookup_word): Use bool instead of int when appropriate.
5820         (yylex): Use size_t for count, not int.
5821         Detect overflow when parsing large integer constants.
5822         Add support for fractions.
5823         (get_date): Make pointers 'const' if possible.
5824         Use more-portable code to detect integer overflow.
5825         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5826         Don't use ctime; it's not reliable if the year has >4 digits.
5827
5828         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5829         This is for compatibility with BSD.
5830
5831         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5832         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5833         From coreutils' system.h.
5834
5835         * userspec.c: Don't include "posixver.h".
5836         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5837         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5838         compatible extension.  Simplify code by removing a boolean int
5839         that was always nonzero if a string was nonnull.
5840
5841 2004-03-30  Jim Meyering  <jim@meyering.net>
5842
5843         Merge from coreutils.
5844
5845         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5846
5847         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5848         an empty input stream.
5849
5850         * readtokens.c: Include <stdbool.h>.
5851         (readtoken): Use `size_t' rather than int/long.
5852         All callers adjusted.
5853         Use `bool' rather than `int' where appropriate.
5854         Use memset rather than an explicit loop.
5855         Use x2nrealloc rather than xrealloc.
5856         Allow the use of `\0' as a delimiter.
5857         (readtokens): Likewise.
5858         * readtokens.h (readtoken, readtokens): Update prototypes.
5859
5860 2004-03-30  Bruno Haible  <bruno@clisp.org>
5861
5862         * getloadavg.c (getloadavg): Don't assume setlocale returns
5863         nonnull.
5864
5865 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5866
5867         Merge changes to getloadavg.c from coreutils and Emacs.
5868
5869         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5870         Define to an expression, not to the empty string.
5871         Include cloexec.h and xalloc.h.
5872         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5873         Use set_cloexec_flag rather than rolling our own.
5874         * cloexec.c, cloexec.h: New files.
5875
5876 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5877
5878         * getopt.h: Sync with libc CVS.
5879
5880 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5881             Bruno Haible  <bruno@clisp.org>
5882
5883         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5884         not on all platforms that have <wchar.h>.
5885         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5886
5887 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5888
5889         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5890         Sync with libc CVS.
5891         * getopt_int.h: New file, also synced from libc.
5892
5893 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5894
5895         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5896         '#if' expressions.  Unlike the code it replaces, it does not
5897         depend on (defined _SC_PAGESIZE).  However, it does depend on
5898         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5899         first reported by Jason Andrade in
5900         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5901
5902 2004-01-18  Simon Josefsson  <jas@extundo.com>
5903
5904         * strdup.h: New file.
5905         * strdup.c: Include it.
5906         * path-concat.c: Include strdup.h. Drop strdup declaration.
5907         * userspec.c: Include strdup.h. Drop strdup declaration.
5908
5909 2004-02-06  Karl Berry  <karl@gnu.org>
5910
5911         * config.charset: update from gettext 0.14.1.
5912
5913 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5914
5915         Add comments and code, prompted by suggestions from Bruno Haible
5916         for sh-quote.
5917         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5918         describing the enum quoting_style values.
5919         * quotearg.c (quotearg_alloc): New function.
5920         (quotearg_buffer_restyled): Treat lone { and } as special.
5921         Treat = as special.  Work around bug with older shells
5922         that "see" a '\' that is really the 2nd byte of a multibyte char.
5923         Quote empty string with shell_quoting_style.
5924
5925 2004-02-03  Bruno Haible  <bruno@clisp.org>
5926
5927         * pipe.h: New file, from GNU gettext.
5928         * pipe.c: New file, from GNU gettext.
5929
5930 2004-01-27  Bruno Haible  <bruno@clisp.org>
5931
5932         * execute.h: New file, from GNU gettext.
5933         * execute.c: New file, from GNU gettext.
5934         * w32spawn.h: New file, from GNU gettext.
5935
5936 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5937
5938         Exit-status fix from coreutils.
5939
5940         Use exit_failure consistently in place of EXIT_FAILURE,
5941         so that program exit statuses are consistent on failure.
5942
5943         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5944         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5945         * argmatch.h: Comment fix to match the above.
5946         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5947         Now a macro referring to exit_failure, instead of a separate
5948         variable.  Include "exitfail.h" to get it.
5949         * xstrtol.h: Include "exitfail.h".
5950         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5951
5952         * long-options.c (parse_long_options): Use prototype
5953         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5954         for clarity.
5955
5956 2004-01-21  Jim Meyering  <jim@meyering.net>
5957
5958         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5959         so as not to conflict with a different-sized __mktime_internal
5960         function in GNU libc.
5961         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5962         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5963
5964 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5965
5966         Merge from diffutils.
5967
5968         * file-type.c (file_type): Add typed memory objects.
5969         * file-type.h (S_TYPEISTMO): New macro.
5970
5971         * c-stack.h (c_stack_action): Remove argv argument.
5972         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5973         (die): Don't calculate message unless segv_action returns.
5974         (get_stack_location, min_address_from_argv, max_address_from_argv,
5975         volatile stack_base, volatile_stack_size): Remove.
5976         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5977         that every segmentation violation is a stack overflow.  (Ouch!)
5978         See Debian bug 136249 (still outstanding) for more info about why
5979         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5980
5981 2003-11-30  Bruno Haible  <bruno@clisp.org>
5982
5983         Safer stack allocation.
5984         * setenv.c: Include allocsa.h.
5985         (alloca): Remove fallback definition.
5986         (freea): Remove macro.
5987         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5988         instead of freea.
5989
5990 2003-10-17  Bruno Haible  <bruno@clisp.org>
5991
5992         * binary-io.h: Avoid warnings on Cygwin.
5993
5994 2003-12-28  Bruno Haible  <bruno@clisp.org>
5995
5996         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5997         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5998
5999 2003-11-28  Bruno Haible  <bruno@clisp.org>
6000
6001         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6002
6003 2003-11-27  Bruno Haible  <bruno@clisp.org>
6004
6005         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6006
6007 2003-11-17  Bruno Haible  <bruno@clisp.org>
6008
6009         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6010
6011 2003-11-24  Bruno Haible  <bruno@clisp.org>
6012
6013         * xallocsa.h: New file, from GNU gettext.
6014         * xallocsa.c: New file, from GNU gettext.
6015
6016 2003-11-24  Bruno Haible  <bruno@clisp.org>
6017
6018         * allocsa.h: New file, from GNU gettext.
6019         * allocsa.c: New file, from GNU gettext.
6020
6021 2003-11-24  Bruno Haible  <bruno@clisp.org>
6022
6023         * eealloc.h: New file.
6024
6025 2004-01-15  Jim Meyering  <jim@meyering.net>
6026
6027         Merge from coreutils.
6028
6029         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6030         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6031         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6032
6033         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6034         optional configure-time default.
6035
6036         * version-etc.c (version_etc_copyright): Update copyright date.
6037
6038         * xreadlink.c (xreadlink): Correct outdated comment.
6039
6040 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6041
6042         Merge from coreutils.
6043
6044         * posixver.c: Include posixver.h.
6045
6046         * same.c: Include <stdbool.h>, <limits.h>.
6047         (_POSIX_NAME_MAX): Define if not defined.
6048         (MIN): New macro.
6049         (same_name): If file names are silently truncated, report
6050         that the file names are the same if they are the same after
6051         the silent truncation.
6052
6053         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6054         conversion function.
6055         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6056         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6057         longer needed.
6058
6059 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6060
6061         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6062         with like-named macro in fnmatch.c.
6063         (EXT): Use an internal constant instead.
6064
6065         Merge fnmatch patches from glibc.
6066         * fnmatch.c (mbsinit): Remove define.
6067         Add libc_hidden_ver (__fnmatch, fnmatch).
6068         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6069         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6070
6071 2003-12-14  Karl Berry  <karl@gnu.org>
6072
6073         * config.charset: update from gettext-runtime.
6074
6075 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6076
6077         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6078         Bug reported by Alfred M. Szmidt.
6079
6080 2003-11-29  Karl Berry  <karl@gnu.org>
6081
6082         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6083
6084 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6085             Bruno Haible  <bruno@clisp.org>
6086
6087         * printf-parse.h: Don't include sys/types.h.
6088         (ARG_NONE): New macro.
6089         (char_directive): Change type of *arg_index fields to size_t.
6090         * printf-parse.c: Don't include sys/types.h.
6091         (SSIZE_MAX): Remove macro.
6092         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6093         Remove unnecessary overflow check.
6094         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6095         fields.
6096
6097 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6098
6099         * alloca.c: Remove dependency on xalloc module.
6100         (xalloc_die): Remove.
6101         (memory_full) [!defined emacs]: New macro.
6102         [!defined emacs]: Don't include xalloc.h.
6103         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6104         address arithmetic overflows.  Change datatypes a bit to avoid
6105         unnecessary casts.
6106
6107 2003-11-22  Jim Meyering  <jim@meyering.net>
6108
6109         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6110
6111 2003-11-17  Bruno Haible  <bruno@clisp.org>
6112
6113         * vasnprintf.c (alloca): Remove fallback definition.
6114         (freea): Remove definition.
6115         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6116         Reported by Paul Eggert.
6117
6118 2003-11-17  Jim Meyering  <jim@meyering.net>
6119
6120         On systems without utime and without a utimes function capable of
6121         dealing with a NULL struct utimbuf* argument, this utime replacement
6122         could -- in unusual circumstances -- leak a file descriptor.
6123         * utime.c: Include <unistd.h> and <errno.h>.
6124         (utime_null): Be sure to close `fd' and to preserve errno.
6125         Reported by Geoff Collyer via Arnold Robbins.
6126
6127 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6128             Bruno Haible  <bruno@clisp.org>
6129
6130         Protect against address arithmetic overflow.
6131         * printf-args.h: Include stddef.h.
6132         (arguments): Change type of field 'count' to size_t.
6133         * printf-args.c (printf_fetchargs): Use size_t instead of
6134         'unsigned int' where appropriate.
6135         * printf-parse.h: Include sys/types.h.
6136         (char_directive): Change type of *arg_index fields to ssize_t.
6137         (char_directives): Change type of fields 'count', max_*_length to
6138         size_t.
6139         * printf-parse.c: Include sys/types.h and xsize.h.
6140         (SSIZE_MAX): Define fallback value.
6141         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6142         instead of 'int' where appropriate. Check a_allocated, d_allocated
6143         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6144         * vasnprintf.c: Include xsize.h.
6145         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6146         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6147         overflow. Avoid wraparound when converting a width or precision from
6148         decimal to binary.
6149
6150 2003-11-16  Bruno Haible  <bruno@clisp.org>
6151
6152         Update from GNU gettext.
6153         * printf-parse.c: Generalize to it can be compiled for wide strings.
6154         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6155         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6156         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6157         SNPRINTF): New macros.
6158         Don't include <alloca.h> if the file is used inside libintl.
6159         (local_wcslen): New function, for Solaris 2.5.1.
6160         (VASNPRINTF): Use it instead of wcslen.
6161
6162 2003-11-16  Bruno Haible  <bruno@clisp.org>
6163
6164         * xsize.h (xmax): New function.
6165         (xsum, xsum3, xsum4): Declare as "pure" functions.
6166
6167 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6168
6169         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6170         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6171         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6172         heuristic is just as accurate as far as we know, and it removes a
6173         dependency on size_max.m4 and ptrdiff_max.m4.
6174
6175 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6176
6177         * xstrtol.c (__xstrtol): Remove "break" immediately after
6178         "return", to pacify some unknown compiler.  Problem reported
6179         by Joerg Schilling.
6180
6181 2003-11-11  Bruno Haible  <bruno@clisp.org>
6182
6183         * xsize.h (SIZE_MAX): Remove fallback definition.
6184         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6185         defined.
6186
6187 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6188
6189         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6190         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6191         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6192         From Bruno Haible.
6193         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6194         not (size_t) -1, since it's defined here.
6195
6196 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6197
6198         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6199         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6200         Reject sizes of exactly SIZE_MAX bytes.
6201         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6202         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6203
6204 2003-11-05  Bruno Haible  <bruno@clisp.org>
6205
6206         * xsize.h: Include limits.h, to avoid a possible collision with
6207         SIZE_MAX defined in <limits.h> on Solaris.
6208
6209 2003-11-04  Bruno Haible  <bruno@clisp.org>
6210
6211         * xsize.h: New file.
6212         * linebreak.c: Include xsize.h.
6213         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6214         argument for overflow.
6215         Suggested by Paul Eggert.
6216
6217 2003-10-31  Bruno Haible  <bruno@clisp.org>
6218
6219         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6220         to avoid (extremely rare) race condition.
6221         Suggested by Paul Eggert.
6222
6223 2003-11-03  Jim Meyering  <jim@meyering.net>
6224
6225         * userspec.c: Include "userspec.h".
6226         * userspec.h: New file.
6227
6228 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6229
6230         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6231         * mountlist.c (SIZE_MAX): Define if not defined already.
6232         (read_filesystem_list): Set and use me_type_malloced.
6233         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6234         whatever the type happens to be), for brevity and consistency.
6235         Check for size calculation overflow on Alphas running OSF/1.
6236
6237 2003-10-31  Jim Meyering  <jim@meyering.net>
6238
6239         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6240
6241         * linebuffer.c: Include <string.h> for declaration of memset.
6242
6243 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6244             Bruno Haible  <bruno@clisp.org>
6245
6246         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6247         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6248
6249 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6250
6251         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6252         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6253         no longer needed.
6254         * quotearg.c (quotearg_n_options): Use it.
6255         * group-member.c: Include <stdbool.h>.
6256         (free_group_info): Arg is now const *; don't free arg.
6257         (get_group_info): Now returns bool and accepts struct group_info *,
6258         rather than returning a malloc'ed struct group_info *.
6259         All uses changed.  Check for overflow in internal size calculation.
6260
6261         * getusershell.c (readname): Simplify the code by using x2nrealloc
6262         rather than xmalloc/xrealloc.
6263         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6264         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6265         conformance bug: the old code used a pointer after freeing the
6266         storage that it addressed.
6267         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6268         rather than doing it by hand.
6269         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6270         the buffer preserved.  Use free and xmalloc instead.
6271         * quotearg.c (quotearg_n_options): Likewise.
6272         Use a simpler test for size overflow.  Don't use xalloc_oversized
6273         because unsigned int might be wider than size_t (!); this suggests
6274         that we should switch from unsigned int to size_t for slot numbers.
6275
6276 2003-10-27  Bruno Haible  <bruno@clisp.org>
6277
6278         * stdbool_.h: Better support for BeOS.
6279
6280 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6281
6282         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6283         to allocate the returned structure.  Do not allocate a subarray,
6284         as x2nrealloc will do that.
6285         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6286         instead of xnrealloc.
6287         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6288
6289 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6290
6291         * xalloc.h (xalloc_oversized): New static inline function, for
6292         callers that want to do their own size-overflow checking.  Include
6293         <stdbool.h>, since xalloc_oversized returns bool.
6294         * xalloc.c (array_size_overflow): Remove.  All callers changed
6295         to use xalloc_oversized.
6296
6297         Add two functions x2realloc, x2nrealloc, for programs that grow
6298         arrays dynamically by doubling their sizes.
6299         * xalloc.h (x2realloc, x2nrealloc): New decls.
6300         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6301         New functions.
6302
6303         Port to C99 semantics for 'inline' of external functions.
6304         Bug reported by Bruno Haible.
6305         * xmalloc.c (xnmalloc_inline): New static inline function,
6306         with the old contents of xnmalloc.
6307         (xnmalloc, xmalloc): Use it.
6308         (xnrealloc_inline): New static inline function,
6309         with the old contents of xnrealloc.
6310         (xnrealloc, xrealloc): Use it.
6311
6312         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6313
6314 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6315
6316         Fix several address-calculation bugs in the hash modules,
6317         plus some minor code cleanup.
6318
6319         * hash.h: Include <stdbool.h>, for bool.
6320         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6321         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6322         hash_get_n_entries, hash_get_max_bucket_length,
6323         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6324         hash_rehash): Use size_t rather than unsigned.
6325         * hash.c (struct hash_table, hash_get_n_buckets,
6326         hash_get_n_buckets_used, hash_get_n_entries,
6327         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6328         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6329         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6330         Likewise.
6331         (SIZE_MAX): Define if not defined.
6332         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6333         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6334         hash_print):
6335         Use const * when possible.
6336         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6337         (check_tuning): Fix bug: if tuning parameters were very close to
6338         0 or 1, rounding errors could have caused subscript violations.
6339         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6340         (hash_initialize): Add 'fail:' label
6341         to free table and return NULL, and use it to simplify code.
6342         Use calloc rather than clearing the storage ourself.
6343         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6344         buffer size calculations.
6345         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6346         Include <stddef.h>, for size_t.
6347         * hash-pjw.c (hash_pjw): Likewise.
6348         Switch to method described by Bruno Haible.
6349         Include <limits.h>, for CHAR_BIT.
6350         (SIZE_BITS): New macro.
6351
6352 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6353
6354         * getndelim2.c (getndelim2): When size calculation overflows,
6355         ceiling the allocation at NMAX bytes rather than silently
6356         discarding input bytes before NMAX is reached.  This makes
6357         a difference only if NMAX exceeds SIZE_MAX / 2.
6358
6359         * obstack.c: Merge from glibc.
6360         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6361         Add libc_hidden_def (_obstack_newchunk).
6362         (_obstack_free) [! defined _LIBC]: Remove.
6363         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6364         a clone of the function body.
6365         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6366         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6367
6368         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6369         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6370         arg to memcpy.
6371
6372         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6373         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6374         Don't use lvalue casts, as GCC plans to remove support for them
6375         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6376         was also present in the non-GCC version, indicating that this
6377         code had always been buggy and had never been widely used.
6378         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6379         Use the fast variant of each macro, rather than copying the
6380         definiens of the fast variant; that way, we'll be more likely to
6381         catch future bugs in the fast variants.
6382
6383 2003-10-20  Bruno Haible  <bruno@clisp.org>
6384
6385         * wait-process.h: New file, from GNU gettext.
6386         * wait-process.c: New file, from GNU gettext.
6387
6388 2003-10-19  Jim Meyering  <jim@meyering.net>
6389
6390         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6391
6392 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6393
6394         * getgroups.c: Include <errno.h>, <stdlib.h>.
6395         (getgroups): First arg is int, not size_t.
6396         Don't let 'free' mangle errno.
6397
6398 2003-10-16  Jim Meyering  <jim@meyering.net>
6399
6400         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6401
6402 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6403
6404         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6405         (SIZE_MAX): Remove.
6406         (new_exclude, add_exclude_file): Initial size no longer needs to
6407         be a power of 2.
6408         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6409         our own address arithmetic overflow checking.
6410
6411         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6412         (fnmatch): Do not alloca more than 2000 wide characters;
6413         instead, use malloc for large buffers.
6414         Check for address arithmetic overflow, and return -1
6415         with errno set to ENOMEM in that case.
6416         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6417         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6418         instead, return -1.  Check for address arithmetic overflow.
6419
6420 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6421
6422         Handle invalid suffixes and overflow independently, so that
6423         callers can treat them independently as needed.  Fix some bugs in
6424         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6425         suffix for a human-readable blocksize.  The major caller-visible
6426         change is the addition of a new
6427         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6428         that both overflow and suffix chars were found.
6429
6430         * human.c (humblock): Don't check separately for invalid suffix
6431         char; that is xstrtoumax's job (now that its bug is fixed).
6432         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6433         INTMAX_MAX]: New macros.
6434         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6435         TYPE_MAXIMUM): New macros.
6436         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6437         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6438         if overflow occurs, as it's what __strtol does and it's more useful
6439         in practice.
6440         (__xstrtol): If __strtol reports some error other than ERANGE,
6441         reflect it to the caller as LONGINT_INVALID.  If it reports
6442         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6443         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6444         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6445         value.
6446         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6447         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6448         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6449         [defined UINTMAX_MAX]: New macros.
6450
6451 2003-10-14  Bruno Haible  <bruno@clisp.org>
6452
6453         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6454         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6455         Also use volatile where needed.
6456
6457 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6458
6459         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6460         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6461         and define in terms of the other primitives.
6462         * xmalloc.c: Include stdbool.h; do not include exit.h.
6463         (SIZE_MAX): Define if not already defined.
6464         (array_size_overflow): New function.
6465         (xalloc_die): Abort instead of exiting if 'error' returns.
6466         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6467         (xmalloc, xrealloc): Use them.
6468         (xcalloc): Check for address arithmetic overflow.
6469         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6470         a bit faster than strcpy.
6471
6472 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6473
6474         Merge getpass from libc, plus a few fixes.
6475
6476         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6477         Include <stdbool.h>.
6478         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6479         __fsetlocking to empty.
6480         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6481         do include <bits/libc-lock.h>.
6482         Do not include <fcntl.h>; not needed.
6483         [_LIBC]: Include <wchar.h>.
6484         (NOTCANCEL_MODE): New macro.
6485         (flockfile, funlockfile) [_LIBC]: New macros.
6486         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6487         [!_LIBC]: New macros.
6488         (call_fclose): New function.
6489         (getpass): Use it.  Save tty stream separately; this simplifies the
6490         code and makes it more reliable if stdin happens to equal stdout.
6491         Invoke __fsetlocking on tty.
6492         Handle thread cancellation if needed.
6493         Namespace cleanup (use __tcgetattr, __getline).
6494         Use bool for Booleans.
6495         [USE_IN_LIBIO]: Handle wide streams.
6496         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6497         stream might go where.
6498
6499         * unlocked-io.h: Include <stdio.h>, so that the caller
6500         doesn't have to include <stdio.h> before us.
6501         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6502         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6503         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6504         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6505         if not declared, so that we can use getpass.c code from libc without
6506         rewriting it.
6507         (flockfile, ftrylockfile, funlockfile): New macros.
6508
6509 2003-10-06  Bruno Haible  <bruno@clisp.org>
6510
6511         * version-etc-2.h: Remove file.
6512         * version-etc-2.c: Remove file.
6513
6514 2003-09-25  Jim Meyering  <jim@meyering.net>
6515             Bruno Haible  <bruno@clisp.org>
6516
6517         This lets translators provide better translations for the
6518         "Written by ..." part of --version output.
6519         * version-etc.h: Include stdarg.h.
6520         (version_etc_copyright): Declare as readonly.
6521         (version_etc): Make this function variadic with a NULL-terminated list
6522         of author name strings.
6523         (version_etc_va): New declaration.
6524         * version-etc.c: Include stdarg.h, stdlib.h.
6525         (version_etc_copyright): Declare as readonly.
6526         (version_etc_va): New function. Provide a different translatable string
6527         for each possible number of authors < 10. Abbreviate when there are 10
6528         authors or more.
6529         (version_etc): Make this function variadic. Call version_etc_va.
6530         Suggestion from Gary V. Vaughan.
6531
6532         * long-options.h (parse_long_options): Change prototype: the authors
6533         string is moved to the end and becomes variadic.
6534         * long-options.c: Include stdarg.h.
6535         (parse_long_options): Make this function variadic, too.
6536         Call version_etc_va, not version_etc.
6537
6538 2003-10-06  Bruno Haible  <bruno@clisp.org>
6539
6540         * fatal-signal.h: New file, from GNU gettext.
6541         * fatal-signal.c: New file, from GNU gettext.
6542
6543 2003-10-04  Karl Berry  <karl@gnu.org>
6544
6545         * argp*: update from libc.
6546
6547 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6548
6549         * getpass.c (getpass): Use a no-op fseek when switching from input to
6550         output mode on the same stream.
6551
6552 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6553
6554         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6555         Fix arg typo in previous patch.
6556
6557 2003-09-28  Jim Meyering  <jim@meyering.net>
6558
6559         * error.c: Correct cpp indentation.
6560
6561 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6562
6563         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6564         Omit the special code that used __typeof__, since we worry that
6565         it could be more trouble than it's worth.  See:
6566         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6567         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6568
6569         * free.c: New file.
6570
6571 2003-09-26  Jim Meyering  <jim@meyering.net>
6572
6573         * error.c (error_tail): Move some declarations
6574         into inner scope where the local variables are used.
6575
6576 2003-09-26  Bruno Haible  <bruno@clisp.org>
6577
6578         * stpncpy.h (gnu_stpncpy): New declaration.
6579         (stpncpy): Define as alias for gnu_stpncpy.
6580         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6581
6582 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6583
6584         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6585         (error_tail): Do not loop, reallocating temporary buffer, since
6586         the output cannot contain more wide characters than the input
6587         contains bytes, the size must be big enough already.  This avoids
6588         one potential size overflow calculation.  Check for size overflow
6589         when calculating temporary buffer size.  Free temporary buffer
6590         when done, if it was allocated with malloc; this plugs a memory
6591         leak.  Remove casts from void * to pointers, that are no longer
6592         needed now that we're assuming C89 or better.
6593
6594         Merge error changes from glibc.
6595
6596         * error.c, error.h: Update copyright notice header to match glibc.
6597         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6598         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6599         Disable cancellation while printing error.
6600         * error.h: Prepend __ to parameter names.
6601
6602 2003-09-25  Karl Berry  <karl@gnu.org>
6603
6604         * argp-fmtstream.c, argp-help.c: update from libc.
6605
6606 2003-09-25  Bruno Haible  <bruno@clisp.org>
6607
6608         * version-etc-2.h: New file, from version-etc.h with modifications.
6609         * version-etc-2.c: New file, from version-etc.c with modifications.
6610
6611 2003-09-25  Simon Josefsson  <jas@extundo.com>
6612
6613         * xgetdomainname.h: New file.
6614         * xgetdomainname.c: New file.
6615
6616 2003-09-25  Simon Josefsson  <jas@extundo.com>
6617             Bruno Haible  <bruno@clisp.org>
6618
6619         * getdomainname.h: New file.
6620         * getdomainname.c: New file.
6621
6622 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6623
6624         * linebuffer.c (freebuffer): Don't free the argument, just
6625         the buffer associated with the argument.  Bug reported by
6626         Simon Josefsson.
6627
6628 2003-09-19  Karl Berry  <karl@gnu.org>
6629
6630         * argp.h: update from libc.
6631
6632 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6633
6634         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6635         input error, instead of returning NULL the next time we are called
6636         (and therefore losing track of errno).
6637
6638 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6639
6640         * getndelim2.c (getndelim2): Don't trash errno when a read
6641         fails, so that the caller gets the proper errno.
6642
6643         * readutmp.c (read_utmp): Likewise.
6644         Check for fstat error.  Close stream and free storage
6645         when failing.
6646
6647 2003-09-14  Bruno Haible  <bruno@clisp.org>
6648
6649         * fwriteerror.h: New file.
6650         * fwriteerror.c: New file.
6651
6652 2003-09-14  Jim Meyering  <jim@meyering.net>
6653
6654         * getloadavg.c: Correct cpp indentation.
6655         * strdup.c: Likewise.
6656         * vasnprintf.c: Likewise.
6657
6658 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6659
6660         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6661         * obstack.c [!defined _LIBC]: Likewise.
6662         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6663         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6664         * exitfail.c: Don't include stdlib.h; no longer needed.
6665
6666         More changes to assume C89 or better.
6667
6668         * error.c (error_tail): Assume vprintf.
6669
6670         * argmatch.c (getenv): Remove decl.
6671         * progreloc.c (get_full_program_name): Define via prototype.
6672         * setenv.c (clearenv): Likewise.
6673         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6674         needed.
6675         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6676         (malloc, memcpy): Remove decls.
6677         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6678         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6679         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6680         (memcpy): Remove macro.
6681         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6682         (__P): Remove.  All uses removed.
6683         (PTR): Remove.  All uses changed to void *.
6684         (CHAR_BIT, NULL): Remove.
6685         (spaces, zeros, memset_space, memset_zero)
6686         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6687         Remove.
6688         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6689         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6690         Define with prototype.
6691         Remove now-unnecessary prototype decl.
6692         (extra_args_spec): Assume ANSI C.  All uses changed.
6693         (extra_args_spec_iso): Remove.
6694         (my_strftime, emacs_strftimeu): Define via prototype.
6695         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6696         unconditionally.
6697         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6698         * strtoimax.c: Include <stdlib.h> unconditionally.
6699         (strtoul, strtol): Remove decls.
6700         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6701         LONG_MAX): Remove.
6702         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6703         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6704         (LOCALE_PARAM_PROTO): New macro.
6705         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6706         (INTERNAL (strtol), strtol): Define with a prototype.
6707         (PARAMS): Remove.  All uses removed.
6708         * tempname.c: Include <string.h> unconditionally.
6709         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6710         * xgethostname.c (main): Define with a prototype.
6711         * xmalloc.c: Include "xalloc.h" first, to check interface.
6712         Include <stdlib.h> unconditionally.
6713         (calloc, malloc, realloc, free): Remove decls.
6714         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6715         Include <stdlib.h> unconditionally.  Sort include file names.
6716         (strtod): Remove.
6717         (xstrtod): Define with a prototype.
6718         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6719         (strtol, strtoul): Remove decls.
6720
6721 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6722
6723         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6724         Include <stdlib.h>, <string.h> unconditionally.
6725         Remove now-unnecessary cast to char *.
6726         * strnlen.c: Include <string.h> unconditionally.
6727         * yesno.c (yesno): Define with a prototype.
6728
6729 2003-09-10  Bruno Haible  <bruno@clisp.org>
6730
6731         * strcspn.c: Include <string.h> unconditionally.
6732         * strpbrk.c: Include <string.h> unconditionally.
6733         * strstr.c: Include <string.h> unconditionally.
6734         * unicodeio.c: Include <string.h> unconditionally.
6735         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6736         * unsetenv.c: Likewise.
6737         * xreadlink.c: Include <stdlib.h> unconditionally.
6738         * yesno.c: Include <stdlib.h> unconditionally.
6739         (rpmatch): Add prototype.
6740
6741 2003-09-10  Jim Meyering  <jim@meyering.net>
6742
6743         * error.c: Correct indentation of cpp directives.
6744
6745 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6746
6747         More K&R removal.
6748
6749         * acosl.c (main): Use a prototype.
6750         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6751         tanl.c: Likewise.
6752
6753         * getloadavg.c (getloadavg, main): Define via prototypes.
6754
6755         * getopt.h (struct option.name): Assume C89, and use 'const'.
6756         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6757         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6758         with a prototype.
6759         * getopt.c (const): Remove macro.
6760         Include <string.h> unconditionally.
6761         (my_index): Remove; all uses changed to strchr.
6762         (strlen): Remove decl.
6763         (exchange): Remove forward decl; no longer needed.
6764         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6765         Define with prototype.
6766         * getopt1.c (const): Remove macro.
6767         (getopt_long, getopt_long_only, main): Define with prototype.
6768
6769         * getugroups.c: Include <string.h> unconditionally.
6770
6771         * getusershell.c: Include <stdlib.h> unconditionally.
6772         (getusershell, setusershell, endusershell, readname, main):
6773         Define with prototypes.
6774
6775         * group-member.c: Include group-member.h first.
6776         Include <stdlib.h> unconditionally.
6777
6778         * hard-locale.c: Include hard-locale.h first.
6779         Include <stdlib.h>, <string.h> unconditionally.
6780
6781         * hash.c (free, malloc): Remove decls.
6782         Include <stdlib.h> unconditionally.
6783
6784         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6785         (getenv): Do not declare.
6786
6787         * idcache.c: Include <string.h> unconditionally.
6788
6789         * long-options.c: Include long-options.h first, to test interface.
6790         Include <stdlib.h> unconditionally.
6791
6792         * makepath.c: Include makepath.h first, to test interface.
6793         Include <stdlib.h> and <string.h> unconditionally.
6794
6795         * linebuffer.c: Include <stdlib.h>.
6796         (free): Remove decl.
6797
6798         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6799         rpl_malloc returns void *, not char *.
6800         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6801
6802         * md5.h: Include <limits.h> unconditionally.
6803         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6804         (__P): Remove; all uses removed.
6805         * md5.c: Include "md5.h" first.
6806         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6807         md5_buffer, md5_process_bytes, md5_process_block):
6808         Define with prototypes.
6809         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6810         * sha.c: Include "sha.h" first.
6811         Include <stdlib.h>, <string.h> unconditionally.
6812
6813         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6814         * memcmp.c (__ptr_t): Likewise.
6815         * memrchr.c (__ptr_t): Likewise.
6816         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6817         Include <string.h> unconditionally.
6818         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6819         * memchr.c: Include <stdlib.h> unconditionally.
6820         * memchr.c (LONG_MAX): Remove.
6821         * memrchr.c (LONG_MAX): Likewise.
6822         * memchr.c (__memchr): Define via a prototype.
6823         * memrchr.c (__memrchr): Likewise.
6824         * memcmp.c (__P): Remove, and remove all uses.
6825         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6826         Remove forward decls; no longer needed.
6827         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6828         Use types required by C89 in prototype.
6829
6830         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6831         * savedir.c: Likewise.
6832         * mkdir.c (free): Remove decl.
6833         * rmdir.c (rmdir): Define with a prototype.
6834         * savedir.c: Include savedir.h first, to test interface.
6835
6836         * mktime.c (STDC_HEADERS): Remove.
6837         Include <stdlib.h>, <string.h> unconditionally.
6838
6839         * modechange.c: Include <stdlib.h> unconditionally.
6840         (malloc): Remove decl.
6841
6842         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6843         (free): Remove decl.
6844
6845         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6846         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6847         (This type really should be intptr_t, but that's a C99ism.)
6848         (_obstack_memcpy): Remove: all uses changed to memcpy.
6849         Include <string.h> unconditionally.
6850         (struct obstack): Assume __STDC__ for types of members
6851         chunkfun, freefun, extra_arg.
6852         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6853         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6854         obstack_begin, obstack_specify_allocation,
6855         obstack_specify_allocation_with_arg, obstack_chunkfun,
6856         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6857         Remove unprototyped decls and the macros that use them.
6858         * obstack.c (POINTER): Remove.  All uses changed to void *.
6859         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6860         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6861         (defined __STDC__ && __STDC__)]:
6862         Remove nonprototyped code.
6863         Include <stdlib.h> unconditionally.
6864         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6865         _obstack_allocated_p, _obstack_free, obstack_free,
6866         _obstack_memory_used, print_and_abort):
6867         Define using prototypes.
6868         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6869         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6870         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6871         obstack_next_free, obstack_object_size, obstack_room) [0]:
6872         Remove unused, unprototyped code.
6873
6874         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6875
6876         * physmem.c (physmem_total, physmem_available, main): Define
6877         with prototypes.
6878
6879         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6880         (main): Define with a prototype.
6881
6882         * posixver.c (getenv): Remove decl.
6883
6884         * putenv.c (malloc): Returns void *, not char *.
6885         Include <string.h> unconditionally.
6886         (strchr, memcpy, NULL): Do not define.
6887
6888         * readtokens.c: Include readtokens.h first, to test interface.
6889         Include <stdlib.h>, <string.h> unconditionally.
6890         (init_tokenbuffer): Define with a prototype.
6891
6892         * regex.c (PARAMS): Remove.  All uses removed.
6893         All uses of _RE_ARGS removed, too.
6894         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6895         unconditionally.
6896         (bzero): Assume memset exists.
6897         (memcmp, memcpy, NULL): Remove.
6898         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6899         char, or assignments to local vars of type signed char.
6900         (init_syntax_once, PREFIX(extract_number_and_incr),
6901         PREFIX(print_partial_compiled_pattern),
6902         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6903         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6904         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6905         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6906         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6907         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6908         wcs_compile_range, byte_compile_range, truncate_wchar,
6909         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6910         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6911         count_mbs_length, wcs_re_match_2_internal,
6912         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6913         PREFIX(alt_match_null_string_p),
6914         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6915         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6916         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6917         now-unnecessary declaration, if any.
6918         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6919         regcomp, regexec):
6920         Remove now-unnecessary casts among pointer types.
6921         * regex.h (_RE_ARGS): Remove.  All uses removed.
6922
6923         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6924         (free): Remove decl.
6925
6926         * rpmatch.c: Include <stdlib.h> unconditionally.
6927
6928         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6929         (free): Remove decl.
6930
6931         * save-cwd.c: Include <stdlib.h> unconditionally.
6932         * xgetcwd.c: Likewise.
6933
6934         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6935         (free): Remove decl.
6936
6937         * strchrnul.c (strchrnul): Define with a prototype.
6938         Fix bug: c_in was not converted to char before searching.
6939
6940         The following changes are not K&R related:
6941
6942         * group-member.h: Include <sys/types.h>, so that this file is
6943         self-contained.
6944         * makepath.h: Likewise.
6945
6946         * getusershell.c (readname, default_index, line_size, readname):
6947         Use size_t, not int, for sizes.
6948         (readname): If the size overflows, report an error instead of
6949         looping forever.
6950
6951 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6952
6953         * getndelim2.c: Assume stdlib.h per the C89 spec.
6954
6955 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6956
6957         Assume C89 or better; remove K&R cruft.
6958         A few of these changes were first proposed by Derek Robert Price
6959         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6960
6961         * addext.c: Include <string.h> unconditionally.
6962         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6963         Don't declare getenv or malloc.
6964
6965         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6966         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6967         (NULL): Remove.
6968         (find_stack_direction, alloca): Use prototypes.
6969
6970         * atexit.c (atexit): Define using a prototype.
6971
6972         * basename.c, dirname.c, stripslash.c:
6973         Include <string.h> unconditionally.
6974
6975         * bcopy.c: Include <stddef.h>.
6976         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6977
6978         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6979
6980         * error.h (error, error_at_line, error_print_progname)
6981         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6982         * error.c: Include error.h first, to check interface.
6983         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6984         (VA_START): Remove; all uses changeed to va_start.
6985         (exit, strerror): Remove decls.
6986         (error_print_progname): Prototype uncondionally.
6987         Don't include <errno.h>; no longer needed.
6988         (private_strerror): Remove.
6989         (error_tail): Always define.
6990         (error, error_at_line): Assume C89 or better; always use prototypes.
6991         * fatal.c: Include "fatal.h" first, to test interface.
6992         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6993         (VA_START): Remove; all uses changed to va_start.
6994         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6995         this case.
6996         (exit): Remove decl.
6997         (fatal): Prototype unconditionally.  Assume va_start works.
6998         Abort at end, to pacify gcc.
6999
7000         * euidaccess.c (main): Define with a prototype.
7001
7002         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7003
7004         * exitfail.c: Include <stdlib.h> unconditionally.
7005
7006         * fnmatch_.h (__P): Remove.  All uses changed to assume
7007         prototypes.
7008         * fnmatch.c: Include fnmatch.h first, to test interface.
7009         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7010         (getenv): Remove decl.
7011         (fnmatch): Define using a prototype.
7012         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7013         (FCT): Define using a prototype.
7014
7015         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7016
7017         * gethostname.c: Include <stddef.h>.
7018         (gethostname): Define with prototype.  Length is size_t, not int.
7019
7020 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7021
7022         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7023         getversion.c should have been removed then, but was accidentally
7024         preserved.
7025
7026         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7027         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7028
7029 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7030
7031         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7032         copy_tm_result.  Bug reported by Simon Josefsson in
7033         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7034
7035 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7036
7037         * time_r.c, time_r.h: New files.
7038
7039         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7040         __localtime_r.
7041         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7042         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7043
7044         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7045         __gmtime_r.
7046         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7047         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7048         Include <time_r.h>.
7049
7050         * timegm.c: Switch to glibc implementation, with the following changes:
7051         [defined HAVE_CONFIG_H]: Include <config.h>.
7052         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7053         (__mktime_internal) [!defined _LIBC]: New decl.
7054         (__gmtime_r) [!defined _LIBC]: New macro and function.
7055         (timegm): Use a prototype, since gnulib assumes C89.
7056         Do not bother declaring tmp to be const, as it's not really usefu.
7057         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7058         (timegm): Declare only if HAVE_DECL_TIMEGM.
7059
7060 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7061
7062         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7063         Bug reported by Lute Kamstra in
7064         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7065
7066         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7067         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7068         course with correspondingly smaller numbers for tomorrow and
7069         yesterday.  From Tadayoshi Funaba.  Originally installed into
7070         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7071         coreutils merge?).
7072
7073 2003-08-31  Simon Josefsson  <jas@extundo.com>
7074
7075         * timegm.h: New file.
7076         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7077
7078 2003-08-31  Karl Berry  <karl@gnu.org>
7079
7080         * argp.h: update from libc.
7081
7082 2003-08-28  Bruno Haible  <bruno@clisp.org>
7083
7084         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7085         warning on QNX, which defines O_BINARY to 000000.
7086
7087 2003-08-24  Bruno Haible  <bruno@clisp.org>
7088
7089         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7090         MSVC7 <stdio.h> is included later.
7091
7092 2003-08-20  Bruno Haible  <bruno@clisp.org>
7093
7094         * progname.h: New file, from GNU gettext.
7095         * progname.c: New file, from GNU gettext.
7096         * progreloc.c: New file, from GNU gettext.
7097
7098 2003-08-19  Bruno Haible  <bruno@clisp.org>
7099
7100         * xstrdup.c: Assume <string.h> exists.
7101
7102 2003-08-18  Jim Meyering  <jim@meyering.net>
7103
7104         * setenv.h: Indent nested cpp directive.
7105         * vasnprintf.c: Remove trailing blanks.
7106
7107 2003-08-17  Simon Josefsson  <jas@extundo.com>
7108             Bruno Haible  <bruno@clisp.org>
7109
7110         * xstrndup.h: New file.
7111         * xstrndup.c: New file.
7112
7113 2003-08-17  Bruno Haible  <bruno@clisp.org>
7114
7115         * strndup.h: New file.
7116
7117 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7118
7119         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7120         space, undoing this 2003-08-12 change:
7121         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7122
7123 2003-08-16  Jim Meyering  <jim@meyering.net>
7124
7125         Merge from coreutils.
7126         * xstrtoimax.c: #else #if -> #elif.
7127         * xstrtoumax.c: Likewise.
7128
7129 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7130
7131         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7132         rather than tab, after '#' in shell-script copyright notices.
7133         Suggested by Bruno Haible.
7134
7135 2003-08-15  Jim Meyering  <jim@meyering.net>
7136         and Paul Eggert  <eggert@twinsun.com>
7137
7138         Merge from coreutils.
7139         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7140         member but strut utmpx does not.  Needed for AIX 4.3.3.
7141         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7142
7143 2003-08-15  Jim Meyering  <jim@meyering.net>
7144
7145         Merge from coreutils.
7146         * xgethostname.c: Include <stdlib.h>.
7147         (xghostname): Don't exit for anything other than memory-related
7148         failure; just return NULL.
7149         * userspec.c: Include "posixver.h".
7150         (parse_user_spec): Accept `.' as a separator only
7151         in pre-POSIX-200112 mode.
7152         * strtoimax.c: Use #elif rather than #else #if.
7153         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7154         Remove function, now that we can rely on a working tzset function.
7155         [!_LIBC]: Ensure that the required autoconf test has been run.
7156         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7157         Use underlying_strftime for %r.
7158         * sha.c: Merge in some clean-up and optimization changes from glibc.
7159         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7160         Ensure that it is a multiple of 64.
7161         Rearrange loop exit tests so as to avoid performing an
7162         additional fread after encountering an error or EOF.
7163         * realloc.c: Update copyright date.
7164
7165 2003-08-14  Jim Meyering  <jim@meyering.net>
7166
7167         Merge from coreutils.
7168         * obstack.h: Whitespace changes.
7169         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7170         and xcalloc return values.
7171         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7172         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7173         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7174         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7175         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7176         error from mntctl.
7177         Use mntctl's return value to drive the entry-processing loop, since
7178         we can't rely on the value of the vmt_length member in the last
7179         entry.  On some systems doing so could result in exhausting
7180         virtual memory.  Based in part on a patch from Mike Jetzer.
7181
7182 2003-08-14  Jim Meyering  <jim@meyering.net>
7183         and Paul Eggert  <eggert@twinsun.com>
7184
7185         Merges from coreutils, plus other fixes.
7186         * physmem.c: Merge in portability changes from gcc/libiberty
7187         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7188         for credits and details.  Thanks to Kaveh Ghazi for helping
7189         to keep these files in sync.
7190         (ARRAY_SIZE): Define it.
7191         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7192         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7193         (memcasecmp): Don't assume size_t fits in unsigned int.
7194         Remove casts and duplicate code.
7195         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7196         (memcpy): Remove definition.
7197         Merge in some clean-up and optimization changes from glibc.
7198         [BLOCKSIZE]: Move definition to top of file.
7199         Ensure that it is a multiple of 64.
7200         Rearrange loop exit tests so as to avoid performing an
7201         additional fread after encountering an error or EOF.
7202         * md5.h (md5_uintptr): Define.
7203         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7204         return to the initial working directory.  Preserve errno
7205         for caller.
7206         * idcache.c: Include "xalloc.h".
7207         (xmalloc, xrealloc): Remove decls.
7208         (getuser): Remove casts no longer required in C89.
7209         * human.c: Include stdio.h, for sprintf.
7210         * group-member.c: Include "xalloc.h".
7211         (xmalloc, xrealloc): Remove decls.
7212         (get_group_info): Remove casts no longer required in C89.
7213         * getusershell.c (readname): Remove casts no longer required in C89.
7214         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7215         * getline.c: Whitespace fix, from coreutils.
7216
7217 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7218
7219         * exclude.c: Include <ctype.h>
7220         (IN_CTYPE_DOMAIN): New macro.
7221         (is_space): New fn.
7222         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7223         and empty lines.
7224
7225         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7226         Undo previous (whitespace-only) change.
7227
7228 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7229
7230         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7231         Normalize leading white space and remove trailing white space.
7232         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7233         notice, as per ../config/srclist-update.
7234
7235         Merge from coreutils.
7236         * euidaccess.h: New file.
7237         * euidaccess.c: Include it.
7238         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7239         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7240         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7241
7242 2003-08-11  Bruno Haible  <bruno@clisp.org>
7243
7244         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7245         (vasnprintf): Use it instead of wcslen.
7246
7247 2003-08-11  Bruno Haible  <bruno@clisp.org>
7248
7249         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7250         value to ensure that _Bool promotes to int. Use #define for _Bool when
7251         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7252
7253 2003-08-10  Karl Berry  <karl@gnu.org>
7254
7255         * regex.h: update from libc (whitespace fix).
7256
7257 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7258
7259         Merge some files from coreutils.  These changes were
7260         originally made by Jim Meyering.
7261         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7262         many older Unixes require this.
7263         * alloca.c (alloca): Remove cast to argument of free;
7264         no longer needed in C89.
7265         * alloca_.h, regex.h: Fix white space to match
7266         what GNU indent does.
7267
7268 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7269
7270         * bumpalloc.h: Remove.
7271
7272 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7273
7274         * getloadavg.c: Change copyright notice and spacing to conform to
7275         GNU coding style.
7276
7277         Merge from coreutils.
7278         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7279         From glibc.
7280         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7281         from Karl Berry, implemented by Jim Meyering.
7282         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7283         from Dmitry V. Levin.
7284         Remove anachronistic cast of xrealloc.
7285         * fnmatch_.h (__const): Remove.  Use 'const'.
7286         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7287         type. Otherwise, it wouldn't compile with at least /bin/cc on
7288         ymp-cray-unicos9.0.2.X.
7289         Combine two mostly-identical uses of alloca into one.
7290         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7291
7292 2003-08-04  Dave Love <d.love@dl.ac.uk>
7293
7294         [From Emacs.]
7295
7296         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7297         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7298         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7299         obsolete NLIST_NAME_UNION.
7300         [__GNU__]: Undef BSD and FSCALE.
7301         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7302
7303 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7304
7305         * stdbool_.h (_Bool): Make it signed char, instead of
7306         an enum type, so that it's guaranteed to promote to int.  See:
7307         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7308
7309 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7310
7311         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7312         (strerror): Don't assume that a printable int fits in 14 bytes.
7313
7314 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7315             Bruno Haible  <bruno@clisp.org>
7316
7317         * getline.h (getline, getdelim): Change return type to ssize_t.
7318         * getline.c (getline, getdelim): Likewise.
7319         Remove _GNU_SOURCE define; now it's defined in config.h through
7320         m4/getline.m4.
7321
7322 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7323
7324         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7325         over-parenthesization in macros.
7326
7327         Sync with coreutils.
7328
7329         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7330         required by C99.
7331
7332         Use `exit_failure' for xalloc and xmemcoll instead of their own
7333         private exit-failure variables.
7334         * xalloc.h (xalloc_exit_failure): Remove.
7335         * xmalloc.c: Likewise.  Include exitfail.h.
7336         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7337         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7338         * xmemcoll.c: Likewise.  Include exitfail.h.
7339         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7340
7341 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7342
7343         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7344         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7345         to test that it can stand by itself.  Include "exitfail.h".
7346         Clients should set exit_failure instead.
7347         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7348
7349 2003-07-18  Andreas Schwab  <schwab@suse.de>
7350
7351         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7352
7353 2003-07-18  Bruno Haible  <bruno@clisp.org>
7354
7355         * getndelim2.h: New file.
7356         * getndelim2.c: Make into a module of its own. Include config.h,
7357         getndelim2.h.
7358         (getndelim2): Make non-static. Change return type to ssize_t.
7359         * getline.h: Change argument names.
7360         * getline.c: Include getndelim2.h instead of getndelim2.c.
7361         * getnline.c: Include getndelim2.h.
7362
7363 2003-07-17  Bruno Haible  <bruno@clisp.org>
7364
7365         * Makefile.am: Remove file.
7366         * Makefile.in: Remove file.
7367
7368 2003-07-17  Bruno Haible  <bruno@clisp.org>
7369
7370         * getnline.h: New file.
7371         * getnline.c: New file.
7372         * getndelim2.c: New file, extracted from getline.c.
7373         (getndelim2): Renamed from getdelim2, with added nmax argument.
7374         * getline.c: Include getndelim2.c.
7375         (getdelim2): Moved out to getndelim2.c.
7376         (getline, getdelim): Update.
7377
7378 2003-07-15    <karl@gnu.org>
7379
7380         * vasnprintf.c: update from gettext.
7381
7382 2003-07-15  Jim Meyering  <jim@meyering.net>
7383
7384         * makepath.c (make_path): Enclose diagnostic in _(...).
7385
7386 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7387
7388         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7389         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7390         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7391         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7392         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7393         updated automatically by ../config/srclist-update.  This changes
7394         their license from LPGL to GPL.
7395
7396 2003-07-14  Jim Meyering  <jim@meyering.net>
7397
7398         Don't emit diagnostics.  Let callers do that.
7399         * save-cwd.c: Don't include "error.h".
7400         (save_cwd): Don't call error.  Ensure that errno is valid
7401         when returning nonzero.
7402
7403         * save-cwd.h (restore_cwd): Update prototype.
7404         * save-cwd.c (restore_cwd): Remove two parameters.
7405         Simplify.  Don't call error upon failure.  Let callers do that.
7406         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7407         when auditing is enabled.  But don't bother updating the #if.
7408
7409 2003-07-14  Simon Josefsson  <jas@extundo.com>
7410
7411         * mempcpy.h: New file.
7412         * mempcpy.c: New file.
7413
7414 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7415
7416         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7417         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7418         unicodeio.c, unicodeio.h, unlocked-io.h:
7419         Switch from LGPL to GPL.
7420
7421 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7422
7423         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7424         it breaks C++ compilation.
7425         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7426
7427 2003-07-10  Jim Meyering  <jim@meyering.net>
7428
7429         * vasnprintf.c: Remove trailing blanks.
7430         Make cpp indentation consistent.
7431
7432 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7433
7434         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7435         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7436         Switch from LGPL to GPL.
7437
7438 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7439
7440         * mktime.c: Fix some boundary cases and remove need for floating point.
7441
7442         Issue a compile-time diagnostic if time_t is floating point, or if
7443         two's complement arithmetic is not in effect, or if arithmetic
7444         right shift does not propagate the sign.  These assumptions were
7445         all in the original code but they weren't checked.
7446
7447         (TIME_T_MIDPOINT, verify): New macros.
7448         (__isleap): Remove; it has integer overflow problems.
7449         (leapyear): New function, without those problems.
7450         (ydhms_tm_diff): Remove; splitting into two parts.
7451         (ydhms_diff): New function, containing the arithmetic part of
7452         the old ydhms_tm_diff function.  Issue a compile-time
7453         diagnostic if we are not using C99 integer division.
7454         Avoid casts when possible.
7455         (guess_time_tm): New function, containing the checking part of
7456         the old ydhms_tm_diff function.  Return the new value, rather than
7457         the difference between it and the old.  Accept a new argument T
7458         so that *T specifies the old value.  Check for overflow in the result.
7459
7460         (__mktime_internal): Use a time_t offset, not a long int offset.
7461         This undoes the 2003-06-04 change, which is no longer needed now
7462         that we have better overflow checking.
7463         (localtime_offset): Likewise.
7464
7465         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7466         and long are 64-bit but int is only 32-bit.
7467         (ydhms_diff): Use long int to store year1 and yday1.
7468         Issue a compile-time diagnostic if long int is not wide enough.
7469
7470         (__mktime_internal): Use long int to store adjusted year and yday.
7471         Use plain C rather than preprocessor commands, if that doesn't
7472         affect efficiency.
7473         Check for overflow (and try to repair) after each probe
7474         rather than checking only at the very end.  This avoids some bugs
7475         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7476         does not equal GMT offset at maximum time).
7477         Use integer to check for overflow rather than floating point; this
7478         is more portable to non-IEEE hosts, and is a tad faster.
7479         When we detect that we are oscillating between two values,
7480         don't check whether tm_isdst has the requested value, since
7481         we already know the answer.  When tm_isdst has the wrong value,
7482         use a different heuristic to find the right one, based on the
7483         extreme values actually observed in practice in tz2003a,
7484         rather than the (overly optimistic) "previous 3 calendar quarters".
7485
7486         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7487         "T const" to accommodate glibc style.
7488         (check_result): Use less-confusing report format.  "long" -> "long int.
7489         (main): Likewise.
7490         Don't loop if the iteration overflows time_t.
7491         Allow a negative step in the iteration.
7492
7493 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7494
7495         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7496         having it depend on HAVE_SYS_TYPES_H.
7497
7498 2003-06-25  Bruno Haible  <bruno@clisp.org>
7499
7500         * readlink.c: New file.
7501
7502 2003-06-20  Bruno Haible  <bruno@clisp.org>
7503
7504         Assume C89, so PARAMS isn't needed.
7505         * unicodeio.h (PARAMS): Remove.
7506         * unicodeio.c: Don't use PARAMS.
7507
7508 2003-06-18  Jim Meyering  <jim@meyering.net>
7509
7510         Merge changes from coreutils.
7511         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7512         Remove explicit declarations of xmalloc and realloc.
7513         Include xalloc.h.
7514         (read_utmp): Remove anachronistic cast of xmalloc.
7515
7516 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7517
7518         Assume C89, so PARAMS isn't needed.
7519         * backupfile.h (PARAMS): Remove.  All uses removed.
7520         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7521         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7522         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7523         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7524         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7525         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7526         xstrtol.h: Likewise.
7527         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7528         same.h, strverscmp.h: Do not include config.h; no longer needed.
7529         Anyway, config.h should always be included before any other file.
7530
7531 2003-06-11  Simon Josefsson  <jas@extundo.com>
7532
7533         * sysexit_.h: New file.
7534
7535 2003-05-20  Derek Price  <derek@ximbiot.com>
7536
7537         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7538
7539 2003-06-10  Simon Josefsson  <jas@extundo.com>
7540
7541         * strchrnul.h: New file.
7542         * strchrnul.c: New file.
7543
7544 2003-06-10  Simon Josefsson <jas@extundo.com>
7545
7546         * argp.h: New file, from glibc.
7547         * argp-ba.c: New file, from glibc.
7548         * argp-eexst.c: New file, from glibc.
7549         * argp-fmtstream.c: New file, from glibc.
7550         * argp-fmtstream.h: New file, from glibc.
7551         * argp-fs-xinl.c: New file, from glibc.
7552         * argp-help.c: New file, from glibc.
7553         * argp-namefrob.h: New file, from glibc.
7554         * argp-parse.c: New file, from glibc.
7555         * argp-pv.c: New file, from glibc.
7556         * argp-pvh.c: New file, from glibc.
7557         * argp-xinl.c: New file, from glibc.
7558
7559 2003-06-07  Jim Meyering  <jim@meyering.net>
7560
7561         * readtokens.h: Put `Free Software Foundation, Inc.'
7562         in place of my name in the copyright comment.
7563         Remove definition and uses of __P.
7564
7565         From coreutils.
7566         * stat.c: Don't declare xmalloc explicitly.
7567         Instead, include "xalloc.h".
7568         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7569         xrealloc, and xcalloc return values.
7570         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7571         Improve comment.
7572         * xgetcwd.h: Remove definition/uses of PARAMS.
7573
7574 2003-06-06  Jim Meyering  <jim@meyering.net>
7575
7576         * stdbool_.h: Renamed from stdbool.h.in.
7577
7578 2003-06-06  Jim Meyering  <jim@meyering.net>
7579
7580         Merge from coreutils.
7581         * same.c: (same_name): Declare *_basename locals to be `const'.
7582         Consolidate declarations and initializations of *_base* locals.
7583
7584         Merge from coreutils.
7585         This avoids a core dump on systems without GNU putenv,
7586         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7587         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7588         (unsetenv): New static function, from GNU libc.
7589         (rpl_putenv): Use it.
7590
7591         * modechange.c: Remove trailing blanks.
7592
7593         Merge from coreutils.
7594         * fsusage.c: Remove declaration of statfs.
7595         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7596
7597         * posixtm.c: Include <stdbool.h> unconditionally.
7598
7599 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7600
7601         * mktime.c (__mktime_internal): When resolving a tm_isdst
7602         mismatch, look in future quarters as well as past.  This fixes a
7603         bug when processing fall-backwards gaps immediately after a long
7604         period of daylight-saving time.
7605
7606         * mktime.c: Assume freestanding C89 or better.
7607         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7608         (__P): Remove; not used.
7609         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7610         (mktime, not_equal_tm, print_tm, check_result,
7611         main): Use prototypes.  Use const * where appropriate.
7612         (main): Fix typo in testing code that uncovered by above changes.
7613         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7614
7615 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7616
7617         * mktime.c: Fix Debian bug 177940
7618         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7619         (localtime_offset): Now long int, not time_t, because we want it
7620         to be guaranteed to be signed.  All uses changed.
7621         (__mktime_internal): If overflow would occur when adding offset,
7622         don't add it.
7623
7624         Merge 'human' changes from coreutils.  Rewrite to support
7625         locale-specific notations like thousands separators.
7626         * human.c: Simplify authorship notice.
7627         Include human.h immediately after config.h.
7628         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7629         <limits.h>: Do not include, since human.h does.
7630         (SIZE_MAX, UINTMAX_MAX): New macros.
7631         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7632         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7633         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7634         (power_letter): Renamed from suffixes.
7635         (generate_suffix_backwards): Remove.
7636         (adjust_value): Now takes int style (because of human.h changes)
7637         and long double value (for greater precision on some platforms).
7638         (group_number): New function.
7639         (human_readable): Use it.  Use integer options, not enum.
7640         Put the options before the sizes in the arg list.
7641         Support all the new options.
7642         The old human_readable function has been removed;
7643         use inttostr.h instead.
7644         (human_readable, default_block_size, humblock):
7645         Use uintmax_t, not int, for block sizes.
7646         (human_readable_inexact, block_size_types): Remove.
7647         (block_size_opts): New constant.
7648         (human_options): Renamed from human_block_size, with new signature
7649         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7650         * human.h: Add copyright and authorship notice.
7651         Include <limits.h> and <stdbool.h> unconditionally.
7652         (PARAMS): Remove.  All uses removed.
7653         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7654         (enum human_inexact_style): Remove tag; now a nameless enum.
7655         (human_floor, human_ceiling, human_round_to_even): Now have
7656         values 2, 0, 1 rather than -1, 1, 0.
7657         (human_group_digits, human_suppress_point_zero, human_autoscale,
7658         human_base_1024, human_SI, human_B): New constants.
7659         (human_readable_inexact, human_block_size): Remove.
7660         (human_readable): Size args are now uintmax_t, not int.
7661         (human_options): New decl.
7662
7663         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7664         unnecessary now that we assume C89 or better.  This change
7665         imported from coreutils.
7666
7667         * mktime.c (__mktime_internal): Do not reject negative timestamps
7668         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7669         in the 2003-05-30 sync from glibc.
7670
7671         .h files should stand alone, but we shouldn't include <sys/types.h>
7672         if we can get away with just <stddef.h>.
7673
7674         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7675         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7676         rather than <sys/types.h>, as we merely need size_t.
7677         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7678         to get size_t.
7679         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7680         Include <stdio.h>, to get FILE.
7681         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7682         memcasecmp.h has included <stddef.h> and all we need is size_t.
7683         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7684         our interface, instead of including <sys/types.h>
7685
7686 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7687
7688         [from coreutils]
7689         Fix some minor time-related bugs with POSIX time arguments.
7690         Some valid time stamps were being rejected (notably -1, and
7691         time stamps before 1900 on 64-bit hosts).  And some invalid
7692         time stamps were being accepted, e.g. September 31.
7693
7694         * posixtm.h (posixtime): Return bool instead of time_t, so
7695         that we can return (time_t) -1 successfully.
7696         * posixtm.c: Likewise.
7697         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7698         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7699         (t): Remove static var.
7700         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7701         of static var.  All uses changed.
7702         (year): Do not reject years before 1900; they can occur with
7703         64-bit time_t.
7704         (posix_time_parse): Do not check for out-of-range components;
7705         that is now the caller's responsibility, since our checks were
7706         only approximations.
7707         (posixtime): Use mktime to check for out-of-range components,
7708         since it knows them exactly.
7709         If mktime returns (time_t) -1, check whether an error actually occurred
7710         by invoking localtime on -1.
7711         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7712         posixtime failures better.
7713         Improve the test data (in comments only).
7714
7715 2003-05-30    <karl@gnu.org>
7716
7717         * mktime.c: update from libc.
7718
7719 2003-05-30  Bruno Haible  <bruno@clisp.org>
7720
7721         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7722         * localcharset.h: Likewise.
7723         * localcharset.c: Likewise.
7724
7725 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7726
7727         Assume the headers required for C89 freestanding compilers.
7728         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7729         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7730         without checking for HAVE_LIMITS_H.
7731         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7732         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7733         to do that.
7734         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7735         * exclude.c: Include <stdbool.h> unconditionally.
7736         * tempname.c: Include <stddef.h> unconditionally.
7737         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7738         * modechange.c, rpmatch.c (NULL): Don't define, since
7739         <stddef.h> does that.
7740         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7741         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7742         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7743         * xstrtol.c: Likewise.
7744         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7745         * savedir.c: Include <stddef.h> instead of defining NULL.
7746
7747         * addext.c (addext): Use assignment rather than cast, to avoid
7748         warnings on some platforms.
7749
7750         * mktime.c (__mktime_internal): Do not reject negative timestamps
7751         arbitrarily.
7752
7753 2003-05-10  Bruno Haible  <bruno@clisp.org>
7754
7755         * linebreak.c (iconv_string_length): Don't return -1 just because the
7756         string is longer than 4 KB.
7757
7758 2003-05-12  Jim Meyering  <jim@meyering.net>
7759
7760         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7761         the space-padded-by-default conversion specifiers, %e, %k, %l.
7762
7763 2003-05-03  Bruno Haible  <bruno@clisp.org>
7764
7765         Upgrade to Unicode-4.0.
7766         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7767         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7768         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7769         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7770         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7771         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7772         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7773         Change width of U+E0100..U+E01EF from 1 to 0.
7774
7775 2003-04-25  Bruno Haible  <bruno@clisp.org>
7776
7777         * copy-file.c: Include <stddef.h>, for size_t.
7778
7779 2003-04-25  Jim Meyering  <jim@meyering.net>
7780
7781         * copy-file.c (copy_file_preserving): Declare buf_size to be
7782         of type size_t, not int.
7783
7784 2003-04-11  Jim Meyering  <jim@meyering.net>
7785
7786         Merge changes from Coreutils.
7787
7788         2003-03-22  Jim Meyering  <jim@meyering.net>
7789
7790         * strftime.c (widen): Cast alloca return value to proper type.
7791
7792         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7793
7794         From GNU libc.
7795         * strftime.c (my_strftime): Handle very large width
7796         specifications for numeric values correctly.  Improve checks for
7797         overflow.
7798
7799         2003-01-19  Jim Meyering  <jim@meyering.net>
7800
7801         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7802         (nl_get_alt_digit) [! defined my_strftime]: Define.
7803         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7804         _nl_get_alt_digit and _nl_get_walt_digit.
7805
7806         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7807         These changes have no effect outside of _LIBC.
7808
7809 2003-04-10  Bruno Haible  <bruno@clisp.org>
7810
7811         * findprog.h: New file, from GNU gettext.
7812         * findprog.c: New file, from GNU gettext.
7813
7814 2003-04-05  Jim Meyering  <jim@meyering.net>
7815
7816         Merge changes from Coreutils.
7817
7818         * exclude.h (PARAMS): Remove definition and uses.
7819         * exclude.c: Remove uses of `PARAMS'.
7820
7821         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7822         Add test-cases for DOS filenames. Declare program_name.
7823         (main): Set up program_name.  Patch by Rich Dawe.
7824
7825         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7826         error from mntctl.
7827         Use mntctl's return value to drive the entry-processing loop, since
7828         we can't rely on the value of the vmt_length member in the last
7829         entry.  On some systems doing so could result in exhausting
7830         virtual memory.  Based in part on a patch from Mike Jetzer.
7831
7832 2003-04-04  Bruno Haible  <bruno@clisp.org>
7833
7834         * linebreak.h: New file, from GNU gettext.
7835         * linebreak.c: New file, from GNU gettext with slight modifications.
7836         * lbrkprop.h: New file, from GNU gettext.
7837
7838 2003-04-03  Bruno Haible  <bruno@clisp.org>
7839
7840         * utf8-ucs4.h: New file, from GNU gettext.
7841         * utf16-ucs4.h: New file, from GNU gettext.
7842         * ucs4-utf8.h: New file, from GNU gettext.
7843         * ucs4-utf16.h: New file, from GNU gettext.
7844
7845 2003-04-02  Bruno Haible  <bruno@clisp.org>
7846
7847         * binary-io.h: New file, from GNU gettext.
7848
7849 2003-04-01  Bruno Haible  <bruno@clisp.org>
7850
7851         * pathname.h: New file, from GNU gettext.
7852         * concatpath.c: New file, from GNU gettext.
7853
7854 2003-03-30  Bruno Haible  <bruno@clisp.org>
7855
7856         * copy-file.c (copy_file_preserving): Don't set owner if the function
7857         chown() doesn't exist.
7858
7859 2003-03-28  Bruno Haible  <bruno@clisp.org>
7860
7861         * copy-file.h: New file, from GNU gettext.
7862         * copy-file.c: New file, from GNU gettext.
7863
7864 2003-03-18  Jim Meyering  <jim@meyering.net>
7865
7866         * quote.c (quote_n): Fix typo in comment.
7867
7868 2003-03-14  Jim Meyering  <jim@meyering.net>
7869
7870         Merge changes from Coreutils.
7871         * obstack.h (obstack_object_size): Declare temporary, __o,
7872         to be const, in order to avoid warnings.
7873         (obstack_room): Likewise.
7874         (obstack_empty_p): Likewise.
7875
7876 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7877
7878         Merge changes from Bison.
7879         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7880         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7881         when compiling Bison 1.875's `bitset bset = obstack_alloc
7882         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7883         * hash.c: Include <stdbool.h> unconditionally.
7884
7885 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7886
7887         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7888         Reported by Bruce Becker; see:
7889         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7890
7891 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7892             Bruno Haible  <bruno@clisp.org>
7893
7894         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7895         Reported by John Hughes, see
7896         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7897
7898 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7899
7900         * poll_.h: New file.
7901         * poll.c: New file.
7902
7903 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7904
7905         * mathl.h: New file.
7906         * acosl.c: New file.
7907         * asinl.c: New file.
7908         * atanl.c: New file.
7909         * ceill.c: New file.
7910         * cosl.c: New file.
7911         * expl.c: New file.
7912         * floorl.c: New file.
7913         * frexpl.c: New file.
7914         * ldexpl.c: New file.
7915         * logl.c: New file.
7916         * sincosl.c: New file.
7917         * sinl.c: New file.
7918         * sqrtl.c: New file.
7919         * tanl.c: New file.
7920         * trigl.c: New file.
7921         * trigl.h: New file.
7922
7923 2003-02-17  Bruno Haible  <bruno@clisp.org>
7924
7925         * mkdtemp.h: New file, from GNU gettext.
7926         * mkdtemp.c: New file, from GNU gettext.
7927
7928 2003-01-31  Bruno Haible  <bruno@clisp.org>
7929
7930         * rename.c: #undef rename before defining rpl_rename.
7931         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7932
7933 2003-01-30  Bruno Haible  <bruno@clisp.org>
7934
7935         * printf-args.h: New file, from GNU gettext.
7936         * printf-args.c: New file, from GNU gettext.
7937         * printf-parse.h: New file, from GNU gettext.
7938         * printf-parse.c: New file, from GNU gettext.
7939         * vasnprintf.h: New file, from GNU gettext.
7940         * vasnprintf.c: New file, from GNU gettext.
7941         * asnprintf.c: New file, from GNU gettext.
7942         * vasprintf.h: New file, from GNU gettext with modifications.
7943         * vasprintf.c: New file, from GNU gettext.
7944         * asprintf.c: New file, from GNU gettext.
7945
7946 2003-01-29  Bruno Haible  <bruno@clisp.org>
7947
7948         * stpncpy.h: New file, from GNU gettext with modifications.
7949         * stpncpy.c: New file, from GNU gettext with modifications.
7950
7951 2003-01-28  Bruno Haible  <bruno@clisp.org>
7952
7953         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7954         Paul Eggert.
7955         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7956         Paul Eggert.
7957
7958 2003-01-27  Bruno Haible  <bruno@clisp.org>
7959
7960         * xsetenv.h: New file, from GNU gettext.
7961         * xsetenv.c: New file, from GNU gettext.
7962
7963 2003-01-23  Bruno Haible  <bruno@clisp.org>
7964
7965         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7966
7967 2003-01-22  Bruno Haible  <bruno@clisp.org>
7968
7969         * exit.h: New file, from GNU gettext.
7970
7971 2003-01-11  Bruno Haible  <bruno@clisp.org>
7972
7973         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7974         * strcase.h (strcasecmp, strncasecmp): Likewise.
7975
7976 2003-01-14  Jim Meyering  <jim@meyering.net>
7977
7978         * same.c (same_name): Tweak a comment.
7979
7980 2003-01-11  Bruno Haible  <bruno@clisp.org>
7981
7982         * same.c (same_name): Reorder tests so as to avoid calling stat()
7983         when a string comparison is sufficient.
7984
7985 2003-01-11  Bruno Haible  <bruno@clisp.org>
7986
7987         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7988         'unsigned int'.
7989
7990 2003-01-11  Bruno Haible  <bruno@clisp.org>
7991
7992         * hash-pjw.c: Add comment about low quality of this function.
7993
7994 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7995
7996         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7997         to avoid collisions with libcurses and libreadline.
7998
7999         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8000         * getstr.h, getstr.c: Remove.
8001         * getline.c: Include "getline.h", to check interface.
8002         Move body of old getstr.c here: this defines MIN_CHUNK and
8003         declares getdelim2, which is renamed from getstr.
8004         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8005
8006         * linebuffer.c (readlinebuffer): Renamed from readline.
8007         All uses changed.
8008         * linebuffer.h: Likewise.
8009         (readline): Remove backward-compatibility macro.
8010
8011 2003-01-12  Jim Meyering  <jim@meyering.net>
8012
8013         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8014
8015 2003-01-10  Bruno Haible  <bruno@clisp.org>
8016
8017         * alloca_.h: New file.
8018         * getdate.y: Unconditionally include alloca.h.
8019         * makepath.c: Likewise.
8020         * setenv.c: Likewise.
8021         * userspec.c: Likewise.
8022
8023 2003-01-09  Bruno Haible  <bruno@clisp.org>
8024
8025         * stdbool.h.in: New file.
8026
8027 2003-01-08  Bruno Haible  <bruno@clisp.org>
8028
8029         * safe-read.c: Include specification header first, to ensure its
8030         selfcontainedness.
8031         * full-write.c: Likewise.
8032
8033 2003-01-08  Jim Meyering  <jim@meyering.net>
8034
8035         * full-write.c: Undefine and define-away `const' after inclusion
8036         of errno.h, not before.  Suggestion from Bruno Haible.
8037
8038 2003-01-07  Jim Meyering  <jim@meyering.net>
8039
8040         * full-write.c: Rework so that it may serve to define full_read, too.
8041         * full-read.c: Simply #define FULL_READ and include full-write.c.
8042
8043 2003-01-06  Jim Meyering  <jim@meyering.net>
8044
8045         * version-etc.c: Update year in translatable copyright string.
8046
8047 2002-12-25  Bruno Haible  <bruno@clisp.org>
8048
8049         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8050         * xstrtol.h: Likewise.
8051         * xstrtoimax.c: Likewise.
8052         * xstrtoumax.c: Likewise.
8053         * human.h: Likewise.
8054
8055         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8056         on systems that have <inttypes.h> but not <stdint.h>.
8057
8058 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8059
8060         * memcoll.c (memcoll): Fall back on a simple algorithm using
8061         memcmp if strcoll doesn't work.
8062
8063 2002-12-23  Bruno Haible  <bruno@clisp.org>
8064
8065         * localcharset.h: New file.
8066         * localcharset.c: Include it.
8067         * unicodeio.c: Likewise.
8068
8069 2002-12-22  Bruno Haible  <bruno@clisp.org>
8070
8071         * utime.c (utime_null): No need to call ftruncate if the file was
8072         nonempty.
8073
8074 2002-12-23  Bruno Haible  <bruno@clisp.org>
8075
8076         * memcoll.c (STRCOLL): New macro.
8077         (memcoll): Use it.
8078
8079 2002-12-22  Bruno Haible  <bruno@clisp.org>
8080
8081         * getstr.h (getstr): Define, to avoid clash with libcurses.
8082         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8083
8084 2002-12-22  Bruno Haible  <bruno@clisp.org>
8085
8086         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8087
8088 2002-12-23  Bruno Haible  <bruno@clisp.org>
8089
8090         * getline.h: Include <stddef.h>, for size_t.
8091
8092         * unicodeio.h: Include <stddef.h>, for size_t.
8093         * unicodeio.c: Don't include <stddef.h>.
8094
8095 2002-12-17  Bruno Haible  <bruno@clisp.org>
8096
8097         * canon-host.c (strdup): Remove unused declaration.
8098
8099         * fsusage.c: Include full_read.h.
8100         (get_fs_usage): Use full_read instead of safe_read.
8101
8102         * utime.c (utime_null): Use SAFE_READ_ERROR.
8103
8104 2002-12-11  Bruno Haible  <bruno@clisp.org>
8105
8106         * setenv.h: Rewritten to cope with systems that have setenv() but not
8107         unsetenv().
8108         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8109         modifications:
8110
8111         2002-12-11  Bruno Haible  <bruno@clisp.org>
8112
8113                 * setenv.c (alloca): Fall back to malloc.
8114                 (freea): New macro.
8115                 (setenv): Use freea() to free memory allocated with alloca().
8116
8117         2002-11-13  Bruno Haible  <bruno@clisp.org>
8118
8119                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8120                 function declarations.
8121                 * unsetenv.c (unsetenv): Likewise.
8122
8123         2002-03-04  Bruno Haible  <bruno@clisp.org>
8124
8125                 Portability to AIX 4.3.3.
8126                 * unsetenv.c: New file, extracted from setenv.c.
8127                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8128
8129         2001-12-20  Bruno Haible  <bruno@clisp.org>
8130
8131                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8132                 use malloc instead. For SunOS 4.
8133
8134         2001-12-11  Bruno Haible  <bruno@clisp.org>
8135
8136                 * setenv.c: Declare alloca.
8137                 (compar_fn_t): New typedef.
8138                 (KNOWN_VALUE, STORE_VALUE): Use it.
8139
8140         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8141         setenv.h.
8142
8143 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8144
8145         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8146         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8147         Choose values that are less likely to collide with system fnmatch
8148         options.
8149         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8150         defined (e.g., a pure POSIX system).
8151         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8152         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8153
8154 2002-12-06  Jim Meyering  <jim@meyering.net>
8155
8156         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8157
8158         Merge in changes from libc's misc/error.c, in preparation
8159         for the merge of gnulib's changes back into libc.
8160
8161         * error.c (_): Define only if not already defined.
8162         Move definition to follow all #include directives.
8163         Include unlocked-io.h only if !_LIBC.
8164         [_LIBC]: Include <libio/libioP.h>.
8165         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8166         (fflush): Tweak definition to use INTUSE.
8167         (putc): Define.
8168
8169 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8170
8171         * alloca.c [defined emacs]: Include "lisp.h".
8172         (xalloc_die) [defined emacs]: New macro.
8173         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8174         [! defined emacs]: Include <xalloc.h>.
8175         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8176         (pointer): Typedef to POINTER_TYPE *.
8177         (malloc): Remove decl; we now always use xmalloc.
8178         (alloca): Use old-style definition, since Emacs needs this.
8179         Check for arithmetic overflow when computing combined size.
8180
8181 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8182
8183         Do not generate unlocked-io.h automatically, since it's easier to
8184         maintain it by hand.
8185
8186         * unlocked-io.h: New file, from GNU diffutils,
8187         but with proper copyright notice and attribution.
8188         * gen-uio: Remove.
8189         * Makefile.am: Add copyright notice.
8190         (libfetish_a_SOURCES): Add unlocked-io.h.
8191         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8192         (DISTCLEANFILES, io_functions): Remove macros.
8193         (EXTRA_DIST): Remove gen_uio.
8194         (unlocked-io.h): Remove rule.
8195
8196 2002-12-04  Jim Meyering  <jim@meyering.net>
8197
8198         Reflect the fact that stat.c and lstat.c are no longer generated.
8199         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8200         (DISTCLEANFILES): Likewise.
8201         (EXTRA_DIST): Likewise.
8202         (all_local): Don't depend on stat.c or lstat.c.
8203         (stat.c, lstat.c): Remove rules.
8204         (EXTRA_DIST): Remove xstat.in.
8205
8206         * xstat.in: Remove file.  Contents moved into stat.c.
8207         * stat.c: New file.  Contents mostly from xstat.in.
8208         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8209         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8210
8211         * safe-read.c: Rework so that it may serve to define safe_write, too.
8212         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8213
8214 2002-12-03  Jim Meyering  <jim@meyering.net>
8215
8216         * safe-read.c, safe-write.c: Change variable names and comments, but
8217         not semantics, to minimize the differences between these two files.
8218         (safe_read): Change comment to mention SAFE_READ_ERROR.
8219
8220         * safe-read.c (IS_EINTR): Define.
8221         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8222
8223 2002-12-02  Bruno Haible  <bruno@clisp.org>
8224
8225         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8226         Define, taken from safe-read.c.
8227         (INT_MAX): Provide fallback.
8228         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8229         * safe-write.h (SAFE_WRITE_ERROR): Define.
8230
8231         * safe-read.c (EINTR): Remove definition.
8232         (safe_read): Don't use EINTR if it is absent.
8233
8234 2002-12-02  Jim Meyering  <jim@meyering.net>
8235
8236         * safe-read.c (EINTR): Define.
8237         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8238         (INT_MAX): Provide fallback.
8239         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8240
8241         * safe-read.h (SAFE_READ_ERROR): Define.
8242
8243 2002-12-01  Jim Meyering  <jim@meyering.net>
8244
8245         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8246         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8247
8248 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8249
8250         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8251         hash_rehash): Replace `if (limit <= value) abort ();' with
8252         `if (! (value < limit)) abort ();', for readability.
8253
8254 2002-11-26    <karl@gnu.org>
8255
8256         * strdup.c: copy from libc again, with jim's ok.
8257         * .cppi-disable: re-add strdup.c
8258
8259 2002-11-25    <karl@gnu.org>
8260
8261         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8262         instead of "strtol.c".
8263
8264 2002-11-25  Jim Meyering  <jim@meyering.net>
8265
8266         * mktime.c: Sync from libc, now that it has the latest fix.
8267
8268 2002-11-24    <karl@gnu.org>
8269
8270         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8271         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8272
8273 2002-11-24  Jim Meyering  <jim@meyering.net>
8274
8275         Update from coreutils:
8276
8277         * mktime.c: Merge in changes from libc.
8278
8279         Avoid a link-time failure on some Linux systems.
8280         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8281         (__mon_yday): Declare with the STATIC attribute.
8282         (__mktime_internal): Likewise.
8283         Based on a report from Greg Schafer.
8284
8285 2002-11-23  Jim Meyering  <jim@meyering.net>
8286
8287         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8288         Use `unsigned', not `int', as type of index.
8289
8290         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8291
8292         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8293
8294 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8295
8296         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8297         hint that one should use `if (! x) abort ();' rather than `assert
8298         (x);', and anyway it's one less thing to worry about configuring.
8299         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8300         hash_rehash, hash_insert): Use abort rather than assert.
8301
8302 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8303
8304         * quotearg.h: Allow multiple inclusion by surrounding with
8305         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8306         so that we can be included first.
8307         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8308         * quotearg.c: Include quotearg.h immediately after config.h.
8309         No need to include stddef.h or sys/types.h any more.
8310         Surround local include files with "", not "<>".
8311         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8312         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8313         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8314         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8315         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8316         (ISPRINT): Remove; no longer needed now that we assume C89.
8317
8318         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8319         Preserve errno.
8320
8321         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8322         quotearg_char): Use SIZE_MAX rather than
8323         (size_t) -1 when we are talking about "infinity".
8324
8325         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8326
8327 2002-11-22  Bruno Haible  <bruno@clisp.org>
8328
8329         * safe-read.h: Assume C89. Add comments.
8330         (safe_read): Change return type to size_t.
8331         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8332         counts > SSIZE_MAX correctly.
8333         * safe-write.h: New file.
8334         * safe-write.c: New file.
8335         * full-read.h: New file.
8336         * full-read.c: New file.
8337         * full-write.h: Assume C89. Add comments.
8338         * full-write.c: Include safe-write.h.
8339         (full_write): Rewritten to use safe_write.
8340         Suggested by Jim Meyering and Paul Eggert.
8341
8342 2002-11-21  Bruno Haible  <bruno@clisp.org>
8343
8344         Remove case insensitive option matching.
8345         * argmatch.h (argcasematch): Remove declaration.
8346         (ARGCASEMATCH): Remove macro.
8347         (__xargmatch_internal): Remove case_sensitive argument.
8348         (XARGMATCH): Update.
8349         (XARGCASEMATCH): Remove macro.
8350         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8351         case_sensitive argument.
8352         (argcasematch): Remove function.
8353         (__xargmatch_internal): Remove case_sensitive argument.
8354         (main): Use XARGMATCH instead of XARGCASEMATCH.
8355
8356         * xmalloc.c: Change compile-time error message. Add comment about
8357         required autoconf version.
8358
8359 2002-11-21  Jim Meyering  <jim@meyering.net>
8360
8361         * strdup.c (strdup): Tweak comment and initial #if/#include.
8362
8363         Merge in changes from the coreutils.
8364
8365         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8366         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8367         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8368         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8369         int.  Work more efficiently if X is the same width as uintmax_t.
8370         Do not compare X to -1, to avoid bogus compiler warning.
8371         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8372         Don't assume that f_frsize and f_bsize are the same type.
8373
8374         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8375         on FreeBSD.
8376
8377         * makepath.c (make_path): Restore umask *before* creating the final
8378         component.
8379         (make_path): Minor reformatting.
8380
8381         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8382         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8383
8384         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8385         ones.  At least on GNU/Linux systems, `auto' means something else.
8386         From Michael Stone.
8387
8388 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8389
8390         Merge argmatch cleanups from Bison.  Assume C89.
8391
8392         * argmatch.c: Include config.h here, not in argmatch.h.
8393         Include stdlib.h, for EXIT_FAILURE.
8394         Always include <string.h>, since we assume C89.
8395         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8396         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8397         Include <stddef.h> instead, since it's all we need for size_t.
8398         (PARAMS): Remove.  All uses removed.
8399         (ARRAY_CARDINALITY): Do not bother to #undef.
8400         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8401         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8402         Remove unnecessary parentheses.
8403         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8404         Insert necessary parentheses.
8405         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8406         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8407
8408 2002-11-19  Bruno Haible  <bruno@clisp.org>
8409
8410         * mbswidth.c: Include mbswidth.h right at the beginning.
8411         * mbswidth.h: Include <stddef.h>, for size_t.
8412
8413         * mbswidth.h (PARAMS): Remove macro.
8414         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8415         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8416
8417         * gcd.h (PARAMS): Remove macro.
8418         (gcd): Use ANSI C function declarations.
8419         * gcd.c (gcd): Likewise.
8420
8421 2002-11-15  Bruno Haible  <bruno@clisp.org>
8422
8423         * strcspn.c: Include <stddef.h>.
8424         (strcspn): Use ANSI C function declaration. Change return type to
8425         size_t. Use NULL.
8426         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8427         (strpbrk): Use NULL.
8428         * strpbrk.h (PARAMS): Remove macro.
8429         (strpbrk): Use ANSI C function declaration.
8430         * strstr.c: Don't include <sys/types.h>.
8431         * strstr.h (PARAMS): Remove macro.
8432         (strstr): Use ANSI C function declarations.
8433
8434 2002-11-06  Bruno Haible  <bruno@clisp.org>
8435
8436         * gcd.h (gcd): Change argument type to 'unsigned long'.
8437         * gcd.c (gcd): Likewise.
8438
8439 2002-11-05  Bruno Haible  <bruno@clisp.org>
8440
8441         * gcd.h: New file, from gettext-0.11.5.
8442         * gcd.c: New file, from gettext-0.11.5.
8443
8444 2002-11-05  Bruno Haible  <bruno@clisp.org>
8445
8446         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8447         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8448         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8449         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8450
8451         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8452         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8453
8454         * closeout.c: Include gettext.h instead of <libintl.h>.
8455         * human.c: Include gettext.h instead of <libintl.h>.
8456         * quotearg.c: Include gettext.h instead of <libintl.h>.
8457         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8458         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8459         * userspec.c: Include gettext.h instead of <libintl.h>.
8460         * version-etc.c: Include gettext.h instead of <libintl.h>.
8461         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8462         (textdomain): Remove definition.
8463         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8464
8465         * long-options.c: Remove include of <libintl.h> and definition of _.
8466         * same.c: Remove include of <libintl.h> and definition of _.
8467
8468 2002-11-04  Bruno Haible  <bruno@clisp.org>
8469
8470         * stpcpy.h: New file, from GNU gettext-0.11.5.
8471         * strcase.h: New file, from GNU gettext-0.11.5.
8472         * strpbrk.h: New file, from GNU gettext-0.11.5.
8473         * strstr.h: New file, from GNU gettext-0.11.5.
8474         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8475
8476 2002-05-09  Bruno Haible  <bruno@clisp.org>
8477
8478         * config.charset: Update for newest glibc. Add canonical names
8479         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8480
8481 2002-05-09  Bruno Haible  <bruno@clisp.org>
8482
8483         * localcharset.c (get_charset_aliases): Add more Windows specific
8484         aliases.
8485
8486 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8487
8488         * config.charset: A few additions for Solaris.
8489
8490 2001-12-05  Bruno Haible  <bruno@clisp.org>
8491
8492         * localcharset.c (locale_charset): Don't return an empty string.
8493
8494 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8495
8496         * config.charset: msdos in uk_UA uses CP1125.
8497
8498 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8499
8500         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8501         * localcharset.c (locale_charset): Declare as extern "C".
8502
8503 2002-02-15  Bruno Haible  <bruno@clisp.org>
8504
8505         * config.charset [msdosdjgpp]: For Russian, use CP866.
8506
8507 2002-02-11  Bruno Haible  <bruno@clisp.org>
8508
8509         * config.charset: Add support for NetBSD.
8510
8511 2002-09-25    <karl@gnu.org>
8512
8513         * strdup.c: copy from libc/string (via ../config/srclist*).
8514         * getopt*: copy from libc/posix.
8515         * gettext.h: copy from gettext.
8516         * .cppi-disable: add strdup.c, gettext.h.
8517
8518 2002-07-01  Jim Meyering  <meyering@lucent.com>
8519
8520         * c-stack.c: Include sys/time.h.
8521         From Volker Borchert.
8522
8523 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8524
8525         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8526         New macro.  Use it uniformly instead of
8527         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8528         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8529         reported by Vin Shelton.
8530
8531 2002-06-22  Jim Meyering  <meyering@lucent.com>
8532
8533         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8534         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8535
8536 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8537
8538         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8539         Do not assume SA_SIGINFO behavior.
8540         Bug reported by Jim Meyering on NetBSD 1.5.2.
8541
8542 2002-06-22  Jim Meyering  <meyering@lucent.com>
8543
8544         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8545
8546         * exitfail.c, exitfail.h: Likewise.
8547         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8548
8549         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8550         of fnmatch.h.
8551         (EXTRA_DIST): Add fnmatch_loop.c.
8552         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8553
8554         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8555         * fnmatch.c: Update from diffutils-2.8.2.
8556         * fnmatch_.h: New file.  From diffutils-2.8.2.
8557         * fnmatch.h: Remove file.
8558
8559 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8560
8561         * file-type.h: Report an error if neither S_ISREG nor
8562         S_IFREG is defined, instead of using a test specific to glibc
8563         2.2.  This should be safe, since POSIX requires S_ISREG and
8564         Unix Version 7 had S_IFREG.  We don't need to check for
8565         <sys/types.h> since we don't use any symbols that it defines.
8566
8567 2002-06-15  Jim Meyering  <meyering@lucent.com>
8568
8569         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8570         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8571         have been included before this file.
8572
8573 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8574
8575         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8576         so that each temporary file name is unique and valid in the first
8577         8 characters, for operation under DOS.
8578
8579 2002-06-15  Jim Meyering  <meyering@lucent.com>
8580
8581         Work even with DJGPP 2.03, which lacks support for symlinks.
8582         From Richard Dawe.
8583         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8584         is defined.
8585         * lchown.c (S_ISLNK): Likewise.
8586
8587 2002-06-14  Jim Meyering  <meyering@lucent.com>
8588
8589         * file-type.h: Use the version from diffutils-2.8.2.
8590         * file-type.c: Likewise.
8591
8592 2002-05-27  Jim Meyering  <meyering@lucent.com>
8593
8594         Fix a problem seen only on nonconforming systems whereby ls.c's
8595         use of localtime, and then of gettimeofday would cause trouble:
8596         the localtime call used to initialize rpl_gettimeofday's save
8597         mechanism would clobber ls's current local time information so
8598         that in any long listing the first file would always be listed
8599         with date 1970-01-01.  Analysis by Volker Borchert.
8600
8601         * gettimeofday.c (localtime): Undefine.
8602         (rpl_localtime): New function.
8603
8604 2002-05-22  Jim Meyering  <meyering@lucent.com>
8605
8606         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8607         * file-type.h: New file.
8608         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8609
8610 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8611
8612         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8613
8614 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8615
8616         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8617         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8618         of 127, since 64 is the largest conceivable number for ancient
8619         nonstandard hosts.
8620         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8621
8622 2002-04-28  Jim Meyering  <meyering@lucent.com>
8623
8624         * sig2str.c (WTERMSIG): Remove definition (unused).
8625
8626 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8627
8628         * sig2str.h, sig2str.c: New files.
8629         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8630
8631 2002-04-24  Jim Meyering  <meyering@lucent.com>
8632
8633         * gettext.h: New file, from Gettext.
8634         * Makefile.am (INCLUDES): Remove -I../intl.
8635         (libfetish_a_SOURCES): Add gettext.h.
8636
8637 2002-04-16  Jim Meyering  <meyering@lucent.com>
8638
8639         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8640         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8641         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8642
8643 2002-04-12  Jim Meyering  <meyering@lucent.com>
8644
8645         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8646
8647 2002-03-10  Jim Meyering  <meyering@lucent.com>
8648
8649         * makepath.c (make_path): Remove a comma from a diagnostic.
8650         Suggestion from Santiago Vila.
8651
8652 2002-03-08  Jim Meyering  <meyering@lucent.com>
8653
8654         * rename.c: Mention that this wrapper is needed also on
8655         mips-dec-ultrix4.4 systems.
8656
8657 2002-03-02  Jim Meyering  <meyering@lucent.com>
8658
8659         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8660         not HAVE_CLOCK_SETTIME.
8661
8662 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8663
8664         * nanosleep.h: Rename to....
8665         * timespec.h: New name for nanosleep.h.  All uses changed.
8666
8667         * gettime.c: New file.
8668         * settime.c: New file.
8669         * stime.c: Remove.
8670
8671         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8672         timespec.h.  Remove nanosleep.h.
8673
8674 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8675
8676         * acl.c, acl.h: New files.
8677         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8678
8679 2002-02-24  Jim Meyering  <meyering@lucent.com>
8680
8681         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8682         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8683         cause trouble.  Reported by Nelson Beebe.
8684
8685 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8686
8687         * path-concat.c (xpath_concat): Reorder code to pacify
8688         compilers that don't know that xalloc_die never returns.
8689
8690 2002-02-20  Jim Meyering  <meyering@lucent.com>
8691
8692         * getdate.c: Regenerate using bison-1.33.
8693
8694 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8695
8696         * posixver.c, posixver.h: New files.
8697         * Makefile.am (libfetish_a_SOURCES): Add them.
8698
8699 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8700             Bruno Haible  <bruno@clisp.org>
8701
8702         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8703         (fwrite_success_callback): New declaration.
8704         * unicodeio.c (unicode_to_mb): New function, extracted from
8705         print_unicode_char. Call failure callback instead of error.
8706         (fwrite_success_callback): New function.
8707         (exit_failure_callback): New function.
8708         (fallback_failure_callback): New function.
8709         (print_unicode_char): Call unicode_to_mb.
8710
8711 2002-01-26  Jim Meyering  <meyering@lucent.com>
8712
8713         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8714
8715 2002-01-22  Jim Meyering  <meyering@lucent.com>
8716
8717         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8718         Otherwise, some versions of automake would omit the rule that makes
8719         Makefile from Makefile.in.
8720
8721 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8722
8723         * xmemcoll.h, xmemcoll.c: New files.
8724         * Makefile.am (libfetish_a_SOURCES): Add them.
8725         * memcoll.c: Include errno.h, and declare errno if not defined.
8726         (memcoll): Set errno to zero if there is no error.
8727
8728         * quotearg.c (quotearg_buffer_restyled):
8729         Fix bug with quoting buffers containing NUL when backslashing escapes.
8730         This bug was exposed by the other changes in this patch.
8731         (quotearg_n_options): New arg ARGSIZE.
8732         All callers changed.
8733         (quoting_options_from_style): New function.
8734         (quotearg_n_style): Use it.
8735         (quotearg_n_style_mem): New function.
8736
8737         * quotearg.h (quotearg_n_style_mem): New function.
8738
8739 2002-01-16  Jim Meyering  <meyering@lucent.com>
8740
8741         * getdate.y: Add three semicolons, each just before a closing brace.
8742         Bison (as of version 1.31) no longer papers over that mistake.
8743
8744 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8745
8746         * backupfile.c (ISDIGIT): Comment fix.
8747         * getdate.y (ISDIGIT): Likewise.
8748         * posixtm.c (ISDIGIT, year): Likewise.
8749         * strverscmp.c (ISDIGIT): Likewise.
8750         * userspec.c (ISDIGIT): Likewise.
8751
8752 2002-01-05  Jim Meyering  <meyering@lucent.com>
8753
8754         * version-etc.c (version_etc_copyright): Update copyright year.
8755
8756 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8757
8758         * closeout.c (close_stdout_status): If ferror (stdout), do
8759         not silently exit merely because the output buffer happens to
8760         have nothing pending.
8761
8762 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8763
8764         See the big note in ../ChangeLog.
8765         * human.c (suffixes): Prefer K to k for 1024.
8766         (generate_suffix_backwards): New function.
8767         (human_readable_inexact): Use it.
8768         * xstrtol.c (__xstrtol): If there is no number but there
8769         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8770         Accept 'K' as well as 'k'.
8771
8772 2001-12-15  Jim Meyering  <meyering@lucent.com>
8773
8774         * regex.h (__restrict_arr): Update from libc.
8775
8776         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8777         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8778         (STREQ): Define.
8779
8780 2001-12-10  Jim Meyering  <meyering@lucent.com>
8781
8782         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8783         Instead, include "xalloc.h".
8784         (initbuffer): Don't cast xmalloc return value to char*.
8785         (readline): Reword comment.
8786         Don't cast xrealloc return value to char*
8787         Return NULL, not 0.
8788
8789 2001-12-09  Jim Meyering  <meyering@lucent.com>
8790
8791         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8792         `signed and unsigned type in conditional expression'.
8793         * posixtm.c (posix_time_parse): Likewise.
8794
8795         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8796
8797         * readtokens.c (readtoken): Declare an index to be of type unsigned
8798         to avoid a pedantic warning.
8799
8800         * getstr.c: Don't include assert.h.
8801         (getstr): Remove warning-evoking assertions.
8802         Return -1 if offset parameter is out of bounds.
8803         Change the type of a local from int to size_t.
8804
8805         * strftime.c (my_strftime_localtime_r): Include this function
8806         definition in the `#if ! HAVE_TM_GMTOFF' block.
8807
8808         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8809         Include xalloc.h instead.
8810
8811 2001-12-02  Jim Meyering  <meyering@lucent.com>
8812
8813         * tempname.c: Don't declare getenv, thus reverting the change of
8814         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8815         included.
8816
8817         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8818         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8819
8820 2001-11-30  Akim Demaille  <akim@epita.fr>
8821
8822         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8823         before being defined.
8824
8825 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8826
8827         * quotearg.h (quotearg_n, quotearg_n_style):
8828         First arg is int, not unsigned.
8829         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8830         (SIZE_MAX, UINT_MAX): New macros.
8831         (quotearg_n_options): Abort if N is negative.
8832         Avoid overflow check on hosts where size_t is 64 bits and int
8833         is 32 bits, as overflow is impossible there.
8834         Fix off-by-one typo that caused unnecessary reallocation.
8835
8836 2001-11-27  Jim Meyering  <meyering@lucent.com>
8837
8838         * tempname.c: Merge with version from libc.
8839         * regex.c: Likewise.
8840
8841         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8842         for which STDC_HEADERS is 0, it was not included, resulting in a
8843         warning about an integer-to-pointer conversion problem with getenv.
8844         Reported by Volker Borchert.
8845
8846 2001-11-26  Jim Meyering  <meyering@lucent.com>
8847
8848         * gtod.h: Remove file.
8849         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8850         * gettimeofday.c: Don't include gtod.h.
8851         (GTOD_init): Remove function.
8852         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8853         Suggestion from Volker Borchert.
8854
8855 2001-11-23  Jim Meyering  <meyering@lucent.com>
8856
8857         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8858         * hash.c (struct hash_table): Define it here instead.
8859
8860 2001-11-22  Jim Meyering  <meyering@lucent.com>
8861
8862         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8863
8864 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8865
8866         * tempname.c (TMP_MAX): Remove; no longer needed.
8867         (TEMPORARIES): New macro.
8868         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8869         removes an artificial limitation (e.g. HP-UX 10.20, where
8870         TMP_MAX is 17576).
8871
8872 2001-11-18  Jim Meyering  <meyering@lucent.com>
8873
8874         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8875         on SunOS 4.
8876
8877         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8878         files will be created before anything else.
8879
8880 2001-11-17  Jim Meyering  <meyering@lucent.com>
8881
8882         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8883         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8884         rather than group writable.  Patch by Juan F. Codagnone.
8885
8886         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8887         Instead, include "xalloc.h".
8888
8889         * mountlist.c: Include unlocked-io.h after all system headers.
8890         Remove explicit declarations of xmalloc, xrealloc,
8891         and xstrdup.  Instead, include "xalloc.h".
8892
8893         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8894         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8895         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8896
8897         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8898         Reported by Padraig Brady.
8899
8900         * mkstemp.c: #undef mkstemp.
8901         Include config.h.
8902         (rpl_mkstemp): Rename from mkstemp.
8903         Protoize.
8904
8905 2001-11-16  Jim Meyering  <meyering@lucent.com>
8906
8907         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8908         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8909         determine the amount of total physical memory, use pstat_getstatic.
8910         HPUX-11 doesn't define _SC_PHYS_PAGES.
8911         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8912         If sysconf couldn't be used to determine the amount of available
8913         physical memory, use both pstat_getstatic and pstat_getdynamic.
8914         Based on a patch from Bob Proulx.
8915
8916 2001-11-05  Jim Meyering  <meyering@lucent.com>
8917
8918         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8919
8920 2001-11-03  Jim Meyering  <meyering@lucent.com>
8921
8922         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8923         in argmatch_to_argument call.
8924
8925         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8926         argument.
8927
8928         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8929         e.g., a fault due to an attempt to free a NULL pointer.
8930
8931 2001-11-01  Jim Meyering  <meyering@lucent.com>
8932
8933         * dirfd.c, dirfd.h: New files.
8934         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8935
8936         * hash.c (hash_print) [TESTING]: Clean up.
8937
8938 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8939
8940         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8941         to avoid a warning if -Wall.
8942
8943 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8944
8945         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8946
8947 2001-10-21  Jim Meyering  <meyering@lucent.com>
8948
8949         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8950         this code would end up calling gettext even in packages built
8951         with --disable-nls.
8952         * getopt.c (_): Likewise.
8953         * regex.c (_): Likewise.
8954
8955 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8956
8957         * error.c (strerror_r): Do not declare unless !_LIBC.
8958         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8959         Use strerror_r that is only a macro, even if it is not a function.
8960         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8961         (private_strerror): Use prototypes, not old-style function definition.
8962         (print_errno_message): New function.
8963         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8964         char*-flavored one.
8965         (error_tail, error, error_at_line): Use it.
8966
8967 2001-10-11  Jim Meyering  <meyering@lucent.com>
8968
8969         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8970         and quote_n (1, ... to avoid clobbering a buffer.
8971
8972 2001-10-05  Jim Meyering  <meyering@lucent.com>
8973
8974         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8975         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8976         * hash-pjw.h: New file.
8977
8978 2001-09-30  Jim Meyering  <meyering@lucent.com>
8979
8980         * mountlist.c [MOUNTED_GETFSSTAT]:
8981         Include <sys/ucred.h>, for Apple Darwin.
8982         Include sys/mount.h and sys/fs_types.h only if available.
8983         (FS_TYPE): Define.
8984         (read_filesystem_list): Use FS_TYPE.
8985
8986 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8987
8988         * exclude.c (excluded_filename): 0 -> false, since it's
8989         a boolean context.
8990
8991 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8992
8993         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8994         #defines strtoimax.  Also treat the other strto* functions
8995         like strtoimax.
8996
8997         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8998         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8999         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9000
9001 2001-09-26  Jim Meyering  <meyering@lucent.com>
9002
9003         Most macros in unlocked-io.h had the wrong number of arguments.
9004         * gen-uio: New script.
9005         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9006         * unlocked-io.hin: Remove file.
9007         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9008         rather than trying to embed it here.
9009         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9010         Reported by Padraig Brady.
9011
9012 2001-09-25  Volker Borchert  <bt@teknon.de>
9013
9014         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9015
9016 2001-09-23  Jim Meyering  <meyering@lucent.com>
9017
9018         * mountlist.c: Remove useless parentheses in #if directives.
9019         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9020         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9021
9022 2001-09-22  Jim Meyering  <meyering@lucent.com>
9023
9024         * localcharset.c: Update from latest gettext.
9025         * config.charset: Likewise.
9026
9027 2001-09-20  Jim Meyering  <meyering@lucent.com>
9028
9029         * xstrtol.c (strtoimax): Guard declaration with
9030         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9031         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9032         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9033         (strtoumax): Likewise, for completeness (it wasn't necessary).
9034
9035 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9036
9037         * strtoimax.c (HAVE_LONG_LONG):
9038         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9039         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9040         to work around bug in IBM C compiler.
9041
9042 2001-09-16  Jim Meyering  <meyering@lucent.com>
9043
9044         * mkdir.c: New file.
9045
9046 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9047
9048         * xgetcwd.c: Revert some of the previous change; intead,
9049         fix the HAVE_GETCWD_NULL code to behave more like the
9050         !HAVE_GETCWD_NULL code used to.
9051
9052         Include "xalloc.h".
9053         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9054         invoke xalloc_die.
9055
9056 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9057
9058         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9059         Use ssize_t, not int, to store result of readlink.
9060         Check for ssize_t overflow as well as size_t overflow,
9061         as POSIX says the result of readlink is implementation-defined
9062         when ssize_t overflows.
9063         Remove unnecessary cast to char*.
9064         Use free+malloc instead of realloc, as the storage doesn't need
9065         to be preserved and it's clearer and can be more efficient that way.
9066         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9067         * xreadlink.h (xreadlink): Update prototype.
9068
9069 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9070
9071         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9072         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9073         spotted by Jim Meyering.
9074
9075 2001-09-03  Jim Meyering  <meyering@lucent.com>
9076
9077         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9078
9079 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9080
9081         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9082         like the HAVE_GETCWD_NULL code.
9083         Include pathmax.h if not HAVE_GETCWD.
9084         Do not include xalloc.h.
9085         (INITIAL_BUFFER_SIZE): New symbol.
9086         Do not use xmalloc / xrealloc, since the caller is responsible for
9087         handling errors.  Preserve errno around `free' during failure.
9088         Do not overrun buffer when using getwd.
9089
9090 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9091
9092         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9093         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9094
9095 2001-09-02  Jim Meyering  <meyering@lucent.com>
9096
9097         * error.c: Update from GNU libc.
9098
9099 2001-09-01  Jim Meyering  <meyering@lucent.com>
9100
9101         * xreadlink.c: New file.
9102         * xreadlink.h: New file.
9103         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9104
9105         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9106         doesn't conflict with sparc Solaris 7's definition in
9107         /usr/include/sys/int_types.h.
9108
9109         * exclude.c: Use `""', not `<>' to #include non-system header files.
9110         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9111         and strncasecmp as r-values.  Unixware didn't have declarations.
9112
9113 2001-08-31  Jim Meyering  <meyering@lucent.com>
9114
9115         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9116         Use an initial, malloc'd, buffer of length 128 rather than
9117         a statically allocated one of length 1024.
9118
9119 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9120
9121         * xgetcwd.c: Don't include pathmax.h.
9122         Include stdlib.h and unistd.h if available.
9123         Include xalloc.h.
9124         (xmalloc, xstrdup, free): Remove decls.
9125         (xgetcwd): Don't assume sizes fit in unsigned.
9126         Check for overflow when computing sizes.
9127         Simplify reallocation code.
9128
9129 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9130
9131         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9132
9133         * strtoimax.c: Renamed from strtoxmax.c, removing the
9134         old strtoimax.c.
9135
9136         Also, make the following further changes to make this file's
9137         configuration more similar to that of strtol.c:
9138         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9139         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9140         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9141         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9142         changed to signed values.
9143
9144         And make the following changes as well:
9145         Fix copyright notice, as 1999 was missing.
9146         (verify): New macro.
9147         (strtoimax): Check sizes at compile-time, not run-time.
9148         Prefer strtol to strtoll if both work.
9149         (main): Remove; it was not that useful and was a pain to maintain.
9150
9151         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9152
9153 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9154
9155         * savedir.c (savedir): Remove size parameter, as POSIX says that
9156         a directory's st_size can have an arbitrary value, so the old
9157         usage could waste an arbitrary amount of memory.  All uses
9158         changed.
9159         * savedir.h: Update prototype.
9160
9161 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9162
9163         * xstrtol.c (strtoimax): New decl.
9164
9165 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9166
9167         * xstrtol.h: Add copyright notice.
9168         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9169         LONGINT_INVALID_SUFFIX_CHAR.
9170
9171 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9172
9173         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9174         tm to be declared.
9175
9176 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9177
9178         * hash.c: Remove '2001' from copyright notice.
9179
9180 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9181
9182         * full-write.h: New file.
9183         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9184         * full-write.c: Correct credits, as cccp.c no longer
9185         exists and anyway it was so heavily changed from the old cccp
9186         code as to be unrecognizable.  Include full-write.h.
9187         (full_write) Return size_t, with short writes meaning failure.
9188         All callers changed.  This fixes a bug with large buffers
9189         on 64-bit hosts.
9190         * utime.c: Include full-write.h.
9191
9192 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9193
9194         Merge 'exclude' changes from tar 1.13.22.
9195         This fixes one or two unlikely storage allocation overflow bugs,
9196         but doesn't change user-visible behavior otherwise.
9197
9198 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9199
9200         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9201         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9202         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9203         Include if available.
9204         (<xalloc.h>): Include
9205         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9206         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9207         collide with FNM macros.
9208         (struct patopts): New struct.
9209         (struct exclude): Use it, as exclude patterns now come with options.
9210         (new_exclude): Support above changes.
9211         (new_exclude, add_exclude_file):
9212         Initial size must now be a power of two to simplify overflow checking.
9213         (free_exclude, fnmatch_no_wildcards): New function.
9214         (excluded_filename): No longer requires options arg, as the options
9215         are determined by add_exclude.  Now returns bool, not int.
9216         (excluded_filename, add_exclude):
9217         Add support for the fancy new exclusion options.
9218         (add_exclude, add_exclude_file): Now takes int options arg.
9219         Check for arithmetic overflow when computing sizes.
9220         (add_exclude_file): xrealloc might modify errno, so don't
9221         realloc until after errno might be used.
9222
9223         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9224         New macros.
9225         (free_exclude): New decl.
9226         (add_exclude, add_exclude_file): Now takes int options arg.
9227         (excluded_filename): No longer requires options arg, as the options
9228         are determined by add_exclude.  Now returns bool, not int.
9229
9230 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9231
9232         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9233
9234 2001-08-27  Jim Meyering  <meyering@lucent.com>
9235
9236         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9237
9238         * version-etc.c (N_): Remove definition.
9239         Revert most of last change.
9240         Instead, simply don't mark the `Copyright...' string for translation.
9241         Based on advice from Paul Eggert.
9242
9243         * strtoxmax.c: Tweak comment.
9244
9245 2001-08-26  Jim Meyering  <meyering@lucent.com>
9246
9247         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9248         of copyright with `%s' so translators don't get an untranslated
9249         message in 2002.
9250         (COPYRIGHT_YEAR): Define.
9251         (version_etc): Use fprintf rather than fputs.
9252         Suggestion from Ulrich Drepper.
9253
9254         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9255
9256         * strtoll.c: New file, from GNU libc.
9257         * xstrtoimax.c: New file.
9258
9259         * xstrtol.h: Add xstrtoimax.
9260         * strtoumax.c: New file.  Simply include "strtoumax.c".
9261         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9262
9263         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9264         * strtoxmax.c: ... then renamed to this.
9265
9266 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9267
9268         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9269         Port to Solaris 8, where 'sed' requires a space after the 'r'
9270         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9271         Redirect output to $tmp just once.
9272
9273 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9274
9275         * addext.c (<errno.h>): Include.
9276         (errno): Declare if not defined.
9277         (addext): Work correctly when pathconf returns -1 and leaves
9278         errno alone because there is no limit.  Also, work even if
9279         pathconf returns a value greater than SIZE_MAX.
9280
9281 2001-08-12  Jim Meyering  <meyering@lucent.com>
9282
9283         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9284         Simply `return getcwd (NULL, 0);'.
9285         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9286         Use 1300 as initial value for length, not PATH_MAX.
9287
9288         * pathmax.h: Clean up cpp syntax.
9289
9290 2001-08-12  Jim Meyering  <meyering@lucent.com>
9291
9292         * gettimeofday.c: New file.
9293         * gtod.h: New file.
9294         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9295
9296 2001-08-04  Jim Meyering  <meyering@lucent.com>
9297
9298         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9299         to get in sync with glibc.
9300
9301 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9302
9303         The following changes are from gettext 0.10.39 as maintained by
9304         Bruno Haible.
9305
9306         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9307         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9308         with inverted sense.  All uses changed.
9309
9310         * mbswidth.c: Don't include <limits.h>.
9311         Include <stdlib.h> and <string.h> unconditionally.
9312         (iswcntrl, mbsinit, ISCNTRL): New macros.
9313         (mbsnwidth): Use K&R style function declarations.
9314         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9315         can optimize it when MB_CUR_MAX == 1.
9316         The width of control characters is zero, not 1.
9317
9318 2001-07-15  Jim Meyering  <meyering@lucent.com>
9319
9320         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9321         (BUILT_SOURCES): Add unlocked-io.h.
9322         (io_functions): Define.
9323         (unlocked-io.h): New rule.
9324         (DISTCLEANFILES): Add unlocked-io.h.
9325         (all-local): Depend on unlocked-io.h, to ensure it is created.
9326
9327         * unlocked-io.hin: New file
9328
9329         * regex.c: Update from glibc.
9330
9331 2001-07-05  Jim Meyering  <meyering@lucent.com>
9332
9333         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9334         recommendation.
9335         (libfetish_a_SOURCES): Put all .h files here instead.
9336         Remove a thus-exposed (better checks in automake) duplicate and
9337         two unnecessary .h files.
9338
9339 2001-06-11  Jim Meyering  <meyering@lucent.com>
9340
9341         * regex.c: Update from GNU libc.
9342
9343 2001-05-27  Jim Meyering  <meyering@lucent.com>
9344
9345         * readutmp.h (UT_TYPE): Define.
9346
9347 2001-05-24  Jim Meyering  <meyering@lucent.com>
9348
9349         * argmatch.c: Include "quote.h".
9350         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9351         quote function.  Reported by Göran Uddeborg.
9352
9353 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9354
9355         * dirname.c (dir_name): Compute append_dot using path, not newpath
9356         which is not yet declared.
9357
9358 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9359
9360         * Makefile.am (libfetish_a_SOURCES):
9361         Add strftime.c, since we now compile it on all hosts.
9362
9363         * strftime.c (my_strftime):
9364         Define to nstrftime if emacs, but only if my_strftime is not defined.
9365         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9366         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9367         Add one more extra argument: a nanoseconds value.
9368         All uses changed.
9369         (ns): New macro.
9370         (my_strftime function): Add %N format.
9371         (emacs_strftimeu): Renamed from emacs_strftime,
9372         with extra ut argument.
9373
9374 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9375
9376         dirname code cleanup.  base_name now behaves more compatibly
9377         with POSIX basename when given file names that have trailing
9378         slashes, and similarly for dir_name.  Add new primitives
9379         base_len and dir_len.  Put the directory-name-related decls
9380         into dirname.h.
9381
9382         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9383         * backupfile.c (base_name): Likewise.
9384         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9385         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9386         * makepath.c (strip_trailing_slashes): Likewise.
9387         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9388         Likewise.
9389         * rename.c (strip_trailing_slashes): Likewise.
9390         * same.c (base_name): Likewise.
9391         * stripslash.c (ISSLASH): Likewise.
9392
9393         * addext.c: Include <dirname.h> after size_t is defined.
9394         * backupfile.c: Likewise.
9395
9396         * addext.c (addext): Use base_len to trim redundant
9397         trailing slashes instead of doing it ourselves.
9398         But do not trim the last slash if it is not redundant.
9399
9400         * backupfile.c (find_backup_file_name,
9401         max_backup_version): Use base_len instead of rolling it ourselves.
9402         Handle the case of "" and (on DOS) "C:" correctly.
9403
9404         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9405         Include <string.h>, <dirname.h>.
9406         (base_name): Allow file names ending in slashes, other than names
9407         that are all slashes.  In this case, return the basename followed
9408         by the slashes.  This is more general, and can be used in places
9409         where the original base_name purposely had an assertion failure.
9410         (base_len): New function.
9411
9412         * dirname.c: Include <string.h> instead of <stdlib.h>.
9413         Do not include <assert.h>; no longer needed.
9414         Include xalloc.h.
9415         (memrchr): Remove decl.
9416         (dir_name_r): Remove.
9417         (dir_len): Renamed from dirlen.  All callers changed.
9418         Rewrite in terms of base_name, for simplicity and consistency.
9419         (dir_name): Never return NULL.  All callers changed.
9420         Do not include <stdlib.h> in test program; no longer needed.
9421         return 0; is fine for test program.
9422
9423         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9424         New macros.
9425         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9426
9427         * path-concat.c (path_concat): Use base_len to compute
9428         base length, not strlen; this means we cannot rely on memcpy
9429         to null-terminate.
9430
9431         * same.c (STREQ): Remove.
9432         (same_name): Handle the case where the basename ends in trailing '/'.
9433
9434         * stripslash.c (strip_trailing_slashes): Return nonzero if
9435         a slash was stripped.  Do not strip the last slash after a
9436         file system prefix.
9437
9438 2001-04-08  Jim Meyering  <meyering@lucent.com>
9439
9440         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9441         recomputed; that's necessary when the offset spans a DST transition.
9442         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9443
9444 2001-04-02  Jim Meyering  <meyering@lucent.com>
9445
9446         * regex.h, regex.c: Update from GNU libc.
9447
9448 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9449
9450         * version-etc.c (version_etc_copyright): Update to 2001.
9451
9452 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9453
9454         * tempname.c (uint64_t): Define to uintmax_t if
9455         not defined, and if UINT64_MAX is not defined.
9456         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9457         Reported by John David Anglin.
9458
9459 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9460
9461         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9462         alias if codeset is empty.
9463         * config.charset (BeOS): Use wildcard syntax.
9464
9465 2001-03-13  Jim Meyering  <meyering@lucent.com>
9466
9467         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9468         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9469         From Bruno Haible.
9470
9471 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9472
9473         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9474         Don't return NULL.
9475         * unicodeio.c (print_unicode_char): Simplify accordingly.
9476
9477 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9478
9479         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9480         support for DOS/DJGPP.
9481
9482 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9483
9484         * Makefile.am (libfetish_a_SOURCES):
9485         Add dup-safer.c, fopen-safer.c.
9486         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9487
9488         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9489
9490 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9491
9492         The mkstemp replacement is taken from glibc 2.2.2, with some
9493         portability fixes for use outside glibc, as follows:
9494
9495         * tempname.c (struct_stat64): New macro.
9496         (direxists, __gen_tempname): Use it.
9497         This avoids a portability problem with Solaris 8.
9498
9499         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9500         (<stddef.h>, <stdint.h>, <string.h>):
9501         Include only if STDC_HEADERS || _LIBC.
9502         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9503         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9504         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9505         (__set_errno): Define this macro if <errno.h> doesn't.
9506         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9507         Define these macros if <stdio.h> doesn't.
9508         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9509         Define these macros if <sys/stat.h>
9510         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9511         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9512         __xstat64): Define if not _LIBC.
9513         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9514         (__gen_tempname): Invoke gettimeofday only if
9515         HAVE_GETTIMEOFDAY || _LIBC;
9516         otherwise, fall back on plain "time".
9517         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9518
9519         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9520
9521         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9522
9523 2001-02-17  Jim Meyering  <meyering@lucent.com>
9524
9525         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9526         around included file name.
9527
9528         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9529
9530         * strftime.c: Update from GNU libc (the only changes were to comments).
9531
9532 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9533
9534         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9535
9536 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9537
9538         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9539         Remove workaround macros for hosts that have mbrtowc but not
9540         mbstate_t, as we now insist on proper declarations for both
9541         before using mbrtowc.
9542
9543 2001-02-17  Jim Meyering  <meyering@lucent.com>
9544
9545         * regex.c: Update from libc.
9546
9547 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9548
9549         * alloca.c (malloc): Undef before defining, since stdlib.h
9550         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9551         Reported by Mark Hounschell via Paul Eggert.
9552
9553 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9554
9555         * config.charset: Update for FreeBSD 4.2.
9556
9557 2001-01-26  Jim Meyering  <meyering@lucent.com>
9558
9559         * quotearg.c: Include stddef.h.
9560         * quote.c: Include stddef.h.
9561         Reported by Axel Kittenberger.
9562
9563         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9564         line in double quotes so that it evokes a better diagnostic.
9565         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9566         Reported by Axel Kittenberger.
9567
9568 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9569
9570         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9571         to avoid a warning.  Add back 'const' to inptr.
9572
9573 2001-01-16  Jim Meyering  <meyering@lucent.com>
9574
9575         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9576         From Bruno Haible.
9577
9578 2001-01-14  Jim Meyering  <meyering@lucent.com>
9579
9580         * rename.c: New file.  From Volker Borchert.
9581         Include stdlib.h, string.h or strings.h, and xalloc.h.
9582         Use strip_trailing_slashes rather than open-coding it.
9583
9584 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9585
9586         * strftime.c: Sync with glibc time/strftime.c 1.81.
9587
9588 2001-01-03  Jim Meyering  <meyering@lucent.com>
9589
9590         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9591         local `inptr' to avoid warning with some system declarations of iconv.
9592
9593 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9594
9595         * modechange.c: Do not assume that mode_t uses the
9596         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9597         the other-execute bit of FOO even if S_IXOTH != 1.
9598
9599         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9600         WOTH, XOTH, ALLM): New macros.
9601         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9602          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9603         Use them.
9604         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9605         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9606         (mode_compile):
9607         No need to use uintmax_t; unsigned long is long enough.
9608         Don't bother to get suffix since we don't use it.
9609
9610 2000-12-24  Jim Meyering  <meyering@lucent.com>
9611
9612         * hash.c (is_prime): Return explicit boolean values.
9613         (hash_get_first): Return NULL to appease Irix5.6's 89.
9614         Reported by Nelson Beebe.
9615
9616 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9617
9618         * localcharset.c (locale_charset): Add support for Win32.
9619
9620 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9621
9622         * physmem.h, physmem.c: New files.
9623
9624         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9625         (noinst_HEADERS): Add physmem.h.
9626
9627         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9628         't' for compatibility with Solaris 8 sort.
9629
9630 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9631
9632         * config.charset: Add support for BeOS.
9633
9634 2000-12-16  Jim Meyering  <meyering@lucent.com>
9635
9636         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9637         SHELLS_FILE to a file name that's useful on djgpp systems.
9638         Include stdlib.h.
9639         (ADDITIONAL_DEFAULT_SHELLS): Define.
9640         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9641         Based mostly on a patch from Prashant TR.
9642
9643 2000-12-16  Jim Meyering  <meyering@lucent.com>
9644
9645         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9646         N and M) would have treated it like `chown N:N FILE'.
9647
9648         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9649
9650 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9651
9652         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9653         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9654         to the list of canonical encodings. Rename EUC-CN to GB2312.
9655
9656 2000-12-08  Andreas Schwab  <schwab@suse.de>
9657
9658         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9659         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9660
9661 2000-12-07  Jim Meyering  <meyering@lucent.com>
9662
9663         * stripslash.c (ISSLASH): Define.
9664         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9665         From Prashant TR.
9666
9667         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9668         (dir_name_r): Declare this function as static.
9669         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9670         manifest itself on a name containing a mix of slashes and
9671         backslashes.
9672         Make this function work with names starting with a DOS-style
9673         drive letter and colon prefix.
9674         (dir_name): Append `.' if necessary.
9675         Based mostly on patches from Prashant TR and Eli Zaretskii.
9676
9677         * dirname.h (dir_name_r): Remove prototype.
9678
9679 2000-12-05  Jim Meyering  <meyering@lucent.com>
9680
9681         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9682
9683 2000-12-04  Jim Meyering  <meyering@lucent.com>
9684
9685         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9686         Also include memory.h, stdlib.h, unistd.h if appropriate.
9687         Reported by Andreas Jaeger (conflicting declaration of malloc).
9688
9689 2000-12-02  Jim Meyering  <meyering@lucent.com>
9690
9691         * closeout.h: Make idempotent, to avoid some obscure warnings.
9692
9693 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9694
9695         * memrchr.c: Include <config.h> before any system include file.
9696
9697 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9698
9699         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9700
9701 2000-11-26  Jim Meyering  <meyering@lucent.com>
9702
9703         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9704
9705 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9706
9707         * strftime.c (my_strftime): Do not invoke mbrlen with a
9708         size of (size_t) -1; it's not portable.
9709
9710 2000-11-17  Akim Demaille  <akim@epita.fr>
9711
9712         * obstack.h: Formatting changes.
9713         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9714         prevent type checking.
9715         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9716         cast the value to (void *): assigning a `foo *' to a `void *'
9717         variable is valid.
9718         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9719
9720 2000-11-17  Jim Meyering  <meyering@lucent.com>
9721
9722         * strstr.c: Update from GNU libc.
9723
9724 2000-11-16  Jim Meyering  <meyering@lucent.com>
9725
9726         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9727
9728 2000-11-11  Jim Meyering  <meyering@lucent.com>
9729
9730         * error.c: Add a couple #includes, merging from GNU libc version.
9731
9732 2000-11-10  Jim Meyering  <meyering@lucent.com>
9733
9734         * obstack.h: Update from GNU libc.
9735         * obstack.c: Likewise.
9736
9737 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9738
9739         * getusershell.c (setusershell): Use rewind rather than
9740         fseek/fseeko, to avoid configuration hassles with fseeko.
9741         Don't bother opening SHELLS_FILE if shellstream is NULL;
9742         it's not necessary.
9743
9744 2000-11-05  Jim Meyering  <meyering@lucent.com>
9745
9746         * makepath.h (make_dir): Declare.
9747         * makepath.c (make_dir): Remove `static' attribute.
9748         Tweak a comment.
9749
9750 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9751
9752         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9753         last one in a bucket, advance to the next bucket.
9754
9755 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9756
9757         * fnmatch.c: Do not comment out all the code if we are using
9758         the GNU C library, because in some cases we are replacing buggy
9759         code in the GNU C library itself.
9760
9761 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9762
9763         * error.h, getline.h, modechange.h:
9764         Remove "2000" from Copyright line, as the file hasn't been
9765         changed this year other than in the copyright notice.
9766
9767         * xalloc.h: Add "2000" to Copyright line, as this file
9768         was changed this year.
9769
9770 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9771
9772         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9773         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9774         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9775
9776 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9777
9778         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9779         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9780         doesn't define __restrict_arr.
9781
9782 2000-10-29  Jim Meyering  <meyering@lucent.com>
9783
9784         * xstat.in: Fix grammar in comment.
9785
9786 2000-10-28  Jim Meyering  <meyering@lucent.com>
9787
9788         * memchr.c: Update from libc.
9789         Adjust for portability:
9790         [HAVE_STDLIB_H]: Include stdlib.h.
9791         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9792         Undef __memchr, too.
9793         [!weak_alias]: Define __memchr to memchr.
9794
9795         * regex.c: Update from libc.
9796         * regex.h: Likewise.
9797         * getopt1.c: Likewise.
9798         * memcmp.c: Likewise.
9799
9800         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9801         Avoid using fseek, when possible -- it's broken by design.
9802         Patch by Ulrich Drepper.
9803
9804 2000-10-26  Jim Meyering  <meyering@lucent.com>
9805
9806         * strftime.c: Update from libc.
9807
9808 2000-10-25  Jim Meyering  <meyering@lucent.com>
9809
9810         * obstack.c: Update from libc.
9811
9812 2000-10-23  Jim Meyering  <meyering@lucent.com>
9813
9814         * hard-locale.c (hard_locale): Revert last change -- it was simply
9815         wrong.  That set_locale call must not have any side effects.
9816         From Paul Eggert.
9817
9818 2000-10-22  Jim Meyering  <meyering@lucent.com>
9819
9820         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9821         [CYCLIC]: Remove now-unused definition.
9822
9823         * save-cwd.c (O_DIRECTORY): Define, if needed.
9824         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9825         Suggestion from Ulrich Drepper.
9826
9827 2000-10-21  Jim Meyering  <meyering@lucent.com>
9828
9829         * dirname.c (dir_name_r): New function, factored out of dir_name.
9830         (dir_name): Use dir_name_r.
9831         * dirname.h (dir_name_r): Declare it.
9832
9833 2000-10-21  Jim Meyering  <meyering@lucent.com>
9834
9835         * dirname.c (memrchr): Declare if necessary.
9836         (dir_name): Remove the restriction that there be no
9837         trailing slashes.  Now, this code skips past them, effectively
9838         ignoring them.
9839         [TEST_DIRNAME] (main): New unit tests.
9840
9841         * memrchr.c: New file from GNU libc.
9842         Undef __memrchr, too.
9843         [!weak_alias]: Define __memrchr to memrchr.
9844         Guard weak_alias use with `#ifdef weak_alias'.
9845
9846 2000-10-17  Jim Meyering  <meyering@lucent.com>
9847
9848         * quote.h (PARAMS): Define and use.
9849         Reported by Akim Demaille.
9850
9851         * getopt.c: Update from libc.
9852
9853 2000-10-16  Jim Meyering  <meyering@lucent.com>
9854
9855         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9856         From Jan Fedak.
9857
9858 2000-09-25  Jim Meyering  <meyering@lucent.com>
9859
9860         * md5.h (rol): Define (from GnuPG).
9861
9862         * sha.c: Give credit (GnuPG) where due.
9863         (M): Use rol rather than open-coding it.
9864         Add a FIXME comment.
9865
9866 2000-09-21  Jim Meyering  <meyering@lucent.com>
9867
9868         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9869         Reported by Michael Stone.
9870
9871 2000-09-20  Jim Meyering  <meyering@lucent.com>
9872
9873         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9874         (noinst_HEADERS): Add sha.h.
9875         Based on code from Scott G. Miller and from GnuPG.
9876
9877 2000-09-15  Jim Meyering  <meyering@lucent.com>
9878
9879         * regex.c: Update from libc.
9880
9881 2000-09-10  Jim Meyering  <meyering@lucent.com>
9882
9883         * getopt.c (_getopt_internal): Update from glibc.
9884
9885 2000-09-09  Jim Meyering  <meyering@lucent.com>
9886
9887         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9888         think it should be used as a general replacement for isascii.
9889         * fnmatch.c: Likewise.
9890         * mbswidth.c: Likewise
9891         * regex.c: Likewise.
9892
9893         Don't use atoi.
9894         * userspec.c: Include sys/param.h and limits.h.
9895         Include xstrtol.h.
9896         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9897         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9898         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9899         UID, GID.  Check range.
9900
9901 2000-09-06  Jim Meyering  <meyering@lucent.com>
9902
9903         * getopt.c (_getopt_internal): Update from glibc.
9904
9905 2000-08-30  Jim Meyering  <meyering@lucent.com>
9906
9907         * strftime.c: Merge in changes from GNU libc.
9908
9909 2000-08-26  Jim Meyering  <meyering@lucent.com>
9910
9911         * closeout.c: Include "__fpending.h".
9912         (close_stdout_status): Return right away if there's nothing to flush.
9913
9914         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9915         * __fpending.c: New file.
9916         * __fpending.h: New file.
9917
9918 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9919
9920         Standardize on "memory exhausted" instead of "Memory exhausted"
9921         or "virtual memory exhausted".
9922         * obstack.c (print_and_abort): Use "memory exhausted", not
9923         "virtual memory exhausted".
9924         * same.c (same_name): Invoke xalloc_die instead of printing
9925         our own message.
9926         * userspec.c (parse_user_spec): Likewise.
9927         * bumpalloc.h: comment fix
9928         * same.c, userspec.c: Include xalloc.h.
9929
9930         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9931         not char *const and pointing to a constant array.
9932         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9933         (xrealloc): Comment fix.
9934
9935         * userspec.c (parse_user_spec):
9936         Don't translate a message until just before returning,
9937         to avoid unnecessary translation.
9938
9939 2000-08-07  Jim Meyering  <meyering@lucent.com>
9940
9941         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9942         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9943         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9944         getgroups.c, gethostname.c, getopt.h, group-member.c,
9945         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9946         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9947         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9948         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9949         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9950         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9951         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9952         yesno.c: Back out Copyright date changes for each file with no change
9953         this year.  This eases coordination with other programs using the same
9954         source code modules.  From Paul Eggert.
9955
9956 2000-08-03  Greg McGary  <greg@mcgary.org>
9957
9958         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9959         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9960         (EXTEND_BUFFER): Use them.
9961
9962 2000-08-01  Jim Meyering  <meyering@lucent.com>
9963
9964         * dirname.c (ISSLASH): Define.
9965         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9966         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9967         both `\' and `/' may be use as path separators.
9968         Based on a patch from Prashant TR.
9969
9970 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9971
9972         * quotearg.c (quotearg_n_options): Don't make the initial
9973         slot vector a constant, since it might get modified.
9974
9975 2000-07-31  Jim Meyering  <meyering@lucent.com>
9976
9977         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9978         * obstack.c (print_and_abort): Likewise.
9979
9980 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9981
9982         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9983         buffer, so that the caller can always quote one small
9984         component of a "memory exhausted" message in slot 0.
9985         From a suggestion by Jim Meyering.
9986
9987 2000-07-30  Jim Meyering  <meyering@lucent.com>
9988
9989         * makepath.c (make_path): Quote the other instance, too.
9990
9991         * quotearg.c (N_STATIC_SLOTVECS): Define.
9992         (STATIC_BUF_SIZE): Define.
9993         (quotearg_n_options): Use only statically allocated storage when
9994         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9995         than STATIC_BUF_SIZE.
9996
9997 2000-07-29  Jim Meyering  <meyering@lucent.com>
9998
9999         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10000         * dirname.c (dir_name): Likewise.
10001
10002         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10003
10004         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10005         (dir_name): Assert that there are no trailing slashes.
10006
10007 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10008
10009         * mbswidth.h (mbswidth): Add a flags argument.
10010         (mbswidth): New declaration.
10011         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10012         * mbswidth.c (mbswidth): Add a flags argument.
10013         (mbsnwidth): New function.
10014
10015 2000-07-24  Jim Meyering  <meyering@lucent.com>
10016
10017         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10018
10019 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10020
10021         * mbswidth.c (_XOPEN_SOURCE):
10022         Don't define; this causes problems on Solaris 7.
10023         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10024
10025 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10026
10027         * quotearg.c:
10028         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10029         so that mbstate_t is always defined.
10030
10031         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10032         be 1 in at least one GCC installation, and this configuration
10033         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10034         performance on hosts that have mbrtowc but have only unibyte
10035         locales, but I assume these hosts are rare.
10036
10037 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10038
10039         * quotearg.c: Streamline by invoking multibyte code only if needed.
10040         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10041         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10042         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10043         invoke multibyte primitives.
10044
10045 2000-07-23  Jim Meyering  <meyering@lucent.com>
10046
10047         * basename.c (base_name): Add an assertion.
10048
10049 2000-07-15  Bruno Haible  <clisp.cons.org>
10050
10051         * quotearg.c: When the system forces us to redefine mbstate_t,
10052         shadow its mbsinit function.
10053
10054 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10055
10056         * mbswidth.h: New file.
10057         * mbswidth.c: New file.
10058         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10059         (noinst_HEADERS): Add mbswidth.h.
10060
10061 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10062
10063         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10064         and IRIX 6.
10065
10066 2000-07-15  Jim Meyering  <meyering@lucent.com>
10067
10068         * makepath.c: Include quote.h.
10069         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10070         corresponding argument in a `quote (...)' call.
10071         Give better diagnostics.
10072
10073         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10074         (noinst_HEADERS): Add quote.h.
10075
10076         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10077         from tar's src/misc.c.
10078         * quote.h: New file.  Prototypes for same.
10079
10080 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10081
10082         From a suggestion by Bruno Haible.
10083         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10084         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10085         to decide whether to define the BeOS workaround macro;
10086         this adjusts to the change to AC_MBSTATE_T.
10087
10088 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10089
10090         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10091
10092         * quotearg.c (quoting_style_args, quoting_style_vals,
10093         quotearg_buffer_restyled): Add support for
10094         clocale_quoting_style.  Undo previous change to
10095         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10096         and "{RIGHT QUOTATION MARK}" msgids.
10097
10098 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10099
10100         The old behavior of quoting `like this' doesn't look good with
10101         newer, ISO-style fonts.  See:
10102         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10103
10104         Instead, quote "like this" by default.  Let the translator
10105         tailor the locale-specific quoting behavior by providing
10106         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10107
10108         * quotearg.c (N_): New macro.
10109         (gettext_default): New function.
10110         (quotearg_buffer_restyled): Use
10111         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10112         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10113
10114 2000-07-09  Jim Meyering  <meyering@lucent.com>
10115
10116         * Most files: Update copyright dates to include 2000.
10117
10118 2000-07-08  Jim Meyering  <meyering@lucent.com>
10119
10120         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10121         if not defined.
10122         (xgethostname): Remove now-unnecessary #ifdef.
10123         Move declaration of `err' into loop where it's used.
10124
10125 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10126
10127         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10128         by allocating a larger buffer. Test the gethostname return value for
10129         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10130         returns an error and ENAMETOOLONG isn't defined.
10131
10132 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10133         and Bruno Haible  <haible@clisp.cons.org>
10134
10135         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10136
10137 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10138
10139         * quotearg.c (struct quoting_options): Simplify quote_these_too
10140         dimension.
10141
10142 2000-07-03  Jim Meyering  <meyering@lucent.com>
10143
10144         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10145         Reported by Bruno Haible.
10146
10147 2000-07-04  Jim Meyering  <meyering@lucent.com>
10148
10149         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10150         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10151         lacks mbrtowc.
10152
10153 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10154         and Bruno Haible  <haible@clisp.cons.org>
10155
10156         * quotearg.c (mbrtowc):
10157         Assign to *pwc, and return 1 only if result is nonzero.
10158         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10159
10160 2000-07-03  Jim Meyering  <meyering@lucent.com>
10161
10162         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10163         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10164         From Bob Proulx.
10165
10166 2000-07-02  Jim Meyering  <meyering@lucent.com>
10167
10168         * quotearg.c (mbstate_t): Don't define here.
10169
10170 2000-07-02  Jim Meyering  <meyering@lucent.com>
10171
10172         * nanosleep.c (SIGCONT): Define if not already defined.
10173
10174 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10175
10176         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10177         per change in ../m4/ls-mntd-fs.m4.
10178         (read_filesystem_list): Ignore symbolic links.
10179
10180 2000-06-29  Jim Meyering  <meyering@lucent.com>
10181
10182         * same.c: Include <string.h> or <strings.h>, as appropriate,
10183         for declaration of strcmp.
10184
10185         * long-options.c: Include <stdlib.h>, for declaration of exit.
10186
10187         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10188         Avoid warning by casting result to `char *' to remove `const'.
10189
10190 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10191
10192         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10193
10194 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10195
10196         savedir now sets errno on failure and invokes xmalloc to get memory.
10197         Fix a couple of other minor bugs while we're at it.
10198
10199         * savedir.c (<unistd.h>): Do not include; there's no need.
10200         (NAMLEN): Remove macro.
10201         (malloc, realloc): Remove decls.
10202         (stpcpy): Likewise.
10203         ("xalloc.h"): Include.
10204         (NAME_SIZE_DEFAULT): New macro.
10205         (savedir): Use xmalloc / xrealloc to allocate memory.
10206         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10207         Skip "" directory entries.
10208         Use strlen to calculate directory entry length, since the old method
10209         is rarely used these days and isn't worth supporting.
10210         Don't use a pointer after freeing it.
10211         Check for integer overflow when calculating allocation size.
10212         Use memcpy to copy entries, instead of stpcpy.
10213         Set errno properly when returning NULL.
10214         Check for readdir error.
10215
10216 2000-06-26  Jim Meyering  <meyering@lucent.com>
10217
10218         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10219
10220 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10221
10222         * getusershell.c (xmalloc, xrealloc): Remove functions.
10223         Include xalloc.h.
10224         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10225
10226 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10227
10228         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10229
10230 2000-06-24  Jim Meyering  <meyering@lucent.com>
10231
10232         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10233
10234 2000-06-21  Jim Meyering  <meyering@lucent.com>
10235
10236         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10237
10238 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10239
10240         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10241         (mbrtowc, mbstate_t): Define substitutes if
10242         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10243         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10244         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10245
10246 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10247
10248         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10249         than 1024, return a memory chunk of least possible size, instead
10250         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10251         Use free/xmalloc instead of xrealloc to avoid copying for very long
10252         paths.
10253
10254 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10255
10256         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10257         address, not strdup.  Include <stdlib.h> and don't declare free().
10258
10259 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10260
10261         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10262         the empty string.
10263
10264 2000-06-21  Jim Meyering  <meyering@lucent.com>
10265
10266         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10267         (noinst_HEADERS): Add getstr.h.
10268
10269         * getline.c (getstr): Move into a separate file.
10270         * getstr.c (getstr): New file, extracted from getline.c, with
10271         the following changes: new parameter, delim2; both delim[12]
10272         parameters have type `int', not `char'.  The latter would lose
10273         with 8-bit delimiters.
10274         * getstr.h: New file.
10275
10276 2000-06-19  Jim Meyering  <meyering@lucent.com>
10277
10278         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10279
10280 2000-06-18  Jim Meyering  <meyering@lucent.com>
10281
10282         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10283         Besides, these days every porting target provides a mkdir function.
10284
10285         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10286         (this snippet comes from src/system.h).
10287
10288 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10289
10290         * human.c (adjust_value): New function.
10291         (human_readable_inexact): Apply rounding style even when
10292         printing approximate values.
10293
10294 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10295
10296         * human.c (human_readable_inexact): Allow an input block
10297         size that is not a multiple of the output block size, and vice versa.
10298         Reported by Piergiorgio Sartor.
10299
10300 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10301
10302         * getdate.y (get_date): Apply relative times after time
10303         zone indicator, not before.  Reported by Todd A. Jacobs.
10304
10305 2000-06-13  Jim Meyering  <meyering@lucent.com>
10306
10307         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10308
10309         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10310
10311 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10312
10313         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10314
10315 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10316
10317         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10318
10319 2000-06-04  Jim Meyering  <meyering@lucent.com>
10320
10321         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10322         SunOS 4.1.4 for which gid_t is an unsigned type.
10323
10324 2000-06-03  Jim Meyering  <meyering@lucent.com>
10325
10326         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10327
10328 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10329
10330         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10331         newer, don't install charset.alias.
10332         * config.charset: Change the Linux/glibc rules so they become empty
10333         on glibc-2.1 or newer.
10334
10335 2000-06-02  Jim Meyering  <meyering@lucent.com>
10336
10337         * mountlist.c: Back out last change.  Instead, do this...
10338         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10339         member using the same `ignore'-testing code.
10340         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10341         fs_type strings.
10342         From Mark D. Roth.
10343
10344 2000-05-29  Jim Meyering  <meyering@lucent.com>
10345
10346         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10347         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10348
10349 2000-05-22  Jim Meyering  <meyering@lucent.com>
10350
10351         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10352
10353 2000-05-18  Jim Meyering  <meyering@lucent.com>
10354
10355         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10356         back, too, since it may have been modified by allocate_entry.
10357         (hash_delete): Rewrite to use neither the assignment operator
10358         nor the comma operator in an if-expression.
10359
10360 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10361
10362         * closeout.c:
10363         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10364         Remove; no longer needed.
10365         "quotearg.h": Add include.
10366         (file_name): Do not bother to explicitly initialize to NULL; it's less
10367         efficient on some hosts.
10368         (close_stdout_status): Remove test as to whether stdout was already
10369         closed; it breaks for the case "echo x | sort >&-".
10370         Quote file name colons.
10371         Do not assume that _("write error") lacks format strings.
10372
10373 2000-05-15  Jim Meyering  <meyering@lucent.com>
10374
10375         * version-etc.c (version_etc_copyright): Update the copyright string
10376         used in all --version output.
10377
10378 2000-05-14  Jim Meyering  <meyering@lucent.com>
10379
10380         * closeout.c (close_stdout_set_file_name): New function.
10381         (close_stdout_status): Use new file-scoped global.
10382         Return right away if fstat says the stdout file descriptor is invalid.
10383         * closeout.h (close_stdout_set_file_name): Declare.
10384
10385 2000-05-10  Jim Meyering  <meyering@lucent.com>
10386
10387         * closeout.c [default_exit_status]: New file-scoped variable.
10388         (close_stdout_set_status): New function.
10389         * closeout.h (close_stdout_set_status): Declare.
10390
10391 2000-05-08  Jim Meyering  <meyering@lucent.com>
10392
10393         * long-options.c: Don't include closeout.h.
10394         (parse_long_options): Don't call close_stdout for --version.
10395
10396 2000-05-06  Jim Meyering  <meyering@lucent.com>
10397
10398         * strnlen.c: Undefine __strnlen and strnlen.
10399         [!weak_alias]: Define __strnlen to strnlen.
10400
10401         * atexit.c: New file, from libiberty.
10402
10403 2000-05-06  Jim Meyering  <meyering@lucent.com>
10404
10405         * closeout.c (close_stdout_status): Also check for errors on the
10406         stderr stream.
10407
10408 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10409
10410         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10411         instead of xmalloc, xrealloc, path_concat.
10412         (locale_charset): Treat empty environment variables as absent.
10413         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10414
10415 2000-05-04  Jim Meyering  <meyering@lucent.com>
10416
10417         * getopt.c: Update from glibc.
10418         * obstack.c: Likewise.
10419         * obstack.h: Likewise.
10420         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10421
10422         * regex.h: Likewise.
10423         * strndup.c: Likewise.
10424         * strnlen.c: New file, from glibc.
10425
10426 2000-05-01  Jim Meyering  <meyering@lucent.com>
10427
10428         * full-write.c (full_write): Remove `FIXME' part of comment.
10429
10430 2000-04-29  Jim Meyering  <meyering@lucent.com>
10431
10432         * path-concat.c: Declare strdup only if it's not defined.
10433         * canon-host.c: Likewise.
10434
10435 2000-04-28  Jim Meyering  <meyering@lucent.com>
10436
10437         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10438         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10439         included first, then limits.h is included by locale.h by libintl.h.
10440         From John David Anglin.
10441
10442 2000-04-25  Jim Meyering  <meyering@lucent.com>
10443
10444         * makepath.c (S_IRWXUGO): Define.
10445         (make_path): Always perform explicit chmod if MODE specifies any
10446         of the `special' permission bits.  Prompted by a bug report against
10447         install from Mate Wierdl and Joost van Baal.
10448
10449 2000-04-18  Jim Meyering  <meyering@lucent.com>
10450
10451         * README: New file.
10452
10453         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10454         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10455
10456 2000-04-17  Jim Meyering  <meyering@lucent.com>
10457
10458         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10459         the definition of it to rpl_strftime also defined-away the system's
10460         declaration.
10461
10462 2000-04-15  Jim Meyering  <meyering@lucent.com>
10463
10464         Use `C' to denote so-called `contiguous' files, the same way
10465         that tar does.
10466         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10467         (ftypelet): Use S_ISCTG.
10468         From Michael Deutschmann.
10469
10470 2000-04-14  Jim Meyering  <meyering@lucent.com>
10471
10472         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10473
10474 2000-04-08  Jim Meyering  <meyering@lucent.com>
10475
10476         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10477         names don't conflict.  Reported by Eli Zaretskii.
10478
10479 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10480
10481         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10482         bug.  Deal with the different error behavior of Irix iconv.
10483
10484 2000-04-07  Jim Meyering  <meyering@lucent.com>
10485
10486         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10487         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10488
10489 2000-04-05  Jim Meyering  <meyering@lucent.com>
10490
10491         Portability tweaks required for ultrix4.3.
10492         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10493         * readutmp.c: Include sys/types.h before sys/stat.h.
10494         * canon-host.c: Declare strdup.
10495         * path-concat.c: Likewise.
10496         From John David Anglin.
10497
10498 2000-04-04  Jim Meyering  <meyering@lucent.com>
10499
10500         Be more DOS 8.3-friendly.
10501         * ref-add.sin: Renamed from ref-add.sed.in.
10502         * ref-del.sin: Renamed from ref-del.sed.in.
10503         * Makefile.am: Reflect renaming.
10504         Reported by Eli Zaretskii.
10505
10506         Use a temporary file name that won't clash with `charset.alias'
10507         in the DOS 8.3 name space.
10508         * Makefile.am (charset_tmp): Define.
10509         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10510         (uninstall-local): Likewise.
10511         Reported by Eli Zaretskii.
10512
10513 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10514
10515         * time/strftime.c (my_strftime): Make sure we call the system
10516         strftime, not ourselves, when invoking the underlying strftime.
10517
10518 2000-03-24  Jim Meyering  <meyering@lucent.com>
10519
10520         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10521         (charset_alias): Define.
10522         (install-exec-local): Factor out common code.
10523         (uninstall-local): Split lines longer than 80.
10524         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10525         (SUFFIXES): Define.
10526         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10527         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10528
10529 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10530
10531         * config.charset: Output a line containing "Packages using this file".
10532         * ref-add.sed.in, ref-del.sed.in: New files.
10533         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10534         ref-del.sed): New rules.
10535
10536 2000-03-17  Jim Meyering  <meyering@lucent.com>
10537
10538         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10539         Otherwise, include <strings.h>
10540
10541 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10542
10543         * unicodeio.c (utf8_wctomb): New function.
10544         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10545         format instead of in UCS-4 with platform dependent endianness.
10546
10547 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10548
10549         * savedir.c (savedir): Work even if directory size is
10550         negative; this can happen with some screwy NFS configurations.
10551
10552 2000-03-06  Jim Meyering  <meyering@lucent.com>
10553
10554         * localcharset.c (get_charset_aliases): Don't try to free file_name
10555         if it's NULL (because we ran out of memory).  From Bruno Haible.
10556
10557 2000-03-05  Jim Meyering  <meyering@lucent.com>
10558
10559         * localcharset.c ("path-concat.h"): Include.
10560         (get_charset_aliases): Use path_concat instead of ANSI string
10561         concatenation.
10562
10563         * unicodeio.h (PARAMS): Define.
10564         Use it to guard prototype.
10565
10566 2000-03-04  Jim Meyering  <meyering@lucent.com>
10567
10568         * Makefile.am (install-exec-local): Create $(libdir) before installing
10569         into it.
10570         (uninstall-local): Uncomment this rule so `make distcheck' works
10571         once again.
10572
10573         * unicodeio.c (<errno.h>): Include it.
10574         (errno): Declare if not defined.
10575
10576         * localcharset.c: Add Bruno's comment justifying use of volatile.
10577
10578         * config.charset: New version, incorporating remarks from a linux
10579         i18n mailing list.  From Bruno Haible.
10580
10581 2000-03-02  Jim Meyering  <meyering@lucent.com>
10582
10583         * Makefile.am (EXTRA_DIST): Add config.charset.
10584
10585 2000-03-01  Jim Meyering  <meyering@lucent.com>
10586
10587         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10588         * unicodeio.c: Likewise.
10589
10590 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10591
10592         * config.charset: New file.
10593         * localcharset.c: New file.
10594         * unicodeio.h, unicodeio.c: New files.
10595         * Makefile.am (DEFS): Add -DLIBDIR=...
10596         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10597         (noinst_HEADERS): Add unicodeio.h.
10598         (all-local, install-exec-local, charset.alias): New targets.
10599
10600 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10601
10602         * quotearg.c (ALERT_CHAR): New macro.
10603         (quotearg_buffer_restyled): Use it.
10604
10605 2000-02-27  Jim Meyering  <meyering@lucent.com>
10606
10607         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10608         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10609
10610         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10611         not `#if STDC_HEADERS'.
10612         Declare malloc if needed.
10613
10614         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10615         now that autoconf always defines the HAVE_DECL_ symbols.
10616         * human.c: Likewise.
10617         * same.c: Likewise.
10618         * strtoumax.c: Likewise.
10619
10620         * backupfile.c: Arrange for cpp to fail if the configure-time
10621         declaration check was not run.
10622         * hash.c: Likewise.
10623         * human.c: Likewise.
10624         * same.c: Likewise.
10625         * strtoumax.c: Likewise.
10626
10627         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10628         then first look up the entire `.'-containing string as a login name.
10629
10630 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10631
10632         * getdate.y: Handle two-digit years with leading zeros correctly.
10633         (textint): New typedef.
10634         (parser_control): Member year changed from int to textint.
10635         All uses changed.
10636         (YYSTYPE): Removed; replaced by %union with int and textint members.
10637         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10638         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10639         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10640         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10641         (date, number, to_year): Use width of number in digits, not its value,
10642         to determine whether it's a 2-digit year, or a 2-digit time.
10643         (yylex): Store number of digits of numeric tokens.
10644         Reported by John Kendall.
10645
10646         (parser_control): Changed from struct parser_control to typedef (for
10647         consistency).  All uses changed.
10648
10649         (tID): Removed; not used.
10650         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10651
10652 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10653
10654         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10655         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10656
10657 2000-02-12  Jim Meyering  <meyering@lucent.com>
10658
10659         * userspec.c (ISDIGIT): Define it.
10660         (isdigit): Remove definition.
10661         (is_number): Use ISDIGIT, not isdigit.
10662         <libintl.h>: Include.
10663         (_ and N_): Define.
10664         (parse_user_spec): Mark translatable strings.
10665
10666 2000-02-10  Jim Meyering  <meyering@lucent.com>
10667
10668         With these changes, nanosleep.[ch] are finally enough like the other
10669         lib/* replacement files to compile on a few more losing systems.
10670
10671         * nanosleep.h: Don't include config.h.
10672         Remove prototype from declaration of nanosleep.
10673         (PARAMS): Remove now-unneeded definition.
10674         * nanosleep.c: #undef nanosleep.
10675         (rpl_nanosleep): Rename from nanosleep.
10676
10677 2000-02-03  Jim Meyering  <meyering@lucent.com>
10678
10679         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10680         rather than with `#if HAVE_UTMPNAME'.
10681
10682 2000-02-01  Jim Meyering  <meyering@lucent.com>
10683
10684         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10685
10686 2000-01-31  Jim Meyering  <meyering@lucent.com>
10687
10688         * nanosleep.h (nanosleep): Guard declaration with
10689         `#if ! HAVE_DECL_NANOSLEEP'.
10690         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10691         the declaration in that vendor's sys/timers.h.
10692         Reported by Christian Krackowizer.
10693
10694         * quotearg.c (ISASCII): Add #undef and move definition to follow
10695         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10696         (ISPRINT): Likewise.
10697         Reported by Tom Tromey.
10698
10699 2000-01-30  Jim Meyering  <meyering@lucent.com>
10700
10701         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10702         uses of ->ut_name.  The latter doesn't work with new Linux header files
10703         where only utmpx.ut_user is declared.
10704
10705         * readutmp.h (UT_USER): Define.
10706
10707 2000-01-23  Jim Meyering  <meyering@lucent.com>
10708
10709         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10710         obstack.c.
10711
10712 2000-01-22  Jim Meyering  <meyering@lucent.com>
10713
10714         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10715         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10716         Required for some AIX systems.  Reported by Christian Krackowizer.
10717         [TESTING] (main): New function.
10718
10719         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10720         * dirname.c (dir_name): Support for DOS-style file names with drive
10721         letters.
10722
10723         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10724
10725         * strverscmp.c (ISDIGIT): Define.
10726         (strverscmp): Use ISDIGIT, not isdigit.
10727
10728 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10729
10730         * nanosleep.c (nanosleep):
10731         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10732         POSIX.1 doesn't require SA_INTERRUPT and some systems
10733         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10734         it's been part of POSIX.1 since day 1 (in 1988).
10735
10736 2000-01-17  Jim Meyering  <meyering@lucent.com>
10737
10738         * interlock: Remove unused file.  Reported by François Pinard.
10739
10740 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10741
10742         * quotearg.c (quotearg_buffer_restyled): Do not quote
10743         alert, backslash, formfeed, and vertical tab unnecessarily in
10744         shell quoting style.
10745
10746
10747 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10748 Free Software Foundation, Inc.
10749 Copying and distribution of this file, with or without modification,
10750 are permitted provided the copyright notice and this notice are preserved.