2006-10-02 Dmitry V. Levin <ldv@altlinux.org>
[gnulib.git] / lib / ChangeLog
1 2006-10-02  Dmitry V. Levin  <ldv@altlinux.org>
2
3         * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
4
5 2006-10-02  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
6
7         * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
8
9 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
10
11         Work around bug in Solaris 10 /proc file system:
12         /proc/self/fd/NNN/.. isn't the parent directory of
13         the directory whose file descriptor is NNN.  This needs to
14         be worked around at run time, not compile time, since a
15         program might be built on Solaris 8, where things work, and
16         run on Solaris 10.
17         * openat-priv.h (BUILD_PROC_NAME): Remove.  All callers changed
18         to use the following interface instead:
19         (OPENAT_BUFFER_SIZE): New macro.
20         (openat_proc_name): New function.
21         * at-func.c (AT_FUNC_NAME): Adjust to above changes.
22         * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
23         Likewise.
24         * openat-proc.c: New file.
25
26 2006-09-29  Bruno Haible  <bruno@clisp.org>
27
28         * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
29         * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
30         argument. Set stdout_closed before testing for ferror, not after.
31         (fwriteerror, fwriteerror_no_ebadf): New functions.
32
33 2006-09-28  Bruno Haible  <bruno@clisp.org>
34
35         * strndup.h: Simplify the redefinition of strndup.
36         (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
37
38 2006-09-28  Bruno Haible  <bruno@clisp.org>
39
40         * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
41         * gl_linkedhash_list.c: Likewise.
42         * gl_rbtreehash_list.c: Likewise.
43
44 2006-09-28  Jim Meyering  <jim@meyering.net>
45
46         * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
47         Include <unistd.h>.
48
49 2006-09-27  Jim Meyering  <jim@meyering.net>
50
51         This file could end up with a definition for a function
52         named __strndup, rather than rpl_strndup on a system with
53         incomplete weak_alias support.
54         * strndup.c (strndup): Rename from __strndup.
55         Remove #defines that used to map __strndup to strndup.
56         Don't use K&R prototypes.
57         Remove LIBC-related code, since this file is not sync'd with glibc.
58         * strndup.h: Revamp, accordingly.
59
60 2006-09-27  Paul Eggert  <eggert@cs.ucla.edu>
61
62         * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
63         getaddrinfo.
64
65         * __fpending.h: Don't include <stdio_ext.h> unless
66         HAVE_DECL___FPENDING.  This avoids a bug with lsbcc, where
67         it causes <stdio_ext.h> to cause a compile-time error.
68         Problem reported by Nelson H. F. Beebe.
69         * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
70         of HAVE_DECL___PENDING.
71
72 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
73
74         * savewd.c: Include <signal.h>, for 'raise'.
75
76 2006-09-26  Eric Blake  <ebb9@byu.net>
77
78         * verror.c: Include <config.h> unconditionally.
79
80 2006-09-22  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
81
82         * gl_anylinked_list2.h [lint] (gl_linked_iterator)
83         (gl_linked_iterator_from_to): Initialize struct completely.
84         * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
85         (gl_tree_iterator_from_to): Likewise
86         * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
87         * gl_array_list.c [lint] (gl_array_iterator)
88         (gl_array_iterator_from_to): Likewise.
89         * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
90         * gl_carray_list.c [lint] (gl_carray_iterator)
91         (gl_carray_iterator_from_to): Likewise.
92
93         * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
94         * md4.c (md4_process_block): Remove unused variable.
95         * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
96         parentheses for clarity.
97
98 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
99
100         Import this patch from libc:
101
102         2006-09-06  Jakub Jelinek  <jakub@redhat.com>
103
104         * regex_internal.c (re_string_reconstruct): Handle
105         offset < pstr->valid_raw_len && pstr->offsets_needed case.
106         Ensure no bytes read before raw_mbs array.  Pass a saved copy of
107         pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
108         re_string_context_at.
109
110 2006-09-20  Bruno Haible  <bruno@clisp.org>
111
112         * mkdtemp.c: Import from libc.
113         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
114                 * sysdeps/posix/tempname.c (__gen_tempname): Change
115                 attempts_min into a macro.  Use preprocessor to decide how to
116                 initialize attempts [Coverity CID 67].
117         2001-11-27  Paul Eggert  <eggert@twinsun.com>
118                 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
119                 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
120
121 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
122
123         * mkstemp.h: New file, since some standard headers
124         #define mkstemp.
125         * mkstemp.c: Revamp to put the !_LIBC code together.
126         Include "mkstemp.h".
127         Make the _LIBC code resemble glibc original more,
128         e.g., use K&R style.
129         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
130         (mkstemp): Remove, since mkstemp.h does this for us.
131         * stdlib--.h: Include mkstemp.h.
132
133         Import this patch from libc:
134
135         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
136
137         * tempname.c (__gen_tempname): Change attempts_min
138         into a macro.  Use preprocessor to decide how to initialize
139         attempts [Coverity CID 67].
140
141 2006-09-18  Bruno Haible  <bruno@clisp.org>
142
143         * javaversion.c: Include configmake.h.
144
145 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
146
147         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
148         that prevented coreutils 6.1 from building.  Problem reported
149         by Petter Reinholdtsen.
150
151 2006-09-18  Jim Meyering  <jim@meyering.net>
152
153         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
154
155 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
156
157         * dirchownmod.c: Don't include fcntl.h; no longer needed.
158         (dirchownmod): New arg FD.  All callers changed.
159         Use FD rather than opening the directory ourself, as opening is
160         now the caller's responsibility.
161         * dirchownmod.h: Likewise.
162         * mkancesdirs.c: Include <sys/types.h>, for portability to older
163         hosts that require <sys/types.h> before <sys/stat.h>.  Include
164         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
165         (test_dir): Remove.
166         (mkancesdirs): Return length of prefix of FILE that has already
167         been made, or -2 if there is a child doing the work.  Redo
168         algorithm so that it is O(N) rather than O(N**2).  Optimize away
169         ".", and treat ".." specially since it might stray back into
170         already-created areas.  Use a subprocess if necessary.  New arg
171         WD; all users changed.  MAKE_DIR function should now return 1
172         if it creates a directory that is not readable.  Return -2 if
173         a child process is spun off.
174         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
175         Adjust signature to match code.
176         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
177         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
178         all users changed.
179         * savewd.c, savewd.h: New files.
180
181 2006-09-15  Jim Meyering  <jim@meyering.net>
182
183         * rename-dest-slash.c (has_trailing_slash): Use
184         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
185         (rpl_rename_dest_slash): Perform the cheaper trailing slash
186         test before testing whether SRC is a directory.
187         Suggestions from Bruno Haible.
188
189         Avoid a warning about an unused variable.
190         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
191         into the #ifdef block where it's used.
192
193         * rename-dest-slash.c: New file.
194
195 2006-09-14  Bruno Haible  <bruno@clisp.org>
196
197         * allocsa.c: Include <config.h> unconditionally.
198         * asnprintf.c: Likewise.
199         * asprintf.c: Likewise.
200         * c-strcasecmp.c: Likewise.
201         * c-strcasestr.c: Likewise.
202         * c-strncasecmp.c: Likewise.
203         * c-strstr.c: Likewise.
204         * classpath.c: Likewise.
205         * clean-temp.c: Likewise.
206         * concatpath.c: Likewise.
207         * copy-file.c: Likewise.
208         * csharpcomp.c: Likewise.
209         * csharpexec.c: Likewise.
210         * execute.c: Likewise.
211         * fatal-signal.c: Likewise.
212         * findprog.c: Likewise.
213         * fwriteerror.c: Likewise.
214         * gl_array_list.c: Likewise.
215         * gl_array_oset.c: Likewise.
216         * gl_avltree_list.c: Likewise.
217         * gl_avltree_oset.c: Likewise.
218         * gl_avltreehash_list.c: Likewise.
219         * gl_carray_list.c: Likewise.
220         * gl_linked_list.c: Likewise.
221         * gl_linkedhash_list.c: Likewise.
222         * gl_list.c: Likewise.
223         * gl_oset.c: Likewise.
224         * gl_rbtree_list.c: Likewise.
225         * gl_rbtree_oset.c: Likewise.
226         * gl_rbtreehash_list.c: Likewise.
227         * imaxabs.c: Likewise.
228         * imaxdiv.c: Likewise.
229         * javacomp.c: Likewise.
230         * javaexec.c: Likewise.
231         * javaversion.c: Likewise.
232         * linebreak.c: Likewise.
233         * localcharset.c: Likewise.
234         * lock.c: Likewise.
235         * mbchar.c: Likewise.
236         * mbswidth.c: Likewise.
237         * mkdtemp.c: Likewise.
238         * pipe.c: Likewise.
239         * printf-args.c: Likewise.
240         * printf-parse.c: Likewise.
241         * progname.c: Likewise.
242         * progreloc.c: Likewise.
243         * readlink.c: Likewise.
244         * sh-quote.c: Likewise.
245         * stpcpy.c: Likewise.
246         * stpncpy.c: Likewise.
247         * strcasecmp.c: Likewise.
248         * strcasestr.c: Likewise.
249         * strcspn.c: Likewise.
250         * striconv.c: Likewise.
251         * strncasecmp.c: Likewise.
252         * strnlen1.c: Likewise.
253         * strstr.c: Likewise.
254         * strtok_r.c: Likewise.
255         * tls.c: Likewise.
256         * tmpdir.c: Likewise.
257         * unicodeio.c: Likewise.
258         * unsetenv.c: Likewise.
259         * vasnprintf.c: Likewise.
260         * vasprintf.c: Likewise.
261         * wait-process.c: Likewise.
262         * xallocsa.c: Likewise.
263         * xsetenv.c: Likewise.
264         * xstriconv.c: Likewise.
265
266 2006-09-13  Eric Blake  <ebb9@byu.net>
267
268         * getopt.c: Fix typo in last commit.
269
270 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
271
272         * _fpending.c: Include <config.h> unconditionally, since we no
273         longer worry about uses that don't define HAVE_CONFIG_H.
274         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
275         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
276         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
277         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
278         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
279         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
280         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
281         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
282         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
283         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
284         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
285         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
286         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
287         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
288         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
289         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
290         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
291         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
292         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
293         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
294         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
295         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
296         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
297         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
298         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
299         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
300         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
301         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
302         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
303         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
304         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
305         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
306         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
307         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
308         Likewise.
309
310 2006-09-12  Jim Meyering  <jim@meyering.net>
311
312         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
313         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
314         Reported by Nelson H. F. Beebe.
315
316 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
317
318         * argp-help.c (argp_doc): Make sure NULL is not passed to
319         dgettext.
320
321 2006-09-10  Bruno Haible  <bruno@clisp.org>
322
323         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
324
325 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
326
327         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
328         program_invocation_name and program_invocation_short_name are
329         initialized.
330         * argp-namefrob.h: Move declarations of program_invocation_name
331         and program_invocation_short_name to argp.h, so they are visible
332         to user programs.
333         * argp.h: Likewise
334
335 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
336
337         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
338         convention.  Text proposed by Bruno Haible.
339         (struct argp_option): Document the use of N_() wrappers.
340
341         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
342         and translate the two parts separately, instead of feeding
343         the whole string to gettext.  This allows to exclude
344         '\v' from the strings visible to the translator by writing doc
345         strings as N_("..") "\v" N_("..").
346
347 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
348
349         * mktime.c (guess_time_tm): Fix bug where mktime
350         returned the maximum time_t value rather than (time_t) -1.
351         Problem originally reported by William Bardwell
352         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
353
354         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
355         Moved to here ...
356         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
357         ... from here.
358
359 2006-09-06  Bruno Haible  <bruno@clisp.org>
360
361         * striconv.h: New file.
362         * striconv.c: New file, merging iconvme.c with GNU gettext's
363         iconvstring.c.
364         * xstriconv.h: New file.
365         * xstriconv.c: New file.
366
367 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
368
369         * argz_.h: Sync from Libtool.
370
371         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
372                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
373
374         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
375
376 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
377
378         * trim.h: New file.
379         * trim.c: New file.
380
381 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
382
383         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
384         Problem reported by Ralf Wildenhues in
385         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
386
387         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
388         HAVE_STRUCT_STATFS_F_FSTYPENAME.
389
390 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
391
392         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
393         or stdbool.h, because they might not exist while configuring.
394
395         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
396         Don't include unistd.h or limits.h; not needed, since chdir-long.h
397         does that for us.
398         (O_DIRECTORY): Remove.
399
400 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
401
402         Work around a bug in both the Linux and SunOS 64-bit kernels:
403         nanosleep mishandles sleeps for longer than 2**31 seconds.
404         Problem reported by Frank v Waveren in
405         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
406         * nanosleep.c (BILLION): New constant.
407         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
408         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
409
410 2006-08-30  Jim Meyering  <jim@meyering.net>
411
412         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
413         the parameter.
414
415 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
416
417         * isapipe.c, isapipe.h: New files.
418
419 2006-08-29  Eric Blake  <ebb9@byu.net>
420
421         * error.c (error_at_line, print_errno_message): Match libc, after
422         resolution of upstream bug 3044.
423
424 2006-08-29  Bruno Haible  <bruno@clisp.org>
425
426         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
427
428 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
429
430         Sync from Libtool:
431
432         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
433
434         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
435         sharing with gnulib.  Report by Eric Blake.
436
437 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
438
439         * fcntl_.h: New file.
440         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
441         the fcntl module.
442         * dirchownmod.c: Likewise.
443         * fts.c: Likewise.
444
445         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
446         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
447         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
448         just before including <inttypes.h>, to avoid circular inclusion.
449
450 2006-08-28  Bruno Haible  <bruno@clisp.org>
451
452         * inttypes_.h (SCNX*): Remove definitions.
453         Reported by Eric Blake.
454
455 2006-08-26  Bruno Haible  <bruno@clisp.org>
456
457         * vasnprintf.c (EOVERFLOW): Remove definition.
458         (VASNPRINTF): Return a string of length > INT_MAX without failing.
459         * vasprintf.c: Include errno.h, limits.h.
460         (EOVERFLOW): New fallback definition.
461         (vasprintf): Test here whether the string length is > INT_MAX.
462         * vsnprintf.c: Include errno.h, limits.h.
463         (EOVERFLOW): New fallback definition.
464         (vsnprintf): Fix bug when generated string was too long for the buffer.
465         Test here whether the string length is > INT_MAX.
466
467 2006-08-26  Bruno Haible  <bruno@clisp.org>
468             Simon Josefsson  <jas@extundo.com>
469
470         BeOS portability.
471         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
472
473 2006-08-28  Bruno Haible  <bruno@clisp.org>
474
475         * c-strstr.h: New file, from GNU gettext.
476         * c-strstr.c: New file, from GNU gettext.
477
478 2006-08-26  Bruno Haible  <bruno@clisp.org>
479
480         * inttypes_.h: New file.
481         * inttypes.h: Remove file.
482         * stdint_.h: Include <inttypes.h> through its absolute filename.
483
484         * imaxabs.c: New file.
485
486         * imaxdiv.c: New file.
487
488 2006-08-22  Bruno Haible  <bruno@clisp.org>
489
490         * readutmp.h: Skip most definitions if neither <utmp.h> nor
491         <utmpx.h> exists.
492
493 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
494
495         BeOS portability.
496         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
497         Problem reported by Bruno Haible.
498
499 2006-08-21  Bruno Haible  <bruno@clisp.org>
500
501         BeOS portability.
502         * mbchar.h: Include <wctype.h> only if it exists.
503
504 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
505
506         * cycle-check.h: Include <stdint.h> unconditionally, since we
507         now assume the stdint module.  Do not include inttypes.h.
508         * fsusage.h: Likewise.
509         * getndelim2.c: Likewise.
510         * human.h: Likewise.
511         * inttostr.h: Likewise.
512         * obstack.c: Likewise.
513         * regex_internal.h: Likewise.
514         * tempname.c: Likewise.
515         * utimecmp.c: Likewise.
516         * xstrtol.h: Likewise.
517
518         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
519
520         * strtoimax.c: Adjust to macro name changes in Autoconf,
521         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
522         * xtime.h: Likewise.
523
524 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
525
526         * fchmodat.c: New file, from coreutils.  This was inadvertently
527         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
528
529 2006-08-18  Bruno Haible  <bruno@clisp.org>
530
531         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
532         (ME_DUMMY): Treat "kernfs" as a dummy.
533         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
534
535 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
536
537         Update from coreutils.
538
539         * __fpending.h: Add copyright notice.
540         * fprintftime.h: Likewise.
541         * savedir.c: Use (C) in copyright notice.
542         * savedir.h: Likewise.
543
544         2006-08-15  Jim Meyering  <jim@meyering.net>
545
546         * at-func.c: New file, with the logic of all emulated at-functions.
547         * openat-priv.h: Include <errno.h> and define ENOSYS,
548         in support of the EXPECTED_ERRNO macro.
549         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
550         Instead, define the appropriate symbols and include "at-func.c".
551         * mkdirat.c (mkdirat): Likewise.
552         * fchmodat.c (fchmodat): Likewise.
553         (ENOSYS): Remove definition.
554         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
555         Don't include "unistd--.h" -- it wasn't ever used.
556
557         2006-01-17  Jim Meyering  <jim@meyering.net>
558
559         Rewrite fts.c not to change the current working directory,
560         by using openat, fstatat, fdopendir, etc..
561
562         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
563         (HAVE_OPENAT_SUPPORT): Define.
564         [_LIBC] (fchdir): Don't undef or define; no longer used.
565         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
566         Now, this `function' always succeeds, and consumes its file descriptor
567         parameter -- so callers must not close such FDs.  Update callers.
568         (diropen_fd, opendirat, cwd_advance_fd): New functions.
569         (diropen): Add parameter, SP.  Adjust all callers.
570         Implement using diropen_fd, rather than open.
571         (fts_open): Initialize new member, fts_cwd_fd.
572         Remove fts_rft-setting code.
573         (fts_close): Close fts_cwd_fd, if necessary.
574         (__opendir2): Define in terms of opendir or opendirat,
575         depending on whether the FST_NOCHDIR flag is set.
576         (fts_build): Since fts_safe_changedir consumes its FD, and since
577         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
578         and close the dup'd file descriptor upon failure.
579         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
580         (fts_safe_changedir): Tweak semantics to reflect that this function
581         now calls cwd_advance_fd and hence consumes its FD argument.
582         * fts_.h [struct FTS] (fts_cwd_fd): New member.
583         [struct FTS] (fts_rft): Remove now-unused member.
584         [struct FTS] (fts_cycle.state): Improve comment.
585
586         * openat.c (openat_needs_fchdir): New function.
587         * openat.h (openat_needs_fchdir): Declare it.
588
589 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
590
591         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
592         Problem and fix reported by Pádraig Brady in
593         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
594
595 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
596
597         * memcoll.c (memcoll): Optimize for the common case where the
598         arguments are bytewise equal.
599
600 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
601
602         Change copyright notice from LGPL 2 to GPL 2, since that's the
603         standard form used in the gnulib repository.
604         * lock.c: LGPL -> GPL.
605         * lock.h: Likewise.
606         * strnlen1.c: Likewise.
607         * strnlen1.h: Likewise.
608         * tls.c: Likewise.
609         * tls.h: Likewise.
610         * tmpdir.c: Likewise.
611
612         * TODO: Remove; this belongs only in coreutils.
613
614 2006-08-14  Eric Blake  <ebb9@byu.net>
615
616         Import the following change from libc:
617
618         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
619
620         Upstream bug 2997.
621         * misc/error.c: Add space between program name and message if file
622         name is missing.
623
624 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
625
626         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
627         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
628
629         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
630         in wchar_t.  Problem reported by Eric Blake.
631
632         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
633         LEN is smaller than SIZE.  Suggested by Bruno Haible.
634         Also, help the compiler to keep LEN in a register.
635
636 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
637
638         * .cppi-disable: Add snprintf.h, socket_.h.
639         * snprintf.c: Include <errno.h> and <limits.h>.
640         (EOVERFLOW): Define if the system does not.
641         Do not include "minmax.h"; it wasn't used.
642         (snprintf): Don't assume size_t promotes to an unsigned type.
643         Fix bug when generated string was too long for the buffer: the
644         buffer's contents are supposed to be the initial prefix of the
645         output.  Don't assume vasnprintf returns EOVERFLOW if the size
646         exceeds INT_MAX; do the check ourselves.
647
648         Import the following changes from libc:
649
650         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
651
652         * posix/regex_internal.c (re_string_skip_chars): If no character has
653         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
654         to the byte which couldn't be converted.
655         (re_string_reconstruct): Don't clear valid_raw_len before calling
656         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
657         tip_context using re_string_context_at.
658
659         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
660
661         * posix/regex.h: g++ still cannot handled [restrict].
662
663         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
664
665         * posix/regex.h: Remove special handling for VMS.
666
667 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
668
669         Sync from coreutils.
670
671         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
672
673         * mountlist.c [ME_REMOTE]: Filter out cifs.
674         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
675
676 2006-08-08  Eric Blake  <ebb9@byu.net>
677
678         * verror.c (verror_at_line): Work around glibc bug 2997, so that
679         verror_at_line output complies with GNU Coding Standards even when
680         file is NULL.
681
682 2006-08-08  Eric Blake  <ebb9@byu.net>
683
684         * verror.h, verror.c: New files.
685
686 2006-08-07  Bruno Haible  <bruno@clisp.org>
687
688         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
689         versions of AIX.
690         Reported by Ralf Wildenhues.
691
692 2006-08-06  Eric Blake  <ebb9@byu.net>
693
694         * error.h: Fold in some upstream changes from glibc.
695         * error.c: Likewise.
696
697 2006-07-29  Bruno Haible  <bruno@clisp.org>
698
699         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
700
701 2006-07-29  Bruno Haible  <bruno@clisp.org>
702
703         * setenv.c: Undo unintended modification done on 2006-02-27.
704
705 2006-07-28  Eric Blake  <ebb9@byu.net>
706
707         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
708         macro expansion.
709
710 2006-07-28  Simon Josefsson  <jas@extundo.com>
711
712         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
713         #include's.
714
715 2006-07-28  Simon Josefsson  <jas@extundo.com>
716
717         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
718         #include's.
719
720 2006-07-28  Bruno Haible <bruno@clisp.org>
721
722         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
723
724 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
725
726         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
727         arpa/inet.h.
728
729 2006-07-28  Bruno Haible  <bruno@clisp.org>
730
731         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
732         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
733         fallbacks.
734         Avoids link error on FreeBSD 4.x.
735         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
736
737         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
738         encoding.
739         * mbswidth.c (iswcntrl): Likewise.
740
741 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
742
743         * modechange.c (mode_compile): Numeric modes now affect setuid and
744         setgid on directories only if they set these bits.
745         * modechange.h: Remove obsolete comment about masks.
746
747 2006-07-27  Bruno Haible  <bruno@clisp.org>
748
749         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
750         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
751         defined.
752
753 2006-07-26  Eric Blake  <ebb9@byu.net>
754
755         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
756         like mingw that lack mkstemp.
757         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
758         avoid compilation warning on mingw.
759
760 2006-07-25  Bruno Haible  <bruno@clisp.org>
761
762         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
763         <stdarg.h> or config.h.
764
765 2006-07-24  Bruno Haible  <bruno@clisp.org>
766
767         * clean-temp.h: New file, from GNU gettext.
768         * clean-temp.c: New file, from GNU gettext.
769
770 2006-07-24  Bruno Haible  <bruno@clisp.org>
771
772         * tmpdir.h: New file, from GNU gettext.
773         * tmpdir.c: New file, from GNU gettext.
774
775 2006-07-23  Bruno Haible  <bruno@clisp.org>
776
777         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
778         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
779         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
780         gl_linked_remove_at): Use it.
781
782 2006-07-23  Eric Blake  <ebb9@byu.net>
783
784         * tmpfile-safer.c: New file.
785         * stdio-safer.h (fopen_safer): Add prototype.
786         * stdio--.h (tmpfile): Make safer.
787
788 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
789
790         * close-stream.c, close-stream.h: New files.
791
792 2006-07-22  Bruno Haible  <bruno@clisp.org>
793
794         Merge from GNU gettext 0.15.
795
796         2005-07-05  Bruno Haible  <bruno@clisp.org>
797
798                 * printf-args.c (printf_fetchargs): Work around broken
799                 definition of wint_t on mingw.
800
801         2005-02-12  Bruno Haible  <bruno@clisp.org>
802
803                 * xallocsa.h: Add extern "C" for C++.
804
805         2006-05-17  Bruno Haible  <bruno@clisp.org>
806
807                 Cygwin portability.
808                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
809
810         2006-04-30  Bruno Haible  <bruno@clisp.org>
811
812                 * progreloc.c: Include <mach-o/dyld.h> if available.
813                 (find_executable): Use _NSGetExecutablePath when possible.
814
815         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
816
817                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
818                 function.
819
820         2005-12-29  Bruno Haible  <bruno@clisp.org>
821
822                 * progreloc.c (set_program_name_and_installdir): Fix
823                 compilation error.
824
825         2005-12-04  Bruno Haible  <bruno@clisp.org>
826
827                 Cygwin portability.
828                 * progreloc.c: Include <windows.h> also on Cygwin.
829                 (find_executable): Add support for Cygwin.
830                 (set_program_name_and_installdir): Handle also platforms with
831                 nonempty EXEEXT.
832
833         2006-07-11  Bruno Haible  <bruno@clisp.org>
834
835                 * javacomp.c: Fix a comment.
836                 Reported by Jim Meyering.
837
838         2006-04-30  Bruno Haible  <bruno@clisp.org>
839
840                 * javacomp.h (compile_java_class): Add source_version,
841                 target_version arguments.
842                 * javacomp.c: Rewritten to choose only a compiler that
843                 respects the specified source_version and target_version.
844
845         2006-06-27  Bruno Haible  <bruno@clisp.org>
846
847                 Assume correct S_ISDIR macro.
848                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
849
850         2006-07-22  Bruno Haible  <bruno@clisp.org>
851
852                 * javaversion.h: New file, from GNU gettext.
853                 * javaversion.c: New file, from GNU gettext.
854                 * javaversion.java: New file, from GNU gettext.
855                 * javaversion.class: New file, from GNU gettext.
856
857         2006-05-17  Bruno Haible  <bruno@clisp.org>
858
859                 Cygwin portability.
860                 * javaexec.c (execute_java_class): Test for jview program
861                 also on Cygwin.
862
863         2006-04-09  Bruno Haible  <bruno@clisp.org>
864
865                 * fatal-signal.c: Don't include string.h.
866                 (at_fatal_signal): Use a copying loop instead of memcpy.
867
868         2005-12-04  Bruno Haible  <bruno@clisp.org>
869
870                 * csharpexec.c: Add support for 'clix' launcher (untested).
871                 (execute_csharp_using_sscli): New function.
872                 (execute_csharp_program): Call it.
873
874         2006-06-21  Bruno Haible  <bruno@clisp.org>
875
876                 Avoid warnings from recent versions of mcs.
877                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
878                 -o, -L, -r any more. Use options documented since mcs-1.0
879                 instead. Similarly for -g.
880
881         2005-07-09  Bruno Haible  <bruno@clisp.org>
882
883                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
884                 add a .dll suffix.
885                 Reported by Mark Junker <mjscod@gmx.de>.
886
887         2006-06-17  Bruno Haible  <bruno@clisp.org>
888
889                 * config.charset: Update for NetBSD 3.0.
890
891         2006-05-17  Bruno Haible  <bruno@clisp.org>
892
893                 Cygwin portability.
894                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
895
896         2006-05-16  Bruno Haible  <bruno@clisp.org>
897
898                 * localcharset.c [CYGWIN]: Include <windows.h>.
899                 (get_charset_aliases): For Cygwin, return the same CPxxx
900                 aliases list as under WIN32.
901                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
902                 the environment variables. Fall back to GetACP().
903
904         2006-04-05  Bruno Haible  <bruno@clisp.org>
905
906                 * config.charset: Update Juan Manuel Guerrero's address.
907
908         2005-02-12  Bruno Haible  <bruno@clisp.org>
909
910                 * allocsa.h: Add extern "C" for C++.
911
912         2005-02-10  Bruno Haible  <bruno@clisp.org>
913
914                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
915                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
916
917         2006-07-22  Bruno Haible  <bruno@clisp.org>
918
919                 * gettext.h: Update to GNU gettext-0.15.
920
921 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
922         and Simon Josefsson <jas@extundo.com>
923
924         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
925
926         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
927
928 2006-07-21  Eric Blake  <ebb9@byu.net>
929
930         * stdlib-safer.h: New file from coreutils, required by
931         stdlib--.h.
932
933 2006-07-19  Derek R. Price  <derek@ximbiot.com>
934
935         * getaddrinfo.h: Don't define unimplemented AI_* flags.
936         Reindent and repaginate.
937
938 2006-07-17  Bruno Haible  <bruno@clisp.org>
939
940         * gl_list.h: New file.
941         * gl_list.c: New file.
942         * gl_array_list.h: New file.
943         * gl_array_list.c: New file.
944         * gl_carray_list.h: New file.
945         * gl_carray_list.c: New file.
946         * gl_linked_list.h: New file.
947         * gl_linked_list.c: New file.
948         * gl_anylinked_list1.h: New file.
949         * gl_anylinked_list2.h: New file.
950         * gl_avltree_list.h: New file.
951         * gl_avltree_list.c: New file.
952         * gl_anyavltree_list1.h: New file.
953         * gl_anyavltree_list2.h: New file.
954         * gl_rbtree_list.h: New file.
955         * gl_rbtree_list.c: New file.
956         * gl_anyrbtree_list1.h: New file.
957         * gl_anyrbtree_list2.h: New file.
958         * gl_anytree_list1.h: New file.
959         * gl_anytree_list2.h: New file.
960         * gl_linkedhash_list.h: New file.
961         * gl_linkedhash_list.c: New file.
962         * gl_anyhash_list1.h: New file.
963         * gl_anyhash_list2.h: New file.
964         * gl_avltreehash_list.h: New file.
965         * gl_avltreehash_list.c: New file.
966         * gl_rbtreehash_list.h: New file.
967         * gl_rbtreehash_list.c: New file.
968         * gl_anytreehash_list1.h: New file.
969         * gl_anytreehash_list2.h: New file.
970
971         * gl_oset.h: New file.
972         * gl_oset.c: New file.
973         * gl_array_oset.h: New file.
974         * gl_array_oset.c: New file.
975         * gl_avltree_oset.h: New file.
976         * gl_avltree_oset.c: New file.
977         * gl_rbtree_oset.h: New file.
978         * gl_rbtree_oset.c: New file.
979         * gl_anytree_oset.h: New file.
980
981 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
982
983         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
984         New files.
985         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
986         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
987         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
988         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
989         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
990         callers changed.  Revamp internals significantly, by not
991         attempting to create directories that are temporarily more
992         permissive than the final results.  Do not attempt to use
993         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
994         This removes some race conditions, fixes some bugs, and simplifies
995         things.  Use new dirchownmod function to do owner and mode changes.
996         * mkdir-p.h: Likewise.
997         * modechange.c (octal_to_mode): New function.
998         (struct mode_change): New member mentioned.
999         (make_node_op_equals): New arg mentioned.  All callers changed.
1000         (mode_compile): Keep track of which mode bits the user has explicitly
1001         mentioned.
1002         (mode_adjust): New arg DIR, so that we implement the X op correctly.
1003         New arg PMODE_BITS, to keep track of which mode bits the user
1004         mentioned; it treats S_ISUID and S_ISGID speciall.
1005         All callers changed.
1006         * modechange.h: Likewise.
1007
1008 2006-07-11  Derek R. Price  <derek@ximbiot.com>
1009
1010         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1011
1012 2006-07-10  Derek R. Price  <derek@ximbiot.com>
1013
1014         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1015         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
1016         macros into the GNU _D_EXACT_NAMLEN.
1017         * savedir.c:  Likewise.
1018         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1019
1020 2006-07-09  Jim Meyering  <jim@meyering.net>
1021
1022         * argp-pv.c: Remove a doubled word in a comment.
1023         * check-version.c (check_version): Likewise.
1024         * javacomp.c (compile_java_class): Likewise.
1025
1026 2006-07-08  Jim Meyering  <jim@meyering.net>
1027
1028         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1029
1030 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
1031
1032         * getaddrinfo.c: Changes to compile under MSVC6: changed
1033         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1034         brackets.  Other minor changes to suppress some compiler
1035         warnings.
1036
1037 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1038
1039         * getloadavg.c: Use __VMS, not VMS.
1040         * getopt.c: Likewise.
1041         * getpagesize.h: Likewise.
1042         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1043         probably does not work.
1044
1045 2006-07-06  Derek R. Price  <derek@ximbiot.com>
1046         and Paul Eggert  <eggert@cs.ucla.edu>
1047
1048         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1049         Don't worry about this obsolete case any more.
1050         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
1051         directories.
1052         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1053         worry about this obsolete case any more.
1054         * fts.c: Likewise.
1055         * getcwd.c: Likewise.
1056         * glob.h: Likewise.
1057         * savedir.c: Likewise.
1058
1059 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1060
1061         * .cppi-disable: Add wcwidth.
1062         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
1063         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1064         (ISGRAPH): Remove.  All uses changed to isgraph.
1065         (FOLD) [!defined _LIBC]: Remove special case.
1066         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1067         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1068         HAVE_ISBLANK.
1069         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1070
1071 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1072
1073         * strtod.c (strtod): cast the argument of tolower to unsigned char.
1074
1075 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
1076
1077         * memcasecmp.c: Include <limits.h>.
1078         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1079         * strtod.c (strtod): Don't assume isspace works on negative chars.
1080         Don't assume isdigit succeeds only on '0' through '9'.
1081
1082 2006-07-05  Derek R. Price  <derek@ximbiot.com>
1083
1084         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1085         All uses of is_space replaced by isspace.
1086         * exit.h: Don't talk about STDC_HEADERS.
1087         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
1088         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1089         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
1090         replaced by isprint etc.
1091         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1092         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1093         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1094         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1095         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1096         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1097
1098 2006-07-05  Eric Blake  <ebb9@byu.net>
1099
1100         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1101         missing from netdb.h.
1102         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1103
1104 2006-06-27  Bruno Haible  <bruno@clisp.org>
1105
1106         Assume ANSI C header files and <ctype.h> functions.
1107         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1108         (mbsnwidth): Use isprint, iscntrl instead.
1109
1110 2006-07-03  Jim Meyering  <jim@meyering.net>
1111
1112         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1113         macro is used before the first cycle_check call.
1114
1115 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1116
1117         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1118         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
1119         reported by Mark D. Baushke, one in
1120         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1121
1122         Merge from coreutils.
1123
1124         * .cppi-disable: Add stdint_.h.
1125         * .cvsignore: Add stdint.h.
1126
1127         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1128
1129         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1130         both double and long double versions.
1131         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1132         * xstrtold.c: New file.
1133         * xstrtod.h (xstrtold): New decl.
1134
1135         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1136
1137         * filemode.c (setst): Remove.
1138         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1139         (arguably) clearer, and the generated code is a bit smaller on my
1140         Debian GNU/Linux stable x86 host.
1141
1142         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1143
1144         * filemode.c: Include "filemode.h" first, to test the interface.
1145         Assume that filemode.h includes sys/types.h and sys/stat.h.
1146         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1147         (ftypelet): Reorder to put common cases first, for efficiency.
1148         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1149         to do 'M'.
1150         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1151         of 10, for compatibility with FreeBSD.  All callers changed.
1152         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1153         that can't be deduced solely from st_mode.  First arg is now a const
1154         pointer.
1155         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1156         (strmode): Renamed from mode_string.
1157         (filemodestring): New decl.
1158         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1159         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1160         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1161
1162         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1163
1164         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1165         fsusage.h now does that.  Include fsusage.h first, to test interface.
1166         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1167         at most one method (the old code could have generated decls that
1168         didn't conform to C89, not that this was ever exercised).
1169         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1170
1171         2006-03-19  Jim Meyering  <jim@meyering.net>
1172
1173         Work even in a chroot where d_ino values for entries in "/"
1174         don't match the stat.st_ino values for the same names.
1175         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1176         number, iterate through all entries again, using lstat instead.
1177         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1178         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1179
1180         * getcwd.c (__getcwd): Clarify a comment.
1181         Use memcpy in place of a call to strcpy.
1182
1183         2006-03-12  Jim Meyering  <jim@meyering.net>
1184
1185         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1186         that of the current directory (which we're about to chdir ".." out of),
1187         then save the dev-ino of the parent, instead.
1188
1189         * same-inode.h (SAME_INODE): New file/macro.
1190         * chdir-safer.c (SAME_INODE): Remove definition.
1191         Include "same-inode.h", instead.
1192         * same.c: Likewise.
1193         * cycle-check.h: Include "same-inode.h".
1194         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1195         * cycle-check.c (SAME_INODE): Remove definition.
1196         * root-dev-ino.h: Include "same-inode.h".
1197
1198         2006-03-11  Eric Blake  <ebb9@byu.net>
1199
1200         * same.c (same_name): s/base_name/last_component/
1201         * backupfile.c (check_extension, numbered_backup): Likewise.
1202         * filenamecat.c (file_name_concat): Likewise.
1203
1204         2006-03-11  Eric Blake  <ebb9@byu.net>,
1205                     Paul Eggert  <eggert@cs.ucla.edu>
1206
1207         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1208         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1209         drive prefix.
1210         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1211         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1212         (last_component): New method.
1213         * dirname.c (dir_len): Determine when drive letters need a
1214         subsequent slash.  Preserve // when it is special.
1215         (dir_name): Don't append dot when drive letter is absolute.
1216         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1217         * basename.c (base_name): New semantics - malloc the result.
1218         Preserve // when it is special.  Preserve relative files that look
1219         like drive letters.
1220         (base_len): Preserve // when it is special.
1221         (last_component): New method, similar to old base_name semantics.
1222         * stripslash.c (strip_trailing_slashes): Use last_component, not
1223         base_name.  Strip redundant slashes from ///.
1224
1225 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1226
1227         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1228         both are 64 bits, since this seems to be the tradition, and this
1229         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1230         we ever run into a host that prefers long long to long in this
1231         case, we'll need another configure-time test.  Problem reported by
1232         Jim Meyering.
1233
1234 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1235
1236         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1237         possible collision with system files.
1238         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1239         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1240         WCHAR_MIN and WCHAR_MAX in this case.
1241         (<stddef.h>): Do not include; no longer needed.
1242         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1243         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1244         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1245         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1246         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1247         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1248         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1249         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1250         !defined(__c99))]: Include in this case too, since it's harmless
1251         now.
1252         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1253         dangerous to do so.
1254         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1255         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1256         (_STDINT_MIN, _STDINT_MAX): New macros.
1257         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1258         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1259         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1260         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1261         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1262         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1263         macros, not typedefs; this simplifies things quite a bit.
1264         Use long int for all types narrower than int64_t.
1265         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1266         Define in terms of long long int or int64_t or long int,
1267         not int64_t or int32_t.  This saves some compile-time testing.
1268         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1269         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1270         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1271         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1272         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1273         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1274         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1275         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1276         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1277         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1278         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1279         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1280         undef any previous version and define our own version, for
1281         simplicity and consistency with the new macros for types.
1282         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1283         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1284         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1285         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1286         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1287         @WINT_T_SUFFIX@ to keep things simple here.
1288         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1289         Simplify by assuming typical 8/16/32/64 host, since we're
1290         already doing that elsewhere anyway.
1291         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1292         and assume long long int is 64 bits if available.  This
1293         speeds up 'configure'.
1294
1295 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1296
1297         * getaddrinfo.c: fixed typo
1298
1299 2006-06-29  Eric Blake  <ebb9@byu.net>
1300
1301         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1302         unused static function.
1303
1304 2006-06-29  Eric Blake  <ebb9@byu.net>
1305
1306         * stat_.h: New file.
1307
1308 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1309
1310         * strftime.c: Assume strftime() exists.
1311
1312 2006-06-28  Bruno Haible  <bruno@clisp.org>
1313
1314         * getaddrinfo.h: Fix POSIX URL.
1315         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1316         (use_win32_p): Make static.
1317         (getaddrinfo): Reject service name if it is empty or does not consist
1318         solely of decimal digits, or if its value is > 65535.
1319         (getnameinfo): Remove useless casts.
1320
1321 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1322
1323         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1324         Autoconf 2.60 says this stuff was obsolete.
1325
1326 2006-05-12  Bruno Haible  <bruno@clisp.org>
1327
1328         * mkdtemp.c [MINGW]: Include <io.h>.
1329         (mkdir): Define using _mkdir.
1330
1331 2006-06-28  Bruno Haible  <bruno@clisp.org>
1332
1333         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1334         declaration for wcwidth.
1335         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1336
1337 2006-06-28  Eric Blake  <ebb9@byu.net>
1338
1339         * xvasprintf.h: Fix comments.
1340
1341 2006-06-28  Eric Blake  <ebb9@byu.net>
1342
1343         * mbchar.h (wcwidth): Include wcwidth.h.
1344         * mbswidth.c (wcwidth): Move from here...
1345         * wcwidth.h: ...to this new file.
1346
1347 2006-06-28  Simon Josefsson  <jas@extundo.com>
1348
1349         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1350         functions there.  It will succeed on Windows XP, but on Windows
1351         2000 and (presumably) earlier, it will fail, and use the internal
1352         re-implementation.
1353         (use_win32_p): New function.
1354         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1355         Support AI_NUMERICSERV to disable getservbyname.
1356         (getnameinfo): New function, only supports
1357         NI_NUMERICHOST|NI_NUMERICSERV for now.
1358
1359         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1360         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1361         getnameinfo.
1362
1363 2006-06-27  Bruno Haible  <bruno@clisp.org>
1364
1365         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1366
1367 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1368
1369         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1370         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1371         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1372
1373 2006-06-26  Bruno Haible  <bruno@clisp.org>
1374
1375         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1376         WCHAR_MAX.
1377         Reported by Mark D. Baushke and Larry Jones.
1378
1379 2006-06-26  Bruno Haible  <bruno@clisp.org>
1380
1381         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1382         in pre-C99 mode.
1383         Suggested by Mark D. Baushke and Larry Jones.
1384
1385 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1386
1387         * stdint_.h: Treat BSD/OS like OpenBSD.
1388
1389 2006-06-23  Bruno Haible  <bruno@clisp.org>
1390
1391         * stdint_.h: Treat IRIX like OpenBSD.
1392
1393 2006-06-23  Bruno Haible  <bruno@clisp.org>
1394
1395         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1396         ISO C 99 Technical Corrigendum 1.
1397
1398 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1399
1400         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1401         Some compiler complained about some of them.  Problem reported by
1402         Larry Jones in
1403         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1404
1405 2006-06-21  Simon Josefsson  <jas@extundo.com>
1406
1407         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1408         variable.
1409
1410         * socket_.h: Don't define WINVER.
1411
1412         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1413         slightly modified to work in gnulib.
1414
1415 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1416
1417         * read-file.c (fread_file): Start with buffer allocation of
1418         0 bytes rather than 1 byte; this simplifies the code.
1419         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1420         code to free buffer and save/restore errno.
1421         (internal_read_file): Remove unused local.
1422
1423 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1424
1425         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1426         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1427         Problem reported by Denis Excoffier in
1428         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1429
1430 2006-06-19  Simon Josefsson  <jas@extundo.com>
1431
1432         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1433
1434 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1435
1436         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1437
1438 2006-06-17  Bruno Haible  <bruno@clisp.org>
1439
1440         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1441
1442 2006-06-17  Bruno Haible  <bruno@clisp.org>
1443
1444         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1445         problem on Solaris 2.5.1.
1446
1447 2006-06-16  Eric Blake  <ebb9@byu.net>
1448
1449         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1450         * unicodeio.c [!defined errno]: Likewise.
1451         * strtol.c [!defined errno]: Likewise.
1452         * strtod.c [!defined errno]: Likewise.
1453
1454 2006-06-15  Bruno Haible  <bruno@clisp.org>
1455
1456         * stdint_.h: Rewritten to be fully auto-configured.
1457         Fixes bug on HP-UX/IA64.
1458
1459 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1460
1461         * getdate.y (__attribute__): Don't define if already defined.
1462         Problem reported by Larry Jones.
1463         * utimens.c (__attribute__): Likewise.
1464
1465 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1466
1467         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1468         reported by Andreas Schwab.
1469
1470 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1471             Bruno Haible  <bruno@clisp.org>
1472
1473         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1474
1475 2006-05-26  Martin Lambers  <marlam@marlam.de>
1476
1477         * getpass.c: Updates the test for the native W32 API, and adds
1478         missing includes, thus fixing compilation warnings.
1479
1480 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1481
1482         * tempname.c (small_open, large_open): New macros.
1483         (__open, __open64) [!_LIBC]: Remove.
1484         (__gen_tempname): Use small_open and large_open instead of __open
1485         and __open64.  This fixes a portability bug on HP-UX 11.11i
1486         reported by Simon Wing-Tang in
1487         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1488
1489 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1490
1491         * exclude.c (exclude_fnmatch): New function.
1492         (excluded_file_name): Call exclude_fnmatch.
1493         * exclude.h (excluded_file_name): New prototype
1494
1495 2006-05-24  Bruno Haible  <bruno@clisp.org>
1496
1497         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1498         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1499         Reported by Thorsten Maerz <torte@netztorte.de> via
1500         Aaron Stone <aaron@serendipity.cx>.
1501
1502 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1503
1504         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1505         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1506         (my_usleep): Don't mishandle maximum value.
1507
1508 2006-05-19  Jim Meyering  <jim@meyering.net>
1509
1510         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1511
1512 2006-05-17  Bruno Haible  <bruno@clisp.org>
1513
1514         Cygwin portability.
1515         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1516
1517 2006-05-17  Bruno Haible  <bruno@clisp.org>
1518
1519         * stdint_.h: Fix recognition of Cygwin.
1520
1521 2006-05-11  Jim Meyering  <jim@meyering.net>
1522
1523         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1524
1525 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1526
1527         * crc.c (crc32_update): Remove unnecessary L suffix.
1528         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1529         unwanted sign propagation, e.g., on hosts with 64-bit int.
1530         There still are some problems with reeelly weird theoretical hosts
1531         (e.g., 33-bit int) but it's not worth worrying about now.
1532         * sha1.c (rol): Likewise.
1533         (K1, K2, K3, K4): Remove unnecessary L suffix.
1534
1535 2006-05-10  Bruno Haible  <bruno@clisp.org>
1536
1537         * des.c: Cast to avoid warnings.
1538
1539 2006-05-10  Simon Josefsson  <jas@extundo.com>
1540
1541         * md4.c: Typo fix, update copyright years.
1542         (K1, K2): Don't use L because it turn computations into 64-bit on
1543         64-bit platforms.
1544
1545 2006-05-09  Bruno Haible  <bruno@clisp.org>
1546
1547         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1548         (EOVERFLOW): Define fallback value.
1549         (xstrcat): New function.
1550         (xvasprintf): Recognize the special case of a string concatenation.
1551
1552 2006-05-01  Bruno Haible  <bruno@clisp.org>
1553
1554         * stdint_.h: Shorter URL.
1555         * inttypes.h: Likewise.
1556
1557 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1558
1559         * verify.h: Document the internals better.  Most of this change
1560         was written by Bruno Haible.
1561
1562 2006-04-29  Bruno Haible  <bruno@clisp.org>
1563
1564         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1565         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1566
1567 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1568
1569         * getdate.y (get_date): When adding relative date, start with the
1570         initial time, not with the result of the first mktime call.
1571
1572 2006-04-23  Bruno Haible  <bruno@clisp.org>
1573
1574         * copy-file.c: Include <unistd.h> unconditionally.
1575         * execute.c: Likewise.
1576         * fatal-signal.c: Likewise.
1577         * findprog.c: Likewise.
1578         * mkdtemp.c: Likewise.
1579         * pipe.h: Likewise.
1580         * pipe.c: Likewise.
1581         * wait-process.h: Likewise.
1582
1583 2006-04-23  Bruno Haible  <bruno@clisp.org>
1584
1585         * fwriteerror.c (fwriteerror): Call fclose also when an error
1586         condition was already detected.
1587         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1588
1589 2006-04-19  Derek Price  <derek@ximbiot.com>
1590             Eric Blake  <ebb9@byu.net>
1591
1592         * inttypes.h: Correct grammar in comment.
1593
1594 2006-04-18  Derek Price  <derek@ximbiot.com>
1595             Paul Eggert  <eggert@cs.ucla.edu>
1596
1597         * inttypes.h: New file.
1598         * strtoimax.c: Assume <inttypes.h>.
1599
1600 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1601
1602         * utimens.c (futimens): glibc futimesat messes up if /proc
1603         isn't mounted.  Problem reported by Kir Kolyshkin.
1604
1605 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1606
1607         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1608         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1609         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1610
1611 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1612
1613         Merge regex changes from libc, removing some of our
1614         POSIX-conformance changes that were rejected and redoing them in a
1615         less-intrusive way.
1616
1617         * regcomp.c (re_compile_internal, init_dfa):
1618         Length arg is now size_t, not Idx.  All uses changed.
1619         (peek_token): Forward decl now says internal_function.
1620         (__re_error_msgid, __re_error_msgid_idx):
1621         Now static rather than extern with attribute_hidden.
1622         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1623         For some reason libc prefers K&R style defns for external functions.
1624         (regerror) [!defined _LIBC]: Likewise.
1625         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1626         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1627         (build_range_exp, build_collating_symbol):
1628         Use K&R-style defn.
1629         (re_compile_fastmap): Use '\0' to memset, not 0.
1630         (utf8_sb_map): Make the calculations more obvious.
1631         (init_dfa, parse_bracket_exp, build_charclass_op):
1632         Call calloc and cast result, as glibc does.
1633         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1634         (build_range_exp, build_collating_symbol):
1635         Now internal functions.
1636
1637         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1638
1639         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1640         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1641         Don't depend on VMS; depend on __VMS instead, for POSIX
1642         namespace cleanness.
1643         (regoff_t): Define to ssize_t, not long int.
1644
1645         Remove the REG_ macros named below.  Instead, make the old names
1646         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1647         __USE_GNU_REGEX.
1648         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1649         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1650         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1651         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1652         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1653         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1654         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1655         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1656         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1657         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1658         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1659         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1660         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1661         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1662         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1663         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1664         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1665         (REG_NREGS):
1666         Remove.  All uses replaced by the old RE_* names.
1667         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1668         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1669         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1670         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1671         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1672         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1673         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1674         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1675         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1676         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1677         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1678         Don't bother having these macros be independent of each others'
1679         values, since they no longer exist in the POSIX name space.
1680
1681         Rename the following member names back to their old names,
1682         unless !__USE_GNU_REGEX.  All uses changed back.
1683         (buffer): Renamed from re_buffer.
1684         (allocated): Renamed from re_allocated.
1685         (used): Renamed from re_used.
1686         (syntax): Renamed from re_syntax.
1687         (fastmap): Renamed from re_fastmap.
1688         (translate): Renamed from re_translate.
1689         (can_be_null): Renamed from re_can_be_null.
1690         (regs_allocated): Renamed from re_regs_allocated.
1691         (fastmap_accurate): Renamed from re_fastmap_accurate.
1692         (no_sub): Renamed from re_no_sub.
1693         (not_bol): Renamed from re_not_bol.
1694         (not_eol): Renamed from re_not_eol.
1695         (newline_anchor): Renamed from re_newline_anchor.
1696         (num_regs): Renamed from rm_num_regs.
1697         (start): Renamed from rm_start.
1698         (end): Renamed from rm_end.
1699
1700         (free_state): Move up a bit.
1701
1702         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1703         #define to be empty.
1704         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1705         when that is what is intended.
1706         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1707         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1708         (MAX): New macro.
1709         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1710         All uses changed back to re_malloc, etc.  It's now the caller's
1711         responsibility to check for overflow; all callers changed.
1712         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1713         (re_x2nrealloc): Remove.
1714         (free_state): Remove decl.
1715
1716         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1717         (re_set_registers, re_exec):
1718         Use K&R-style defn.
1719
1720         2006-01-31  Roland McGrath  <roland@redhat.com>
1721
1722         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1723         Reported by Mike Frysinger <vapier@gentoo.org>.
1724
1725         2006-01-15  Andreas Jaeger  <aj@suse.de>
1726
1727         [BZ #1950]
1728         * regex_internal.c (re_string_reconstruct): Adjust for
1729         build_wcs_upper_buffer change.
1730         (build_wcs_upper_buffer): Change return type.
1731
1732         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1733
1734         * regex_internal.h: Include <stdint.h> if available.
1735
1736         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1737
1738         * regex_internal.h (SIZE_MAX): Provide a default definition.
1739
1740         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1741
1742         * regcomp.c: Adjust for changed secondary hash function.
1743
1744         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1745
1746         * regex.h: Pretty printing.
1747         Clean up namespace a bit.
1748
1749         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1750
1751         * regexec.c (update_cur_sifted_state, check_arrival,
1752         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1753
1754         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1755                     Ulrich Drepper  <drepper@redhat.com>
1756
1757         [BZ #1302]
1758         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1759         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1760
1761         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1762
1763         [BZ #281]
1764         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1765         * regcomp.c: Remove unnecessary uses of
1766         unsigned RE_TRANSLATE_TYPE.
1767         * regex_internal.h: Likewise.
1768         * regex_internal.c: Likewise.
1769         * regexec.c: Likewise.
1770         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1771
1772         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1773
1774         * regexec.c (find_recover_state): Remove unnecessary
1775         initialization.
1776         (transit_state_bkref): Make DFA a const pointer.
1777         (get_subexp): Likewise.
1778         (check_arrival): Likewise.
1779         (update_cur_sifted_state): Likewise.
1780         (re_search_internal): Likewise.
1781         (prune_impossible_nodes): Likewise.
1782         (acquire_init_state_context): Likewise.
1783         (proceed_next_node): Likewise.
1784         (set_regs): Likewise.
1785         (free_fail_stack_return): Likewise.
1786         (check_arrival_expand_ecl): Mark DFA parameter as const.
1787         (check_arrival_expand_ecl_sub): Likewise.
1788         (check_subexp_limits): Likewise.
1789         (sub_epsilon_src_nodes):  Likewise.
1790         (add_epsilon_src_nodes):  Likewise.
1791         (merge_state_array): Likewise.
1792         (update_regs): Likewise.
1793         (build_trtable): Likewise.
1794         (sift_states_backward): Mark MCTX parameter as const.
1795         (build_sifted_states): Likewise.
1796         (update_cur_sifted_state): Likewise.
1797         (sift_states_mkref): Likewise.
1798         (check_arrival_expand_ecl): Mark eclosure as const.
1799         (check_dst_limits_calc_pos_1): Likewise.
1800         * regex_internal.h (re_match_context_t): Make dfa a const
1801         pointer.
1802
1803         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1804
1805         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1806         (transit_state_sb): Likewise.
1807         (transit_state_mb): Likewise.
1808         (sift_states_iter_mb): Likewise.
1809         (check_arrival_add_next_nodes): Likewise.
1810         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1811         [_LIBC] (re_search_2_stub): Use mempcpy.
1812
1813         * regex_internal.c (re_string_reconstruct): Avoid calling
1814         mbrtowc for very simple UTF-8 case.
1815
1816         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1817         a pointer-to-const.
1818         (re_acquire_state_context): Likewise.
1819         * regex_internal.h: Adjust prototypes.
1820
1821         * regex.c: Prevent using C++ compilers.
1822
1823         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1824         (re_acquire_state_context): Likewise.
1825
1826 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1827             Bruno Haible  <bruno@clisp.org>
1828
1829         * stdint_.h: On OpenBSD, don't redefine types already included in
1830         <sys/types.h> and <inttypes.h>.
1831
1832 2006-03-24  Eric Blake  <ebb9@byu.net>
1833
1834         * time_r.c (copy_string_result): Remove, as it is no longer used.
1835
1836 2006-03-24  Simon Josefsson  <jas@extundo.com>
1837
1838         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1839         including some doc fixes.
1840         (base64_encode_alloc): Fix +1 bug on allocation failures.
1841
1842 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1843
1844         * base64.c (base64_encode): Do not read past end of array with
1845         unsanitized input on systems with CHAR_BIT > 8.
1846
1847 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1848
1849         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1850         Typedef to long int, not to off_, as POSIX will likely change
1851         in that direction.
1852
1853 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1854
1855         * argp-help.c (validate_uparams): Fix typo
1856         * argp-parse.c (argp_default_options): Consistently begin help
1857         messages with a lowercase letter.
1858
1859 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1860
1861         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1862         overrun buffers and shouldn't be used (much as gets shouldn't be
1863         used).
1864         * time_r.c (asctime_r, ctime_r): Likewise.
1865
1866 2006-03-08  Simon Josefsson  <jas@extundo.com>
1867
1868         * gc-gnulib.c (randomize): Don't open files called 'no', they
1869         signal that configure disabled the device.
1870
1871 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1872
1873         * c-stack.c: Include unistd.h unconditionally, since we now assume
1874         the unistd module.
1875         * getlogin_r.c: Likewise.
1876         * getlogin_r.h: Likewise.
1877         * glob.c: Likewise.
1878         * pagealign_alloc.c: Likewise.
1879         * unistd_.h: Remove; no longer needed.
1880
1881 2006-03-07  Simon Josefsson  <jas@extundo.com>
1882
1883         * unistd_.h: New file.
1884
1885 2006-03-07  Simon Josefsson  <jas@extundo.com>
1886
1887         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1888
1889 2006-03-01  Simon Josefsson  <jas@extundo.com>
1890
1891         * readline.c: Fix typo, tiny patch from Stepan Kasal
1892         <kasal@ucw.cz>.
1893
1894 2006-02-28  Simon Josefsson  <jas@extundo.com>
1895
1896         * getopt.c: Protect #include of unistd.h, for MSVS.
1897
1898 2006-02-27  Simon Josefsson  <jas@extundo.com>
1899
1900         * base64.h: Indent #define's.  From Jim Meyering
1901         <jim@meyering.net>.
1902
1903 2006-02-27  Jim Meyering  <jim@meyering.net>
1904
1905         Revert the change of 2006-02-24, so these files can continue
1906         to be sync'd from gettext.
1907         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1908         of `config.h'.
1909
1910 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1911
1912         * glob.c: Say "invalid" rather than "illegal" in comments.
1913
1914 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1915
1916         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1917
1918 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1919
1920         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1921         AT_FDCWD exceeds INT_MAX.
1922         * openat.h (AT_FDCWD): Likewise.
1923
1924 2006-02-14  Jim Meyering  <jim@meyering.net>
1925
1926         Sync from coreutils.
1927
1928         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1929         failure on deficient systems, and simplify gnulib lgpl dependencies.
1930         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1931         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1932
1933         * xalloc-die.c: Remove unused definition of N_.
1934
1935 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1936
1937         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1938
1939 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1940
1941         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1942         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1943
1944 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1945
1946         * argp-namefrob.h: Restore changes accidentally lost during the
1947         "autoupdate" on 2005-12-12.
1948
1949 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1950
1951         * fnmatch.c (L_): Renamed from L, to work around a bug in
1952         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1953         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1954         All uses changed.
1955
1956 2006-01-26  Simon Josefsson  <jas@extundo.com>
1957
1958         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1959         prototype is visible on mingw32.
1960
1961         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1962         for mingw32.
1963
1964         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1965         mingw32).
1966
1967 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1968
1969         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1970         attempt to open for write; this always fails, at least on POSIX
1971         hosts.  This reinstates the 2006-01-09 change, which was
1972         inadvertently removed.
1973
1974 2006-01-26  Bruno Haible  <bruno@clisp.org>
1975             Paul Eggert  <eggert@cs.ucla.edu>
1976
1977         * stdbool_.h (_Bool)
1978         [(! (defined __cplusplus || defined __BEOS__)
1979           && !defined __GNUC__
1980           && !(defined __HP_cc || defined __xlc__
1981                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1982                || defined __sgi))]:
1983         #define to signed char in these cases too; this simplifies
1984         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1985         etc., separately) and makes it more conservative.
1986
1987 2006-01-21  Jim Meyering  <jim@meyering.net>
1988
1989         Sync from the stable (b5) branch of coreutils:
1990
1991         * fts.c (fts_children): Don't let close() clobber errno from
1992         failed fchdir().
1993
1994         * fts.c (fts_stat): When following a symlink-to-directory,
1995         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1996         a dangling symlink.  That can also happen at least for ELOOP.
1997         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1998         FYI, this bug predates the inclusion of fts.c in coreutils.
1999
2000         * fts.c (fts_open): Put new maxarglen declaration and uses
2001         in their own block, so pre-c99 compilers don't object.
2002
2003         Avoid the double-free (first in fts_read, second in fts_close) that
2004         would occur when an `active' directory is made inaccessible (e.g.,
2005         via chmod a-x) during a traversal.
2006         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2007         before returning.  Reproduce this failure by
2008         mkdir -p a/b; cd a; chmod a-x . b
2009         Reported by Stavros Passas.
2010
2011 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2012
2013         * argp-namefrob.h: Bugfix. Remove stray #
2014
2015 2006-01-25  Bruno Haible  <bruno@clisp.org>
2016
2017         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2018         warnings.
2019         Reported by Paul Eggert.
2020
2021 2006-01-25  Jim Meyering  <jim@meyering.net>
2022
2023         * fileblocks.c: Remove more useless parentheses.
2024         * readutmp.h: Likewise.
2025
2026 2006-01-24  Bruno Haible  <bruno@clisp.org>
2027
2028         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2029         has it.
2030         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
2031         2005-11-26.
2032
2033         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2034         to avoid problems with the built-in _Bool type.
2035         Reported by Paul Eggert on 2005-11-26.
2036
2037 2006-01-24  Jim Meyering  <jim@meyering.net>
2038
2039         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2040
2041 2006-01-24  Simon Josefsson  <jas@extundo.com>
2042
2043         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2044         Bruno.
2045
2046 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
2047
2048         Work around porting bugs reported by Dieter in
2049         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2050         * getopt.c (_NOPROTO): Remove; no longer needed.
2051         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2052         Include "getopt.h" first, to check interface.
2053         (getenv): Declare only if defined HAVE_DECL_GETENV &&
2054         !HAVE_DECL_GETENV.
2055         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2056         (__strndup): Revert to K&R-style function dfns, the glibc style.
2057         * strnlen.c: Don't claim it's taken from glibc; it's not.
2058         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2059         Include strnlen.h first, to get prototype properly.
2060         (strnlen): Renamed from __strnlen.
2061         Remove weak alias.
2062
2063 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
2064
2065         These changes imported from libc.
2066         * getopt.c: Use __fxprintf instead of inline stream orientation
2067         test and two separate function calls.
2068         * strndup.c (__strndup): Add libc_hidden_def.
2069
2070 2006-01-22  Bruno Haible  <bruno@clisp.org>
2071
2072         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2073         temporary buffer for sprintf, take into account the precision also
2074         for 'd', 'i', 'u', 'o', 'x', 'X'.
2075
2076 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
2077
2078         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2079         to pacify gcc -Wswitch-default.
2080
2081 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2082
2083         * argp-help.c (usage_long_opt): Do not print DOC options.
2084         (__argp_base_name): Removed
2085         * argp-namefrob.h (__argp_basename): Removed definition. Was a
2086         typo.
2087         (__argp_base_name): Provide macro definition or extern declaration
2088         depending on the configuration
2089
2090 2006-01-20  Simon Josefsson  <jas@extundo.com>
2091
2092         * inet_ntop.h: Unconditionally include sys/socket.h.
2093
2094 2006-01-19  Simon Josefsson  <jas@extundo.com>
2095
2096         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2097
2098 2006-01-12  Simon Josefsson  <jas@extundo.com>
2099
2100         * base64.c: Fix warning, reported by Bruno Haible
2101         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2102
2103 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2104
2105         Sync from coreutils.
2106         * md5.c: Fix commentary typos.
2107         (alignof, UNALIGNED_P): No need for a GCC-specific version.
2108         * md5.h (__attribute__): Remove; unused.
2109         * sha1.c: Fix commentary to match md5 better.
2110         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2111         so that we don't need to worry about alignment.  All uses changed.
2112         This merges the 2005-10-28 md5 change into sha1.
2113
2114 2006-01-11  Jim Meyering  <jim@meyering.net>
2115
2116         Sync from coreutils.
2117         * md5.c (OP): Fix spacing.
2118
2119 2006-01-11  Simon Josefsson  <jas@extundo.com>
2120
2121         * stdint_.h (SIZE_MAX): Add missing (.
2122
2123 2006-01-10  Bruno Haible  <bruno@clisp.org>
2124
2125         * argp.h (__const): Remove macro. Use const instead.
2126         * argp-fmtstream.h (__const): Likewise.
2127         * glob_.h (__const): Remove macro.
2128         * glob-libc.h: Use const instead of __const.
2129
2130 2006-01-10  Jim Meyering  <jim@meyering.net>
2131
2132         Avoid the double-free (first in fts_read, second in fts_close) that
2133         would occur when an `active' directory is made inaccessible (e.g.,
2134         via chmod a-x) during a traversal.
2135         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2136         before returning.  Reproduce this failure by
2137         mkdir -p a/b; cd a; chmod a-x . b
2138         Reported by Stavros Passas.
2139
2140         Sync from coreutils.
2141         * sha1.c: Tweak grammar in a comment.
2142
2143 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2144
2145         * regex_internal.h (BITSET_WORD_BITS):
2146         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2147         preprocessor mishandles large unsigned values as if they were signed.
2148         Problem reported by Claudio Fontana in
2149         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2150
2151 2006-01-10  Simon Josefsson  <jas@extundo.com>
2152
2153         * socket_.h: New file.
2154
2155 2006-01-10  Bruno Haible  <bruno@clisp.org>
2156
2157         * localcharset.c: Update from GNU gettext.
2158
2159 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2160
2161         Sync from coreutils.
2162         * chdir-long.c (cdb_free): Don't bother trying to open directory
2163         for write access: POSIX says that must fail.
2164         * fts.c (diropen): Likewise.
2165         * save-cwd.c (save_cwd): Likewise.
2166         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2167         well, for minor improvements on hosts that lack O_DIRECTORY.
2168         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2169         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2170         Fall back on chown if open failed with EACCES.
2171
2172         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2173         Report an error at compile-time if only a 1-second nominal clock
2174         resolution is found.
2175
2176         * lchmod.h: New file.
2177         * mkdir-p.c: Include lchmod.h, lchown.h.
2178         (make_dir_parents): Use lchown rather than chown, and
2179         lchmod rather than chmod.
2180
2181         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2182         too.  Problem with "none" reported by Bob Proulx.  Problem with
2183         "proc" reported by n0dalus.
2184
2185         * mountlist.c: Include <limits.h>.
2186         (dev_from_mount_options)
2187         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2188         New function.  It no longer assumes "dev=" has the System V meaning
2189         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2190         (read_file_system_list)
2191         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2192         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2193         dev= in that case.
2194
2195         * posixtm.h (PDS_PRE_2000): New macro.
2196         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2197         All usages changed.  Reject dates outside the range 1969-1999 if
2198         PDS_PRE_2000 is used.
2199
2200 2006-01-09  Jim Meyering  <jim@meyering.net>
2201
2202         Sync from coreutils.
2203
2204         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2205
2206         * chdir-safer.h, chdir-safer.c: New files.
2207
2208         * modechange.c (mode_compile): Reject an invalid mode string
2209         that starts with an octal digit.  From Andreas Gruenbacher.
2210
2211         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2212         and dup to open_safer and dup_safer, respectively.
2213         (openat_permissive): Fix typo in comment.
2214
2215         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2216         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2217         (_): Remove; no longer needed.
2218         (openat): Renamed from rpl_openat; no need for rpl_openat
2219         since openat.h renames openat for us.
2220         Replace most of the body with a call to openat_permissive,
2221         to avoid duplicate code.
2222         Port to (probably hypothetical) environments were mode_t is
2223         wider than int.
2224         (openat_permissive): Require mode arg, so that we can check
2225         types better.  Put it just after flags.  Change cwd failure
2226         indicator from pointer-to-bool to pointer-to-errno-value.
2227         All callers changed.
2228         Invoke openat_save_fail and/or openat_restore_fail if
2229         cwd_errno is null, so that openat can call us.
2230         (openat_permissive, fdopendir, fstatat, unlinkat):
2231         Simplify errno handling to avoid some duplicate code,
2232         as it's OK to set errno on success.
2233         * openat.h: Revamp code so that function macros depend on
2234         __OPENAT_PREFIX only, not also on AT_FDCWD.
2235         (openat_ro): Remove.  Caller changed to use openat_permissive.
2236         (openat_permissive): Now a macro, if not a function.
2237         (openat_restore_fail, openat_save_fail): Now always functions,
2238         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2239
2240         * openat-priv.h: New file, defining macros used by mkdirat.c
2241         and openat.c.
2242         * mkdirat.c: Include openat-priv.h.
2243         Remove definitions of macros defined therein.
2244         * openat.c: Likewise.
2245
2246         * mkdirat.c (mkdirat): New file and function.
2247         * openat.h (mkdirat): Declare.
2248
2249         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2250
2251         * openat.h (openat_permissive): Declare.
2252         (openat_ro): Define.
2253
2254         * openat.c (EXPECTED_ERRNO): New macro.
2255         (openat_permissive): New function -- used in remove.c rewrite.
2256         (all functions): Set errno just before returning, only if there
2257         was an actual failure.
2258         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2259
2260         Emulate openat-family functions using Linux's procfs, if possible.
2261         Idea and some code based on Ulrich Drepper's glibc changes.
2262
2263         * openat.c: (BUILD_PROC_NAME): New macro.
2264         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2265         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2266         before falling back on save_cwd and restore_cwd.
2267         (fdopendir, fstatat, unlinkat): Likewise.
2268
2269         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2270         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2271
2272         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2273         as second argument to va_arg.  Otherwise, some versions of gcc
2274         warn that `if this code is reached, the program will abort'.
2275
2276 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2277
2278         Sync from coreutils.
2279
2280         Add POSIX ACL support
2281         * acl.h (copy_acl, set_acl): Add declarations.
2282         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2283         systems other than Linux.
2284         (chmod_or_fchmod): New function: use fchmod when possible,
2285         and chmod otherwise.
2286         (file_has_acl): Add a POSIX ACL implementation, with a
2287         Linux-specific subcase.
2288         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2289         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2290         acls are unsupported.
2291         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2292         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2293         are unsupported.
2294
2295 2006-01-09  Bruno Haible  <bruno@clisp.org>
2296
2297         * sysexit_.h (EX_OK): New macro.
2298         Suggested by Martin Lambers <marlam@marlam.de>.
2299
2300 2006-01-09  Bruno Haible  <bruno@clisp.org>
2301
2302         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2303         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2304         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2305         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2306
2307 2006-01-09  Bruno Haible  <bruno@clisp.org>
2308
2309         * stdint_.h (SIZE_MAX): Write the value without involving negative
2310         numbers.
2311
2312 2005-10-16  Bruno Haible  <bruno@clisp.org>
2313
2314         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2315         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2316
2317 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2318
2319         * strftime.c (tzname): Don't declare if it is already #defined.
2320         Problem reported for Mingw by Mark Junker.
2321
2322 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2323
2324         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2325         long int, not int, for nanosecond counts, so that people who are
2326         used to POSIX struct timespec won't be surprised.  Reported by Jim
2327         Meyering.
2328
2329 2005-12-16  Jim Meyering  <jim@meyering.net>
2330
2331         * fprintftime.c, fprintftime.h: New files.
2332
2333 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2334
2335         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2336         * argp-help.c (fill_in_uparams): Check if the constructed
2337         struct uparams is valid. Fall back to the default values if it is
2338         not.
2339
2340 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2341
2342         * argp-help.c (__argp_base_name): New function
2343         (__argp_short_program_name): Rewrite using __argp_base_name
2344         * argp-namefrob.h: Define program_invocation_name and
2345         program_invocation_short_name if requested
2346         (__argp_base_name): Add prototype
2347         * argp-parse.c (argp_def): Use gettext wrappers
2348         (argp_default_parser): Use __argp_base_name
2349         * argp-pin.c: New file. Defines program_invocation_name and
2350         program_invocation_short_name on systems that lack them.
2351
2352 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2353
2354         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2355         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2356         porting problem reported by Georg Schwarz in
2357         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2358
2359 2005-07-09  Bruno Haible  <bruno@clisp.org>
2360
2361         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2362         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2363         Reported by Mark Junker <mjscod@gmx.de>.
2364
2365 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2366
2367         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2368         (uintmax_t) [defined uintmax_t]: Do not declare.
2369         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2370         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2371         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2372         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2373         sake of portability to weird hosts that C allows (though we don't
2374         know of any practical examples).
2375
2376         * savedir.h (fdsavedir): New decl.
2377         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2378         contains most of the former guts of savedir.
2379         (savedir): Use savedirstream.
2380         Include "openat.h".
2381
2382 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2383
2384         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2385         coreutils no longer futzes with rounding modes.
2386
2387 2005-11-14  Jim Meyering  <jim@meyering.net>
2388
2389         * mkstemp-safer.c: Include <config.h>, required for possible
2390         replacement of mkstemp.
2391
2392 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2393
2394         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2395         business.
2396         (gethrxtime) [! (HAVE_NANOUPTIME
2397         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2398         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2399         our own approximation.
2400
2401 2005-11-10  Simon Josefsson  <jas@extundo.com>
2402
2403         * readline.c: Remove EOL.
2404
2405 2005-11-08  Eric Blake  <ebb9@byu.net>
2406
2407         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2408
2409 2005-11-08  Eric Blake  <ebb9@byu.net>
2410
2411         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2412
2413 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2414
2415         Fix porting problem reported by Theodoros V. Kalamatianos.
2416         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2417         Don't assume that futimes failing means we must fail.
2418
2419 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2420
2421         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2422         leave errno alone.  Problem reported by Dmitry V. Levin.
2423
2424 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2425
2426         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2427         errno alone.  Problem reported by Frederic Jolliton.
2428
2429 2005-10-28  Simon Josefsson  <jas@extundo.com>
2430
2431         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2432         "restrict" keywords, as per POSIX.  Protect the function
2433         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2434         Don't use K&R prototypes.  Check the sprintf return values.
2435         Re-define EAFNOSUPPORT if not present.  Indent.
2436
2437         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2438         suggested by Bruno Haible <bruno@clisp.org>.
2439
2440         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2441
2442         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2443
2444         * gc-libgcrypt.c: Add MD2 (which is not available through
2445         libgcrypt).
2446
2447         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2448
2449         * md2.h, md2.c: New files.
2450
2451 2005-10-24  Simon Josefsson  <jas@extundo.com>
2452
2453         * md4.h: Shrink buffer size, now that we changed the type.
2454
2455 2005-10-22  Simon Josefsson  <jas@extundo.com>
2456
2457         * arcfour.h, arcfour.c: Use fixed size indices in the
2458         arcfour_context struct (simplify test vector testing in GNU
2459         Shishi).
2460
2461 2005-10-22  Simon Josefsson  <jas@extundo.com>
2462
2463         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2464         suggested by Bruno Haible <bruno@clisp.org>.
2465
2466 2005-10-22  Simon Josefsson  <jas@extundo.com>
2467
2468         * crc.h: Include stddef.h, for size_t.
2469
2470 2005-10-21  Simon Josefsson  <jas@extundo.com>
2471
2472         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2473         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2474
2475 2005-10-21  Simon Josefsson  <jas@extundo.com>
2476
2477         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2478         block.
2479
2480 2005-10-21  Simon Josefsson  <jas@extundo.com>
2481
2482         * gc-gnulib.c: Support ARCTWO in CBC mode.
2483
2484 2005-10-21  Simon Josefsson  <jas@extundo.com>
2485
2486         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2487         <bruno@clisp.org>.
2488
2489         * hmac-sha1.c (hmac_sha1): Likewise.
2490
2491         * crc.c (crc32_update): Actually use crc parameter, suggested by
2492         Bruno Haible <bruno@clisp.org>.
2493
2494         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2495         <bruno@clisp.org>.
2496
2497 2005-10-21  Simon Josefsson  <jas@extundo.com>
2498
2499         * des.h, des.c: New files.
2500
2501         * gc-gnulib.c: Support DES.c
2502
2503 2005-10-21  Simon Josefsson  <jas@extundo.com>
2504
2505         * arctwo.h, arctwo.c: New files.
2506
2507         * gc-gnulib.c: Support ARCTWO.
2508
2509 2005-10-21  Simon Josefsson  <jas@extundo.com>
2510
2511         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2512
2513 2005-10-19  Simon Josefsson  <jas@extundo.com>
2514
2515         * gc-gnulib.c: Support ARCFOUR.
2516
2517 2005-10-19  Simon Josefsson  <jas@extundo.com>
2518
2519         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2520         support.
2521
2522         * gc.h: Add ECB enum type.
2523
2524         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2525
2526 2005-10-19  Simon Josefsson  <jas@extundo.com>
2527
2528         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2529
2530 2005-10-18  Simon Josefsson  <jas@extundo.com>
2531
2532         * md4.h, md4.c: New files, based on md5.?.
2533
2534 2005-10-17  Simon Josefsson  <jas@extundo.com>
2535
2536         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2537
2538         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2539
2540 2005-10-17  Simon Josefsson  <jas@extundo.com>
2541
2542         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2543
2544 2005-10-17  Simon Josefsson  <jas@extundo.com>
2545
2546         * gc.h, gc-libgcrypt.c: Add ciphers.
2547
2548 2005-10-17  Simon Josefsson  <jas@extundo.com>
2549
2550         * sha1.c: Use uint32_t instead of md5_uint32.t
2551
2552         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2553         md5.h.
2554
2555         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2556
2557         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2558
2559 2005-10-15  Simon Josefsson  <jas@extundo.com>
2560
2561         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2562
2563         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2564
2565 2005-10-14  Simon Josefsson  <jas@extundo.com>
2566
2567         * arcfour.h, arcfour.c: New files.
2568
2569 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2570
2571         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2572         include <wchar.h>; no longer needed.
2573
2574 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2575         and  Ulrich Drepper  <drepper@redhat.com>
2576
2577         Import from libc.
2578         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2579         instead of inline stream orientation test and two separate
2580         function calls.  Pay no attention to USE_IN_LIBIO.
2581
2582 2005-10-14  Roland McGrath  <roland@redhat.com>
2583
2584         Import from libc.  [BZ #1331]
2585         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2586         macro argument.
2587         Reported by Matej Vela <vela@debian.org>.
2588
2589 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2590
2591         * mkdir-p.c (make_dir_parents): Don't report an error if an
2592         intermediate directory is in a read-only file system.  Problem
2593         reported by Eric Blake.
2594
2595 2005-10-13  Simon Josefsson  <jas@extundo.com>
2596
2597         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2598         Move memory allocation outside of loop.
2599
2600 2005-10-12  Simon Josefsson  <jas@extundo.com>
2601
2602         * gc-pbkdf2-sha1.c: New file.
2603
2604         * gc.h: Add gc_pbkdf2_sha1 prototype.
2605
2606 2005-10-12  Simon Josefsson  <jas@extundo.com>
2607
2608         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2609         suggested by Bruno Haible <bruno@clisp.org>.
2610
2611 2005-10-12  Simon Josefsson  <jas@extundo.com>
2612
2613         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2614
2615         * gc-gnulib.c (gc_hmac_sha1): New function.
2616
2617 2005-10-12  Simon Josefsson  <jas@extundo.com>
2618
2619         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2620
2621 2005-10-12  Simon Josefsson  <jas@extundo.com>
2622
2623         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2624         GC_USE_HMAC_MD5, respectively.
2625
2626         * gc-libgcrypt.c (gc_md5): Fix assert call.
2627         (gc_md5): Fix typo.
2628
2629         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2630
2631         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2632
2633         * gc-gnulib.c (gc_hash_buffer): Ditto.
2634
2635 2005-10-11  Bruno Haible  <bruno@clisp.org>
2636
2637         * c-strcasestr.h: New file, from GNU gettext.
2638         * c-strcasestr.c: New file, from GNU gettext.
2639
2640 2005-10-11  Bruno Haible  <bruno@clisp.org>
2641
2642         * c-strcase.h: New file, from GNU gettext.
2643         * c-strcasecmp.c: New file, from GNU gettext.
2644         * c-strncasecmp.c: New file, from GNU gettext.
2645
2646 2005-10-11  Simon Josefsson  <jas@extundo.com>
2647
2648         * crc.h, crc.c: New files.
2649
2650         * gc.h (gc_hash_buffer): Add doc.
2651
2652 2005-10-08  Simon Josefsson  <jas@extundo.com>
2653
2654         * gc.h: Add gc_hash and gc_hash_buffer.
2655
2656         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2657
2658         * gc-libgcrypt.c (gc_hash_buffer): Add.
2659
2660 2005-10-11  Bruno Haible  <bruno@clisp.org>
2661
2662         * strcasecmp.c: Include limits.h.
2663         (strcasecmp): Avoid integer overflow on exotic platforms.
2664         * strncasecmp.c: Include limits.h.
2665         (strncasecmp): Avoid integer overflow on exotic platforms.
2666         Reported by Paul Eggert.
2667
2668 2005-10-06  Simon Josefsson  <jas@extundo.com>
2669
2670         * hmac-md5.c: New file.
2671
2672         * hmac.h: New file.
2673
2674 2005-10-06  Simon Josefsson  <jas@extundo.com>
2675
2676         * memxor.c (memxor): Avoid casts and warnings.
2677
2678 2005-10-05  Derek Price  <derek@ximbiot.com>
2679
2680         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2681
2682 2005-10-05  Simon Josefsson  <jas@extundo.com>
2683
2684         * memxor.c (memxor): Fix compiler error.
2685
2686         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2687         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2688
2689         * memxor.h, memxor.c: New files.
2690
2691         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2692         we assume all systems have it, suggested by Jim Meyering
2693         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2694         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2695         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2696         same reasons.
2697
2698 2005-10-04  Bruno Haible  <bruno@clisp.org>
2699
2700         * verify.h (verify_true): Provide alternative definition for C++.
2701
2702 2005-10-04  Simon Josefsson  <jas@extundo.com>
2703
2704         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2705         D. Baushke" <mdb@gnu.org>.
2706
2707 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2708
2709         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2710         (SSIZE_MAX): New macro, if not already defined.
2711         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2712         than 2 GiB.
2713
2714 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2715
2716         * exclude.c: Include verify.h.
2717         (verify): Remove.  All callers changed to use verify.h's version.
2718         * strtoimax.c: Likewise.
2719         * utimecmp.c: Likewis.e
2720
2721         Sync from coreutils.
2722         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2723         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2724         * .cvsignore: Add fts.h, search.h, t-fpending.
2725         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2726         bother returning ENOSYS if settimeofday or stime fails; just let
2727         them return whatever errno they want to return.
2728         * utimens.c: Include unistd.h, for dup2.
2729         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2730         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2731
2732 2005-10-02  Jim Meyering  <jim@meyering.net>
2733
2734         Sync from coreutils.
2735         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2736         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2737         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2738         Remove AT_FDCWD test.
2739         Do not consume the fd unless successful.
2740         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2741         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2742         block, so that we don't even try to compile it if settimeofday is
2743         available.  This works around a compilation failure on OSF1 V5.1,
2744         due to stime requiring a `long int*' while tv_sec is `int'.
2745
2746 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2747
2748         * getdelim.c (getdelim): Remove unused variables.
2749
2750 2005-10-01  Simon Josefsson  <jas@extundo.com>
2751
2752         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2753         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2754         AI_* and EAI_* definitions.  Protect function declarations.
2755
2756 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2757
2758         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2759         so that the code works even with ancient cpp.  Portability problem
2760         with GCC 2.7.2.1 reported by Thomas M.Ott.
2761
2762 2005-09-27  Jim Meyering  <jim@meyering.net>
2763
2764         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2765
2766         * intprops.h (signed_type_or_expr__): Define.
2767         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2768         for unsigned types.
2769
2770 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2771
2772         * verify.h (verify_expr): Remove, replacing with:
2773         (verify_true): New macro that returns true instead of void.
2774         (verify_type__): Remove.
2775         (verify): Use verify_true rather than verify_type__.
2776
2777 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2778
2779         * utimens.c (ENOSYS): Define if not already defined.
2780         (futimens): Support having a null PATH if the file descriptor
2781         is nonnegative.
2782
2783         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2784         Remove.
2785         (__attribute): Define to empty unless GCC 3.1 or later.
2786         This works around a core dump on OpenBSD 3.4, which has GCC
2787         2.95.3, which dumps core when given __attribute__(()).  It also
2788         simplifies other tests, since we really don't want to bother with
2789         worrying about which ancient version of GCC supported what.
2790         Original problem reported by Yoann Vandoorselaere, with part of
2791         the fix suggested by Derek Price.
2792
2793 2005-09-24  Jim Meyering  <jim@meyering.net>
2794
2795         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2796         so we can once again use a positive bitfield width of 1 -- now we
2797         don't have to explain why we were using a bitfield width of 2.
2798
2799 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2800
2801         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2802         Problem reported by Eric Blake.
2803         (getaddrinfo): Initialize se so that it's not garbage.
2804         Redo internal storage allocation so that it doesn't make unportable
2805         assumptions about alignment.
2806         Fix a memory leak.
2807
2808         * utimens.c (futimens): Use futimesat if available.
2809         Prefer it to futimes since it doesn't have the futimes bug.
2810
2811         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2812         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2813         Instead, declare a function that returns a pointer to an array,
2814         and use verify_type__ to declare the size of the array.
2815         Problem and germ of a solution reported by Bruno Haible.
2816         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2817         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2818
2819 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2820
2821         Sync from coreutils.
2822
2823         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2824         stat-time.h.
2825         * argmatch.h: Include verify.h
2826         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2827         (ARGMATCH_ASSERT): Remove; unused.
2828         * canonicalize.c: Assume STDC_HEADERS.
2829         * exclude.c: Include "strcase.h".
2830         * regex_internal.h [!defined _LIBC]: Likewise.
2831         * getusershell.c: Include stdio--.h rather than stdio.h
2832         and stdio-safer.h.
2833         (getusershell): Call fopen, not fopen_safer.
2834         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2835         Do not include unistd-safer.h.
2836         (save_cwd): Don't call fd_safer; no longer needed
2837         now that we include fcntl--.h.
2838
2839         * getdate.y (relative_time): New type.
2840         (RELATIVE_TIME_0): New constant.
2841         (parser_control): Use relative_time instead of doing it ourselves.
2842         (%union): Add new relative_time rel member.
2843         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2844         Now typeless.
2845         (relunit, relunit_snumber): Now of type rel.
2846         (zone, rel, relunit, get_date): Adjust to above changes.
2847
2848         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2849         Do not include unistd-safer.h.
2850         (getloadavg): Don't call fd_safer; no longer needed
2851         now that we include fcntl--.h.
2852
2853         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2854         (make_dir_parents): Treat ENOSYS like EEXIST.
2855
2856         Improve quality of diagnostics on restore_cwd failure.
2857         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2858         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2859         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2860         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2861         each time through the loop.  Do not diagnose restore_cwd failure;
2862         that is the caller's job (and perhaps the caller does not care).
2863
2864         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2865         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2866         If the file already exists but is not a directory, don't bother
2867         to try to make its parents.
2868         Close potential file descriptor leak if we can't chdir("/") (!).
2869         Don't always return true if chdir($PWD) fails; return true only
2870         if the requested action was done successfully (except for the
2871         chdir($PWD)).
2872         Don't log final directory unless we actually made it.
2873         Refactor to avoid duplicate code to fix up permissions.
2874         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2875
2876         * strftime.c (my_strftime): Rewrite the previous change slightly,
2877         to make it a bit faster and (I hope) clearer.
2878         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2879         Fix bug in formats like %2N.
2880
2881         * verify.h: New file.
2882
2883 2005-09-22  Jim Meyering  <jim@meyering.net>
2884
2885         Sync from coreutils.
2886
2887         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2888
2889         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2890         the .tm_year member, since otherwise gcc-4.0 would now warn about
2891         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2892
2893         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2894         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2895
2896         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2897         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2898         when run in a time zone for which daylight savings time is in effect
2899         for the starting date.
2900
2901         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2902         stop us from restricting permissions of just-created absolute-named
2903         directories.
2904         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2905         to restore initial working directory.
2906         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2907         to tell caller if/when we change the working directory and are
2908         unable to return to the initial one.
2909         * mkdir-p.h (make_dir_parents): Update prototype.
2910         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2911         `return false'.  This fixes a bug introduced on 2004-07-30.
2912
2913         * openat.c (fdopendir): Be sure to close the supplied
2914         file descriptor before returning.  This makes our replacement
2915         implementation a little closer to Solaris's, where fdopendir
2916         ties the file descriptor to the returned DIR* pointer.
2917         * openat.c (unlinkat): New function.
2918         * openat.h (unlinkat): Add prototype.
2919         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2920         (openat_restore_fail): Rename from openat_restore_die.
2921         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2922
2923         Provide an alternative to exiting immediately upon save_cwd or
2924         restore_cwd failure.  Now, an application can arrange e.g.,
2925         to perform a longjump in that case.
2926         * openat.c: Include dirname.h.
2927         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2928         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2929         and openat_restore_die rather than calling error directly.
2930         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2931
2932         * openat-die.c (openat_save_die, openat_restore_die): New file.
2933         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2934
2935         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2936         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2937                             int utc, int nanoseconds);
2938         Background:
2939         date should not have to allocate a megabyte of virtual memory to
2940         handle a format argument like +%1048575T.  When implemented with
2941         strftime, it must allocate such a buffer, use strftime to fill it
2942         in, print it, then free it.
2943         With fprintftime, it simply prints everything and exits.
2944         With no need for memory allocation, that's one fewer way to fail.
2945         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2946         optional field width, not before, so we accept %9:z, not %:9z.
2947         (my_strftime): Be sure to use L_('x') for literals.
2948
2949         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2950         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2951         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2952         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2953         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2954         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2955         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2956         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2957         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2958
2959         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2960         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2961         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2962         and don't include <sys/file.h>).
2963
2964 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2965
2966         Sync from coreutils.
2967
2968         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2969         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2970         [!LDAV_DONE]: Avoid unused variable warning.
2971
2972 2005-09-21  Bruno Haible  <bruno@clisp.org>
2973
2974         * unicodeio.h (unicode_to_mb): New declaration.
2975
2976 2005-09-20  Derek Price  <derek@ximbiot.com>
2977
2978         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2979
2980 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2981
2982         Use a consistent style for including <config.h>.
2983         * __fpending.c, acl.c, argmatch.c,
2984         argp-help.c, argp-parse.c,
2985         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2986         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2987         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2988         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2989         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2990         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2991         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2992         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2993         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2994         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2995         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2996         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2997         modechange.c, mountlist.c, open-safer.c, physmem.c,
2998         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2999         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3000         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3001         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3002         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3003         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3004         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3005         userspec.c, utimecmp.c, version-etc-fsf.c,
3006         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3007         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3008         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3009         Standardize inclusion of config.h.
3010         * __fpending.h, dirfd.h, getdate.h, human.h,
3011         inttostr.h:  Removed inclusion of config.h from header files.
3012         * inttostr.c:  Adjusted in-tree users.
3013         * timespec.h: Remove superfluous warning to include config.h.
3014         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3015         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3016         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3017         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3018
3019 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3020
3021         * stat-time.h: New file.
3022         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3023         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
3024         in a different way.
3025         (timespec_cmp): New function.
3026         * utimecmp.c: Include stat-time.h.
3027         (SYSCALL_RESOLUTION): Depend on whether various struct stat
3028         members exist, not on the obsolescent ST_MTIM_NSEC.
3029         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3030
3031 2005-09-15  Derek Price  <derek@ximbiot.com>
3032             Paul Eggert  <eggert@cs.ucla.edu>
3033
3034         * regcomp.c, regexec.c, regex_internal.c: Back out previous
3035         changes, consolidating in...
3036         * regex_internal.h: ...this file.
3037
3038 2005-09-15  Derek Price  <derek@ximbiot.com>
3039
3040         * regex_internal.h: Blank `pure' for GNUC < 3.
3041         * regex_internal.c: Ditto, using this...
3042         (__GNUC_PREREQ): ...new macro.
3043         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3044         (__GNUC_PREREQ): ...this new macro.
3045
3046         * strstr.h: Include string.h. Define strstr as a macro here.
3047
3048 2005-09-13  Derek Price  <derek@ximbiot.com>
3049
3050         * canon-host.c (canon_host_r): Set *cherror on memory allocation
3051         failure.
3052         Reported by Jim Meyering  <jim@meyering.net>.
3053
3054 2005-09-13  Jim Meyering  <jim@meyering.net>
3055
3056         * canon-host.c: Filter through gnu indent and reword comments slightly.
3057         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3058
3059 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
3060
3061         * base64.c: Typo.
3062         (base64_encode): Put b64str in initialized data section.
3063
3064 2005-09-12  Derek Price  <derek@ximbiot.com>
3065
3066         Return usable errors from canon-host.
3067         * canon-host.h: New file.
3068         * canon-host.c (canon_host): Wrap...
3069         (canon_host_r): ...this new function, which now relies exclusively on
3070         getaddrinfo.
3071         (ch_strerror): New function.
3072         (last_cherror): New global.
3073         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3074         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
3075         void *.
3076         (freeaddrinfo): Free ai->ai_canonname when set.
3077
3078 2005-09-12  Derek Price  <derek@ximbiot.com>
3079             Paul Eggert  <eggert@cs.ucla.edu>
3080
3081         * glob-libc.h: Renamed from glob_.h.  The new version is
3082         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3083         protecting things that should be done only in gnulib contexts.
3084         * glob_.h: New file, containing only the glob things needed for
3085         gnulib.
3086         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
3087         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3088         (glob, globfree, glob_pattern_p): Now defined simply in terms of
3089         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3090         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3091         and to respect the namespace rules better.
3092
3093 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3094
3095         Merge glibc and coreutils changes into gnulib, plus a few
3096         extra fixes.
3097         * md5.c: Use #error rather than a string.
3098         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
3099         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3100         (__attribute__): Define to empty for non recent-GCC.
3101         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3102         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3103         Renamed from their non-__ counterparts, with new macros replacing
3104         them if not _LIBC.  Add __THROW attribute.
3105         (rol): Remove.
3106         (struct md5_ctx): Align buffer if using GCC.
3107         * sha1.h (struct sha1_ctx): Likewise.
3108         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
3109         The old name was backwards.
3110         (NOTSWAP): Remove; not used.
3111         (rol): New macro, moved here from md5.h.
3112         (sha1_process_block): Remove a FIXME that doesn't make sense.
3113
3114 2005-09-12  Derek Price  <derek@ximbiot.com>
3115
3116         * gai_strerror.c: Include config.h when available.  Include
3117         getaddrinfo.h before other headers to test interface.
3118         Reported by Larry Jones <lawrence.jones@ugs.com>.
3119
3120 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3121
3122         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3123         definitions, since that's the preferred style in glibc.
3124         Fix a minor spacing issue, and update copyright notice to match glibc's.
3125
3126 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3127
3128         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3129
3130 2005-09-06  Simon Josefsson  <jas@extundo.com>
3131
3132         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3133         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3134
3135 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3136
3137         Change bitset word type from unsigned int to unsigned long int,
3138         as this has better performance on typical 64-bit hosts.
3139         Port bitset code to hosts with unusual word sizes.
3140         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3141         (build_collating_symbol):
3142         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3143         argument is a bitset.  This is merely a style issue, but it makes
3144         it clearer that an entire array is expected.
3145         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3146         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3147         Port to the case where bitset_word is not the same as unsigned int.
3148         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3149         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3150         Likewise.
3151         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3152         (build_trtable, group_nodes_into_DFAstates):
3153         Likewise.
3154         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3155         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3156         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3157         * regexec.c (group_nodes_into_DFAstates): Likewise.
3158         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3159         * regcomp.c (optimize_subexps, lower_subexp):
3160         Work even if bitset_word has holes in its bitwise representation.
3161         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3162         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3163         Likewise.
3164         * regex_internal.c (re_string_reconstruct):
3165         Don't assume UCHAR_MAX == 255.
3166         * regex_internal.h (bitset_set_all): Likewise.
3167         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3168         All uses changed.
3169         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3170         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3171         All uses changed.
3172         (BITSET_WORD_MAX): New macro.
3173         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3174         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3175         (bitset_empty, bitset_copy):
3176         Prefer sizeof (bitset) to multiplying it out ourselves.
3177         (bitset_not_merge): Remove; unused.
3178         (bitset_contain): Return bool, not unsigned int with one bit on.
3179         All callers changed.
3180         * regexec.c (build_trtable): Don't assume bitset has no stricter
3181         alignment than re_node_set; do this by defining a new internal
3182         type struct dests_alloc and using it to allocate memory.
3183
3184 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3185
3186         Check for arithmetic overflow when calculating sizes, to prevent
3187         some buffer-overflow issues.  These patches are conservative, in the
3188         sense that when I couldn't determine whether an overflow was possible,
3189         I inserted a run-time check.
3190         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3191         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3192         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3193         (re_xnrealloc, re_x2nrealloc): New inline functions.
3194         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3195         (build_equiv_class, build_charclass): Check for arithmetic overflow
3196         in size expression calculations.
3197         * regex_internal.c (re_string_realloc_buffers):
3198         (build_wcs_upper_buffer, re_node_set_add_intersect):
3199         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3200         (re_dfa_add_node, register_state): Likewise.
3201         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3202         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3203         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3204         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3205
3206 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3207
3208         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3209         to avoid a collision with bits/local_lim.h in glibc.
3210         All uses changed.  Problem reported by Dmitry V. Levin in
3211         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3212
3213         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3214         bugs in int versus size_t comparisons.
3215         (re_string_context_at): Fix bug where the code assumed that
3216         Idx is signed.
3217
3218         Use bool where appropriate.
3219         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3220         All callers changed.
3221         (calc_eclosure_iter): Likewise, for ROOT arg.
3222         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3223         (build_charclass_op): Likewise, for NON_MATCH arg.
3224         * regex_internal.c (re_string_allocate, re_string_construct):
3225         (re_string_construct_common): Likewise, for ICASE arg.
3226         * regexec.c (re_search_2_stub, re_search_stub):
3227         Likewise, for RET_LEN arg.
3228         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3229         (set_regs): Likewise, for FL_BACKTRACK arg.
3230         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3231         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3232         (calc_eclosure_iter, parse_bracket_exp):
3233         Use bool for internal variables that are booleans.
3234         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3235         (set_regs, build_sifted_states, sift_states_bkref):
3236         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3237         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3238         (find_collation_sequence_value):
3239         Likewise.
3240         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3241         (re_node_set_compare):
3242         Return bool, not int. All callers changed.
3243         * regexec.c (check_halt_node_context, check_dst_limits):
3244         (build_trtable, check_node_accept): Likewise.
3245         * regex_internal.h: Include stdbool.h.
3246
3247         Fix bugs uncovered when converting to bool.
3248         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3249         failure instead of charging ahead blindly.
3250         * regex_internal.c (register_state): Likewise.
3251         * regexec.c (re_search_2_stub): Use simpler method than boolean
3252         for freeing internal storage.
3253         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3254         bitset pieces used as boolean, to avoid undefined behavior
3255         on hosts that do int overflow checking.
3256
3257 2005-08-31  Derek Price  <derek@ximbiot.com>
3258
3259         * getdelim.c (getdelim): Return EOF on EOF.
3260         Reported by Larry Jones <lawrence.jones@ugs.com>.
3261
3262 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3263
3264         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3265         lengths fit in regoff_t; this isn't true if regoff_t is the same
3266         width as size_t.
3267         * regex.c (re_search_internal): 5th arg is LAST_START
3268         (= START + RANGE) instead of RANGE.  This avoids overflow
3269         problems when regoff_t is the same width as size_t.
3270         All callers changed.
3271         (re_search_2_stub): Check for overflow when adding the
3272         sizes of the two strings.
3273         (re_search_stub): Check for overflow when adding START
3274         to RANGE; if it occurs, substitute the extreme value.
3275
3276 2005-08-31  Jim Meyering  <jim@meyering.net>
3277
3278         * regcomp.c (search_duplicated_node): Make first pointer arg
3279         a pointer-to-const.
3280         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3281         (register_state): Likewise.
3282         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3283         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3284         (group_nodes_into_DFAstates): Likewise.
3285
3286 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3287
3288         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3289         old glibc regex code mishandles strings longer than 2**31 bytes.
3290         This patch fixes this when the regex code is used in gnulib
3291         (i.e., outside glibc).
3292
3293         This patch should not affect the use of the regex code inside
3294         glibc.  No doubt this problem also needs to be handled for glibc
3295         as well, but the result will be an incompatible change to the
3296         glibc ABI, and the old ABI will have to be supported too.  That
3297         can be the the subject for another patch.
3298
3299         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3300         governing whether the rest of this patch is active.  By default,
3301         the macro is disabled and the patch has no effect.
3302         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3303         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3304         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3305         (re_match_2, re_set_registers): Use the new types.
3306         * regex_internal.h (Idx, re_hashval_t): New types.
3307         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3308         New macros.
3309         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3310         (re_string_context_at, bin_tree_t, re_dfastate_t):
3311         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3312         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3313         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3314         (re_string_char_size_at, re_string_wchar_at):
3315         (re_string_elem_size_at):
3316         Use the new types and macros to port to 64-bit hosts.
3317         Use unsigned types for internal values, so that the code
3318         mostly works even for arrays larger than SSIZE_MAX.
3319         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3320         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3321         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3322         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3323         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3324         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3325         (calc_inveclosure, parse_dup_op, build_range_exp):
3326         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3327         (fetch_number, create_token_tree, mark_opt_subexp):
3328         Likewise.
3329         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3330         (create_cd_newstate, re_string_allocate, re_string_construct):
3331         (re_string_realloc_buffers, build_wcs_upper_buffer):
3332         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3333         (re_string_reconstruct, re_string_peek_byte_case):
3334         (re_string_fetch_byte_case, re_string_context_at):
3335         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3336         (re_node_set_init_copy, re_node_set_add_intersect):
3337         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3338         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3339         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3340         (re_acquire_state, re_acquire_state_context, register_state):
3341         Likewise.
3342         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3343         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3344         (re_search_internal, re_search_2_stub, re_search_stub)
3345         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3346         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3347         (update_cur_sifted_state, check_dst_limits):
3348         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3349         (check_subexp_limits, sift_states_bkref, merge_state_array):
3350         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3351         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3352         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3353         (expand_bkref_cache, check_node_accept_bytes):
3354         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3355         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3356         (acquire_init_state_context, check_halt_node_context):
3357         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3358         (sift_states_backward, clean_state_log_if_needed):
3359         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3360         (find_recover_state, transit_state_sb, transit_state_mb):
3361         (transit_state_bkref, build_trtable, match_ctx_clean):
3362         Likewise.
3363         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3364         to work around an assumption that REG_MISSING is negative.
3365
3366         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3367         (seek_collating_symbol_entry) [defined _LIBC]:
3368         (lookup_collation_sequence_value) [defined _LIBC]:
3369         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3370         Use prototypes rather than old-style function definitions.
3371         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3372         (transit_state_sb) [0]:
3373         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3374
3375         * regexec.c (re_search_internal): Simplify update of rm_so and
3376         rm_eo.
3377
3378         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3379         (optimize_subexps, lower_subexp):
3380         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3381         since the signed shift might overflow.  Use 1u<<31 instead.
3382         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3383         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3384         Likewise.
3385
3386         * regcomp.c (optimize_subexps, lower_subexp):
3387         Use CHAR_BIT rather than 8, for clarity.
3388         * regexec.c (check_dst_limits_calc_pos_1):
3389         (check_subexp_matching_top): Likewise.
3390         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3391         have to worry about portability issues when shifting it left.
3392         Remove no-longer-needed test for table_size > 0.
3393         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3394         in a word, as the resulting behavior is undefined.
3395         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3396         in one case, a <= should have been an <, and in another case the
3397         whole test was missing.
3398         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3399         the standard name CHAR_BIT.
3400         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3401         this is not true on one's complement and signed-magnitude hosts.
3402
3403         * regex_internal.h (re_sub_match_top_t): Remove unused member
3404         next_last_offset.
3405         (struct re_dfa_t): Remove unused member states_alloc.
3406         * regcomp.c (init_dfa): Don't initialize unused members.
3407
3408 2005-08-31  Bruno Haible  <bruno@clisp.org>
3409
3410         * strstr.c: Include <stddef.h>, for NULL.
3411         * strcasestr.c: Likewise.
3412         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3413
3414 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3415
3416         * iconvme.h: Add prototype for iconv_alloc.
3417
3418 2005-08-29  Simon Josefsson  <jas@extundo.com>
3419
3420         * iconvme.c: Fix errno.
3421
3422 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3423
3424         * iconvme.c: Split iconv_string into iconv_alloc.
3425
3426 2005-08-27  Jim Meyering  <jim@meyering.net>
3427
3428         * fopen-safer.c: Merge minor changes from coreutils.
3429         * dup-safer.c: Likewise.
3430         * fd-safer.c: Likewise.
3431
3432         Merge from coreutils.
3433         * stdio--.h: New file.
3434         * stdlib--.h: New file.
3435         * mkstemp-safer.c: New file.
3436
3437         GNU tar needs these.
3438         * pipe-safer.c: New file.
3439         * creat-safer.c: New file.
3440         * fcntl--.h (creat): Define to creat_safer.
3441         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3442         * unistd--.h (pipe): Define to pipe_safer.
3443         * unistd-safer.h: Declare pipe_safer.
3444
3445 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3446
3447         * regex_internal.h: Remove all references to
3448         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3449         or better.
3450         (bitset_not, bitset_merge, bitset_not_merge):
3451         (bitset_mask, re_string_allocate, re_string_construct):
3452         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3453         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3454         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3455         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3456         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3457         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3458         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3459         (re_acquire_state_context):
3460         Remove unnecessary forward decls.
3461         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3462         Put __attribute at function definition,
3463         now that the function decl has been removed.
3464         * regex_internal.c (re_string_peek_byte_case):
3465         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3466         Likewise.
3467
3468 2005-08-26  Simon Josefsson  <jas@extundo.com>
3469
3470         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3471         Haible <bruno@clisp.org>.
3472
3473 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3474
3475         * regexec.c (set_regs): Don't alloca with an unbounded size.
3476
3477         alloca modernization/simplification for regex.
3478         * regex.c: Remove portability cruft for alloca.  This no longer
3479         needs to be at the start of the file, and can be moved into
3480         regex_internal.h and simplified.
3481         * regex_internal.h: Include <alloca.h>.
3482         (__libc_use_alloca) [!defined _LIBC]: New macro.
3483         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3484         now works outside glibc.
3485
3486 2005-08-24  Simon Josefsson  <jas@extundo.com>
3487
3488         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3489         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3490         GLIBC specific code.
3491
3492 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3493
3494         Make regex safe for g++.  This fixes one real bug (an "err"
3495         that should have been "*err").  g++ problem reported by
3496         Sam Steingold.
3497         * regex_internal.h (re_calloc): New macro, consistent with
3498         re_malloc etc.  All callers of calloc changed to use re_calloc.
3499         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3500         not int.  All callers changed.
3501         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3502         just use an array of size MB_LEN_MAX.
3503         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3504         (find_recover_state): Change "err" to "*err"; this fixes what
3505         appears to be a real bug.
3506         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3507         versus int.
3508
3509 2005-08-25  Jim Meyering  <jim@meyering.net>
3510
3511         * open-safer.c: Include <config.h>.
3512         Otherwise, we'd lose LARGEFILE support in any file using
3513         e.g. "fcntl--.h"
3514
3515 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3516
3517         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3518         * regex.h (regerror): Likewise.
3519
3520         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3521         requires this.  (The code never needed it.)
3522
3523         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3524         All uses of recently-renamed identifiers changed to use the new,
3525         POSIX-compliant names.  The code will build and run just fine
3526         without these changes, but it's better to eat our own dog food
3527         and use the standard-conforming names.
3528
3529         * regex.h: Fix a multitude of POSIX name space violations.
3530         These changes have an effect only for programs that define
3531         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3532         do not change anything for programs compiled in the normal way.
3533         Also, there is no effect on the ABI.
3534
3535         (_REGEX_SOURCE): New macro.
3536         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3537         defined and _GNU_SOURCE is not; this fixes a name space violation.
3538
3539         Rename the following macros to obey POSIX requirements.
3540         The old names are still visible as macros if _REGEX_SOURCE is defined.
3541         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3542         RE_BACKSLASH_ESCAPE_IN_LISTS.
3543         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3544         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3545         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3546         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3547         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3548         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3549         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3550         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3551         (REG_INTERVALS): renamed from RE_INTERVALS.
3552         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3553         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3554         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3555         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3556         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3557         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3558         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3559         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3560         RE_UNMATCHED_RIGHT_PAREN_ORD.
3561         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3562         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3563         (REG_DEBUG): renamed from RE_DEBUG.
3564         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3565         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3566         unusual, since we can't clash with the POSIX REG_ICASE.
3567         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3568         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3569         (REG_NO_SUB): renamed from RE_NO_SUB.
3570         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3571         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3572         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3573         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3574         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3575         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3576         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3577         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3578         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3579         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3580         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3581         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3582         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3583         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3584         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3585         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3586         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3587         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3588         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3589         (REG_FIXED): Renamed from REGS_FIXED.
3590         (REG_NREGS): Renamed from RE_NREGS.
3591
3592         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3593         of other REG_* macros, since POSIX says the user is allowed to
3594         #undef these macros selectively.
3595
3596         (reg_errcode_t): Update comment stating what other tables need
3597         to be consistent.
3598
3599         Rename the following enum values to obey POSIX requirements.
3600         The old names are still visible as macros.
3601         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3602         is not defined, since GNU is supposed to be a superset of POSIX as
3603         much as possible, and since we want reg_errcode_t to be a signed
3604         type for implementation consistency.
3605         (_REG_NOERROR): Renamed from REG_NOERROR.
3606         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3607         (_REG_BADPAT): Renamed from REG_BADPAT.
3608         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3609         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3610         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3611         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3612         (_REG_EBRACK): Renamed from REG_EBRACK.
3613         (_REG_EPAREN): Renamed from REG_EPAREN.
3614         (_REG_EBRACE): Renamed from REG_EBRACE.
3615         (_REG_BADBR): Renamed from REG_BADBR.
3616         (_REG_ERANGE): Renamed from REG_ERANGE.
3617         (_REG_ESPACE): Renamed from REG_ESPACE.
3618         (_REG_BADRPT): Renamed from REG_BADRPT.
3619         (_REG_EEND): Renamed from REG_EEND.
3620         (_REG_ESIZE): Renamed from REG_ESIZE.
3621         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3622         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3623         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3624         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3625         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3626
3627         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3628         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3629         changed.  But support the old name if the new one is not defined
3630         and if _REGEX_SOURCE.
3631
3632         Change the following member names in struct re_pattern_buffer.
3633         The old names are still supported if !_REGEX_SOURCE.
3634         The new names are always supported, regardless of _REGEX_SOURCE.
3635         (re_buffer): Renamed from buffer.
3636         (re_allocated): Renamed from allocated.
3637         (re_used): Renamed from used.
3638         (re_syntax): Renamed from syntax.
3639         (re_fastmap): Renamed from fastmap.
3640         (re_translate): Renamed from translate.
3641         (re_can_be_null): Renamed from can_be_null.
3642         (re_regs_allocated): Renamed from regs_allocated.
3643         (re_fastmap_accurate): Renamed from fastmap_accurate.
3644         (re_no_sub): Renamed from no_sub.
3645         (re_not_bol): Renamed from not_bol.
3646         (re_not_eol): Renamed from not_eol.
3647         (re_newline_anchor): Renamed from newline_anchor.
3648
3649         Change the following member names in struct re_registers.
3650         The old names are still supported if !_REGEX_SOURCE.
3651         The new names are always supported, regardless of _REGEX_SOURCE.
3652         (rm_num_regs): Renamed from num_regs.
3653         (rm_start): Renamed from start.
3654         (rm_end): Renamed from end.
3655
3656         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3657         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3658         Prepend __ to parameter names.
3659
3660         Undo yesterday's changes.
3661
3662 2005-08-24  Jim Meyering  <jim@meyering.net>
3663
3664         Sync from coreutils.
3665         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3666
3667 2005-08-21  Bruno Haible  <bruno@clisp.org>
3668
3669         * lock.h: Add multiple inclusion guard.
3670         * tls.h: Add multiple inclusion guard.
3671
3672 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3673
3674         * regex.h (REG_NOSYS)
3675         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3676         Define, since POSIX requires it as of 2001.
3677         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3678         New private symbol, used to keep the enum signed in all cases.
3679         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3680         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3681
3682         * regex_internal.c (re_string_skip_chars, register_state):
3683         (calc_state_hash):
3684         Remove forward decls; no longer needed now that we use prototypes.
3685         * regexec.c (acquire_init_state_context, check_halt_node_context):
3686         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3687         (clean_state_log_if_needed): Likewise.
3688
3689 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3690
3691         Fix problems reported by Sam Steingold in
3692         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3693         * regexec.c (sift_states_bkref): Fix portability bug: the code
3694         assumed that reg_errcode_t is a signed type, which is not
3695         necessarily true if _XOPEN_SOURCE is not defined.
3696         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3697         some compilers warn about it otherwise.
3698
3699 2005-08-20  Jim Meyering  <jim@meyering.net>
3700
3701         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3702         of unused local, dfa.
3703
3704 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3705
3706         * regcomp.c (create_initial_state): Remove duplicate decl.
3707         (init_word_char, create_initial_state, duplicate_node_closure):
3708         (fetch_token, peek_token_bracket, build_range_exp):
3709         (build_collating_symbol): Remove forward decls; no longer needed
3710         now that we use prototypes.
3711
3712         * regcomp.c:
3713         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3714         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3715         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3716         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3717         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3718         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3719         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3720         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3721         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3722         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3723         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3724         (build_charclass, build_charclass_op, fetch_number, create_tree):
3725         (create_token_tree, mark_opt_subexp, duplicate_tree):
3726         Use prototypes rather than old-style definitions.
3727
3728         * regex_internal.c:
3729         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3730         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3731         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3732         (re_string_reconstruct, re_string_peek_byte_case):
3733         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3734         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3735         (re_node_set_init_copy, re_node_set_add_intersect):
3736         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3737         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3738         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3739         (re_acquire_state, re_acquire_state_context, register_state):
3740         (create_ci_newstate, create_cd_newstate, free_state):
3741         Likewise.
3742         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3743         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3744         (re_search_internal, prune_impossible_nodes):
3745         (acquire_init_state_context, check_matching, static):
3746         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3747         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3748         (update_regs, sift_states_backward, build_sifted_states):
3749         (clean_state_log_if_needed, merge_state_array):
3750         (update_cur_sifted_state, add_epsilon_src_nodes):
3751         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3752         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3753         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3754         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3755         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3756         (check_arrival, check_arrival_add_next_nodes):
3757         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3758         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3759         (check_node_accept_bytes, check_node_accept, extend_buffers):
3760         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3761         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3762         (sift_ctx_init):
3763         Likewise.
3764
3765         * regex_internal.h:
3766         (re_string_allocate, re_string_construct, re_string_reconstruct):
3767         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3768         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3769         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3770         (re_string_context_at, re_string_peek_byte_case):
3771         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3772         is defined, since we now use prototypes always.
3773
3774         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3775         C89 or better.  All uses removed.
3776
3777 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3778
3779         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3780         [defined lint]: Suppress bogus uninitialized-variable warnings.
3781
3782         * regcomp.c (duplicate_node): Return new index, not an error code,
3783         and let the caller return REG_ESPACE if out of space.  This
3784         removes an uninitialied-variable warning with GCC 4.0.1, and also
3785         avoids taking the address of a local variable.  All callers
3786         changed.
3787
3788 2005-08-19  Jim Meyering  <jim@meyering.net>
3789
3790         * regexec.c (proceed_next_node): Redo local variables to
3791         avoid GCC shadowing warnings.
3792
3793 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3794
3795         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3796         (re_node_set_insert_last, re_dfa_add_node):
3797         Rename local variables to avoid GCC shadowing warnings.
3798
3799 2005-08-18  Bruno Haible  <bruno@clisp.org>
3800
3801         * strstr.c (strstr): Fix return value in multibyte case.
3802         * strcasestr.c (strcasestr): Likewise.
3803
3804 2005-08-17  Jim Meyering  <jim@meyering.net>
3805
3806         Make the %s format (seconds since the epoch) work for a negative
3807         number and when used with a zero-padded field width, e.g. %015s.
3808
3809         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3810         label so that it precedes the code to set `digits'.  Otherwise,
3811         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3812         print `00-22'.  Now, it prints `-0022', as it should.
3813
3814 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3815
3816         * regex.h: Remove useless space-before-tab.  From coreutils.
3817
3818 2005-08-17  Bruno Haible  <bruno@clisp.org>
3819
3820         * strcasestr.h: New file.
3821         * strcasestr.c: New file.
3822
3823 2005-08-17  Bruno Haible  <bruno@clisp.org>
3824
3825         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3826         * strstr.c: Completely rewritten, with multibyte locale support.
3827
3828 2005-08-17  Bruno Haible  <bruno@clisp.org>
3829
3830         * strcasecmp.c: Use mbuiter.h.
3831
3832 2005-08-17  Bruno Haible  <bruno@clisp.org>
3833
3834         * mbuiter.h: New file.
3835
3836 2005-08-16  Bruno Haible  <bruno@clisp.org>
3837
3838         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3839         (mbi_init): Update.
3840         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3841         NUL byte, not after it.
3842
3843 2005-08-16  Bruno Haible  <bruno@clisp.org>
3844
3845         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3846         the valid ones. Makes the comparison operations transitive:
3847         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3848         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3849
3850 2005-08-16  Bruno Haible  <bruno@clisp.org>
3851
3852         * strcase.h (strcasecmp): Add note in comments.
3853         * strncasecmp.c: Use code from strcasecmp.c.
3854         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3855         (strcasecmp): Work correctly in multibyte locales.
3856
3857 2005-08-16  Bruno Haible  <bruno@clisp.org>
3858
3859         * strnlen1.h: New file.
3860         * strnlen1.c: New file.
3861
3862 2005-08-16  Bruno Haible  <bruno@clisp.org>
3863
3864         * mbfile.h: New file.
3865
3866 2005-08-16  Bruno Haible  <bruno@clisp.org>
3867
3868         * mbiter.h: New file.
3869
3870 2005-08-16  Bruno Haible  <bruno@clisp.org>
3871
3872         * mbchar.h: New file.
3873         * mbchar.c: New file.
3874
3875 2005-08-16  Bruno Haible  <bruno@clisp.org>
3876
3877         * tls.h: New file, from GNU gettext.
3878         * tls.c: New file, from GNU gettext.
3879
3880 2005-08-15  Bruno Haible  <bruno@clisp.org>
3881
3882         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3883         is defined.
3884
3885 2005-08-14  Jim Meyering  <jim@meyering.net>
3886
3887         Sync from coreutils.
3888
3889         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3890         Use the hash-table-based cycle-detection code not just when
3891         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3892         Reported by James Youngman in
3893         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3894         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3895         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3896         This lets us compile with -DFTS_DEBUG, once again.
3897         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3898         * fts.c (fd_safer): Remove decl.
3899         Include fcntl--.h rather than unistd-safer.h
3900         (fts_safe_changedir): Don't call fd_safer; no longer needed
3901         now that we include fcntl--.h.
3902
3903 2005-08-11  Simon Josefsson  <jas@extundo.com>
3904
3905         * readline.h, readline.c: New file.
3906
3907 2005-08-11  Bruno Haible  <bruno@clisp.org>
3908
3909         * strnlen.h (strnlen): Change parameter name to match comment.
3910
3911 2005-08-10  Simon Josefsson  <jas@extundo.com>
3912
3913         * strndup.c: Use strnlen.h.
3914
3915         * strnlen.h: New file.
3916
3917 2005-08-02  Simon Josefsson  <jas@extundo.com>
3918
3919         * getline.h, getline.c: Rewrite.
3920
3921         * getdelim.h, getdelim.c: New files, ported from glibc.
3922
3923 2005-07-31  Bruno Haible  <bruno@clisp.org>
3924
3925         * lock.h (gl_lock_initializer): New macro.
3926         (gl_lock_define_initialized): Use it.
3927         (gl_rwlock_initializer): New macro.
3928         (gl_rwlock_define_initialized): Use it.
3929         (gl_recursive_lock_initializer): New macro.
3930         (gl_recursive_lock_define_initialized): Use it.
3931
3932 2005-07-26  Bruno Haible  <bruno@clisp.org>
3933
3934         * lock.h: Update from GNU gettext.
3935         * lock.c: Update from GNU gettext.
3936
3937 2005-07-18  Bruno Haible  <bruno@clisp.org>
3938
3939         * lock.h (gl_once_t): New type.
3940         (gl_once_define, gl_once): New macros.
3941         * lock.c (fresh_once): New variable.
3942         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3943         functions.
3944
3945 2005-07-18  Simon Josefsson  <jas@extundo.com>
3946
3947         * check-version.c (check_version): Accept identical versions too.
3948
3949 2005-07-18  Bruno Haible  <bruno@clisp.org>
3950
3951         * lock.h: New file, from GNU gettext.
3952         * lock.c: New file, from GNU gettext.
3953
3954 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3955
3956         * quotearg.c: Add translator comment suggested by Bruno Haible,
3957         with a minor change.
3958
3959 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3960
3961         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3962         copyright symbol and the year.
3963         * version-etc.c (COPYRIGHT_YEAR): New constant.
3964         (version_etc_va): Use parameterized copyright notice.
3965         Reword to conform to the current GNU coding standards.
3966
3967 2005-07-11  Simon Josefsson  <jas@extundo.com>
3968
3969         * size_max.h: New file.
3970
3971 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3972
3973         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3974         block of defines.
3975
3976 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3977        and  Paul Eggert  <eggert@cs.ucla.edu>
3978
3979         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3980         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3981
3982 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3983
3984         * regex.c, regex.h: Sync from libc.
3985         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3986         New files, synced from libc, except that regex_internal.h
3987         currently has a small porting fix.
3988
3989 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3990
3991         Remove the dependency of the strftime module on the tzset module.
3992         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3993         Copy the input structure, to work around some of the bug with
3994         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3995         Solaris releases, you should also use the tzset module, but we won't
3996         require it as a dependency any more since we don't want LGPLed code
3997         to depend on GPLed code.
3998
3999 2005-07-02  Jim Meyering  <jim@meyering.net>
4000
4001         * backupfile.c (backup_args): Change a `0' to NULL.
4002
4003 2005-07-01  Jim Meyering  <jim@meyering.net>
4004
4005         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4006         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4007         * save-cwd.c, tempname.c:
4008         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4009         and don't include <sys/file.h>).
4010
4011 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
4012
4013         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4014         declares only 'struct timespec;' (!).
4015
4016 2005-06-29  Jim Meyering  <jim@meyering.net>
4017
4018         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4019         type name.  Use the variable name instead.
4020         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4021
4022 2005-06-28  Simon Josefsson  <jas@extundo.com>
4023
4024         * check-version.h, check-version.c: New files.
4025
4026 2005-06-28  Simon Josefsson  <jas@extundo.com>
4027
4028         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
4029         collision with global variable.  Better indentation.  Don't
4030         increment buffer pointer beyond buffer end.  Based on comments
4031         from Paul Eggert <eggert@cs.ucla.edu>.
4032
4033         * base64.h: Indent.
4034
4035 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4036
4037         * canon-host.c (canon-host): Append trailing "," to 0 in
4038         initializer of struct addrinfo, as an indication that we don't
4039         care how many members the structure has.
4040
4041 2005-06-24  Derek Price  <derek@ximbiot.com>
4042         and Bruno Haible  <bruno@clisp.org>
4043
4044         Remove stat module & update lstat.
4045         * stat.c: Remove this file...
4046         (slash_aware_lstat): ...moving this content and its support...
4047         * lstat.c (rpl_lstat): ...into here.
4048         * lstat.h: New file.
4049
4050 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4051
4052         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
4053         (ranged_convert): Don't save conversion in a temporary struct.
4054         This causes a warning with GCC 4.0.0, and anyway in the typical
4055         case it's not worth the extra 100 bytes or so of code.
4056         (ranged_convert, __mktime_internal): When calling a function via a
4057         pointer P, use P () rather than (*P) (), as we now assume C89 or
4058         better.
4059
4060 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4061
4062         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4063         "who -r" failed to give output.  Problem reported by Tim Waugh.
4064
4065         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4066         (xcalloc): Use it to avoid needless tests.
4067         Problem reported by Jim Meyering.
4068
4069 2005-06-16  Jim Meyering  <jim@meyering.net>
4070
4071         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4072         when either N or S is zero.
4073
4074 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4075
4076         * argp.h (__option_is_short): Check upper limit of
4077         __key. Isprint() requires its argument to have the value
4078         of an unsigned char or EOF.
4079
4080 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4081
4082         * fnmatch.c (fnmatch): If there is an encoding error in a
4083         multibyte string or pattern, fall back on unibyte matching.
4084         Problem reported by James Youngman.
4085
4086 2005-06-08  Bruno Haible  <bruno@clisp.org>
4087
4088         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4089         warning on mingw.
4090
4091 2005-06-08  Bruno Haible  <bruno@clisp.org>
4092
4093         * csharpcomp.h: New file, from GNU gettext.
4094         * csharpcomp.c: New file, from GNU gettext.
4095         * csharpcomp.sh.in: New file, from GNU gettext.
4096
4097 2005-06-07  Derek Price  <derek@ximbiot.com>
4098
4099         Sync from CVS.
4100         * glob_.h: Indent nested #ifdef.
4101
4102 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4103
4104         Sync from coreutils.
4105         Use "file name" when talking about file names, instead of "filename"
4106         or "path", as per the GNU coding standards.
4107         * mkdir-p.c: Renamed from makepath.c.
4108         (make_dir_parents): Renamed from make_path.  All callers changed.
4109         * mkdir-p.h: Likewise.  All includers changed.
4110         * filenamecat.c: Renamed from path-concat.c.
4111         (file_name_concat): Renamed from path_concat.  All callers changed.
4112         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4113         * filenamecat.h: Likewise.  All includers changed.
4114         * acl.c: Don't use "path" or "filename" to mean "file name"
4115         in comments or local variable names.
4116         * basename.c: Likewise.
4117         * canonicalize.c, canonicalize.h: Likewise.
4118         * dirname.c, dirname.h: Likewise.
4119         * euidaccess.c: Likewise.
4120         * exclude.c: Likewise
4121         * fnmatch_.h, fnmatch_loop.c: Likewise.
4122         * fsusage.c, fsuage.h: Likewise.
4123         * fts.c, fts_.h: Likewise.
4124         * getcwd.c: Likewise.
4125         * getloadavg.c: Likewise.
4126         * mkstemp.c: Likewise.
4127         * mountlist.c, mountlist.h: Likewise.
4128         * openat.c, openat.h: Likewise.
4129         * readlink-stub.c: Likewise.
4130         * readutmp.c, readutmp.h: Likewise.
4131         * rename.c: Likewise.
4132         * rmdir.c: Likewise.
4133         * same.c: Likewise.
4134         * savedir.c: Likewise.
4135         * stripslash.c: Likewise.
4136         * tempname.c: Likewise.
4137         * xreadlink.c: Likewise.
4138         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4139         All uses changed.
4140         * exclude.h: Likewise.
4141
4142         * euidaccess.c (getuid, getgid, getuid, getegid)
4143         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4144         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4145         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4146         * pathmax.h: Include <limits.h> unconditionally, since other
4147         files have been getting away with it for years (MORE/BSD 4.3
4148         is extinct now).
4149         * userspec.c (getpwnam, getgrnam, getgrgid)
4150         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4151
4152         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4153         Define to 256, not 255, as per modern POSIX.
4154
4155 2005-06-01  Bruno Haible  <bruno@clisp.org>
4156
4157         * csharpexec.h: New file, from GNU gettext.
4158         * csharpexec.c: New file, from GNU gettext.
4159         * csharpexec.sh.in: New file, from GNU gettext.
4160
4161 2005-05-31  Derek Price  <derek@ximbiot.com>
4162             Paul Eggert  <eggert@cs.ucla.edu>
4163
4164         Sync from cvs.
4165         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4166
4167 2005-05-29  Derek Price  <derek@ximbiot.com>
4168             Paul Eggert  <eggert@cs.ucla.edu>
4169
4170         * glob_.h, glob.c: New files.
4171
4172 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4173
4174         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4175
4176         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4177         the configuration hassle isn't worth it.
4178         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4179         (LONGEST_MODIFIER, PRIuMAX): Remove.
4180
4181 2005-05-27  Bruno Haible  <bruno@clisp.org>
4182
4183         * getlogin_r.h: Remove second include of <stddef.h>.
4184
4185 2005-05-25  Bruno Haible  <bruno@clisp.org>
4186             Derek Price  <derek@ximbiot.com>
4187
4188         * getlogin_r.h: Simplify API documentation.
4189
4190 2005-05-25  Derek Price  <derek@ximbiot.com>
4191             Paul Eggert  <eggert@cs.ucla.edu>
4192
4193         * getlogin_r.c, getlogin_r.h: New files.
4194
4195 2005-05-22  Bruno Haible  <bruno@clisp.org>
4196
4197         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4198         Also include <sys/param.h> if it defines MIN, MAX.
4199         Based on a patch by Derek Price <derek@ximbiot.com>.
4200
4201 2005-05-22  Bruno Haible  <bruno@clisp.org>
4202
4203         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4204         (INT64_MIN): Fix definition.
4205         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4206
4207         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4208         NEED_SIGNED_INT_TYPES.
4209
4210         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4211         HAVE_SYSTEM_INTTYPES.
4212
4213 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4214
4215         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4216         so that unistd-safer.h (GPL'ed code) need not be included.
4217
4218 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4219
4220         New fts module.
4221         * fts.c: Don't include "cycle-check.h" or "hash.h".
4222         (setup_dir, free_dir): New functions.
4223         (enter_dir, leave_dir): Define trivial
4224         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4225         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4226         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4227         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4228         Move to fts-cycle.c.
4229         (fts_open): Use setup_dir.
4230         (fts_close): Use free_dir.
4231         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4232         This adds a label and some gotos, but the alternatives were messier.
4233         Check for memory allocation failure when entering a dir.
4234         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4235         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4236         (FTS): New member fts_cycle, that is a union that contains the
4237         old active_dir_ht and cycle_state.  All uses changed to mention
4238         fts_cycle.ht and fts_cycle.state.
4239         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4240         fts.c, with the following changes:
4241         (setup_dir, free_dir): New functions.
4242         (enter_dir): Now returns bool.  Return true if successful, false
4243         if memory exhausted.  All callers changed.
4244         Do not bother partly cleaning up on
4245         memory allocation failure; that is free_dir's job.
4246         However, free ad if hash_insert fails, to avoid memory leak.
4247         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4248         fts->fts_options to see which union member to use.
4249
4250 2005-05-20  Jim Meyering  <jim@meyering.net>
4251
4252         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4253         Now a macro, to pacify GCC.
4254
4255 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4256
4257         * chown.c (rpl_chown): Return -1 on failure.
4258
4259 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4260
4261         * canonicalize.c: Include canonicalize.h first, to test interface.
4262         Include <stddef.h> unconditionally, since we assume C89 now.
4263         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4264         * fts.c: Include fts_.h first, to check interface.
4265         Do not include intprops.h; no longer needed.
4266         Include cycle-check.h and hash.h, since fts_.h no longer does.
4267         Remove unnecessary casts of closedir to void.
4268         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4269         decide whether to decrement nlinks.
4270         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4271         (FTS): Use struct hash_table * instead of Hash_table, so that
4272         we no longer need to include hash.h here.
4273
4274 2005-05-17  Jim Meyering  <jim@meyering.net>
4275
4276         * fts.c, fts_.h: New files, from coreutils.
4277
4278 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4279
4280         Sync from coreutils.
4281         * unlinkdir.c, unlinkdir.h: New files.
4282         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4283         regex.h, unlocked-io.h, xtime.h:
4284         White space changes only.
4285         * makepath.c (make_path): Port to hosts where leading "//" is special.
4286         * yesno.c: Include getline.h, not ctype.h.
4287         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4288         Use getline to remove arbitrary restriction on response length.
4289
4290 2005-05-13  Bruno Haible  <bruno@clisp.org>
4291
4292         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4293         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4294         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4295         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4296         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4297         Add support for 64-bit integers in the MSVC compiler.
4298
4299 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4300
4301         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4302         Change the initial comment to refer to GPL, not LGPL.
4303         gnulib-tool will change it to LGPL as needed.
4304
4305         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4306         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4307         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4308         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4309         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4310         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4311         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4312         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4313         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4314         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4315         concatpath.c, config.charset, copy-file.c, copy-file.h,
4316         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4317         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4318         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4319         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4320         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4321         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4322         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4323         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4324         full-read.c, full-read.h, full-write.c, full-write.h,
4325         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4326         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4327         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4328         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4329         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4330         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4331         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4332         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4333         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4334         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4335         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4336         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4337         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4338         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4339         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4340         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4341         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4342         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4343         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4344         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4345         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4346         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4347         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4348         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4349         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4350         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4351         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4352         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4353         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4354         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4355         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4356         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4357         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4358         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4359         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4360         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4361         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4362         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4363         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4364         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4365         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4366         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4367         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4368         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4369         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4370         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4371         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4372         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4373         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4374         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4375         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4376         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4377         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4378         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4379         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4380         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4381         Update FSF postal mail address.
4382
4383 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4384
4385         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4386         specified in ai_socktype. Fix invalid ai_protocol
4387         check. ai_protocol is usually set to 0 or depending on
4388         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4389         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4390         ai_socktype / ai_protocol in the returned addrinfo structure.
4391
4392 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4393             Bruno Haible  <bruno@clisp.org>
4394
4395         * inet_ntop.h: New file.
4396         * inet_ntop.c: New file, from glibc with modifications.
4397
4398 2005-05-08  Jim Meyering  <jim@meyering.net>
4399
4400         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4401
4402 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4403
4404         Merge from coreutils.  Among other things,
4405         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4406         * fd-safer.c: New file.
4407         * fcntl-safer.h, open-safer.c: Remove.
4408         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4409         * dup-safer.c: Include unistd-safer.h first.
4410         Don't include errno.h.
4411         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4412         * file-type.h: Don't assume invoker included sys/stat.h first.
4413         * file-type.c: Rely on file-type.h change.
4414         * getloadavg.c: Include unistd-safer.h.
4415         (getloadavg): Use safer open.
4416         * getusershell.c: Include "stdio-safer.h".
4417         (getusershell): Use safer fopen.
4418         * long-options.c (long_options): Use NULL rather than 0.
4419         * modechange.h (mode_free): Remove; all callers changed to invoke
4420         'free'.
4421         * modechange.c: Likewise.
4422         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4423         (MODE_DONE): New constant.
4424         (struct mode_change): Remove 'next' member.
4425         (make_node_op_equals): New function; like the old one of the
4426         same name, except it allocates an array.
4427         (mode_compile, mode_create_from_ref): Use it.
4428         (mode_compile): Allocate result as an array, not a linked list.
4429         Parse octal string ourself, so that we catch mistakes like "+0".
4430         (mode_adjust): Arg is an array, not a linked list.
4431         * modechange.c: Include stat-macros.h, xalloc.h.
4432         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4433         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4434         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4435         Remove.  This is now stat-macros.h's job.
4436         (talloc): Remove.  All callers replaced by xalloc, so that
4437         our invokers don't have to worry about reporting memory failures.
4438         (make_node_op_equals): Remove.
4439         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4440         New constants.
4441         (struct mode_change): Moved here from modechange.h.
4442         (mode_append_entry): Remove.
4443         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4444         apps to have incorrect behavior.  Use simpler algorithm for head
4445         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4446         Detect more invalid usages rather than having somewhat-random behavior.
4447         Don't insert an "a=" action, as that leads to incorrect behavior.
4448         (mode_compile, mode_create_from_ref): Return NULL on error instead
4449         of an enum, since now there's only one way to have an error.  All
4450         callers changed.
4451         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4452         at the correct time.  Simplify calculation of "+u" and its ilk.
4453         Don't mishandle "+X".
4454         (mode_free): Remove "register" and localize decls.
4455         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4456         (struct mode_change): Move to modechange.c; callers don't
4457         need to see this stuff.
4458         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4459         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4460         (mode_change, mode_adjust): Reflect the new signatures noted above.
4461         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4462         that might redefine system include files.
4463         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4464         (my_usleep): Use NULL rather than (void *) 0.
4465         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4466         Use siginterrupt to specify that system calls should be interrupted.
4467         (rpl_nanosleep): Move initialization of suspended closer to call of
4468         my_usleep.
4469         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4470         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4471         (desirable_utmp_entry): New function.
4472         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4473         using x2nrealloc, to simplify logic.
4474         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4475         size calculation.  Do not assume utmp file is a regular file.
4476         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4477         (READ_UTMP_CHECK_PIDS): New constant.
4478         * save-cwd.c: Include unistd-safer.h.
4479         (save_cwd): Use fd_safer.
4480         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4481         [!_LIBC] Include "stat-macros.h" instead.
4482         * unistd-safer.h (fd_safer): New decl.
4483
4484 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4485
4486         * byteswap_.h: New file.
4487
4488 2005-04-25  Albert Chin  <china@thewrittenword.com>
4489
4490         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4491         Toolkit C bug.
4492
4493 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4494
4495         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4496         that "UTC +1 second" continues to work.  Problem reported
4497         by Dmitry V. Levin.
4498         (relunit_snumber): New rule.
4499         (relunit): Use it.
4500
4501 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4502
4503         * getdate.y (universal_time_zone_table): New constant.
4504         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4505         universal_time_zone_table.
4506         (lookup_zone): Prefer universal_time_zone_table to
4507         local_time_zone_table, so that "GMT" time stamps are allowed in
4508         London during the summer.  Problem reported by Ian Abbott.
4509
4510 2005-04-12  Jim Meyering  <jim@meyering.net>
4511
4512         * human.c (humblock): Set *options even when returning due to
4513         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4514         warning from gcc-4.
4515
4516 2005-04-09  Jim Meyering  <jim@meyering.net>
4517
4518         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4519         -Wuninitialized: initialize tm0.tm_year.
4520
4521 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4522
4523         * getdate.y (parser_control): rels_seen is now a boolean, not a
4524         count, since there's no maximum.  All uses changed.
4525         Add member dsts_seen.
4526         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4527         not being INT_MAX.
4528         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4529         Use pc_rels_seen to decide whther a date is absolute.
4530
4531         * getdate.y (number): Don't overwrite year.
4532         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4533         check.
4534
4535 2005-04-02  Simon Josefsson  <jas@extundo.com>
4536
4537         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4538         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4539
4540 2005-03-27  Jim Meyering  <jim@meyering.net>
4541
4542         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4543
4544 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4545
4546         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4547         "one's complement" -> "ones' complement" in comment, as per Knuth.
4548         "value of type" -> "type or expression" in comment.
4549         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4550
4551 2005-03-26  Jim Meyering  <jim@meyering.net>
4552
4553         Comment nits.
4554         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4555         Correct typos: s/or/of/.
4556
4557 2005-03-23  Jim Meyering  <jim@meyering.net>
4558
4559         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4560
4561 2005-03-21  Jim Meyering  <jim@meyering.net>
4562
4563         Changes imported from coreutils.
4564
4565         * cycle-check.c: Don't include xalloc.h.
4566
4567         * path-concat.c: Don't include assert.h.
4568         (path_concat): Remove assertion that would have triggered
4569         for ABASE starting with more than one slash.
4570         Reported by Andreas Schwab.
4571
4572         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4573         properly when ABASE is an absolute file name.
4574         Correct the description of this function.
4575         Include <assert.h>.
4576         Add an assertion and a test driver.
4577         This fixes a bug introduced on 2004-07-02.
4578         Andreas Schwab reported the resulting failure of cp --parents:
4579         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4580
4581 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4582
4583         * strftime.c (my_strftime): If the underlying strftime returns 0
4584         (which shouldn't happen), generate nothing instead of returning 0
4585         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4586
4587 2005-03-16  Bruno Haible  <bruno@clisp.org>
4588
4589         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4590
4591 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4592
4593         * strftime.c (my_strftime): Prepend space to format so that we can
4594         reliably distinguish strftime failure from empty output on POSIX
4595         hosts.
4596
4597 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4598
4599         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4600         (iconv_string): Don't guess a size-zero buffer, as that might cause
4601         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4602         result would be 'too large', where 'too large' is (heuristically)
4603         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4604         overflow concerns.  This will prevent some unwanted malloc failures
4605         when the inputs are very large.
4606
4607 2005-03-15  Bruno Haible  <bruno@clisp.org>
4608
4609         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4610         'negate'.
4611
4612         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4613         variable.
4614
4615         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4616
4617 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4618
4619         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4620         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4621         intprops.h.
4622         * strtol.c: Likewise.
4623
4624 2005-03-14  Simon Josefsson  <jas@extundo.com>
4625
4626         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4627         <fx@gnu.org>.
4628
4629 2005-03-14  Jim Meyering  <jim@meyering.net>
4630
4631         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4632         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4633         to be nonzero so that we (and caller) can detect the difference
4634         between a valid zero-length expansion and an error return, even
4635         when the underlying strftime fails before writing anything into
4636         that location.
4637
4638 2005-03-10  Jim Meyering  <jim@meyering.net>
4639
4640         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4641         so that this module works on systems without fchdir.
4642
4643 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4644
4645         Factor int-properties macros into a single file, except for
4646         glibc-related files.
4647         * intprops.h: New file.
4648         * getloadavg.c: Include it instead of limits.h.
4649         (INT_STRLEN_BOUND): Remove.
4650         * human.c: Include intprops.h.
4651         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4652         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4653         * inttostr.h: Include intprops.h instead of limits.h.
4654         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4655         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4656         for consistency with intprops.h.
4657         (time_t_is_integer, twos_complement_arithmetic): Use them.
4658         * sig2str.h: Include <signal.h>, intprops.h.
4659         (INT_STRLEN_BOUND): Remove.
4660         * strftime.c (TYPE_SIGNED): Remove.
4661         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4662         * strtol.c: Adjust comments to match intprops.h.
4663         * userspec.c: Include intprops.h.
4664         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4665         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4666         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4667         instead of rolling our own expressions.
4668         * xstrtol.c: Include xstrtol.h first, to test interface.
4669
4670         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4671         instead of int.
4672         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4673         the right thing even if adding 1900 would overflow.  Similarly
4674         for tm_mon + 1 and tm_yday + 1.
4675         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4676         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4677         (DO_SIGNED_NUMBER): New macro.
4678         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4679
4680 2005-03-07  Bruno Haible  <bruno@clisp.org>
4681
4682         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4683
4684 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4685             Bruno Haible  <bruno@clisp.org>
4686
4687         * pagealign_alloc.h: New file.
4688         * pagealign_alloc.c: New file.
4689
4690 2005-01-28  Bruno Haible  <bruno@clisp.org>
4691
4692         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4693         stpncpy.c uses it.
4694
4695 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4696
4697         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4698         The workaround isn't strictly needed for POSIX conformance, and
4699         it's too much of a pain to configure and maintain.  We'll ask
4700         people to fix their kernels instead.
4701         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4702         (NANOSLEEP_BUG_WORKAROUND): Remove.
4703         (xnanosleep): Remove the workaround.
4704
4705 2005-02-12  Bruno Haible  <bruno@clisp.org>
4706
4707         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4708
4709 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4710
4711         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4712         * timespec.h (gettime): Return void, since it always
4713         succeeds now.  All uses changed.
4714         * gettime.c (gettime) Likewise.
4715         [HAVE_NANOTIME]: Prefer nanotime.
4716         Assume gettimeofday succeeds, as POSIX requires.
4717         Assime time () succeeds, since other code already does.
4718         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4719         (timespec_subtract): Remove.
4720         (NANOSLEEP_BUG_WORKAROUND): New constant.
4721         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4722         things considerably.  Use it only on GNU/Linux hosts, since the
4723         workaround shouldn't be needed elsewhere.
4724
4725 2005-02-24  Bruno Haible  <bruno@clisp.org>
4726
4727         * gettext.h: Update from GNU gettext 0.14.2.
4728
4729 2005-02-24  Bruno Haible  <bruno@clisp.org>
4730
4731         * localcharset.c: Update from GNU gettext 0.14.2.
4732         * config.charset: Update from GNU gettext 0.14.2.
4733
4734 2005-02-22  Simon Josefsson  <jas@extundo.com>
4735
4736         * iconvme.h, iconvme.c: New files, from libc.
4737
4738 2005-02-20  Neil Conway  <neilc@samurai.com>
4739
4740         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4741         returned by OSX/Darwin if the specified buffer is not large
4742         enough for the hostname.
4743
4744 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4745
4746         * memrchr.h: New file.
4747         * chdir-long.c: Include it.
4748         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4749         Don't bother including stddef.h.
4750
4751 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4752
4753         * argp-help.c (__argp_help): Create a fake struct argp_state and
4754         pass it to _help, otherwise the latter coredumps trying to
4755         dereference state.root_argp.
4756
4757 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4758
4759         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4760         inclusion.
4761         Include <sys/types.h>, for dev_t.
4762         (ME_DUMMY, ME_REMOTE): Move from here....
4763         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4764         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4765         Dmitry V. Levin.
4766         Include mountlist.h first, to test the interface.
4767
4768 2005-01-29  Bruno Haible  <bruno@clisp.org>
4769
4770         * progname.c (program_name): Initialize.
4771         Needed when linking statically on MacOS X.
4772
4773 2005-01-28  Bruno Haible  <bruno@clisp.org>
4774
4775         * javacomp.sh.in: New file, from GNU gettext.
4776         * javacomp.h: New file, from GNU gettext.
4777         * javacomp.c: New file, from GNU gettext.
4778
4779 2005-01-26  Bruno Haible  <bruno@clisp.org>
4780
4781         * javaexec.sh.in: New file, from GNU gettext.
4782         * javaexec.h: New file, from GNU gettext.
4783         * javaexec.c: New file, from GNU gettext.
4784
4785 2005-01-26  Simon Josefsson  <jas@extundo.com>
4786
4787         * gai_strerror.c: Use GPL in header.
4788
4789 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4790
4791         * argp-help.c (hol_entry_help): Avoid using non-constant
4792         initializers for struct pentry_state.
4793         (__argp_error): Check return value of __asprintf
4794         (__argp_failure): Translate error message
4795
4796         * argp-parse.c: Removed braces around the expansion of N_()
4797
4798 2005-01-21  Jim Meyering  <jim@meyering.net>
4799
4800         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4801         same value as for Solaris 9.
4802
4803         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4804         component length.  This included changing the parameter to be
4805         of type `char *' rather than `char const *'.
4806         * chdir-long.h (chdir_long): Update prototype.
4807
4808         * openat.c (fdopendir, fstatat): New functions.
4809         * openat.h: Include headers required for use of DIR and struct stat.
4810         [AT_SYMLINK_NOFOLLOW]: Define.
4811         (fdopendir, fstatat): Add prototypes.
4812
4813 2005-01-21  Bruno Haible  <bruno@clisp.org>
4814
4815         * classpath.h: New file, from GNU gettext.
4816         * classpath.c: New file, from GNU gettext.
4817
4818 2005-01-20  Simon Josefsson  <jas@extundo.com>
4819
4820         * version-etc-fsf.c: New file, with version_etc_copyright.
4821         * version-etc.c: Remove version_etc_copyright.
4822         * version-etc.h (version_etc_copyright): Use [] instead of * in
4823         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4824
4825 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4826
4827         * save-cwd.c (save_cwd): Remove code to support the case
4828         where fchdir is missing or flaky.
4829
4830 2005-01-20  Simon Josefsson  <jas@extundo.com>
4831
4832         * base64.h (isbase64): Add.
4833
4834         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4835         using a unsigned prototype, don't inline.
4836         (base64_decode): Use it.
4837
4838 2005-01-19  Bruno Haible  <bruno@clisp.org>
4839
4840         * sh-quote.h: New file, from GNU gettext.
4841         * sh-quote.c: New file, from GNU gettext.
4842
4843 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4844
4845         Merge changes from coreutils, as described below in several
4846         changelogs dated today.
4847
4848         * save-cwd.c: Include "save-cwd.h" before other include files.
4849         (O_DIRECTORY): Remove; not needed here, since "." must be
4850         a directory.  All uses removed.
4851         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4852         universal on Suns, and we also need to test for IRIX.
4853         Revamp code to use 'if' rather than '#if'.
4854         Avoid unnecessary comparison of cwd->desc to 0.
4855
4856         * utimens.c (futimens): Robustify the previous patch, by checking
4857         for known valid error numbers rather than observed invalid ones.
4858
4859 2005-01-18  Jim Meyering  <jim@meyering.net>
4860
4861         * version-etc.c (version_etc_copyright): Update copyright date.
4862
4863         * utimens.c (futimens): Account for the fact that futimes
4864         can also fail with errno == ENOSYS or errno == ENOENT.
4865         Patch from Dmitry V. Levin.
4866
4867         Change the name of the robust chdir function from chdir to chdir_long.
4868         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4869         (restore_cwd): Use chdir_long, not chdir.
4870         * chdir-long.c: Renamed from chdir.c.
4871         * chdir-long.h: Renamed from chdir.h.
4872         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4873         Hurd.
4874
4875 2005-01-18  Bob Proulx  <bob@proulx.com>
4876
4877         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4878         offsetof() macro construct to avoid compile failure with native HP-UX
4879         11.0 ANSI C compiler.
4880
4881 2005-01-06  Bruno Haible  <bruno@clisp.org>
4882
4883         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4884         because stpncpy.m4 takes care of it.
4885
4886 2004-01-24  Bruno Haible  <bruno@clisp.org>
4887
4888         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4889
4890 2003-10-09  Bruno Haible  <bruno@clisp.org>
4891
4892         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4893
4894 2005-01-06  Bruno Haible  <bruno@clisp.org>
4895
4896         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4897         * fwriteerror.c: Include <stdbool.h>.
4898         (fwriteerror): At the end, close the file stream. Record whether
4899         stdout was already closed.
4900
4901 2004-05-27  Bruno Haible  <bruno@clisp.org>
4902
4903         * execute.c (environ): Declare if needed.
4904         * pipe.c (environ): Likewise.
4905         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4906
4907 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4908
4909         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4910         definitions to be after all include files, to avoid collisions.
4911         Problem reported by Bob Proulx.
4912
4913 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4914
4915         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4916         not needed.  This removes a dependency on the gettext module.
4917         [defined _LIBC]: Do not include <libintl.h>; not needed.
4918
4919 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4920
4921         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4922         HAVE_DECL_STRTOLD.
4923
4924 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4925
4926         * argp-parse.c: Include <stddef.h>.
4927         (alignof, alignto): New macros.
4928         (parser_init): Don't assume that void * is aligned sufficiently
4929         for struct option.
4930
4931         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4932         need to extend the stack.
4933         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4934         large.
4935
4936 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4937
4938         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4939
4940 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4941
4942         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4943         Remove now-obsolete comment about AIX.
4944         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4945         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4946         (YYMAXDEPTH): New macro.
4947
4948 2004-12-18  Bruno Haible  <bruno@clisp.org>
4949
4950         * fatal-signal.c (fatal_signals): Make non-const.
4951         (init_fatal_signals): New function.
4952         (uninstall_handlers, install_handlers): Ignore signals that were set to
4953         SIG_IGN.
4954         (at_fatal_signal): Call init_fatal_signals.
4955         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4956         SIG_IGN.
4957         Reported by Paul Eggert.
4958
4959 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4960
4961         * getdate.y (textint): New member "negative".
4962         (time_zone_hhmm): New function.
4963         Expect 14 shift-reduce conflicts, not 13.
4964         (o_colon_minutes): New rule.
4965         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4966         (yylex): Set the "negative" member of signed numbers.
4967
4968 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4969
4970         Changes imported from coreutils.
4971         * hard-locale.c: Assume <locale.h> exists.
4972         Include "strdup.h".
4973         (GLIBC_VERSION): New macro.
4974         (hard_locale): Assume setlocale exists.
4975         Rewrite to avoid #ifdef.
4976         Use strdup rather than malloc + strcpy.
4977         * human.c: Assume <locale.h> exists.
4978         (human_readable): Assume localeconv exists.
4979
4980 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4981
4982         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4983         convert T2, not T.  (Imported from libc.)
4984
4985 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4986
4987         * getcwd.c (is_ENAMETOOLONG): New macro.
4988         (__getcwd.c): Don't restore errno; glibc doesn't.
4989         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4990         first, falling back to our code only if its results look suspicious.
4991         Ensure that the resulting buffer is only as large as necessary.
4992
4993         * readutmp.c: Include readutmp.h first.
4994         Include <errno.h>, since readutmp.h no longer does that.
4995         * readutmp.h: Don't include <errno.h>,
4996         <sys/param.h>, <time.h>; not needed to establish interface.
4997         (errno): Remove decl.
4998         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4999         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5000         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5001
5002 2004-11-28  Simon Josefsson  <jas@extundo.com>
5003
5004         * base64.h, base64.c: New file.
5005
5006 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
5007
5008         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5009
5010 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
5011
5012         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5013         HP's ANSI C compiler.
5014         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5015         Declaring int functions causes warnings on some modern systems and
5016         shouldn't be needed to compile on ancient ones.
5017         * same.c (MIN) [defined MIN]: Don't define, since it's already
5018         defined.
5019
5020         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5021         with the following changes.
5022         (__set_errno): Parenthesize properly.
5023         Include <stdbool.h>.
5024         (MIN, MAX, MATCHING_INO): New macros.
5025         (__getcwd): Define with prototype, not K&R form.
5026         Use heuristics to allocate default buffer on stack if possible.
5027         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5028         behavior, and to avoid the PATH_MAX limit when computing
5029         ../../../../...
5030         Use MATCHING_INO to compare inode number to file.
5031         Check for arithmetic overflow in size calculations.
5032         Fix bug in reallocation of dot array that caused getcwd to fail
5033         on directories nested deeper than 75.
5034         Be more careful about saving errno on error.
5035         Do not use realloc; use only free+malloc, as this is a bit
5036         more flexible and avoids a needless copy operation.
5037         Do not inspect st_dev and st_ino for symbolic links; POSIX
5038         doesn't specify the latter.
5039         Check for closedir errors.
5040         Avoid needless casts.
5041         Use "#ifdef weak_alias" around weak_alias, to be like other
5042         glibc code.
5043         The following changes to getcwd.c have effect only when used in
5044         gnulib; they have no effect inside glibc proper.
5045         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5046         as alloca isn't used.
5047         (alloca, __alloca): Likewise.
5048         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5049         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5050         unconditionally, as gnulib assumes C89 or better.
5051         Do not include <sys/param.h>.
5052         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5053         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5054         better.
5055         (NULL) [!defined NULL]: Remove; we assume C89 or better.
5056         Include <dirent.h> in a way that is compatible with modern Autoconf.
5057         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5058         New macros, if not already defined.
5059         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5060         Use "_LIBC", not "defined _LIBC", for consistency.
5061         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5062         a mempcpy module.
5063         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5064         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
5065         * xgetcwd.c: David MacKenzie's old code was removed, so give
5066         credit only to Jim Meyering and adjust the copyright dates.
5067         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5068         <stdlib.h>, <unistd.h>, "pathmax.h".
5069         Instead, include "xgetcwd.h" (first) and "getcwd.h".
5070         (INITIAL_BUFFER_SIZE): Remove.
5071         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5072
5073 2004-11-23  Jim Meyering  <jim@meyering.net>
5074
5075         * getopt_.h: Remove trailing blanks.
5076
5077 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
5078
5079         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5080         (futimens): New function, which uses futimes if available.
5081         (futimens, utimens): Support timespec==NULL, with same semantics
5082         as utime and utimens.
5083         * utimens.h (futimens): New decl.
5084
5085 2004-11-23  Jim Meyering  <jim@meyering.net>
5086
5087         * __fpending.c: Add comment.
5088
5089 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5090
5091         * getopt_.h: Re-addition of __getopt_argv_const caused
5092         redefinition warnings. To avoid them, include the defines
5093         in `#if !defined __need_getopt ... #endif'. The only place
5094         where __getopt_argv_const is used is in definitions
5095         of getopt_long and getopt_long_only below, which are as well
5096         protected by `#ifndef __need_getopt'.
5097         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5098         __need_getopt after including <stdio.h> and <unistd.h> These
5099         headers might have defined it.
5100
5101 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
5102
5103         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5104         New macros.
5105         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5106         optopt): Use them instead of invoking ## directly; otherwise, the
5107         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5108
5109 2004-11-19  Bruno Haible  <bruno@clisp.org>
5110
5111         * strtok_r.c: Move comments from here...
5112         * strtok_r.h: ... to here.
5113
5114 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
5115
5116         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5117         might fail.  Problem reported by Yoann Vandoorselaere.
5118         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5119         that mishandle size_t overflow.
5120
5121 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5122
5123         * canon-host.c: Include "strdup.h".
5124         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5125         Use strdup instead of malloc/strcpy to duplicate strings.
5126
5127         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5128         (human_space_before_unit): New constant.
5129         * human.c (human_readable): Support it.
5130
5131         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5132         (xgetcwd): Set errno correctly when failing.
5133         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5134         the failure is actually due to a PATH_MAX problem.
5135
5136         Further getopt changes to make it more likely that glibc will
5137         buy the changes back.
5138         * getopt.c (POSIXLY_CORRECT): New constant.
5139         (getopt): Use it, so to preserve glibc semantic
5140         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5141         when compiling for libc.
5142         * getopt_.h (__getopt_argv_const): Bring it back.
5143         (getopt_long, getopt_long_only): Use it.
5144
5145         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5146         New arg POSIXLY_CORRECT.  All callers changed.
5147         (getopt): Argv is now char * const *, as per standard.
5148         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5149         not char *__getopt_argv_const *.
5150         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5151         _getopt_long_only_r): Likewise.
5152         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5153         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5154         _getopt_long_r, _getopt_long_only_r): Likewise.
5155         * getopt_.h (__getopt_argv_const): Remove.
5156         (getopt): Argv is now char * const *, as per standard.
5157
5158         * getdate.y (tORDINAL): New token.
5159         (day, relunit): Allow it for relative times.
5160         (relative_time_table): Use tORDINAL for ordinals.
5161
5162 2004-11-15  Jim Meyering  <jim@meyering.net>
5163
5164         * closeout.c: Include "__fpending.h" once again.
5165         Include <stdbool.h>.
5166         (close_stdout): Don't fail just because stdout was closed initially,
5167         since some programs don't write to stdout in the normal course of
5168         operation (other than --version and --help), and we don't want this
5169         function to make e.g. `touch file >&-' fail.
5170         But do fail if it was closed and someone has tried to write to it.
5171         E.g., `printf foo >&-' must fail.
5172
5173 2004-11-11  Simon Josefsson  <jas@extundo.com>
5174
5175         * strtok_r.h, strtok_r.c: New file.
5176
5177 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5178
5179         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5180         we can stop lying to compilers about the constness of argv when we
5181         are compiled outside glibc.
5182         (getopt, getopt_long, getopt_long_only): Use it.
5183         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5184         getopt): Likewise.
5185         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5186         _getopt_long_only_r): Likewise.
5187         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5188         _getopt_long_only_r): Likewise.
5189
5190         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5191         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5192         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5193         the other external symbols.
5194         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5195         declaration, since the above renaming now works around collisions.
5196
5197 2004-11-11  Jim Meyering  <jim@meyering.net>
5198
5199         * linebreak.c: Remove trailing blanks.
5200         * alloca_.h: Likewise.
5201         * acosl.c: Likewise.
5202         * euidaccess.c: Likewise.
5203         * allocsa.h: Likewise.
5204
5205 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5206
5207         * mktime.c (SHR): New macro, which is a portable
5208         substitute for >> that should work even on Crays.
5209         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5210         Problem reported by Mark D. Baushke in
5211         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5212         * getdate.y (SHR): Likewise.
5213         (tm_diff): Use it.
5214         * strftime.c (SHR): Likewise.
5215         (tm_diff): Use it.
5216         * quotearg.c (struct quoting_options): Use unsigned int for
5217         quote_these_too, so that right shifts are well defined.  All uses
5218         changed.
5219
5220 2004-11-10  Simon Josefsson  <jas@extundo.com>
5221
5222         * getaddrinfo.h, getaddrinfo.c: New files.
5223
5224 2004-11-10  Jim Meyering  <jim@meyering.net>
5225
5226         Ensure that no close failure goes unreported.
5227         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5228         return early when it seems there's nothing to flush.
5229         Don't include __fpending.h.
5230
5231 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5232
5233         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5234
5235 2004-11-05  Bruno Haible  <bruno@clisp.org>
5236
5237         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5238         Reported by Mark D. Baushke <mdb@cvshome.org>.
5239
5240 2004-11-04  Bruno Haible  <bruno@clisp.org>
5241
5242         2004-09-11  Bruno Haible  <bruno@clisp.org>
5243                 * allocsa.valgrind: New file.
5244         2004-02-06  Bruno Haible  <bruno@clisp.org>
5245                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5246                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5247                 Reported by Christopher Seip <chris.seip@hp.com>.
5248
5249 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5250
5251         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5252         with errno == ERANGE if the buffer is too small.
5253         Problem reported by Mark D. Baushke.
5254
5255 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5256
5257         * xreadlink.c (MAXSIZE): New macro.
5258         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5259         size does not exceed MAXSIZE.  Avoid cast.
5260         As suggested by Mark D. Baushke in
5261         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5262         if readlink fails with buffer size just under MAXSIZE, try again
5263         with MAXSIZE.
5264
5265 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5266         and  Paul Eggert  <eggert@cs.ucla.edu>
5267
5268         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5269         (get_date): Overparenthesize to avoid GCC warning.
5270
5271 2004-11-02  Bruno Haible  <bruno@clisp.org>
5272
5273         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5274         function returns void.
5275
5276 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5277
5278         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5279         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5280         already declared.
5281
5282 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5283
5284         * getdate.y: Add support for TZ="foo" within a date string.
5285         Fix some bugs near time_t boundaries.  Reject dates with
5286         out-of-range components, e.g., "Sept 31".
5287         Include <stdlib.h>, "setenv.h", "xalloc.h".
5288         (ISDIGIT_LOCALE): Remove; unused.
5289         Note that the TZ and time functions used here are not reentrant.
5290         (mktime_ok, get_tz): New functions.
5291         (TZBUFSIZE): New constant.
5292         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5293         This requires that we sometimes generate our own TZ="XXX..." setting.
5294
5295 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5296
5297         * mktime.c (not_equal_tm): Remove redundant check.
5298
5299 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5300
5301         * getdate.y: Use Bison 1.875 features, and some minor
5302         code cleanups.  This change does not affect semantics.
5303         Don't include <stdlib.h>; no longer needed.
5304         Don't include unlocked-io.h; only the "#if TEST" code uses
5305         stdio, and performance isn't crucial there.
5306         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5307         Bison 1.875 features as described below.
5308         All uses of "PC." replaced by "pc->".
5309         (YYSTYPE): Add a forward declaration.
5310         (yylex, yyerror): Use full prototypes in forward decls.
5311         Use "%pure-parser" rather than obsolescent "%pure_parser".
5312         Use %parse-param and %lex-param instead of obsolescent
5313         YYPARSE_PARAM and YYLEX_PARAM.
5314         (meridian_table, month_and_day_table, time_units_table,
5315         relative_time_table, time_zone_table, military_table,
5316         lookup_zone, lookup_word, get_date):
5317         Use NULL instead of 0 where appropriate.
5318         (to_hour): Avoid abort (), to avoid a dependency on
5319         stdlib.h.
5320         (yyerror, yylex): Now accepts parser_control * arg.
5321         (main) [TEST]: Use '\0' rather than 0 for char.
5322
5323 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5324
5325         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5326         It's now the caller's responsibility to handle the case where
5327         !HAVE_GETPAGESIZE && !defined getpagesize.
5328
5329         * mktime.c (leapyear): Arg is long int, not int.
5330
5331 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5332
5333         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5334
5335 2004-10-12  Simon Josefsson  <jas@extundo.com>
5336
5337         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5338         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5339         to real functions.
5340
5341 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5342
5343         * vsnprintf.h: New file.
5344         * vsnprintf.c: New file.
5345
5346 2004-10-07  Bruno Haible  <bruno@clisp.org>
5347
5348         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5349         into the provided buffer.
5350
5351 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5352
5353         * diacrit.c, diacrit.h: Add GPL notice.
5354
5355         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5356         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5357         * logl.c (logl): Keep the code as similar to glibc as possible.
5358         This avoids a potential constant-folding bug.
5359
5360 2004-10-05  Bruno Haible  <bruno@clisp.org>
5361
5362         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5363
5364 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5365
5366         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5367         * xmalloc.c (xmemdup): Likewise.
5368         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5369         XFREE): Remove these long-obsolescent macros.
5370         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5371         * xstrdup.c: Remove.
5372
5373         * regex.c (re_comp): Cast gettext return value to char *,
5374         Problem reported by Martin Neitzel via Mark D. Baushke.
5375
5376 2004-10-04  Simon Josefsson  <jas@extundo.com>
5377
5378         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5379         '#ifdef USE_UNLOCKED_IO'.
5380
5381 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5382
5383         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5384         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5385         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5386         regex.c, sha1.c, version-etc.c, yesno.c:
5387         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5388         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5389         the includer's responsibility.
5390
5391         Sync from coreutils.
5392
5393         * modechange.c (mode_compile): Don't decrement a pointer that
5394         points to the start of a string, as the C Standard says the
5395         resulting behavior is undefined.
5396
5397         * backupfile.h (enum backuptype): Rename none -> no_backups,
5398         simple -> simple_backups, numbered_existing ->
5399         numbered_existing_backups, numbered -> numbered_backups
5400         to avoid shadowing problems.  All uses changed.
5401         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5402         * backupfile.c (check_extension, numbered_backup):
5403         Rename locals to avoid shadowing 'basename'.
5404         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5405         once.
5406
5407         * .cppi-disable: Add getopt_.h, getopt_int.h.
5408         * .cvsignore: Add getopt.h.
5409
5410 2004-10-04  Simon Josefsson  <jas@extundo.com>
5411
5412         * memmem.h: New file.
5413         * memmem.c: New file, taken from glibc.
5414
5415 2004-10-02  Jim Meyering  <jim@meyering.net>
5416
5417         * dirfd.h, getpagesize.h: Add copyright notice.
5418
5419 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5420
5421         * snprintf.c: Remove comments as to why each header is needed.
5422
5423 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5424
5425         * strsep.h: New file.
5426         * strsep.c: New file.
5427
5428 2004-10-01  Simon Josefsson  <jas@extundo.com>
5429
5430         * snprintf.c (snprintf): Handle size==0.
5431
5432 2004-10-01  Simon Josefsson  <jas@extundo.com>
5433             Bruno Haible  <bruno@clisp.org>
5434
5435         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5436         (snprintf): Declare 'args'.
5437
5438 2004-09-30  Simon Josefsson  <jas@extundo.com>
5439
5440         * snprintf.h, snprintf.c: New files.
5441
5442 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5443
5444         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5445         (hol_entry_help): Never translate an empty string.
5446         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5447         * argp.h (OPTION_NO_TRANS): New option.
5448
5449 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5450
5451         * xvasprintf.c: Include xalloc.h.
5452         (xvasprintf): Use xalloc_die, not xmalloc_die.
5453
5454 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5455
5456         * dummy.c: Change copyright notice to FSF, and license to GPL.
5457
5458 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5459
5460         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5461         Problem reported by Bruno Haible in:
5462         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5463
5464 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5465
5466         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5467         in case some system header has #define'd it.  Problem reported by
5468         Soeren D. Schulze in
5469         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5470
5471 2004-09-08  Bruno Haible  <bruno@clisp.org>
5472
5473         * stdint_.h: New file, taken from GNU clisp.
5474
5475 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5476
5477         * xvasprintf.h: New file.
5478         * xvasprintf.c: New file.
5479         * xasprintf.c: New file.
5480
5481 2004-09-08  Bruno Haible  <bruno@clisp.org>
5482
5483         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5484         is > INT_MAX.
5485         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5486
5487 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5488
5489         Import from coreutils.
5490         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5491         strings on unbounded length.  alloca's performance benefits aren't
5492         that important here.
5493         (V_STRDUP): Remove.
5494         (parse_with_separator): New function, with most of the internals
5495         of the old parse_user_spec.  Allow user to omit both user and group,
5496         for compatibility with FreeBSD.
5497         Clone only the user name, not the entire spec.
5498         Do not set *uid, *gid unless entirely successful.
5499         Avoid memory leak in some failing cases.
5500         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5501         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5502         (parse_user_spec): Rewrite to use parse_with_separator.
5503
5504 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5505
5506         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5507         its complicated substitute.
5508         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5509         and program_invocation_name.
5510         (__argp_basename) [!_LIBC]: Remove; the only use was
5511         replaced by its body.
5512         (__argp_short_program_name): Change condition from
5513         !defined __argp_short_program_name to
5514         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5515         to match argp-namefrob.h.
5516         (__argp_failure): Don't assume strerror_r returns char *.
5517         * argp-parse.c (N_): Define unconditionally.
5518         (argp_default_options): Fill out initializers with 0 to avoid
5519         gcc warnings.
5520
5521 2004-08-12  Simon Josefsson  <jas@extundo.com>
5522
5523         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5524         * getopt_.h: Renamed from getopt.h.
5525
5526 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5527
5528         Merge from coreutils.
5529
5530         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5531         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5532         for Reliant Unix 5.43.
5533
5534         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5535         (union fooround): Use uintmax_t, not long int.
5536         The rest is a merge from libc:
5537         [defined _LIBC]: Include <shlib-compat.h>.
5538         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5539
5540         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5541
5542         * strverscmp.c: Convert to UTF-8.
5543
5544 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5545
5546         * obstack.h (obstack_empty_p):
5547         Don't assume that chunk->contents is suitably aligned.
5548         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5549         Likewise. Problem reported by Benno in
5550         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5551
5552         * chown.c (rpl_chown): Work even if the file is writeable but not
5553         readable.  This could be improved further but it'd take some work.
5554
5555 2004-08-08  Simon Josefsson  <jas@extundo.com>
5556
5557         * xgethostname.c: Don't include error.h (not used).
5558
5559         * getpass.h: Add.
5560         * getpass.c: Include getpass.h first.
5561
5562 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5563
5564         * xalloc-die.c: New files.
5565         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5566         All uses removed.
5567         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5568         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5569         (_, N_, xalloc_die): Move to xalloc-die.c.
5570         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5571         so that we needn't mess with xalloc_msg_memory_exhausted.
5572
5573         * sha1.h: Renamed from sha.h.
5574         (SHA1_H): Renamed from _SHA_H.
5575         (sha1_ctx): Renamed from sha_ctx.
5576         (sha1_init_ctx): Renamed from sha_init_ctx.
5577         (sha1_process_block): Renamed from sha_process_block.
5578         (sha1_process_bytes): Renamed from sha_process_bytes.
5579         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5580         (sha1_read_ctx): Renamed from sha_read_ctx.
5581         (sha1_stream): Renamed from sha_stream.
5582         (sha1_buffer): Renamed from sha_buffer.
5583         * sha1.c: Likewise; renamed from sha.c.
5584         Do not include <sys/types.h>.
5585         Include <stddef.h> rather than <stdlib.h>.
5586
5587 2004-08-08  Bruno Haible  <bruno@clisp.org>
5588
5589         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5590         FILESYSTEM_PREFIX_LEN.
5591         * progreloc.c: Likewise.
5592         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5593
5594 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5595
5596         Merge from tar.
5597         * argp-help.c (make_hol, hol_append): Don't assume that
5598         SIZE_MAX is a valid preprocessor constant.
5599         (__argp_basename): Change from "#ifndef _LIBC"
5600         to "#ifndef __argp_short_program_name", so that
5601         we don't compile these functions for tar.
5602
5603         More merges from coreutils.
5604         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5605         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5606         yesno.h: New files.
5607         * addext.c: Remove; no longer needed.
5608         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5609         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5610         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5611         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5612         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5613         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5614         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5615         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5616         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5617         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5618         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5619         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5620         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5621         Import changes from coreutils.
5622
5623 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5624
5625         Merge from coreutils.
5626
5627         * .gdb-history: Remove; this doesn't belong here.
5628
5629         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5630         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5631         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5632
5633         * dirname.h: Include <stdbool.h>.
5634         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5635         for consistency with POSIX terminology.  All uses changed.
5636         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5637         (strip_trailing_slashes): Use bool for booleans.
5638         * stripslash.c (strip_trailing_slashes): Likewise.
5639
5640         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5641         sometimes returns a positive errno value even when it succeeds.
5642         (print_errno_message) [!LIBC]: Fall back on strerror if
5643         __strerror_r fails.
5644
5645         * path-concat.c (mempcpy): Don't define if a system header defines it.
5646         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5647         (longest_relative_suffix): New function.
5648         (path_concat): Use it.  Assume first argument is not NULL.
5649         Port to DOS.  Omit redundant separators.
5650         Report an error instead of returning NULL.
5651         Use mempcpy instead of memcpy.
5652         (xpath_concat): Remove: not declared or used.
5653
5654         * same.h: Include <stdbool.h>
5655         (same_name): Return bool, not int.
5656         * same.c (same_name): Likewise.
5657         (errno): Don't declare; we assume C89 or better now.
5658
5659         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5660         if not already defined.
5661
5662         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5663         * dup-safer.c (errno): Likewise.
5664
5665 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5666
5667         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5668         working.
5669
5670 2004-08-03  Simon Josefsson  <jas@extundo.com>
5671
5672         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5673         * progname.h: Don't include stdbool.h.
5674
5675 2004-08-02  Simon Josefsson  <jas@extundo.com>
5676
5677         * getsubopt.h: New file, with comments from Bruno Haible.
5678         * getsubopt.c: New file, from glibc, but slightly modified based on
5679         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5680
5681 2004-08-01  Simon Josefsson  <jas@extundo.com>
5682
5683         * xgetdomainname.c: Include stdlib.h, for free().
5684
5685 2004-07-16  Simon Josefsson  <jas@extundo.com>
5686
5687         * dummy.c: New file.
5688
5689 2004-07-16  Bruno Haible  <bruno@clisp.org>
5690
5691         * backupfile.h: Add extern "C" for C++.
5692         * closeout.h: Likewise.
5693         * copy-file.h: Likewise.
5694         * findprog.h: Likewise.
5695         * full-write.h: Likewise.
5696         * pathname.h: Likewise.
5697         * progname.h: Likewise.
5698         * stpcpy.h: Likewise.
5699         * stpncpy.h: Likewise.
5700         * strcase.h: Likewise.
5701         * strstr.h: Likewise.
5702         * xalloc.h: Likewise.
5703
5704         * mbswidth.h: Add extern "C" for C++.
5705         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5706
5707 2004-07-09  Simon Josefsson  <jas@extundo.com>
5708
5709         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5710         failed without this.)
5711
5712 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5713
5714         * fchown-stub.c: New file.
5715
5716 2004-06-24  Jim Meyering  <jim@meyering.net>
5717
5718         * obstack.h (obstack_base): Cast to (void *), per documentation.
5719
5720 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5721
5722         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5723
5724 2004-06-01  Jim Meyering  <jim@meyering.net>
5725
5726         * calloc.c: New file.
5727
5728 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5729
5730         * getdate.y (yylex): Allow space between sign and number.
5731         Problem reported by Dan Jacobson.
5732
5733 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5734         and  Jim Meyering  <jim@meyering.net>
5735
5736         Merge from coreutils CVS.
5737
5738         * stat-macros.h: New file, with contents from file-type.h
5739         and coreutils' system.h.
5740         * file-type.c: Include "stat-macros.h".
5741         * file-type.h (file_type): Move all macro definitions to new file,
5742         stat-macros.h.
5743
5744         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5745         Wrap old code with this conditional.
5746         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5747         function that does not dereference symlinks.
5748         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5749
5750         * xreadlink.c: Include xreadlink.h first, to catch .h file
5751         dependency problems.
5752         (xreadlink): Accept new arg SIZE, for efficiency.
5753         All decls and uses changed.
5754         * xreadlink.h: Include <stddef.h>, for size_t.
5755
5756         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5757         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5758
5759         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5760
5761 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5762
5763         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5764         macros to be defined.
5765         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5766         the allocator returns NULL because the requested size is zero.
5767
5768 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5769
5770         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5771         var.  Add comment explaining why libc still defines it.  This
5772         merges the following patch from glibc:
5773         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5774
5775 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5776
5777         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5778         present in glibc since revision 1.1 of this file.
5779         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5780         obstack_alignment_mask, obstack_alloc, obstack_base,
5781         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5782         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5783         obstack_grow0, obstack_init, obstack_int_grow,
5784         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5785         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5786         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5787         nonexistent functions.
5788
5789 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5790             Paul Eggert  <eggert@cs.ucla.edu>
5791
5792         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5793
5794 2004-05-14  Bruno Haible  <bruno@clisp.org>
5795
5796         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5797         that consists of a '.' followed by an empty digit string.
5798         Patch by Tor Lillqvist <tml@iki.fi>.
5799
5800 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5801
5802         Port obstack to the AS/400, where pointers are 16 bytes wide and
5803         you cannot cast an integer to a valid pointer.  This patch is
5804         currently waiting to be integrated into glibc; see
5805         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5806
5807         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5808         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5809         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5810         (struct obstack): temp member is now a union of a pointer and
5811         an integer, instead of an integer.  All integer uses changed.
5812         This does not affect the physical layout of struct obstack,
5813         except on hosts (like the AS/400) where the size or alignment of
5814         void * is greater than that of ptrdiff_t.
5815         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5816         __STDC__)]: Store temporary in pointer member of union, not
5817         integer member.
5818         * obstack.c: Include <stddef.h>, for offsetof.
5819         (struct fooalign): Remove; it doesn't need a name.
5820         (union fooround): Change double to long double, and add void *.
5821         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5822         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5823         not a macro.  Hence the values are always int; so remove all
5824         casts-to-int in uses.
5825
5826 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5827             Derek Price  <derek@ximbiot.com>
5828
5829         * alloca.c: Include <alloca.h>, to get our interface.
5830         * alloca_.h: Use __alloca on AIX, so that we don't have to
5831         include <alloca.h> first.  Use C89 prototype for alloca; this
5832         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5833         Use #elif for simplicity, since we can assume C89 now.
5834         Don't try to source the system alloca.h since it will not be found
5835         and to prevent recursively including its replacement.
5836         * fnmatch.c: Include <alloca.h> instead of opencoding.
5837         * regex.c: Likewise.
5838
5839 2004-05-16  Derek Price  <derek@ximbiot.com>
5840             Paul Eggert  <eggert@cs.ucla.edu>
5841
5842         getline cleanup.  This changes the getndelim2 API: both order of
5843         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5844         no delimiter).
5845
5846         * getline.c: Don't include stddef.h or stdio.h, since our
5847         interface does that.
5848         (getline): Always use getdelim, so that we don't have two
5849         copies of this code.
5850         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5851         if available.
5852         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5853         (GETNDELIM2_MAXIMUM): New macro.
5854         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5855         instead of the old practice of delim2==0.  All callers changed.
5856         Return -1 on overflow, instead of returning junk.
5857         Do not set *linesize unless allocation succeeds.
5858         * getndelim2.h: Do not include stddef.h; no longer needed, now
5859         that we include sys/types.h.
5860         * getnline.h: Likewise.
5861         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5862         (getndelim2): Reorder arguments.
5863         * getnline.c (getnline, getndelim):
5864         Don't discard the NMAX argument.
5865         (getnline): Invoke getndelim, to avoid code duplication.
5866         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5867         of (size_t) -1 by callers of the getnline family.
5868
5869 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5870
5871         * nanosleep.c (suspended): Change its type from int to
5872         sig_atomic_t volatile.
5873         (first_call): Make it private to rpl_nanosleep, and have it
5874         be zero initially as that's a bit faster.
5875         (my_usleep): Round up fractional times instead of truncating them,
5876         as this is the usual meaning for 'sleep'.
5877
5878         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5879         doesn't work.
5880         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5881         (ENOSYS): Define if not defined.
5882         (settime): Fall back on stime if it exists and settimeofday fails.
5883         But don't bother with fallbacks if a method fails with errno == EPERM.
5884
5885 2004-05-11  Jim Meyering  <jim@meyering.net>
5886
5887         Prior to this change, the save_cwd caller required read access to the
5888         current directory on most systems (ones with the fchdir function).
5889
5890         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5891         fails, try write-only, and finally, resort to using xgetcwd.
5892
5893 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5894
5895         * obstack.c, obstack.h: Import changes from libc.
5896
5897 2004-04-28  Bruno Haible  <bruno@clisp.org>
5898
5899         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5900         implicitly appends .exe to executables.
5901         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5902         accepts Windows pathnames.
5903         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5904         Cygwin like Windows, since it now accepts Windows pathnames.
5905         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5906         Cygwin like Windows, since it now accepts Windows pathnames.
5907         Reported by Derek Robert Price <derek@ximbiot.com>.
5908
5909 2004-04-20  Jim Meyering  <jim@meyering.net>
5910
5911         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5912
5913 2004-04-20  Jim Meyering  <jim@meyering.net>
5914             Bruno Haible  <bruno@clisp.org>
5915
5916         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5917         memory when realloc fails.
5918
5919 2004-04-18  Jim Meyering  <jim@meyering.net>
5920
5921         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5922         don't leak memory and do call END_UTMP_ENT.
5923
5924 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5925
5926         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5927         (CHAR_BIT): Remove, since we assume C89.
5928         Include <stdint.h> if available, as per current Autoconf CVS advice.
5929
5930 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5931
5932         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5933         not bool, to be more consistent with Unix conventions.
5934         Suggested by Bruno Haible.
5935
5936         Merge from coreutils.
5937
5938         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5939         New files.
5940
5941         * getdate.h: Include stdbool.h, and timespec.h instead of
5942         the usual <time.h> dance.
5943         (get_date): Change signature to support fractional time stamps.
5944         All callers changed.
5945         * getdate.y: Include "getdate.h" first, as we can now
5946         assume C89 and don't need to worry about 'const'.
5947         Similarly, include "unlocked-io.h" near start, not in middle.
5948         Include <limits.h>.
5949         (textint.value): Use long int rather than int.
5950         (textint.digits): Use size_t rather than int.
5951         (BILLION, LOG10_BILLION): New constants.
5952         (parser_control): New member rel_ns.  Members day_ordinal,
5953         time_zone, month, day, hour, minutes, rel_year, rel_month,
5954         rel_day, rel_hour, rel_minutes, rel_seconds
5955         are now long int, not int.  Member seconds is now struct timespec,
5956         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5957         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5958         not int.
5959         (%union.intval): Now long int, not int.
5960         New member timespec.
5961         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5962         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5963         (spec): Now is a timespec or an item list.
5964         (timespec, items): New nonterminals.
5965         (time, rel, relunit, number, get_date):
5966         Add support for fractional seconds.
5967         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5968         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5969         (to_hour): First arg is now long int, not int.
5970         (to_year): Returns long int, not int.
5971         Don't treat year -70 like 70.
5972         (tm_diff): Returns long int, not int.
5973         (lookup_word): Use bool instead of int when appropriate.
5974         (yylex): Use size_t for count, not int.
5975         Detect overflow when parsing large integer constants.
5976         Add support for fractions.
5977         (get_date): Make pointers 'const' if possible.
5978         Use more-portable code to detect integer overflow.
5979         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5980         Don't use ctime; it's not reliable if the year has >4 digits.
5981
5982         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5983         This is for compatibility with BSD.
5984
5985         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5986         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5987         From coreutils' system.h.
5988
5989         * userspec.c: Don't include "posixver.h".
5990         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5991         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5992         compatible extension.  Simplify code by removing a boolean int
5993         that was always nonzero if a string was nonnull.
5994
5995 2004-03-30  Jim Meyering  <jim@meyering.net>
5996
5997         Merge from coreutils.
5998
5999         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6000
6001         * readtokens.c (readtoken): Don't leak 64 bytes when reading
6002         an empty input stream.
6003
6004         * readtokens.c: Include <stdbool.h>.
6005         (readtoken): Use `size_t' rather than int/long.
6006         All callers adjusted.
6007         Use `bool' rather than `int' where appropriate.
6008         Use memset rather than an explicit loop.
6009         Use x2nrealloc rather than xrealloc.
6010         Allow the use of `\0' as a delimiter.
6011         (readtokens): Likewise.
6012         * readtokens.h (readtoken, readtokens): Update prototypes.
6013
6014 2004-03-30  Bruno Haible  <bruno@clisp.org>
6015
6016         * getloadavg.c (getloadavg): Don't assume setlocale returns
6017         nonnull.
6018
6019 2004-03-29  Paul Eggert  <eggert@twinsun.com>
6020
6021         Merge changes to getloadavg.c from coreutils and Emacs.
6022
6023         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6024         Define to an expression, not to the empty string.
6025         Include cloexec.h and xalloc.h.
6026         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6027         Use set_cloexec_flag rather than rolling our own.
6028         * cloexec.c, cloexec.h: New files.
6029
6030 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6031
6032         * getopt.h: Sync with libc CVS.
6033
6034 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6035             Bruno Haible  <bruno@clisp.org>
6036
6037         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6038         not on all platforms that have <wchar.h>.
6039         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6040
6041 2004-03-09  Paul Eggert  <eggert@twinsun.com>
6042
6043         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6044         Sync with libc CVS.
6045         * getopt_int.h: New file, also synced from libc.
6046
6047 2004-03-07  Paul Eggert  <eggert@twinsun.com>
6048
6049         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
6050         '#if' expressions.  Unlike the code it replaces, it does not
6051         depend on (defined _SC_PAGESIZE).  However, it does depend on
6052         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6053         first reported by Jason Andrade in
6054         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6055
6056 2004-01-18  Simon Josefsson  <jas@extundo.com>
6057
6058         * strdup.h: New file.
6059         * strdup.c: Include it.
6060         * path-concat.c: Include strdup.h. Drop strdup declaration.
6061         * userspec.c: Include strdup.h. Drop strdup declaration.
6062
6063 2004-02-06  Karl Berry  <karl@gnu.org>
6064
6065         * config.charset: update from gettext 0.14.1.
6066
6067 2004-02-05  Paul Eggert  <eggert@twinsun.com>
6068
6069         Add comments and code, prompted by suggestions from Bruno Haible
6070         for sh-quote.
6071         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
6072         describing the enum quoting_style values.
6073         * quotearg.c (quotearg_alloc): New function.
6074         (quotearg_buffer_restyled): Treat lone { and } as special.
6075         Treat = as special.  Work around bug with older shells
6076         that "see" a '\' that is really the 2nd byte of a multibyte char.
6077         Quote empty string with shell_quoting_style.
6078
6079 2004-02-03  Bruno Haible  <bruno@clisp.org>
6080
6081         * pipe.h: New file, from GNU gettext.
6082         * pipe.c: New file, from GNU gettext.
6083
6084 2004-01-27  Bruno Haible  <bruno@clisp.org>
6085
6086         * execute.h: New file, from GNU gettext.
6087         * execute.c: New file, from GNU gettext.
6088         * w32spawn.h: New file, from GNU gettext.
6089
6090 2004-01-23  Paul Eggert  <eggert@twinsun.com>
6091
6092         Exit-status fix from coreutils.
6093
6094         Use exit_failure consistently in place of EXIT_FAILURE,
6095         so that program exit statuses are consistent on failure.
6096
6097         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6098         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6099         * argmatch.h: Comment fix to match the above.
6100         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6101         Now a macro referring to exit_failure, instead of a separate
6102         variable.  Include "exitfail.h" to get it.
6103         * xstrtol.h: Include "exitfail.h".
6104         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6105
6106         * long-options.c (parse_long_options): Use prototype
6107         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
6108         for clarity.
6109
6110 2004-01-21  Jim Meyering  <jim@meyering.net>
6111
6112         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6113         so as not to conflict with a different-sized __mktime_internal
6114         function in GNU libc.
6115         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6116         Problem building statically-linked `ls' reported by Michael Brunnbauer.
6117
6118 2004-01-18  Paul Eggert  <eggert@twinsun.com>
6119
6120         Merge from diffutils.
6121
6122         * file-type.c (file_type): Add typed memory objects.
6123         * file-type.h (S_TYPEISTMO): New macro.
6124
6125         * c-stack.h (c_stack_action): Remove argv argument.
6126         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6127         (die): Don't calculate message unless segv_action returns.
6128         (get_stack_location, min_address_from_argv, max_address_from_argv,
6129         volatile stack_base, volatile_stack_size): Remove.
6130         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6131         that every segmentation violation is a stack overflow.  (Ouch!)
6132         See Debian bug 136249 (still outstanding) for more info about why
6133         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6134
6135 2003-11-30  Bruno Haible  <bruno@clisp.org>
6136
6137         Safer stack allocation.
6138         * setenv.c: Include allocsa.h.
6139         (alloca): Remove fallback definition.
6140         (freea): Remove macro.
6141         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6142         instead of freea.
6143
6144 2003-10-17  Bruno Haible  <bruno@clisp.org>
6145
6146         * binary-io.h: Avoid warnings on Cygwin.
6147
6148 2003-12-28  Bruno Haible  <bruno@clisp.org>
6149
6150         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6151         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6152
6153 2003-11-28  Bruno Haible  <bruno@clisp.org>
6154
6155         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6156
6157 2003-11-27  Bruno Haible  <bruno@clisp.org>
6158
6159         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6160
6161 2003-11-17  Bruno Haible  <bruno@clisp.org>
6162
6163         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6164
6165 2003-11-24  Bruno Haible  <bruno@clisp.org>
6166
6167         * xallocsa.h: New file, from GNU gettext.
6168         * xallocsa.c: New file, from GNU gettext.
6169
6170 2003-11-24  Bruno Haible  <bruno@clisp.org>
6171
6172         * allocsa.h: New file, from GNU gettext.
6173         * allocsa.c: New file, from GNU gettext.
6174
6175 2003-11-24  Bruno Haible  <bruno@clisp.org>
6176
6177         * eealloc.h: New file.
6178
6179 2004-01-15  Jim Meyering  <jim@meyering.net>
6180
6181         Merge from coreutils.
6182
6183         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6184         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6185         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6186
6187         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6188         optional configure-time default.
6189
6190         * version-etc.c (version_etc_copyright): Update copyright date.
6191
6192         * xreadlink.c (xreadlink): Correct outdated comment.
6193
6194 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6195
6196         Merge from coreutils.
6197
6198         * posixver.c: Include posixver.h.
6199
6200         * same.c: Include <stdbool.h>, <limits.h>.
6201         (_POSIX_NAME_MAX): Define if not defined.
6202         (MIN): New macro.
6203         (same_name): If file names are silently truncated, report
6204         that the file names are the same if they are the same after
6205         the silent truncation.
6206
6207         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6208         conversion function.
6209         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6210         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6211         longer needed.
6212
6213 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6214
6215         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6216         with like-named macro in fnmatch.c.
6217         (EXT): Use an internal constant instead.
6218
6219         Merge fnmatch patches from glibc.
6220         * fnmatch.c (mbsinit): Remove define.
6221         Add libc_hidden_ver (__fnmatch, fnmatch).
6222         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6223         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6224
6225 2003-12-14  Karl Berry  <karl@gnu.org>
6226
6227         * config.charset: update from gettext-runtime.
6228
6229 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6230
6231         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6232         Bug reported by Alfred M. Szmidt.
6233
6234 2003-11-29  Karl Berry  <karl@gnu.org>
6235
6236         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6237
6238 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6239             Bruno Haible  <bruno@clisp.org>
6240
6241         * printf-parse.h: Don't include sys/types.h.
6242         (ARG_NONE): New macro.
6243         (char_directive): Change type of *arg_index fields to size_t.
6244         * printf-parse.c: Don't include sys/types.h.
6245         (SSIZE_MAX): Remove macro.
6246         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6247         Remove unnecessary overflow check.
6248         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6249         fields.
6250
6251 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6252
6253         * alloca.c: Remove dependency on xalloc module.
6254         (xalloc_die): Remove.
6255         (memory_full) [!defined emacs]: New macro.
6256         [!defined emacs]: Don't include xalloc.h.
6257         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6258         address arithmetic overflows.  Change datatypes a bit to avoid
6259         unnecessary casts.
6260
6261 2003-11-22  Jim Meyering  <jim@meyering.net>
6262
6263         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6264
6265 2003-11-17  Bruno Haible  <bruno@clisp.org>
6266
6267         * vasnprintf.c (alloca): Remove fallback definition.
6268         (freea): Remove definition.
6269         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6270         Reported by Paul Eggert.
6271
6272 2003-11-17  Jim Meyering  <jim@meyering.net>
6273
6274         On systems without utime and without a utimes function capable of
6275         dealing with a NULL struct utimbuf* argument, this utime replacement
6276         could -- in unusual circumstances -- leak a file descriptor.
6277         * utime.c: Include <unistd.h> and <errno.h>.
6278         (utime_null): Be sure to close `fd' and to preserve errno.
6279         Reported by Geoff Collyer via Arnold Robbins.
6280
6281 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6282             Bruno Haible  <bruno@clisp.org>
6283
6284         Protect against address arithmetic overflow.
6285         * printf-args.h: Include stddef.h.
6286         (arguments): Change type of field 'count' to size_t.
6287         * printf-args.c (printf_fetchargs): Use size_t instead of
6288         'unsigned int' where appropriate.
6289         * printf-parse.h: Include sys/types.h.
6290         (char_directive): Change type of *arg_index fields to ssize_t.
6291         (char_directives): Change type of fields 'count', max_*_length to
6292         size_t.
6293         * printf-parse.c: Include sys/types.h and xsize.h.
6294         (SSIZE_MAX): Define fallback value.
6295         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6296         instead of 'int' where appropriate. Check a_allocated, d_allocated
6297         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6298         * vasnprintf.c: Include xsize.h.
6299         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6300         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6301         overflow. Avoid wraparound when converting a width or precision from
6302         decimal to binary.
6303
6304 2003-11-16  Bruno Haible  <bruno@clisp.org>
6305
6306         Update from GNU gettext.
6307         * printf-parse.c: Generalize to it can be compiled for wide strings.
6308         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6309         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6310         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6311         SNPRINTF): New macros.
6312         Don't include <alloca.h> if the file is used inside libintl.
6313         (local_wcslen): New function, for Solaris 2.5.1.
6314         (VASNPRINTF): Use it instead of wcslen.
6315
6316 2003-11-16  Bruno Haible  <bruno@clisp.org>
6317
6318         * xsize.h (xmax): New function.
6319         (xsum, xsum3, xsum4): Declare as "pure" functions.
6320
6321 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6322
6323         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6324         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6325         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6326         heuristic is just as accurate as far as we know, and it removes a
6327         dependency on size_max.m4 and ptrdiff_max.m4.
6328
6329 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6330
6331         * xstrtol.c (__xstrtol): Remove "break" immediately after
6332         "return", to pacify some unknown compiler.  Problem reported
6333         by Joerg Schilling.
6334
6335 2003-11-11  Bruno Haible  <bruno@clisp.org>
6336
6337         * xsize.h (SIZE_MAX): Remove fallback definition.
6338         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6339         defined.
6340
6341 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6342
6343         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6344         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6345         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6346         From Bruno Haible.
6347         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6348         not (size_t) -1, since it's defined here.
6349
6350 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6351
6352         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6353         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6354         Reject sizes of exactly SIZE_MAX bytes.
6355         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6356         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6357
6358 2003-11-05  Bruno Haible  <bruno@clisp.org>
6359
6360         * xsize.h: Include limits.h, to avoid a possible collision with
6361         SIZE_MAX defined in <limits.h> on Solaris.
6362
6363 2003-11-04  Bruno Haible  <bruno@clisp.org>
6364
6365         * xsize.h: New file.
6366         * linebreak.c: Include xsize.h.
6367         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6368         argument for overflow.
6369         Suggested by Paul Eggert.
6370
6371 2003-10-31  Bruno Haible  <bruno@clisp.org>
6372
6373         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6374         to avoid (extremely rare) race condition.
6375         Suggested by Paul Eggert.
6376
6377 2003-11-03  Jim Meyering  <jim@meyering.net>
6378
6379         * userspec.c: Include "userspec.h".
6380         * userspec.h: New file.
6381
6382 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6383
6384         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6385         * mountlist.c (SIZE_MAX): Define if not defined already.
6386         (read_filesystem_list): Set and use me_type_malloced.
6387         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6388         whatever the type happens to be), for brevity and consistency.
6389         Check for size calculation overflow on Alphas running OSF/1.
6390
6391 2003-10-31  Jim Meyering  <jim@meyering.net>
6392
6393         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6394
6395         * linebuffer.c: Include <string.h> for declaration of memset.
6396
6397 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6398             Bruno Haible  <bruno@clisp.org>
6399
6400         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6401         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6402
6403 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6404
6405         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6406         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6407         no longer needed.
6408         * quotearg.c (quotearg_n_options): Use it.
6409         * group-member.c: Include <stdbool.h>.
6410         (free_group_info): Arg is now const *; don't free arg.
6411         (get_group_info): Now returns bool and accepts struct group_info *,
6412         rather than returning a malloc'ed struct group_info *.
6413         All uses changed.  Check for overflow in internal size calculation.
6414
6415         * getusershell.c (readname): Simplify the code by using x2nrealloc
6416         rather than xmalloc/xrealloc.
6417         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6418         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6419         conformance bug: the old code used a pointer after freeing the
6420         storage that it addressed.
6421         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6422         rather than doing it by hand.
6423         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6424         the buffer preserved.  Use free and xmalloc instead.
6425         * quotearg.c (quotearg_n_options): Likewise.
6426         Use a simpler test for size overflow.  Don't use xalloc_oversized
6427         because unsigned int might be wider than size_t (!); this suggests
6428         that we should switch from unsigned int to size_t for slot numbers.
6429
6430 2003-10-27  Bruno Haible  <bruno@clisp.org>
6431
6432         * stdbool_.h: Better support for BeOS.
6433
6434 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6435
6436         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6437         to allocate the returned structure.  Do not allocate a subarray,
6438         as x2nrealloc will do that.
6439         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6440         instead of xnrealloc.
6441         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6442
6443 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6444
6445         * xalloc.h (xalloc_oversized): New static inline function, for
6446         callers that want to do their own size-overflow checking.  Include
6447         <stdbool.h>, since xalloc_oversized returns bool.
6448         * xalloc.c (array_size_overflow): Remove.  All callers changed
6449         to use xalloc_oversized.
6450
6451         Add two functions x2realloc, x2nrealloc, for programs that grow
6452         arrays dynamically by doubling their sizes.
6453         * xalloc.h (x2realloc, x2nrealloc): New decls.
6454         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6455         New functions.
6456
6457         Port to C99 semantics for 'inline' of external functions.
6458         Bug reported by Bruno Haible.
6459         * xmalloc.c (xnmalloc_inline): New static inline function,
6460         with the old contents of xnmalloc.
6461         (xnmalloc, xmalloc): Use it.
6462         (xnrealloc_inline): New static inline function,
6463         with the old contents of xnrealloc.
6464         (xnrealloc, xrealloc): Use it.
6465
6466         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6467
6468 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6469
6470         Fix several address-calculation bugs in the hash modules,
6471         plus some minor code cleanup.
6472
6473         * hash.h: Include <stdbool.h>, for bool.
6474         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6475         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6476         hash_get_n_entries, hash_get_max_bucket_length,
6477         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6478         hash_rehash): Use size_t rather than unsigned.
6479         * hash.c (struct hash_table, hash_get_n_buckets,
6480         hash_get_n_buckets_used, hash_get_n_entries,
6481         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6482         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6483         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6484         Likewise.
6485         (SIZE_MAX): Define if not defined.
6486         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6487         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6488         hash_print):
6489         Use const * when possible.
6490         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6491         (check_tuning): Fix bug: if tuning parameters were very close to
6492         0 or 1, rounding errors could have caused subscript violations.
6493         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6494         (hash_initialize): Add 'fail:' label
6495         to free table and return NULL, and use it to simplify code.
6496         Use calloc rather than clearing the storage ourself.
6497         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6498         buffer size calculations.
6499         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6500         Include <stddef.h>, for size_t.
6501         * hash-pjw.c (hash_pjw): Likewise.
6502         Switch to method described by Bruno Haible.
6503         Include <limits.h>, for CHAR_BIT.
6504         (SIZE_BITS): New macro.
6505
6506 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6507
6508         * getndelim2.c (getndelim2): When size calculation overflows,
6509         ceiling the allocation at NMAX bytes rather than silently
6510         discarding input bytes before NMAX is reached.  This makes
6511         a difference only if NMAX exceeds SIZE_MAX / 2.
6512
6513         * obstack.c: Merge from glibc.
6514         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6515         Add libc_hidden_def (_obstack_newchunk).
6516         (_obstack_free) [! defined _LIBC]: Remove.
6517         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6518         a clone of the function body.
6519         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6520         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6521
6522         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6523         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6524         arg to memcpy.
6525
6526         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6527         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6528         Don't use lvalue casts, as GCC plans to remove support for them
6529         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6530         was also present in the non-GCC version, indicating that this
6531         code had always been buggy and had never been widely used.
6532         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6533         Use the fast variant of each macro, rather than copying the
6534         definiens of the fast variant; that way, we'll be more likely to
6535         catch future bugs in the fast variants.
6536
6537 2003-10-20  Bruno Haible  <bruno@clisp.org>
6538
6539         * wait-process.h: New file, from GNU gettext.
6540         * wait-process.c: New file, from GNU gettext.
6541
6542 2003-10-19  Jim Meyering  <jim@meyering.net>
6543
6544         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6545
6546 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6547
6548         * getgroups.c: Include <errno.h>, <stdlib.h>.
6549         (getgroups): First arg is int, not size_t.
6550         Don't let 'free' mangle errno.
6551
6552 2003-10-16  Jim Meyering  <jim@meyering.net>
6553
6554         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6555
6556 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6557
6558         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6559         (SIZE_MAX): Remove.
6560         (new_exclude, add_exclude_file): Initial size no longer needs to
6561         be a power of 2.
6562         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6563         our own address arithmetic overflow checking.
6564
6565         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6566         (fnmatch): Do not alloca more than 2000 wide characters;
6567         instead, use malloc for large buffers.
6568         Check for address arithmetic overflow, and return -1
6569         with errno set to ENOMEM in that case.
6570         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6571         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6572         instead, return -1.  Check for address arithmetic overflow.
6573
6574 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6575
6576         Handle invalid suffixes and overflow independently, so that
6577         callers can treat them independently as needed.  Fix some bugs in
6578         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6579         suffix for a human-readable blocksize.  The major caller-visible
6580         change is the addition of a new
6581         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6582         that both overflow and suffix chars were found.
6583
6584         * human.c (humblock): Don't check separately for invalid suffix
6585         char; that is xstrtoumax's job (now that its bug is fixed).
6586         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6587         INTMAX_MAX]: New macros.
6588         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6589         TYPE_MAXIMUM): New macros.
6590         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6591         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6592         if overflow occurs, as it's what __strtol does and it's more useful
6593         in practice.
6594         (__xstrtol): If __strtol reports some error other than ERANGE,
6595         reflect it to the caller as LONGINT_INVALID.  If it reports
6596         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6597         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6598         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6599         value.
6600         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6601         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6602         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6603         [defined UINTMAX_MAX]: New macros.
6604
6605 2003-10-14  Bruno Haible  <bruno@clisp.org>
6606
6607         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6608         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6609         Also use volatile where needed.
6610
6611 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6612
6613         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6614         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6615         and define in terms of the other primitives.
6616         * xmalloc.c: Include stdbool.h; do not include exit.h.
6617         (SIZE_MAX): Define if not already defined.
6618         (array_size_overflow): New function.
6619         (xalloc_die): Abort instead of exiting if 'error' returns.
6620         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6621         (xmalloc, xrealloc): Use them.
6622         (xcalloc): Check for address arithmetic overflow.
6623         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6624         a bit faster than strcpy.
6625
6626 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6627
6628         Merge getpass from libc, plus a few fixes.
6629
6630         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6631         Include <stdbool.h>.
6632         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6633         __fsetlocking to empty.
6634         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6635         do include <bits/libc-lock.h>.
6636         Do not include <fcntl.h>; not needed.
6637         [_LIBC]: Include <wchar.h>.
6638         (NOTCANCEL_MODE): New macro.
6639         (flockfile, funlockfile) [_LIBC]: New macros.
6640         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6641         [!_LIBC]: New macros.
6642         (call_fclose): New function.
6643         (getpass): Use it.  Save tty stream separately; this simplifies the
6644         code and makes it more reliable if stdin happens to equal stdout.
6645         Invoke __fsetlocking on tty.
6646         Handle thread cancellation if needed.
6647         Namespace cleanup (use __tcgetattr, __getline).
6648         Use bool for Booleans.
6649         [USE_IN_LIBIO]: Handle wide streams.
6650         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6651         stream might go where.
6652
6653         * unlocked-io.h: Include <stdio.h>, so that the caller
6654         doesn't have to include <stdio.h> before us.
6655         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6656         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6657         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6658         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6659         if not declared, so that we can use getpass.c code from libc without
6660         rewriting it.
6661         (flockfile, ftrylockfile, funlockfile): New macros.
6662
6663 2003-10-06  Bruno Haible  <bruno@clisp.org>
6664
6665         * version-etc-2.h: Remove file.
6666         * version-etc-2.c: Remove file.
6667
6668 2003-09-25  Jim Meyering  <jim@meyering.net>
6669             Bruno Haible  <bruno@clisp.org>
6670
6671         This lets translators provide better translations for the
6672         "Written by ..." part of --version output.
6673         * version-etc.h: Include stdarg.h.
6674         (version_etc_copyright): Declare as readonly.
6675         (version_etc): Make this function variadic with a NULL-terminated list
6676         of author name strings.
6677         (version_etc_va): New declaration.
6678         * version-etc.c: Include stdarg.h, stdlib.h.
6679         (version_etc_copyright): Declare as readonly.
6680         (version_etc_va): New function. Provide a different translatable string
6681         for each possible number of authors < 10. Abbreviate when there are 10
6682         authors or more.
6683         (version_etc): Make this function variadic. Call version_etc_va.
6684         Suggestion from Gary V. Vaughan.
6685
6686         * long-options.h (parse_long_options): Change prototype: the authors
6687         string is moved to the end and becomes variadic.
6688         * long-options.c: Include stdarg.h.
6689         (parse_long_options): Make this function variadic, too.
6690         Call version_etc_va, not version_etc.
6691
6692 2003-10-06  Bruno Haible  <bruno@clisp.org>
6693
6694         * fatal-signal.h: New file, from GNU gettext.
6695         * fatal-signal.c: New file, from GNU gettext.
6696
6697 2003-10-04  Karl Berry  <karl@gnu.org>
6698
6699         * argp*: update from libc.
6700
6701 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6702
6703         * getpass.c (getpass): Use a no-op fseek when switching from input to
6704         output mode on the same stream.
6705
6706 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6707
6708         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6709         Fix arg typo in previous patch.
6710
6711 2003-09-28  Jim Meyering  <jim@meyering.net>
6712
6713         * error.c: Correct cpp indentation.
6714
6715 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6716
6717         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6718         Omit the special code that used __typeof__, since we worry that
6719         it could be more trouble than it's worth.  See:
6720         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6721         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6722
6723         * free.c: New file.
6724
6725 2003-09-26  Jim Meyering  <jim@meyering.net>
6726
6727         * error.c (error_tail): Move some declarations
6728         into inner scope where the local variables are used.
6729
6730 2003-09-26  Bruno Haible  <bruno@clisp.org>
6731
6732         * stpncpy.h (gnu_stpncpy): New declaration.
6733         (stpncpy): Define as alias for gnu_stpncpy.
6734         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6735
6736 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6737
6738         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6739         (error_tail): Do not loop, reallocating temporary buffer, since
6740         the output cannot contain more wide characters than the input
6741         contains bytes, the size must be big enough already.  This avoids
6742         one potential size overflow calculation.  Check for size overflow
6743         when calculating temporary buffer size.  Free temporary buffer
6744         when done, if it was allocated with malloc; this plugs a memory
6745         leak.  Remove casts from void * to pointers, that are no longer
6746         needed now that we're assuming C89 or better.
6747
6748         Merge error changes from glibc.
6749
6750         * error.c, error.h: Update copyright notice header to match glibc.
6751         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6752         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6753         Disable cancellation while printing error.
6754         * error.h: Prepend __ to parameter names.
6755
6756 2003-09-25  Karl Berry  <karl@gnu.org>
6757
6758         * argp-fmtstream.c, argp-help.c: update from libc.
6759
6760 2003-09-25  Bruno Haible  <bruno@clisp.org>
6761
6762         * version-etc-2.h: New file, from version-etc.h with modifications.
6763         * version-etc-2.c: New file, from version-etc.c with modifications.
6764
6765 2003-09-25  Simon Josefsson  <jas@extundo.com>
6766
6767         * xgetdomainname.h: New file.
6768         * xgetdomainname.c: New file.
6769
6770 2003-09-25  Simon Josefsson  <jas@extundo.com>
6771             Bruno Haible  <bruno@clisp.org>
6772
6773         * getdomainname.h: New file.
6774         * getdomainname.c: New file.
6775
6776 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6777
6778         * linebuffer.c (freebuffer): Don't free the argument, just
6779         the buffer associated with the argument.  Bug reported by
6780         Simon Josefsson.
6781
6782 2003-09-19  Karl Berry  <karl@gnu.org>
6783
6784         * argp.h: update from libc.
6785
6786 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6787
6788         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6789         input error, instead of returning NULL the next time we are called
6790         (and therefore losing track of errno).
6791
6792 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6793
6794         * getndelim2.c (getndelim2): Don't trash errno when a read
6795         fails, so that the caller gets the proper errno.
6796
6797         * readutmp.c (read_utmp): Likewise.
6798         Check for fstat error.  Close stream and free storage
6799         when failing.
6800
6801 2003-09-14  Bruno Haible  <bruno@clisp.org>
6802
6803         * fwriteerror.h: New file.
6804         * fwriteerror.c: New file.
6805
6806 2003-09-14  Jim Meyering  <jim@meyering.net>
6807
6808         * getloadavg.c: Correct cpp indentation.
6809         * strdup.c: Likewise.
6810         * vasnprintf.c: Likewise.
6811
6812 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6813
6814         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6815         * obstack.c [!defined _LIBC]: Likewise.
6816         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6817         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6818         * exitfail.c: Don't include stdlib.h; no longer needed.
6819
6820         More changes to assume C89 or better.
6821
6822         * error.c (error_tail): Assume vprintf.
6823
6824         * argmatch.c (getenv): Remove decl.
6825         * progreloc.c (get_full_program_name): Define via prototype.
6826         * setenv.c (clearenv): Likewise.
6827         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6828         needed.
6829         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6830         (malloc, memcpy): Remove decls.
6831         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6832         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6833         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6834         (memcpy): Remove macro.
6835         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6836         (__P): Remove.  All uses removed.
6837         (PTR): Remove.  All uses changed to void *.
6838         (CHAR_BIT, NULL): Remove.
6839         (spaces, zeros, memset_space, memset_zero)
6840         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6841         Remove.
6842         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6843         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6844         Define with prototype.
6845         Remove now-unnecessary prototype decl.
6846         (extra_args_spec): Assume ANSI C.  All uses changed.
6847         (extra_args_spec_iso): Remove.
6848         (my_strftime, emacs_strftimeu): Define via prototype.
6849         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6850         unconditionally.
6851         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6852         * strtoimax.c: Include <stdlib.h> unconditionally.
6853         (strtoul, strtol): Remove decls.
6854         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6855         LONG_MAX): Remove.
6856         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6857         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6858         (LOCALE_PARAM_PROTO): New macro.
6859         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6860         (INTERNAL (strtol), strtol): Define with a prototype.
6861         (PARAMS): Remove.  All uses removed.
6862         * tempname.c: Include <string.h> unconditionally.
6863         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6864         * xgethostname.c (main): Define with a prototype.
6865         * xmalloc.c: Include "xalloc.h" first, to check interface.
6866         Include <stdlib.h> unconditionally.
6867         (calloc, malloc, realloc, free): Remove decls.
6868         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6869         Include <stdlib.h> unconditionally.  Sort include file names.
6870         (strtod): Remove.
6871         (xstrtod): Define with a prototype.
6872         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6873         (strtol, strtoul): Remove decls.
6874
6875 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6876
6877         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6878         Include <stdlib.h>, <string.h> unconditionally.
6879         Remove now-unnecessary cast to char *.
6880         * strnlen.c: Include <string.h> unconditionally.
6881         * yesno.c (yesno): Define with a prototype.
6882
6883 2003-09-10  Bruno Haible  <bruno@clisp.org>
6884
6885         * strcspn.c: Include <string.h> unconditionally.
6886         * strpbrk.c: Include <string.h> unconditionally.
6887         * strstr.c: Include <string.h> unconditionally.
6888         * unicodeio.c: Include <string.h> unconditionally.
6889         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6890         * unsetenv.c: Likewise.
6891         * xreadlink.c: Include <stdlib.h> unconditionally.
6892         * yesno.c: Include <stdlib.h> unconditionally.
6893         (rpmatch): Add prototype.
6894
6895 2003-09-10  Jim Meyering  <jim@meyering.net>
6896
6897         * error.c: Correct indentation of cpp directives.
6898
6899 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6900
6901         More K&R removal.
6902
6903         * acosl.c (main): Use a prototype.
6904         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6905         tanl.c: Likewise.
6906
6907         * getloadavg.c (getloadavg, main): Define via prototypes.
6908
6909         * getopt.h (struct option.name): Assume C89, and use 'const'.
6910         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6911         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6912         with a prototype.
6913         * getopt.c (const): Remove macro.
6914         Include <string.h> unconditionally.
6915         (my_index): Remove; all uses changed to strchr.
6916         (strlen): Remove decl.
6917         (exchange): Remove forward decl; no longer needed.
6918         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6919         Define with prototype.
6920         * getopt1.c (const): Remove macro.
6921         (getopt_long, getopt_long_only, main): Define with prototype.
6922
6923         * getugroups.c: Include <string.h> unconditionally.
6924
6925         * getusershell.c: Include <stdlib.h> unconditionally.
6926         (getusershell, setusershell, endusershell, readname, main):
6927         Define with prototypes.
6928
6929         * group-member.c: Include group-member.h first.
6930         Include <stdlib.h> unconditionally.
6931
6932         * hard-locale.c: Include hard-locale.h first.
6933         Include <stdlib.h>, <string.h> unconditionally.
6934
6935         * hash.c (free, malloc): Remove decls.
6936         Include <stdlib.h> unconditionally.
6937
6938         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6939         (getenv): Do not declare.
6940
6941         * idcache.c: Include <string.h> unconditionally.
6942
6943         * long-options.c: Include long-options.h first, to test interface.
6944         Include <stdlib.h> unconditionally.
6945
6946         * makepath.c: Include makepath.h first, to test interface.
6947         Include <stdlib.h> and <string.h> unconditionally.
6948
6949         * linebuffer.c: Include <stdlib.h>.
6950         (free): Remove decl.
6951
6952         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6953         rpl_malloc returns void *, not char *.
6954         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6955
6956         * md5.h: Include <limits.h> unconditionally.
6957         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6958         (__P): Remove; all uses removed.
6959         * md5.c: Include "md5.h" first.
6960         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6961         md5_buffer, md5_process_bytes, md5_process_block):
6962         Define with prototypes.
6963         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6964         * sha.c: Include "sha.h" first.
6965         Include <stdlib.h>, <string.h> unconditionally.
6966
6967         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6968         * memcmp.c (__ptr_t): Likewise.
6969         * memrchr.c (__ptr_t): Likewise.
6970         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6971         Include <string.h> unconditionally.
6972         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6973         * memchr.c: Include <stdlib.h> unconditionally.
6974         * memchr.c (LONG_MAX): Remove.
6975         * memrchr.c (LONG_MAX): Likewise.
6976         * memchr.c (__memchr): Define via a prototype.
6977         * memrchr.c (__memrchr): Likewise.
6978         * memcmp.c (__P): Remove, and remove all uses.
6979         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6980         Remove forward decls; no longer needed.
6981         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6982         Use types required by C89 in prototype.
6983
6984         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6985         * savedir.c: Likewise.
6986         * mkdir.c (free): Remove decl.
6987         * rmdir.c (rmdir): Define with a prototype.
6988         * savedir.c: Include savedir.h first, to test interface.
6989
6990         * mktime.c (STDC_HEADERS): Remove.
6991         Include <stdlib.h>, <string.h> unconditionally.
6992
6993         * modechange.c: Include <stdlib.h> unconditionally.
6994         (malloc): Remove decl.
6995
6996         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6997         (free): Remove decl.
6998
6999         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7000         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7001         (This type really should be intptr_t, but that's a C99ism.)
7002         (_obstack_memcpy): Remove: all uses changed to memcpy.
7003         Include <string.h> unconditionally.
7004         (struct obstack): Assume __STDC__ for types of members
7005         chunkfun, freefun, extra_arg.
7006         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7007         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7008         obstack_begin, obstack_specify_allocation,
7009         obstack_specify_allocation_with_arg, obstack_chunkfun,
7010         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7011         Remove unprototyped decls and the macros that use them.
7012         * obstack.c (POINTER): Remove.  All uses changed to void *.
7013         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7014         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7015         (defined __STDC__ && __STDC__)]:
7016         Remove nonprototyped code.
7017         Include <stdlib.h> unconditionally.
7018         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7019         _obstack_allocated_p, _obstack_free, obstack_free,
7020         _obstack_memory_used, print_and_abort):
7021         Define using prototypes.
7022         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7023         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7024         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7025         obstack_next_free, obstack_object_size, obstack_room) [0]:
7026         Remove unused, unprototyped code.
7027
7028         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7029
7030         * physmem.c (physmem_total, physmem_available, main): Define
7031         with prototypes.
7032
7033         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7034         (main): Define with a prototype.
7035
7036         * posixver.c (getenv): Remove decl.
7037
7038         * putenv.c (malloc): Returns void *, not char *.
7039         Include <string.h> unconditionally.
7040         (strchr, memcpy, NULL): Do not define.
7041
7042         * readtokens.c: Include readtokens.h first, to test interface.
7043         Include <stdlib.h>, <string.h> unconditionally.
7044         (init_tokenbuffer): Define with a prototype.
7045
7046         * regex.c (PARAMS): Remove.  All uses removed.
7047         All uses of _RE_ARGS removed, too.
7048         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7049         unconditionally.
7050         (bzero): Assume memset exists.
7051         (memcmp, memcpy, NULL): Remove.
7052         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7053         char, or assignments to local vars of type signed char.
7054         (init_syntax_once, PREFIX(extract_number_and_incr),
7055         PREFIX(print_partial_compiled_pattern),
7056         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7057         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7058         PREFIX(regex_grow_registers), PREFIX(regex_compile),
7059         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7060         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7061         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7062         wcs_compile_range, byte_compile_range, truncate_wchar,
7063         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7064         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7065         count_mbs_length, wcs_re_match_2_internal,
7066         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7067         PREFIX(alt_match_null_string_p),
7068         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7069         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7070         regfree, PREFIX(extract_number)): Define with prototype.  Remove
7071         now-unnecessary declaration, if any.
7072         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7073         regcomp, regexec):
7074         Remove now-unnecessary casts among pointer types.
7075         * regex.h (_RE_ARGS): Remove.  All uses removed.
7076
7077         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7078         (free): Remove decl.
7079
7080         * rpmatch.c: Include <stdlib.h> unconditionally.
7081
7082         * same.c: Include <stdlib.h>, <string.h> unconditionally.
7083         (free): Remove decl.
7084
7085         * save-cwd.c: Include <stdlib.h> unconditionally.
7086         * xgetcwd.c: Likewise.
7087
7088         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7089         (free): Remove decl.
7090
7091         * strchrnul.c (strchrnul): Define with a prototype.
7092         Fix bug: c_in was not converted to char before searching.
7093
7094         The following changes are not K&R related:
7095
7096         * group-member.h: Include <sys/types.h>, so that this file is
7097         self-contained.
7098         * makepath.h: Likewise.
7099
7100         * getusershell.c (readname, default_index, line_size, readname):
7101         Use size_t, not int, for sizes.
7102         (readname): If the size overflows, report an error instead of
7103         looping forever.
7104
7105 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
7106
7107         * getndelim2.c: Assume stdlib.h per the C89 spec.
7108
7109 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7110
7111         Assume C89 or better; remove K&R cruft.
7112         A few of these changes were first proposed by Derek Robert Price
7113         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7114
7115         * addext.c: Include <string.h> unconditionally.
7116         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7117         Don't declare getenv or malloc.
7118
7119         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7120         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7121         (NULL): Remove.
7122         (find_stack_direction, alloca): Use prototypes.
7123
7124         * atexit.c (atexit): Define using a prototype.
7125
7126         * basename.c, dirname.c, stripslash.c:
7127         Include <string.h> unconditionally.
7128
7129         * bcopy.c: Include <stddef.h>.
7130         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7131
7132         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7133
7134         * error.h (error, error_at_line, error_print_progname)
7135         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7136         * error.c: Include error.h first, to check interface.
7137         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7138         (VA_START): Remove; all uses changeed to va_start.
7139         (exit, strerror): Remove decls.
7140         (error_print_progname): Prototype uncondionally.
7141         Don't include <errno.h>; no longer needed.
7142         (private_strerror): Remove.
7143         (error_tail): Always define.
7144         (error, error_at_line): Assume C89 or better; always use prototypes.
7145         * fatal.c: Include "fatal.h" first, to test interface.
7146         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7147         (VA_START): Remove; all uses changed to va_start.
7148         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7149         this case.
7150         (exit): Remove decl.
7151         (fatal): Prototype unconditionally.  Assume va_start works.
7152         Abort at end, to pacify gcc.
7153
7154         * euidaccess.c (main): Define with a prototype.
7155
7156         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7157
7158         * exitfail.c: Include <stdlib.h> unconditionally.
7159
7160         * fnmatch_.h (__P): Remove.  All uses changed to assume
7161         prototypes.
7162         * fnmatch.c: Include fnmatch.h first, to test interface.
7163         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7164         (getenv): Remove decl.
7165         (fnmatch): Define using a prototype.
7166         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7167         (FCT): Define using a prototype.
7168
7169         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7170
7171         * gethostname.c: Include <stddef.h>.
7172         (gethostname): Define with prototype.  Length is size_t, not int.
7173
7174 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7175
7176         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7177         getversion.c should have been removed then, but was accidentally
7178         preserved.
7179
7180         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7181         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7182
7183 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7184
7185         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7186         copy_tm_result.  Bug reported by Simon Josefsson in
7187         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7188
7189 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7190
7191         * time_r.c, time_r.h: New files.
7192
7193         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7194         __localtime_r.
7195         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7196         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7197
7198         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7199         __gmtime_r.
7200         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7201         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7202         Include <time_r.h>.
7203
7204         * timegm.c: Switch to glibc implementation, with the following changes:
7205         [defined HAVE_CONFIG_H]: Include <config.h>.
7206         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7207         (__mktime_internal) [!defined _LIBC]: New decl.
7208         (__gmtime_r) [!defined _LIBC]: New macro and function.
7209         (timegm): Use a prototype, since gnulib assumes C89.
7210         Do not bother declaring tmp to be const, as it's not really usefu.
7211         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7212         (timegm): Declare only if HAVE_DECL_TIMEGM.
7213
7214 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7215
7216         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7217         Bug reported by Lute Kamstra in
7218         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7219
7220         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7221         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7222         course with correspondingly smaller numbers for tomorrow and
7223         yesterday.  From Tadayoshi Funaba.  Originally installed into
7224         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7225         coreutils merge?).
7226
7227 2003-08-31  Simon Josefsson  <jas@extundo.com>
7228
7229         * timegm.h: New file.
7230         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7231
7232 2003-08-31  Karl Berry  <karl@gnu.org>
7233
7234         * argp.h: update from libc.
7235
7236 2003-08-28  Bruno Haible  <bruno@clisp.org>
7237
7238         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7239         warning on QNX, which defines O_BINARY to 000000.
7240
7241 2003-08-24  Bruno Haible  <bruno@clisp.org>
7242
7243         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7244         MSVC7 <stdio.h> is included later.
7245
7246 2003-08-20  Bruno Haible  <bruno@clisp.org>
7247
7248         * progname.h: New file, from GNU gettext.
7249         * progname.c: New file, from GNU gettext.
7250         * progreloc.c: New file, from GNU gettext.
7251
7252 2003-08-19  Bruno Haible  <bruno@clisp.org>
7253
7254         * xstrdup.c: Assume <string.h> exists.
7255
7256 2003-08-18  Jim Meyering  <jim@meyering.net>
7257
7258         * setenv.h: Indent nested cpp directive.
7259         * vasnprintf.c: Remove trailing blanks.
7260
7261 2003-08-17  Simon Josefsson  <jas@extundo.com>
7262             Bruno Haible  <bruno@clisp.org>
7263
7264         * xstrndup.h: New file.
7265         * xstrndup.c: New file.
7266
7267 2003-08-17  Bruno Haible  <bruno@clisp.org>
7268
7269         * strndup.h: New file.
7270
7271 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7272
7273         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7274         space, undoing this 2003-08-12 change:
7275         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7276
7277 2003-08-16  Jim Meyering  <jim@meyering.net>
7278
7279         Merge from coreutils.
7280         * xstrtoimax.c: #else #if -> #elif.
7281         * xstrtoumax.c: Likewise.
7282
7283 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7284
7285         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7286         rather than tab, after '#' in shell-script copyright notices.
7287         Suggested by Bruno Haible.
7288
7289 2003-08-15  Jim Meyering  <jim@meyering.net>
7290         and Paul Eggert  <eggert@twinsun.com>
7291
7292         Merge from coreutils.
7293         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7294         member but strut utmpx does not.  Needed for AIX 4.3.3.
7295         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7296
7297 2003-08-15  Jim Meyering  <jim@meyering.net>
7298
7299         Merge from coreutils.
7300         * xgethostname.c: Include <stdlib.h>.
7301         (xghostname): Don't exit for anything other than memory-related
7302         failure; just return NULL.
7303         * userspec.c: Include "posixver.h".
7304         (parse_user_spec): Accept `.' as a separator only
7305         in pre-POSIX-200112 mode.
7306         * strtoimax.c: Use #elif rather than #else #if.
7307         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7308         Remove function, now that we can rely on a working tzset function.
7309         [!_LIBC]: Ensure that the required autoconf test has been run.
7310         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7311         Use underlying_strftime for %r.
7312         * sha.c: Merge in some clean-up and optimization changes from glibc.
7313         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7314         Ensure that it is a multiple of 64.
7315         Rearrange loop exit tests so as to avoid performing an
7316         additional fread after encountering an error or EOF.
7317         * realloc.c: Update copyright date.
7318
7319 2003-08-14  Jim Meyering  <jim@meyering.net>
7320
7321         Merge from coreutils.
7322         * obstack.h: Whitespace changes.
7323         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7324         and xcalloc return values.
7325         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7326         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7327         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7328         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7329         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7330         error from mntctl.
7331         Use mntctl's return value to drive the entry-processing loop, since
7332         we can't rely on the value of the vmt_length member in the last
7333         entry.  On some systems doing so could result in exhausting
7334         virtual memory.  Based in part on a patch from Mike Jetzer.
7335
7336 2003-08-14  Jim Meyering  <jim@meyering.net>
7337         and Paul Eggert  <eggert@twinsun.com>
7338
7339         Merges from coreutils, plus other fixes.
7340         * physmem.c: Merge in portability changes from gcc/libiberty
7341         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7342         for credits and details.  Thanks to Kaveh Ghazi for helping
7343         to keep these files in sync.
7344         (ARRAY_SIZE): Define it.
7345         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7346         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7347         (memcasecmp): Don't assume size_t fits in unsigned int.
7348         Remove casts and duplicate code.
7349         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7350         (memcpy): Remove definition.
7351         Merge in some clean-up and optimization changes from glibc.
7352         [BLOCKSIZE]: Move definition to top of file.
7353         Ensure that it is a multiple of 64.
7354         Rearrange loop exit tests so as to avoid performing an
7355         additional fread after encountering an error or EOF.
7356         * md5.h (md5_uintptr): Define.
7357         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7358         return to the initial working directory.  Preserve errno
7359         for caller.
7360         * idcache.c: Include "xalloc.h".
7361         (xmalloc, xrealloc): Remove decls.
7362         (getuser): Remove casts no longer required in C89.
7363         * human.c: Include stdio.h, for sprintf.
7364         * group-member.c: Include "xalloc.h".
7365         (xmalloc, xrealloc): Remove decls.
7366         (get_group_info): Remove casts no longer required in C89.
7367         * getusershell.c (readname): Remove casts no longer required in C89.
7368         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7369         * getline.c: Whitespace fix, from coreutils.
7370
7371 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7372
7373         * exclude.c: Include <ctype.h>
7374         (IN_CTYPE_DOMAIN): New macro.
7375         (is_space): New fn.
7376         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7377         and empty lines.
7378
7379         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7380         Undo previous (whitespace-only) change.
7381
7382 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7383
7384         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7385         Normalize leading white space and remove trailing white space.
7386         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7387         notice, as per ../config/srclist-update.
7388
7389         Merge from coreutils.
7390         * euidaccess.h: New file.
7391         * euidaccess.c: Include it.
7392         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7393         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7394         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7395
7396 2003-08-11  Bruno Haible  <bruno@clisp.org>
7397
7398         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7399         (vasnprintf): Use it instead of wcslen.
7400
7401 2003-08-11  Bruno Haible  <bruno@clisp.org>
7402
7403         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7404         value to ensure that _Bool promotes to int. Use #define for _Bool when
7405         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7406
7407 2003-08-10  Karl Berry  <karl@gnu.org>
7408
7409         * regex.h: update from libc (whitespace fix).
7410
7411 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7412
7413         Merge some files from coreutils.  These changes were
7414         originally made by Jim Meyering.
7415         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7416         many older Unixes require this.
7417         * alloca.c (alloca): Remove cast to argument of free;
7418         no longer needed in C89.
7419         * alloca_.h, regex.h: Fix white space to match
7420         what GNU indent does.
7421
7422 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7423
7424         * bumpalloc.h: Remove.
7425
7426 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7427
7428         * getloadavg.c: Change copyright notice and spacing to conform to
7429         GNU coding style.
7430
7431         Merge from coreutils.
7432         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7433         From glibc.
7434         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7435         from Karl Berry, implemented by Jim Meyering.
7436         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7437         from Dmitry V. Levin.
7438         Remove anachronistic cast of xrealloc.
7439         * fnmatch_.h (__const): Remove.  Use 'const'.
7440         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7441         type. Otherwise, it wouldn't compile with at least /bin/cc on
7442         ymp-cray-unicos9.0.2.X.
7443         Combine two mostly-identical uses of alloca into one.
7444         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7445
7446 2003-08-04  Dave Love <d.love@dl.ac.uk>
7447
7448         [From Emacs.]
7449
7450         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7451         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7452         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7453         obsolete NLIST_NAME_UNION.
7454         [__GNU__]: Undef BSD and FSCALE.
7455         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7456
7457 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7458
7459         * stdbool_.h (_Bool): Make it signed char, instead of
7460         an enum type, so that it's guaranteed to promote to int.  See:
7461         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7462
7463 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7464
7465         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7466         (strerror): Don't assume that a printable int fits in 14 bytes.
7467
7468 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7469             Bruno Haible  <bruno@clisp.org>
7470
7471         * getline.h (getline, getdelim): Change return type to ssize_t.
7472         * getline.c (getline, getdelim): Likewise.
7473         Remove _GNU_SOURCE define; now it's defined in config.h through
7474         m4/getline.m4.
7475
7476 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7477
7478         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7479         over-parenthesization in macros.
7480
7481         Sync with coreutils.
7482
7483         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7484         required by C99.
7485
7486         Use `exit_failure' for xalloc and xmemcoll instead of their own
7487         private exit-failure variables.
7488         * xalloc.h (xalloc_exit_failure): Remove.
7489         * xmalloc.c: Likewise.  Include exitfail.h.
7490         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7491         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7492         * xmemcoll.c: Likewise.  Include exitfail.h.
7493         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7494
7495 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7496
7497         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7498         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7499         to test that it can stand by itself.  Include "exitfail.h".
7500         Clients should set exit_failure instead.
7501         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7502
7503 2003-07-18  Andreas Schwab  <schwab@suse.de>
7504
7505         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7506
7507 2003-07-18  Bruno Haible  <bruno@clisp.org>
7508
7509         * getndelim2.h: New file.
7510         * getndelim2.c: Make into a module of its own. Include config.h,
7511         getndelim2.h.
7512         (getndelim2): Make non-static. Change return type to ssize_t.
7513         * getline.h: Change argument names.
7514         * getline.c: Include getndelim2.h instead of getndelim2.c.
7515         * getnline.c: Include getndelim2.h.
7516
7517 2003-07-17  Bruno Haible  <bruno@clisp.org>
7518
7519         * Makefile.am: Remove file.
7520         * Makefile.in: Remove file.
7521
7522 2003-07-17  Bruno Haible  <bruno@clisp.org>
7523
7524         * getnline.h: New file.
7525         * getnline.c: New file.
7526         * getndelim2.c: New file, extracted from getline.c.
7527         (getndelim2): Renamed from getdelim2, with added nmax argument.
7528         * getline.c: Include getndelim2.c.
7529         (getdelim2): Moved out to getndelim2.c.
7530         (getline, getdelim): Update.
7531
7532 2003-07-15    <karl@gnu.org>
7533
7534         * vasnprintf.c: update from gettext.
7535
7536 2003-07-15  Jim Meyering  <jim@meyering.net>
7537
7538         * makepath.c (make_path): Enclose diagnostic in _(...).
7539
7540 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7541
7542         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7543         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7544         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7545         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7546         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7547         updated automatically by ../config/srclist-update.  This changes
7548         their license from LPGL to GPL.
7549
7550 2003-07-14  Jim Meyering  <jim@meyering.net>
7551
7552         Don't emit diagnostics.  Let callers do that.
7553         * save-cwd.c: Don't include "error.h".
7554         (save_cwd): Don't call error.  Ensure that errno is valid
7555         when returning nonzero.
7556
7557         * save-cwd.h (restore_cwd): Update prototype.
7558         * save-cwd.c (restore_cwd): Remove two parameters.
7559         Simplify.  Don't call error upon failure.  Let callers do that.
7560         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7561         when auditing is enabled.  But don't bother updating the #if.
7562
7563 2003-07-14  Simon Josefsson  <jas@extundo.com>
7564
7565         * mempcpy.h: New file.
7566         * mempcpy.c: New file.
7567
7568 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7569
7570         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7571         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7572         unicodeio.c, unicodeio.h, unlocked-io.h:
7573         Switch from LGPL to GPL.
7574
7575 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7576
7577         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7578         it breaks C++ compilation.
7579         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7580
7581 2003-07-10  Jim Meyering  <jim@meyering.net>
7582
7583         * vasnprintf.c: Remove trailing blanks.
7584         Make cpp indentation consistent.
7585
7586 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7587
7588         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7589         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7590         Switch from LGPL to GPL.
7591
7592 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7593
7594         * mktime.c: Fix some boundary cases and remove need for floating point.
7595
7596         Issue a compile-time diagnostic if time_t is floating point, or if
7597         two's complement arithmetic is not in effect, or if arithmetic
7598         right shift does not propagate the sign.  These assumptions were
7599         all in the original code but they weren't checked.
7600
7601         (TIME_T_MIDPOINT, verify): New macros.
7602         (__isleap): Remove; it has integer overflow problems.
7603         (leapyear): New function, without those problems.
7604         (ydhms_tm_diff): Remove; splitting into two parts.
7605         (ydhms_diff): New function, containing the arithmetic part of
7606         the old ydhms_tm_diff function.  Issue a compile-time
7607         diagnostic if we are not using C99 integer division.
7608         Avoid casts when possible.
7609         (guess_time_tm): New function, containing the checking part of
7610         the old ydhms_tm_diff function.  Return the new value, rather than
7611         the difference between it and the old.  Accept a new argument T
7612         so that *T specifies the old value.  Check for overflow in the result.
7613
7614         (__mktime_internal): Use a time_t offset, not a long int offset.
7615         This undoes the 2003-06-04 change, which is no longer needed now
7616         that we have better overflow checking.
7617         (localtime_offset): Likewise.
7618
7619         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7620         and long are 64-bit but int is only 32-bit.
7621         (ydhms_diff): Use long int to store year1 and yday1.
7622         Issue a compile-time diagnostic if long int is not wide enough.
7623
7624         (__mktime_internal): Use long int to store adjusted year and yday.
7625         Use plain C rather than preprocessor commands, if that doesn't
7626         affect efficiency.
7627         Check for overflow (and try to repair) after each probe
7628         rather than checking only at the very end.  This avoids some bugs
7629         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7630         does not equal GMT offset at maximum time).
7631         Use integer to check for overflow rather than floating point; this
7632         is more portable to non-IEEE hosts, and is a tad faster.
7633         When we detect that we are oscillating between two values,
7634         don't check whether tm_isdst has the requested value, since
7635         we already know the answer.  When tm_isdst has the wrong value,
7636         use a different heuristic to find the right one, based on the
7637         extreme values actually observed in practice in tz2003a,
7638         rather than the (overly optimistic) "previous 3 calendar quarters".
7639
7640         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7641         "T const" to accommodate glibc style.
7642         (check_result): Use less-confusing report format.  "long" -> "long int.
7643         (main): Likewise.
7644         Don't loop if the iteration overflows time_t.
7645         Allow a negative step in the iteration.
7646
7647 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7648
7649         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7650         having it depend on HAVE_SYS_TYPES_H.
7651
7652 2003-06-25  Bruno Haible  <bruno@clisp.org>
7653
7654         * readlink.c: New file.
7655
7656 2003-06-20  Bruno Haible  <bruno@clisp.org>
7657
7658         Assume C89, so PARAMS isn't needed.
7659         * unicodeio.h (PARAMS): Remove.
7660         * unicodeio.c: Don't use PARAMS.
7661
7662 2003-06-18  Jim Meyering  <jim@meyering.net>
7663
7664         Merge changes from coreutils.
7665         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7666         Remove explicit declarations of xmalloc and realloc.
7667         Include xalloc.h.
7668         (read_utmp): Remove anachronistic cast of xmalloc.
7669
7670 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7671
7672         Assume C89, so PARAMS isn't needed.
7673         * backupfile.h (PARAMS): Remove.  All uses removed.
7674         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7675         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7676         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7677         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7678         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7679         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7680         xstrtol.h: Likewise.
7681         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7682         same.h, strverscmp.h: Do not include config.h; no longer needed.
7683         Anyway, config.h should always be included before any other file.
7684
7685 2003-06-11  Simon Josefsson  <jas@extundo.com>
7686
7687         * sysexit_.h: New file.
7688
7689 2003-05-20  Derek Price  <derek@ximbiot.com>
7690
7691         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7692
7693 2003-06-10  Simon Josefsson  <jas@extundo.com>
7694
7695         * strchrnul.h: New file.
7696         * strchrnul.c: New file.
7697
7698 2003-06-10  Simon Josefsson <jas@extundo.com>
7699
7700         * argp.h: New file, from glibc.
7701         * argp-ba.c: New file, from glibc.
7702         * argp-eexst.c: New file, from glibc.
7703         * argp-fmtstream.c: New file, from glibc.
7704         * argp-fmtstream.h: New file, from glibc.
7705         * argp-fs-xinl.c: New file, from glibc.
7706         * argp-help.c: New file, from glibc.
7707         * argp-namefrob.h: New file, from glibc.
7708         * argp-parse.c: New file, from glibc.
7709         * argp-pv.c: New file, from glibc.
7710         * argp-pvh.c: New file, from glibc.
7711         * argp-xinl.c: New file, from glibc.
7712
7713 2003-06-07  Jim Meyering  <jim@meyering.net>
7714
7715         * readtokens.h: Put `Free Software Foundation, Inc.'
7716         in place of my name in the copyright comment.
7717         Remove definition and uses of __P.
7718
7719         From coreutils.
7720         * stat.c: Don't declare xmalloc explicitly.
7721         Instead, include "xalloc.h".
7722         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7723         xrealloc, and xcalloc return values.
7724         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7725         Improve comment.
7726         * xgetcwd.h: Remove definition/uses of PARAMS.
7727
7728 2003-06-06  Jim Meyering  <jim@meyering.net>
7729
7730         * stdbool_.h: Renamed from stdbool.h.in.
7731
7732 2003-06-06  Jim Meyering  <jim@meyering.net>
7733
7734         Merge from coreutils.
7735         * same.c: (same_name): Declare *_basename locals to be `const'.
7736         Consolidate declarations and initializations of *_base* locals.
7737
7738         Merge from coreutils.
7739         This avoids a core dump on systems without GNU putenv,
7740         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7741         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7742         (unsetenv): New static function, from GNU libc.
7743         (rpl_putenv): Use it.
7744
7745         * modechange.c: Remove trailing blanks.
7746
7747         Merge from coreutils.
7748         * fsusage.c: Remove declaration of statfs.
7749         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7750
7751         * posixtm.c: Include <stdbool.h> unconditionally.
7752
7753 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7754
7755         * mktime.c (__mktime_internal): When resolving a tm_isdst
7756         mismatch, look in future quarters as well as past.  This fixes a
7757         bug when processing fall-backwards gaps immediately after a long
7758         period of daylight-saving time.
7759
7760         * mktime.c: Assume freestanding C89 or better.
7761         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7762         (__P): Remove; not used.
7763         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7764         (mktime, not_equal_tm, print_tm, check_result,
7765         main): Use prototypes.  Use const * where appropriate.
7766         (main): Fix typo in testing code that uncovered by above changes.
7767         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7768
7769 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7770
7771         * mktime.c: Fix Debian bug 177940
7772         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7773         (localtime_offset): Now long int, not time_t, because we want it
7774         to be guaranteed to be signed.  All uses changed.
7775         (__mktime_internal): If overflow would occur when adding offset,
7776         don't add it.
7777
7778         Merge 'human' changes from coreutils.  Rewrite to support
7779         locale-specific notations like thousands separators.
7780         * human.c: Simplify authorship notice.
7781         Include human.h immediately after config.h.
7782         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7783         <limits.h>: Do not include, since human.h does.
7784         (SIZE_MAX, UINTMAX_MAX): New macros.
7785         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7786         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7787         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7788         (power_letter): Renamed from suffixes.
7789         (generate_suffix_backwards): Remove.
7790         (adjust_value): Now takes int style (because of human.h changes)
7791         and long double value (for greater precision on some platforms).
7792         (group_number): New function.
7793         (human_readable): Use it.  Use integer options, not enum.
7794         Put the options before the sizes in the arg list.
7795         Support all the new options.
7796         The old human_readable function has been removed;
7797         use inttostr.h instead.
7798         (human_readable, default_block_size, humblock):
7799         Use uintmax_t, not int, for block sizes.
7800         (human_readable_inexact, block_size_types): Remove.
7801         (block_size_opts): New constant.
7802         (human_options): Renamed from human_block_size, with new signature
7803         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7804         * human.h: Add copyright and authorship notice.
7805         Include <limits.h> and <stdbool.h> unconditionally.
7806         (PARAMS): Remove.  All uses removed.
7807         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7808         (enum human_inexact_style): Remove tag; now a nameless enum.
7809         (human_floor, human_ceiling, human_round_to_even): Now have
7810         values 2, 0, 1 rather than -1, 1, 0.
7811         (human_group_digits, human_suppress_point_zero, human_autoscale,
7812         human_base_1024, human_SI, human_B): New constants.
7813         (human_readable_inexact, human_block_size): Remove.
7814         (human_readable): Size args are now uintmax_t, not int.
7815         (human_options): New decl.
7816
7817         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7818         unnecessary now that we assume C89 or better.  This change
7819         imported from coreutils.
7820
7821         * mktime.c (__mktime_internal): Do not reject negative timestamps
7822         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7823         in the 2003-05-30 sync from glibc.
7824
7825         .h files should stand alone, but we shouldn't include <sys/types.h>
7826         if we can get away with just <stddef.h>.
7827
7828         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7829         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7830         rather than <sys/types.h>, as we merely need size_t.
7831         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7832         to get size_t.
7833         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7834         Include <stdio.h>, to get FILE.
7835         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7836         memcasecmp.h has included <stddef.h> and all we need is size_t.
7837         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7838         our interface, instead of including <sys/types.h>
7839
7840 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7841
7842         [from coreutils]
7843         Fix some minor time-related bugs with POSIX time arguments.
7844         Some valid time stamps were being rejected (notably -1, and
7845         time stamps before 1900 on 64-bit hosts).  And some invalid
7846         time stamps were being accepted, e.g. September 31.
7847
7848         * posixtm.h (posixtime): Return bool instead of time_t, so
7849         that we can return (time_t) -1 successfully.
7850         * posixtm.c: Likewise.
7851         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7852         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7853         (t): Remove static var.
7854         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7855         of static var.  All uses changed.
7856         (year): Do not reject years before 1900; they can occur with
7857         64-bit time_t.
7858         (posix_time_parse): Do not check for out-of-range components;
7859         that is now the caller's responsibility, since our checks were
7860         only approximations.
7861         (posixtime): Use mktime to check for out-of-range components,
7862         since it knows them exactly.
7863         If mktime returns (time_t) -1, check whether an error actually occurred
7864         by invoking localtime on -1.
7865         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7866         posixtime failures better.
7867         Improve the test data (in comments only).
7868
7869 2003-05-30    <karl@gnu.org>
7870
7871         * mktime.c: update from libc.
7872
7873 2003-05-30  Bruno Haible  <bruno@clisp.org>
7874
7875         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7876         * localcharset.h: Likewise.
7877         * localcharset.c: Likewise.
7878
7879 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7880
7881         Assume the headers required for C89 freestanding compilers.
7882         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7883         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7884         without checking for HAVE_LIMITS_H.
7885         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7886         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7887         to do that.
7888         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7889         * exclude.c: Include <stdbool.h> unconditionally.
7890         * tempname.c: Include <stddef.h> unconditionally.
7891         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7892         * modechange.c, rpmatch.c (NULL): Don't define, since
7893         <stddef.h> does that.
7894         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7895         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7896         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7897         * xstrtol.c: Likewise.
7898         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7899         * savedir.c: Include <stddef.h> instead of defining NULL.
7900
7901         * addext.c (addext): Use assignment rather than cast, to avoid
7902         warnings on some platforms.
7903
7904         * mktime.c (__mktime_internal): Do not reject negative timestamps
7905         arbitrarily.
7906
7907 2003-05-10  Bruno Haible  <bruno@clisp.org>
7908
7909         * linebreak.c (iconv_string_length): Don't return -1 just because the
7910         string is longer than 4 KB.
7911
7912 2003-05-12  Jim Meyering  <jim@meyering.net>
7913
7914         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7915         the space-padded-by-default conversion specifiers, %e, %k, %l.
7916
7917 2003-05-03  Bruno Haible  <bruno@clisp.org>
7918
7919         Upgrade to Unicode-4.0.
7920         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7921         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7922         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7923         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7924         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7925         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7926         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7927         Change width of U+E0100..U+E01EF from 1 to 0.
7928
7929 2003-04-25  Bruno Haible  <bruno@clisp.org>
7930
7931         * copy-file.c: Include <stddef.h>, for size_t.
7932
7933 2003-04-25  Jim Meyering  <jim@meyering.net>
7934
7935         * copy-file.c (copy_file_preserving): Declare buf_size to be
7936         of type size_t, not int.
7937
7938 2003-04-11  Jim Meyering  <jim@meyering.net>
7939
7940         Merge changes from Coreutils.
7941
7942         2003-03-22  Jim Meyering  <jim@meyering.net>
7943
7944         * strftime.c (widen): Cast alloca return value to proper type.
7945
7946         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7947
7948         From GNU libc.
7949         * strftime.c (my_strftime): Handle very large width
7950         specifications for numeric values correctly.  Improve checks for
7951         overflow.
7952
7953         2003-01-19  Jim Meyering  <jim@meyering.net>
7954
7955         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7956         (nl_get_alt_digit) [! defined my_strftime]: Define.
7957         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7958         _nl_get_alt_digit and _nl_get_walt_digit.
7959
7960         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7961         These changes have no effect outside of _LIBC.
7962
7963 2003-04-10  Bruno Haible  <bruno@clisp.org>
7964
7965         * findprog.h: New file, from GNU gettext.
7966         * findprog.c: New file, from GNU gettext.
7967
7968 2003-04-05  Jim Meyering  <jim@meyering.net>
7969
7970         Merge changes from Coreutils.
7971
7972         * exclude.h (PARAMS): Remove definition and uses.
7973         * exclude.c: Remove uses of `PARAMS'.
7974
7975         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7976         Add test-cases for DOS filenames. Declare program_name.
7977         (main): Set up program_name.  Patch by Rich Dawe.
7978
7979         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7980         error from mntctl.
7981         Use mntctl's return value to drive the entry-processing loop, since
7982         we can't rely on the value of the vmt_length member in the last
7983         entry.  On some systems doing so could result in exhausting
7984         virtual memory.  Based in part on a patch from Mike Jetzer.
7985
7986 2003-04-04  Bruno Haible  <bruno@clisp.org>
7987
7988         * linebreak.h: New file, from GNU gettext.
7989         * linebreak.c: New file, from GNU gettext with slight modifications.
7990         * lbrkprop.h: New file, from GNU gettext.
7991
7992 2003-04-03  Bruno Haible  <bruno@clisp.org>
7993
7994         * utf8-ucs4.h: New file, from GNU gettext.
7995         * utf16-ucs4.h: New file, from GNU gettext.
7996         * ucs4-utf8.h: New file, from GNU gettext.
7997         * ucs4-utf16.h: New file, from GNU gettext.
7998
7999 2003-04-02  Bruno Haible  <bruno@clisp.org>
8000
8001         * binary-io.h: New file, from GNU gettext.
8002
8003 2003-04-01  Bruno Haible  <bruno@clisp.org>
8004
8005         * pathname.h: New file, from GNU gettext.
8006         * concatpath.c: New file, from GNU gettext.
8007
8008 2003-03-30  Bruno Haible  <bruno@clisp.org>
8009
8010         * copy-file.c (copy_file_preserving): Don't set owner if the function
8011         chown() doesn't exist.
8012
8013 2003-03-28  Bruno Haible  <bruno@clisp.org>
8014
8015         * copy-file.h: New file, from GNU gettext.
8016         * copy-file.c: New file, from GNU gettext.
8017
8018 2003-03-18  Jim Meyering  <jim@meyering.net>
8019
8020         * quote.c (quote_n): Fix typo in comment.
8021
8022 2003-03-14  Jim Meyering  <jim@meyering.net>
8023
8024         Merge changes from Coreutils.
8025         * obstack.h (obstack_object_size): Declare temporary, __o,
8026         to be const, in order to avoid warnings.
8027         (obstack_room): Likewise.
8028         (obstack_empty_p): Likewise.
8029
8030 2003-03-13  Paul Eggert  <eggert@twinsun.com>
8031
8032         Merge changes from Bison.
8033         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8034         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8035         when compiling Bison 1.875's `bitset bset = obstack_alloc
8036         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
8037         * hash.c: Include <stdbool.h> unconditionally.
8038
8039 2003-03-09  Paul Eggert  <eggert@twinsun.com>
8040
8041         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8042         Reported by Bruce Becker; see:
8043         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8044
8045 2003-03-03  Paul Eggert  <eggert@twinsun.com>
8046             Bruno Haible  <bruno@clisp.org>
8047
8048         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8049         Reported by John Hughes, see
8050         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8051
8052 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
8053
8054         * poll_.h: New file.
8055         * poll.c: New file.
8056
8057 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
8058
8059         * mathl.h: New file.
8060         * acosl.c: New file.
8061         * asinl.c: New file.
8062         * atanl.c: New file.
8063         * ceill.c: New file.
8064         * cosl.c: New file.
8065         * expl.c: New file.
8066         * floorl.c: New file.
8067         * frexpl.c: New file.
8068         * ldexpl.c: New file.
8069         * logl.c: New file.
8070         * sincosl.c: New file.
8071         * sinl.c: New file.
8072         * sqrtl.c: New file.
8073         * tanl.c: New file.
8074         * trigl.c: New file.
8075         * trigl.h: New file.
8076
8077 2003-02-17  Bruno Haible  <bruno@clisp.org>
8078
8079         * mkdtemp.h: New file, from GNU gettext.
8080         * mkdtemp.c: New file, from GNU gettext.
8081
8082 2003-01-31  Bruno Haible  <bruno@clisp.org>
8083
8084         * rename.c: #undef rename before defining rpl_rename.
8085         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8086
8087 2003-01-30  Bruno Haible  <bruno@clisp.org>
8088
8089         * printf-args.h: New file, from GNU gettext.
8090         * printf-args.c: New file, from GNU gettext.
8091         * printf-parse.h: New file, from GNU gettext.
8092         * printf-parse.c: New file, from GNU gettext.
8093         * vasnprintf.h: New file, from GNU gettext.
8094         * vasnprintf.c: New file, from GNU gettext.
8095         * asnprintf.c: New file, from GNU gettext.
8096         * vasprintf.h: New file, from GNU gettext with modifications.
8097         * vasprintf.c: New file, from GNU gettext.
8098         * asprintf.c: New file, from GNU gettext.
8099
8100 2003-01-29  Bruno Haible  <bruno@clisp.org>
8101
8102         * stpncpy.h: New file, from GNU gettext with modifications.
8103         * stpncpy.c: New file, from GNU gettext with modifications.
8104
8105 2003-01-28  Bruno Haible  <bruno@clisp.org>
8106
8107         * c-ctype.h: New file, from GNU gettext, with changes suggested by
8108         Paul Eggert.
8109         * c-ctype.c: New file, from GNU gettext, with changes suggested by
8110         Paul Eggert.
8111
8112 2003-01-27  Bruno Haible  <bruno@clisp.org>
8113
8114         * xsetenv.h: New file, from GNU gettext.
8115         * xsetenv.c: New file, from GNU gettext.
8116
8117 2003-01-23  Bruno Haible  <bruno@clisp.org>
8118
8119         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8120
8121 2003-01-22  Bruno Haible  <bruno@clisp.org>
8122
8123         * exit.h: New file, from GNU gettext.
8124
8125 2003-01-11  Bruno Haible  <bruno@clisp.org>
8126
8127         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8128         * strcase.h (strcasecmp, strncasecmp): Likewise.
8129
8130 2003-01-14  Jim Meyering  <jim@meyering.net>
8131
8132         * same.c (same_name): Tweak a comment.
8133
8134 2003-01-11  Bruno Haible  <bruno@clisp.org>
8135
8136         * same.c (same_name): Reorder tests so as to avoid calling stat()
8137         when a string comparison is sufficient.
8138
8139 2003-01-11  Bruno Haible  <bruno@clisp.org>
8140
8141         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8142         'unsigned int'.
8143
8144 2003-01-11  Bruno Haible  <bruno@clisp.org>
8145
8146         * hash-pjw.c: Add comment about low quality of this function.
8147
8148 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8149
8150         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8151         to avoid collisions with libcurses and libreadline.
8152
8153         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8154         * getstr.h, getstr.c: Remove.
8155         * getline.c: Include "getline.h", to check interface.
8156         Move body of old getstr.c here: this defines MIN_CHUNK and
8157         declares getdelim2, which is renamed from getstr.
8158         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8159
8160         * linebuffer.c (readlinebuffer): Renamed from readline.
8161         All uses changed.
8162         * linebuffer.h: Likewise.
8163         (readline): Remove backward-compatibility macro.
8164
8165 2003-01-12  Jim Meyering  <jim@meyering.net>
8166
8167         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8168
8169 2003-01-10  Bruno Haible  <bruno@clisp.org>
8170
8171         * alloca_.h: New file.
8172         * getdate.y: Unconditionally include alloca.h.
8173         * makepath.c: Likewise.
8174         * setenv.c: Likewise.
8175         * userspec.c: Likewise.
8176
8177 2003-01-09  Bruno Haible  <bruno@clisp.org>
8178
8179         * stdbool.h.in: New file.
8180
8181 2003-01-08  Bruno Haible  <bruno@clisp.org>
8182
8183         * safe-read.c: Include specification header first, to ensure its
8184         selfcontainedness.
8185         * full-write.c: Likewise.
8186
8187 2003-01-08  Jim Meyering  <jim@meyering.net>
8188
8189         * full-write.c: Undefine and define-away `const' after inclusion
8190         of errno.h, not before.  Suggestion from Bruno Haible.
8191
8192 2003-01-07  Jim Meyering  <jim@meyering.net>
8193
8194         * full-write.c: Rework so that it may serve to define full_read, too.
8195         * full-read.c: Simply #define FULL_READ and include full-write.c.
8196
8197 2003-01-06  Jim Meyering  <jim@meyering.net>
8198
8199         * version-etc.c: Update year in translatable copyright string.
8200
8201 2002-12-25  Bruno Haible  <bruno@clisp.org>
8202
8203         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8204         * xstrtol.h: Likewise.
8205         * xstrtoimax.c: Likewise.
8206         * xstrtoumax.c: Likewise.
8207         * human.h: Likewise.
8208
8209         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8210         on systems that have <inttypes.h> but not <stdint.h>.
8211
8212 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8213
8214         * memcoll.c (memcoll): Fall back on a simple algorithm using
8215         memcmp if strcoll doesn't work.
8216
8217 2002-12-23  Bruno Haible  <bruno@clisp.org>
8218
8219         * localcharset.h: New file.
8220         * localcharset.c: Include it.
8221         * unicodeio.c: Likewise.
8222
8223 2002-12-22  Bruno Haible  <bruno@clisp.org>
8224
8225         * utime.c (utime_null): No need to call ftruncate if the file was
8226         nonempty.
8227
8228 2002-12-23  Bruno Haible  <bruno@clisp.org>
8229
8230         * memcoll.c (STRCOLL): New macro.
8231         (memcoll): Use it.
8232
8233 2002-12-22  Bruno Haible  <bruno@clisp.org>
8234
8235         * getstr.h (getstr): Define, to avoid clash with libcurses.
8236         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8237
8238 2002-12-22  Bruno Haible  <bruno@clisp.org>
8239
8240         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8241
8242 2002-12-23  Bruno Haible  <bruno@clisp.org>
8243
8244         * getline.h: Include <stddef.h>, for size_t.
8245
8246         * unicodeio.h: Include <stddef.h>, for size_t.
8247         * unicodeio.c: Don't include <stddef.h>.
8248
8249 2002-12-17  Bruno Haible  <bruno@clisp.org>
8250
8251         * canon-host.c (strdup): Remove unused declaration.
8252
8253         * fsusage.c: Include full_read.h.
8254         (get_fs_usage): Use full_read instead of safe_read.
8255
8256         * utime.c (utime_null): Use SAFE_READ_ERROR.
8257
8258 2002-12-11  Bruno Haible  <bruno@clisp.org>
8259
8260         * setenv.h: Rewritten to cope with systems that have setenv() but not
8261         unsetenv().
8262         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8263         modifications:
8264
8265         2002-12-11  Bruno Haible  <bruno@clisp.org>
8266
8267                 * setenv.c (alloca): Fall back to malloc.
8268                 (freea): New macro.
8269                 (setenv): Use freea() to free memory allocated with alloca().
8270
8271         2002-11-13  Bruno Haible  <bruno@clisp.org>
8272
8273                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8274                 function declarations.
8275                 * unsetenv.c (unsetenv): Likewise.
8276
8277         2002-03-04  Bruno Haible  <bruno@clisp.org>
8278
8279                 Portability to AIX 4.3.3.
8280                 * unsetenv.c: New file, extracted from setenv.c.
8281                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8282
8283         2001-12-20  Bruno Haible  <bruno@clisp.org>
8284
8285                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8286                 use malloc instead. For SunOS 4.
8287
8288         2001-12-11  Bruno Haible  <bruno@clisp.org>
8289
8290                 * setenv.c: Declare alloca.
8291                 (compar_fn_t): New typedef.
8292                 (KNOWN_VALUE, STORE_VALUE): Use it.
8293
8294         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8295         setenv.h.
8296
8297 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8298
8299         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8300         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8301         Choose values that are less likely to collide with system fnmatch
8302         options.
8303         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8304         defined (e.g., a pure POSIX system).
8305         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8306         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8307
8308 2002-12-06  Jim Meyering  <jim@meyering.net>
8309
8310         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8311
8312         Merge in changes from libc's misc/error.c, in preparation
8313         for the merge of gnulib's changes back into libc.
8314
8315         * error.c (_): Define only if not already defined.
8316         Move definition to follow all #include directives.
8317         Include unlocked-io.h only if !_LIBC.
8318         [_LIBC]: Include <libio/libioP.h>.
8319         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8320         (fflush): Tweak definition to use INTUSE.
8321         (putc): Define.
8322
8323 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8324
8325         * alloca.c [defined emacs]: Include "lisp.h".
8326         (xalloc_die) [defined emacs]: New macro.
8327         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8328         [! defined emacs]: Include <xalloc.h>.
8329         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8330         (pointer): Typedef to POINTER_TYPE *.
8331         (malloc): Remove decl; we now always use xmalloc.
8332         (alloca): Use old-style definition, since Emacs needs this.
8333         Check for arithmetic overflow when computing combined size.
8334
8335 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8336
8337         Do not generate unlocked-io.h automatically, since it's easier to
8338         maintain it by hand.
8339
8340         * unlocked-io.h: New file, from GNU diffutils,
8341         but with proper copyright notice and attribution.
8342         * gen-uio: Remove.
8343         * Makefile.am: Add copyright notice.
8344         (libfetish_a_SOURCES): Add unlocked-io.h.
8345         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8346         (DISTCLEANFILES, io_functions): Remove macros.
8347         (EXTRA_DIST): Remove gen_uio.
8348         (unlocked-io.h): Remove rule.
8349
8350 2002-12-04  Jim Meyering  <jim@meyering.net>
8351
8352         Reflect the fact that stat.c and lstat.c are no longer generated.
8353         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8354         (DISTCLEANFILES): Likewise.
8355         (EXTRA_DIST): Likewise.
8356         (all_local): Don't depend on stat.c or lstat.c.
8357         (stat.c, lstat.c): Remove rules.
8358         (EXTRA_DIST): Remove xstat.in.
8359
8360         * xstat.in: Remove file.  Contents moved into stat.c.
8361         * stat.c: New file.  Contents mostly from xstat.in.
8362         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8363         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8364
8365         * safe-read.c: Rework so that it may serve to define safe_write, too.
8366         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8367
8368 2002-12-03  Jim Meyering  <jim@meyering.net>
8369
8370         * safe-read.c, safe-write.c: Change variable names and comments, but
8371         not semantics, to minimize the differences between these two files.
8372         (safe_read): Change comment to mention SAFE_READ_ERROR.
8373
8374         * safe-read.c (IS_EINTR): Define.
8375         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8376
8377 2002-12-02  Bruno Haible  <bruno@clisp.org>
8378
8379         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8380         Define, taken from safe-read.c.
8381         (INT_MAX): Provide fallback.
8382         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8383         * safe-write.h (SAFE_WRITE_ERROR): Define.
8384
8385         * safe-read.c (EINTR): Remove definition.
8386         (safe_read): Don't use EINTR if it is absent.
8387
8388 2002-12-02  Jim Meyering  <jim@meyering.net>
8389
8390         * safe-read.c (EINTR): Define.
8391         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8392         (INT_MAX): Provide fallback.
8393         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8394
8395         * safe-read.h (SAFE_READ_ERROR): Define.
8396
8397 2002-12-01  Jim Meyering  <jim@meyering.net>
8398
8399         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8400         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8401
8402 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8403
8404         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8405         hash_rehash): Replace `if (limit <= value) abort ();' with
8406         `if (! (value < limit)) abort ();', for readability.
8407
8408 2002-11-26    <karl@gnu.org>
8409
8410         * strdup.c: copy from libc again, with jim's ok.
8411         * .cppi-disable: re-add strdup.c
8412
8413 2002-11-25    <karl@gnu.org>
8414
8415         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8416         instead of "strtol.c".
8417
8418 2002-11-25  Jim Meyering  <jim@meyering.net>
8419
8420         * mktime.c: Sync from libc, now that it has the latest fix.
8421
8422 2002-11-24    <karl@gnu.org>
8423
8424         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8425         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8426
8427 2002-11-24  Jim Meyering  <jim@meyering.net>
8428
8429         Update from coreutils:
8430
8431         * mktime.c: Merge in changes from libc.
8432
8433         Avoid a link-time failure on some Linux systems.
8434         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8435         (__mon_yday): Declare with the STATIC attribute.
8436         (__mktime_internal): Likewise.
8437         Based on a report from Greg Schafer.
8438
8439 2002-11-23  Jim Meyering  <jim@meyering.net>
8440
8441         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8442         Use `unsigned', not `int', as type of index.
8443
8444         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8445
8446         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8447
8448 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8449
8450         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8451         hint that one should use `if (! x) abort ();' rather than `assert
8452         (x);', and anyway it's one less thing to worry about configuring.
8453         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8454         hash_rehash, hash_insert): Use abort rather than assert.
8455
8456 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8457
8458         * quotearg.h: Allow multiple inclusion by surrounding with
8459         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8460         so that we can be included first.
8461         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8462         * quotearg.c: Include quotearg.h immediately after config.h.
8463         No need to include stddef.h or sys/types.h any more.
8464         Surround local include files with "", not "<>".
8465         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8466         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8467         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8468         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8469         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8470         (ISPRINT): Remove; no longer needed now that we assume C89.
8471
8472         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8473         Preserve errno.
8474
8475         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8476         quotearg_char): Use SIZE_MAX rather than
8477         (size_t) -1 when we are talking about "infinity".
8478
8479         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8480
8481 2002-11-22  Bruno Haible  <bruno@clisp.org>
8482
8483         * safe-read.h: Assume C89. Add comments.
8484         (safe_read): Change return type to size_t.
8485         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8486         counts > SSIZE_MAX correctly.
8487         * safe-write.h: New file.
8488         * safe-write.c: New file.
8489         * full-read.h: New file.
8490         * full-read.c: New file.
8491         * full-write.h: Assume C89. Add comments.
8492         * full-write.c: Include safe-write.h.
8493         (full_write): Rewritten to use safe_write.
8494         Suggested by Jim Meyering and Paul Eggert.
8495
8496 2002-11-21  Bruno Haible  <bruno@clisp.org>
8497
8498         Remove case insensitive option matching.
8499         * argmatch.h (argcasematch): Remove declaration.
8500         (ARGCASEMATCH): Remove macro.
8501         (__xargmatch_internal): Remove case_sensitive argument.
8502         (XARGMATCH): Update.
8503         (XARGCASEMATCH): Remove macro.
8504         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8505         case_sensitive argument.
8506         (argcasematch): Remove function.
8507         (__xargmatch_internal): Remove case_sensitive argument.
8508         (main): Use XARGMATCH instead of XARGCASEMATCH.
8509
8510         * xmalloc.c: Change compile-time error message. Add comment about
8511         required autoconf version.
8512
8513 2002-11-21  Jim Meyering  <jim@meyering.net>
8514
8515         * strdup.c (strdup): Tweak comment and initial #if/#include.
8516
8517         Merge in changes from the coreutils.
8518
8519         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8520         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8521         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8522         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8523         int.  Work more efficiently if X is the same width as uintmax_t.
8524         Do not compare X to -1, to avoid bogus compiler warning.
8525         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8526         Don't assume that f_frsize and f_bsize are the same type.
8527
8528         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8529         on FreeBSD.
8530
8531         * makepath.c (make_path): Restore umask *before* creating the final
8532         component.
8533         (make_path): Minor reformatting.
8534
8535         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8536         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8537
8538         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8539         ones.  At least on GNU/Linux systems, `auto' means something else.
8540         From Michael Stone.
8541
8542 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8543
8544         Merge argmatch cleanups from Bison.  Assume C89.
8545
8546         * argmatch.c: Include config.h here, not in argmatch.h.
8547         Include stdlib.h, for EXIT_FAILURE.
8548         Always include <string.h>, since we assume C89.
8549         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8550         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8551         Include <stddef.h> instead, since it's all we need for size_t.
8552         (PARAMS): Remove.  All uses removed.
8553         (ARRAY_CARDINALITY): Do not bother to #undef.
8554         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8555         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8556         Remove unnecessary parentheses.
8557         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8558         Insert necessary parentheses.
8559         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8560         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8561
8562 2002-11-19  Bruno Haible  <bruno@clisp.org>
8563
8564         * mbswidth.c: Include mbswidth.h right at the beginning.
8565         * mbswidth.h: Include <stddef.h>, for size_t.
8566
8567         * mbswidth.h (PARAMS): Remove macro.
8568         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8569         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8570
8571         * gcd.h (PARAMS): Remove macro.
8572         (gcd): Use ANSI C function declarations.
8573         * gcd.c (gcd): Likewise.
8574
8575 2002-11-15  Bruno Haible  <bruno@clisp.org>
8576
8577         * strcspn.c: Include <stddef.h>.
8578         (strcspn): Use ANSI C function declaration. Change return type to
8579         size_t. Use NULL.
8580         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8581         (strpbrk): Use NULL.
8582         * strpbrk.h (PARAMS): Remove macro.
8583         (strpbrk): Use ANSI C function declaration.
8584         * strstr.c: Don't include <sys/types.h>.
8585         * strstr.h (PARAMS): Remove macro.
8586         (strstr): Use ANSI C function declarations.
8587
8588 2002-11-06  Bruno Haible  <bruno@clisp.org>
8589
8590         * gcd.h (gcd): Change argument type to 'unsigned long'.
8591         * gcd.c (gcd): Likewise.
8592
8593 2002-11-05  Bruno Haible  <bruno@clisp.org>
8594
8595         * gcd.h: New file, from gettext-0.11.5.
8596         * gcd.c: New file, from gettext-0.11.5.
8597
8598 2002-11-05  Bruno Haible  <bruno@clisp.org>
8599
8600         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8601         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8602         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8603         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8604
8605         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8606         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8607
8608         * closeout.c: Include gettext.h instead of <libintl.h>.
8609         * human.c: Include gettext.h instead of <libintl.h>.
8610         * quotearg.c: Include gettext.h instead of <libintl.h>.
8611         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8612         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8613         * userspec.c: Include gettext.h instead of <libintl.h>.
8614         * version-etc.c: Include gettext.h instead of <libintl.h>.
8615         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8616         (textdomain): Remove definition.
8617         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8618
8619         * long-options.c: Remove include of <libintl.h> and definition of _.
8620         * same.c: Remove include of <libintl.h> and definition of _.
8621
8622 2002-11-04  Bruno Haible  <bruno@clisp.org>
8623
8624         * stpcpy.h: New file, from GNU gettext-0.11.5.
8625         * strcase.h: New file, from GNU gettext-0.11.5.
8626         * strpbrk.h: New file, from GNU gettext-0.11.5.
8627         * strstr.h: New file, from GNU gettext-0.11.5.
8628         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8629
8630 2002-05-09  Bruno Haible  <bruno@clisp.org>
8631
8632         * config.charset: Update for newest glibc. Add canonical names
8633         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8634
8635 2002-05-09  Bruno Haible  <bruno@clisp.org>
8636
8637         * localcharset.c (get_charset_aliases): Add more Windows specific
8638         aliases.
8639
8640 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8641
8642         * config.charset: A few additions for Solaris.
8643
8644 2001-12-05  Bruno Haible  <bruno@clisp.org>
8645
8646         * localcharset.c (locale_charset): Don't return an empty string.
8647
8648 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8649
8650         * config.charset: msdos in uk_UA uses CP1125.
8651
8652 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8653
8654         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8655         * localcharset.c (locale_charset): Declare as extern "C".
8656
8657 2002-02-15  Bruno Haible  <bruno@clisp.org>
8658
8659         * config.charset [msdosdjgpp]: For Russian, use CP866.
8660
8661 2002-02-11  Bruno Haible  <bruno@clisp.org>
8662
8663         * config.charset: Add support for NetBSD.
8664
8665 2002-09-25    <karl@gnu.org>
8666
8667         * strdup.c: copy from libc/string (via ../config/srclist*).
8668         * getopt*: copy from libc/posix.
8669         * gettext.h: copy from gettext.
8670         * .cppi-disable: add strdup.c, gettext.h.
8671
8672 2002-07-01  Jim Meyering  <meyering@lucent.com>
8673
8674         * c-stack.c: Include sys/time.h.
8675         From Volker Borchert.
8676
8677 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8678
8679         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8680         New macro.  Use it uniformly instead of
8681         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8682         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8683         reported by Vin Shelton.
8684
8685 2002-06-22  Jim Meyering  <meyering@lucent.com>
8686
8687         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8688         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8689
8690 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8691
8692         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8693         Do not assume SA_SIGINFO behavior.
8694         Bug reported by Jim Meyering on NetBSD 1.5.2.
8695
8696 2002-06-22  Jim Meyering  <meyering@lucent.com>
8697
8698         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8699
8700         * exitfail.c, exitfail.h: Likewise.
8701         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8702
8703         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8704         of fnmatch.h.
8705         (EXTRA_DIST): Add fnmatch_loop.c.
8706         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8707
8708         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8709         * fnmatch.c: Update from diffutils-2.8.2.
8710         * fnmatch_.h: New file.  From diffutils-2.8.2.
8711         * fnmatch.h: Remove file.
8712
8713 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8714
8715         * file-type.h: Report an error if neither S_ISREG nor
8716         S_IFREG is defined, instead of using a test specific to glibc
8717         2.2.  This should be safe, since POSIX requires S_ISREG and
8718         Unix Version 7 had S_IFREG.  We don't need to check for
8719         <sys/types.h> since we don't use any symbols that it defines.
8720
8721 2002-06-15  Jim Meyering  <meyering@lucent.com>
8722
8723         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8724         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8725         have been included before this file.
8726
8727 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8728
8729         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8730         so that each temporary file name is unique and valid in the first
8731         8 characters, for operation under DOS.
8732
8733 2002-06-15  Jim Meyering  <meyering@lucent.com>
8734
8735         Work even with DJGPP 2.03, which lacks support for symlinks.
8736         From Richard Dawe.
8737         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8738         is defined.
8739         * lchown.c (S_ISLNK): Likewise.
8740
8741 2002-06-14  Jim Meyering  <meyering@lucent.com>
8742
8743         * file-type.h: Use the version from diffutils-2.8.2.
8744         * file-type.c: Likewise.
8745
8746 2002-05-27  Jim Meyering  <meyering@lucent.com>
8747
8748         Fix a problem seen only on nonconforming systems whereby ls.c's
8749         use of localtime, and then of gettimeofday would cause trouble:
8750         the localtime call used to initialize rpl_gettimeofday's save
8751         mechanism would clobber ls's current local time information so
8752         that in any long listing the first file would always be listed
8753         with date 1970-01-01.  Analysis by Volker Borchert.
8754
8755         * gettimeofday.c (localtime): Undefine.
8756         (rpl_localtime): New function.
8757
8758 2002-05-22  Jim Meyering  <meyering@lucent.com>
8759
8760         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8761         * file-type.h: New file.
8762         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8763
8764 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8765
8766         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8767
8768 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8769
8770         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8771         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8772         of 127, since 64 is the largest conceivable number for ancient
8773         nonstandard hosts.
8774         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8775
8776 2002-04-28  Jim Meyering  <meyering@lucent.com>
8777
8778         * sig2str.c (WTERMSIG): Remove definition (unused).
8779
8780 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8781
8782         * sig2str.h, sig2str.c: New files.
8783         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8784
8785 2002-04-24  Jim Meyering  <meyering@lucent.com>
8786
8787         * gettext.h: New file, from Gettext.
8788         * Makefile.am (INCLUDES): Remove -I../intl.
8789         (libfetish_a_SOURCES): Add gettext.h.
8790
8791 2002-04-16  Jim Meyering  <meyering@lucent.com>
8792
8793         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8794         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8795         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8796
8797 2002-04-12  Jim Meyering  <meyering@lucent.com>
8798
8799         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8800
8801 2002-03-10  Jim Meyering  <meyering@lucent.com>
8802
8803         * makepath.c (make_path): Remove a comma from a diagnostic.
8804         Suggestion from Santiago Vila.
8805
8806 2002-03-08  Jim Meyering  <meyering@lucent.com>
8807
8808         * rename.c: Mention that this wrapper is needed also on
8809         mips-dec-ultrix4.4 systems.
8810
8811 2002-03-02  Jim Meyering  <meyering@lucent.com>
8812
8813         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8814         not HAVE_CLOCK_SETTIME.
8815
8816 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8817
8818         * nanosleep.h: Rename to....
8819         * timespec.h: New name for nanosleep.h.  All uses changed.
8820
8821         * gettime.c: New file.
8822         * settime.c: New file.
8823         * stime.c: Remove.
8824
8825         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8826         timespec.h.  Remove nanosleep.h.
8827
8828 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8829
8830         * acl.c, acl.h: New files.
8831         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8832
8833 2002-02-24  Jim Meyering  <meyering@lucent.com>
8834
8835         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8836         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8837         cause trouble.  Reported by Nelson Beebe.
8838
8839 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8840
8841         * path-concat.c (xpath_concat): Reorder code to pacify
8842         compilers that don't know that xalloc_die never returns.
8843
8844 2002-02-20  Jim Meyering  <meyering@lucent.com>
8845
8846         * getdate.c: Regenerate using bison-1.33.
8847
8848 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8849
8850         * posixver.c, posixver.h: New files.
8851         * Makefile.am (libfetish_a_SOURCES): Add them.
8852
8853 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8854             Bruno Haible  <bruno@clisp.org>
8855
8856         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8857         (fwrite_success_callback): New declaration.
8858         * unicodeio.c (unicode_to_mb): New function, extracted from
8859         print_unicode_char. Call failure callback instead of error.
8860         (fwrite_success_callback): New function.
8861         (exit_failure_callback): New function.
8862         (fallback_failure_callback): New function.
8863         (print_unicode_char): Call unicode_to_mb.
8864
8865 2002-01-26  Jim Meyering  <meyering@lucent.com>
8866
8867         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8868
8869 2002-01-22  Jim Meyering  <meyering@lucent.com>
8870
8871         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8872         Otherwise, some versions of automake would omit the rule that makes
8873         Makefile from Makefile.in.
8874
8875 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8876
8877         * xmemcoll.h, xmemcoll.c: New files.
8878         * Makefile.am (libfetish_a_SOURCES): Add them.
8879         * memcoll.c: Include errno.h, and declare errno if not defined.
8880         (memcoll): Set errno to zero if there is no error.
8881
8882         * quotearg.c (quotearg_buffer_restyled):
8883         Fix bug with quoting buffers containing NUL when backslashing escapes.
8884         This bug was exposed by the other changes in this patch.
8885         (quotearg_n_options): New arg ARGSIZE.
8886         All callers changed.
8887         (quoting_options_from_style): New function.
8888         (quotearg_n_style): Use it.
8889         (quotearg_n_style_mem): New function.
8890
8891         * quotearg.h (quotearg_n_style_mem): New function.
8892
8893 2002-01-16  Jim Meyering  <meyering@lucent.com>
8894
8895         * getdate.y: Add three semicolons, each just before a closing brace.
8896         Bison (as of version 1.31) no longer papers over that mistake.
8897
8898 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8899
8900         * backupfile.c (ISDIGIT): Comment fix.
8901         * getdate.y (ISDIGIT): Likewise.
8902         * posixtm.c (ISDIGIT, year): Likewise.
8903         * strverscmp.c (ISDIGIT): Likewise.
8904         * userspec.c (ISDIGIT): Likewise.
8905
8906 2002-01-05  Jim Meyering  <meyering@lucent.com>
8907
8908         * version-etc.c (version_etc_copyright): Update copyright year.
8909
8910 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8911
8912         * closeout.c (close_stdout_status): If ferror (stdout), do
8913         not silently exit merely because the output buffer happens to
8914         have nothing pending.
8915
8916 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8917
8918         See the big note in ../ChangeLog.
8919         * human.c (suffixes): Prefer K to k for 1024.
8920         (generate_suffix_backwards): New function.
8921         (human_readable_inexact): Use it.
8922         * xstrtol.c (__xstrtol): If there is no number but there
8923         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8924         Accept 'K' as well as 'k'.
8925
8926 2001-12-15  Jim Meyering  <meyering@lucent.com>
8927
8928         * regex.h (__restrict_arr): Update from libc.
8929
8930         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8931         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8932         (STREQ): Define.
8933
8934 2001-12-10  Jim Meyering  <meyering@lucent.com>
8935
8936         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8937         Instead, include "xalloc.h".
8938         (initbuffer): Don't cast xmalloc return value to char*.
8939         (readline): Reword comment.
8940         Don't cast xrealloc return value to char*
8941         Return NULL, not 0.
8942
8943 2001-12-09  Jim Meyering  <meyering@lucent.com>
8944
8945         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8946         `signed and unsigned type in conditional expression'.
8947         * posixtm.c (posix_time_parse): Likewise.
8948
8949         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8950
8951         * readtokens.c (readtoken): Declare an index to be of type unsigned
8952         to avoid a pedantic warning.
8953
8954         * getstr.c: Don't include assert.h.
8955         (getstr): Remove warning-evoking assertions.
8956         Return -1 if offset parameter is out of bounds.
8957         Change the type of a local from int to size_t.
8958
8959         * strftime.c (my_strftime_localtime_r): Include this function
8960         definition in the `#if ! HAVE_TM_GMTOFF' block.
8961
8962         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8963         Include xalloc.h instead.
8964
8965 2001-12-02  Jim Meyering  <meyering@lucent.com>
8966
8967         * tempname.c: Don't declare getenv, thus reverting the change of
8968         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8969         included.
8970
8971         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8972         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8973
8974 2001-11-30  Akim Demaille  <akim@epita.fr>
8975
8976         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8977         before being defined.
8978
8979 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8980
8981         * quotearg.h (quotearg_n, quotearg_n_style):
8982         First arg is int, not unsigned.
8983         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8984         (SIZE_MAX, UINT_MAX): New macros.
8985         (quotearg_n_options): Abort if N is negative.
8986         Avoid overflow check on hosts where size_t is 64 bits and int
8987         is 32 bits, as overflow is impossible there.
8988         Fix off-by-one typo that caused unnecessary reallocation.
8989
8990 2001-11-27  Jim Meyering  <meyering@lucent.com>
8991
8992         * tempname.c: Merge with version from libc.
8993         * regex.c: Likewise.
8994
8995         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8996         for which STDC_HEADERS is 0, it was not included, resulting in a
8997         warning about an integer-to-pointer conversion problem with getenv.
8998         Reported by Volker Borchert.
8999
9000 2001-11-26  Jim Meyering  <meyering@lucent.com>
9001
9002         * gtod.h: Remove file.
9003         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9004         * gettimeofday.c: Don't include gtod.h.
9005         (GTOD_init): Remove function.
9006         (rpl_gettimeofday): Do its job here instead, rather than aborting.
9007         Suggestion from Volker Borchert.
9008
9009 2001-11-23  Jim Meyering  <meyering@lucent.com>
9010
9011         * hash.h (struct hash_table): Don't define here.  Merely declare it.
9012         * hash.c (struct hash_table): Define it here instead.
9013
9014 2001-11-22  Jim Meyering  <meyering@lucent.com>
9015
9016         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9017
9018 2001-11-18  Paul Eggert  <eggert@twinsun.com>
9019
9020         * tempname.c (TMP_MAX): Remove; no longer needed.
9021         (TEMPORARIES): New macro.
9022         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
9023         removes an artificial limitation (e.g. HP-UX 10.20, where
9024         TMP_MAX is 17576).
9025
9026 2001-11-18  Jim Meyering  <meyering@lucent.com>
9027
9028         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9029         on SunOS 4.
9030
9031         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9032         files will be created before anything else.
9033
9034 2001-11-17  Jim Meyering  <meyering@lucent.com>
9035
9036         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9037         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9038         rather than group writable.  Patch by Juan F. Codagnone.
9039
9040         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9041         Instead, include "xalloc.h".
9042
9043         * mountlist.c: Include unlocked-io.h after all system headers.
9044         Remove explicit declarations of xmalloc, xrealloc,
9045         and xstrdup.  Instead, include "xalloc.h".
9046
9047         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9048         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9049         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9050
9051         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9052         Reported by Padraig Brady.
9053
9054         * mkstemp.c: #undef mkstemp.
9055         Include config.h.
9056         (rpl_mkstemp): Rename from mkstemp.
9057         Protoize.
9058
9059 2001-11-16  Jim Meyering  <meyering@lucent.com>
9060
9061         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9062         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9063         determine the amount of total physical memory, use pstat_getstatic.
9064         HPUX-11 doesn't define _SC_PHYS_PAGES.
9065         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9066         If sysconf couldn't be used to determine the amount of available
9067         physical memory, use both pstat_getstatic and pstat_getdynamic.
9068         Based on a patch from Bob Proulx.
9069
9070 2001-11-05  Jim Meyering  <meyering@lucent.com>
9071
9072         * xstat.in (slash_aware_lstat): Correct a misleading comment.
9073
9074 2001-11-03  Jim Meyering  <meyering@lucent.com>
9075
9076         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9077         in argmatch_to_argument call.
9078
9079         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9080         argument.
9081
9082         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9083         e.g., a fault due to an attempt to free a NULL pointer.
9084
9085 2001-11-01  Jim Meyering  <meyering@lucent.com>
9086
9087         * dirfd.c, dirfd.h: New files.
9088         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9089
9090         * hash.c (hash_print) [TESTING]: Clean up.
9091
9092 2001-10-22  Paul Eggert  <eggert@twinsun.com>
9093
9094         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9095         to avoid a warning if -Wall.
9096
9097 2001-10-21  Paul Eggert  <eggert@twinsun.com>
9098
9099         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9100
9101 2001-10-21  Jim Meyering  <meyering@lucent.com>
9102
9103         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
9104         this code would end up calling gettext even in packages built
9105         with --disable-nls.
9106         * getopt.c (_): Likewise.
9107         * regex.c (_): Likewise.
9108
9109 2001-10-20  Paul Eggert  <eggert@twinsun.com>
9110
9111         * error.c (strerror_r): Do not declare unless !_LIBC.
9112         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9113         Use strerror_r that is only a macro, even if it is not a function.
9114         (strerror): Check for HAVE_DECL_STRERROR before declaring.
9115         (private_strerror): Use prototypes, not old-style function definition.
9116         (print_errno_message): New function.
9117         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9118         char*-flavored one.
9119         (error_tail, error, error_at_line): Use it.
9120
9121 2001-10-11  Jim Meyering  <meyering@lucent.com>
9122
9123         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9124         and quote_n (1, ... to avoid clobbering a buffer.
9125
9126 2001-10-05  Jim Meyering  <meyering@lucent.com>
9127
9128         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9129         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9130         * hash-pjw.h: New file.
9131
9132 2001-09-30  Jim Meyering  <meyering@lucent.com>
9133
9134         * mountlist.c [MOUNTED_GETFSSTAT]:
9135         Include <sys/ucred.h>, for Apple Darwin.
9136         Include sys/mount.h and sys/fs_types.h only if available.
9137         (FS_TYPE): Define.
9138         (read_filesystem_list): Use FS_TYPE.
9139
9140 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9141
9142         * exclude.c (excluded_filename): 0 -> false, since it's
9143         a boolean context.
9144
9145 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9146
9147         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9148         #defines strtoimax.  Also treat the other strto* functions
9149         like strtoimax.
9150
9151         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9152         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9153         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9154
9155 2001-09-26  Jim Meyering  <meyering@lucent.com>
9156
9157         Most macros in unlocked-io.h had the wrong number of arguments.
9158         * gen-uio: New script.
9159         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9160         * unlocked-io.hin: Remove file.
9161         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9162         rather than trying to embed it here.
9163         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9164         Reported by Padraig Brady.
9165
9166 2001-09-25  Volker Borchert  <bt@teknon.de>
9167
9168         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9169
9170 2001-09-23  Jim Meyering  <meyering@lucent.com>
9171
9172         * mountlist.c: Remove useless parentheses in #if directives.
9173         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9174         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9175
9176 2001-09-22  Jim Meyering  <meyering@lucent.com>
9177
9178         * localcharset.c: Update from latest gettext.
9179         * config.charset: Likewise.
9180
9181 2001-09-20  Jim Meyering  <meyering@lucent.com>
9182
9183         * xstrtol.c (strtoimax): Guard declaration with
9184         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9185         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9186         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9187         (strtoumax): Likewise, for completeness (it wasn't necessary).
9188
9189 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9190
9191         * strtoimax.c (HAVE_LONG_LONG):
9192         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9193         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9194         to work around bug in IBM C compiler.
9195
9196 2001-09-16  Jim Meyering  <meyering@lucent.com>
9197
9198         * mkdir.c: New file.
9199
9200 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9201
9202         * xgetcwd.c: Revert some of the previous change; intead,
9203         fix the HAVE_GETCWD_NULL code to behave more like the
9204         !HAVE_GETCWD_NULL code used to.
9205
9206         Include "xalloc.h".
9207         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9208         invoke xalloc_die.
9209
9210 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9211
9212         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9213         Use ssize_t, not int, to store result of readlink.
9214         Check for ssize_t overflow as well as size_t overflow,
9215         as POSIX says the result of readlink is implementation-defined
9216         when ssize_t overflows.
9217         Remove unnecessary cast to char*.
9218         Use free+malloc instead of realloc, as the storage doesn't need
9219         to be preserved and it's clearer and can be more efficient that way.
9220         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9221         * xreadlink.h (xreadlink): Update prototype.
9222
9223 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9224
9225         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9226         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9227         spotted by Jim Meyering.
9228
9229 2001-09-03  Jim Meyering  <meyering@lucent.com>
9230
9231         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9232
9233 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9234
9235         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9236         like the HAVE_GETCWD_NULL code.
9237         Include pathmax.h if not HAVE_GETCWD.
9238         Do not include xalloc.h.
9239         (INITIAL_BUFFER_SIZE): New symbol.
9240         Do not use xmalloc / xrealloc, since the caller is responsible for
9241         handling errors.  Preserve errno around `free' during failure.
9242         Do not overrun buffer when using getwd.
9243
9244 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9245
9246         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9247         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9248
9249 2001-09-02  Jim Meyering  <meyering@lucent.com>
9250
9251         * error.c: Update from GNU libc.
9252
9253 2001-09-01  Jim Meyering  <meyering@lucent.com>
9254
9255         * xreadlink.c: New file.
9256         * xreadlink.h: New file.
9257         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9258
9259         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9260         doesn't conflict with sparc Solaris 7's definition in
9261         /usr/include/sys/int_types.h.
9262
9263         * exclude.c: Use `""', not `<>' to #include non-system header files.
9264         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9265         and strncasecmp as r-values.  Unixware didn't have declarations.
9266
9267 2001-08-31  Jim Meyering  <meyering@lucent.com>
9268
9269         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9270         Use an initial, malloc'd, buffer of length 128 rather than
9271         a statically allocated one of length 1024.
9272
9273 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9274
9275         * xgetcwd.c: Don't include pathmax.h.
9276         Include stdlib.h and unistd.h if available.
9277         Include xalloc.h.
9278         (xmalloc, xstrdup, free): Remove decls.
9279         (xgetcwd): Don't assume sizes fit in unsigned.
9280         Check for overflow when computing sizes.
9281         Simplify reallocation code.
9282
9283 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9284
9285         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9286
9287         * strtoimax.c: Renamed from strtoxmax.c, removing the
9288         old strtoimax.c.
9289
9290         Also, make the following further changes to make this file's
9291         configuration more similar to that of strtol.c:
9292         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9293         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9294         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9295         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9296         changed to signed values.
9297
9298         And make the following changes as well:
9299         Fix copyright notice, as 1999 was missing.
9300         (verify): New macro.
9301         (strtoimax): Check sizes at compile-time, not run-time.
9302         Prefer strtol to strtoll if both work.
9303         (main): Remove; it was not that useful and was a pain to maintain.
9304
9305         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9306
9307 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9308
9309         * savedir.c (savedir): Remove size parameter, as POSIX says that
9310         a directory's st_size can have an arbitrary value, so the old
9311         usage could waste an arbitrary amount of memory.  All uses
9312         changed.
9313         * savedir.h: Update prototype.
9314
9315 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9316
9317         * xstrtol.c (strtoimax): New decl.
9318
9319 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9320
9321         * xstrtol.h: Add copyright notice.
9322         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9323         LONGINT_INVALID_SUFFIX_CHAR.
9324
9325 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9326
9327         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9328         tm to be declared.
9329
9330 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9331
9332         * hash.c: Remove '2001' from copyright notice.
9333
9334 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9335
9336         * full-write.h: New file.
9337         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9338         * full-write.c: Correct credits, as cccp.c no longer
9339         exists and anyway it was so heavily changed from the old cccp
9340         code as to be unrecognizable.  Include full-write.h.
9341         (full_write) Return size_t, with short writes meaning failure.
9342         All callers changed.  This fixes a bug with large buffers
9343         on 64-bit hosts.
9344         * utime.c: Include full-write.h.
9345
9346 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9347
9348         Merge 'exclude' changes from tar 1.13.22.
9349         This fixes one or two unlikely storage allocation overflow bugs,
9350         but doesn't change user-visible behavior otherwise.
9351
9352 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9353
9354         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9355         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9356         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9357         Include if available.
9358         (<xalloc.h>): Include
9359         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9360         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9361         collide with FNM macros.
9362         (struct patopts): New struct.
9363         (struct exclude): Use it, as exclude patterns now come with options.
9364         (new_exclude): Support above changes.
9365         (new_exclude, add_exclude_file):
9366         Initial size must now be a power of two to simplify overflow checking.
9367         (free_exclude, fnmatch_no_wildcards): New function.
9368         (excluded_filename): No longer requires options arg, as the options
9369         are determined by add_exclude.  Now returns bool, not int.
9370         (excluded_filename, add_exclude):
9371         Add support for the fancy new exclusion options.
9372         (add_exclude, add_exclude_file): Now takes int options arg.
9373         Check for arithmetic overflow when computing sizes.
9374         (add_exclude_file): xrealloc might modify errno, so don't
9375         realloc until after errno might be used.
9376
9377         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9378         New macros.
9379         (free_exclude): New decl.
9380         (add_exclude, add_exclude_file): Now takes int options arg.
9381         (excluded_filename): No longer requires options arg, as the options
9382         are determined by add_exclude.  Now returns bool, not int.
9383
9384 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9385
9386         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9387
9388 2001-08-27  Jim Meyering  <meyering@lucent.com>
9389
9390         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9391
9392         * version-etc.c (N_): Remove definition.
9393         Revert most of last change.
9394         Instead, simply don't mark the `Copyright...' string for translation.
9395         Based on advice from Paul Eggert.
9396
9397         * strtoxmax.c: Tweak comment.
9398
9399 2001-08-26  Jim Meyering  <meyering@lucent.com>
9400
9401         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9402         of copyright with `%s' so translators don't get an untranslated
9403         message in 2002.
9404         (COPYRIGHT_YEAR): Define.
9405         (version_etc): Use fprintf rather than fputs.
9406         Suggestion from Ulrich Drepper.
9407
9408         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9409
9410         * strtoll.c: New file, from GNU libc.
9411         * xstrtoimax.c: New file.
9412
9413         * xstrtol.h: Add xstrtoimax.
9414         * strtoumax.c: New file.  Simply include "strtoumax.c".
9415         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9416
9417         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9418         * strtoxmax.c: ... then renamed to this.
9419
9420 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9421
9422         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9423         Port to Solaris 8, where 'sed' requires a space after the 'r'
9424         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9425         Redirect output to $tmp just once.
9426
9427 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9428
9429         * addext.c (<errno.h>): Include.
9430         (errno): Declare if not defined.
9431         (addext): Work correctly when pathconf returns -1 and leaves
9432         errno alone because there is no limit.  Also, work even if
9433         pathconf returns a value greater than SIZE_MAX.
9434
9435 2001-08-12  Jim Meyering  <meyering@lucent.com>
9436
9437         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9438         Simply `return getcwd (NULL, 0);'.
9439         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9440         Use 1300 as initial value for length, not PATH_MAX.
9441
9442         * pathmax.h: Clean up cpp syntax.
9443
9444 2001-08-12  Jim Meyering  <meyering@lucent.com>
9445
9446         * gettimeofday.c: New file.
9447         * gtod.h: New file.
9448         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9449
9450 2001-08-04  Jim Meyering  <meyering@lucent.com>
9451
9452         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9453         to get in sync with glibc.
9454
9455 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9456
9457         The following changes are from gettext 0.10.39 as maintained by
9458         Bruno Haible.
9459
9460         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9461         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9462         with inverted sense.  All uses changed.
9463
9464         * mbswidth.c: Don't include <limits.h>.
9465         Include <stdlib.h> and <string.h> unconditionally.
9466         (iswcntrl, mbsinit, ISCNTRL): New macros.
9467         (mbsnwidth): Use K&R style function declarations.
9468         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9469         can optimize it when MB_CUR_MAX == 1.
9470         The width of control characters is zero, not 1.
9471
9472 2001-07-15  Jim Meyering  <meyering@lucent.com>
9473
9474         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9475         (BUILT_SOURCES): Add unlocked-io.h.
9476         (io_functions): Define.
9477         (unlocked-io.h): New rule.
9478         (DISTCLEANFILES): Add unlocked-io.h.
9479         (all-local): Depend on unlocked-io.h, to ensure it is created.
9480
9481         * unlocked-io.hin: New file
9482
9483         * regex.c: Update from glibc.
9484
9485 2001-07-05  Jim Meyering  <meyering@lucent.com>
9486
9487         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9488         recommendation.
9489         (libfetish_a_SOURCES): Put all .h files here instead.
9490         Remove a thus-exposed (better checks in automake) duplicate and
9491         two unnecessary .h files.
9492
9493 2001-06-11  Jim Meyering  <meyering@lucent.com>
9494
9495         * regex.c: Update from GNU libc.
9496
9497 2001-05-27  Jim Meyering  <meyering@lucent.com>
9498
9499         * readutmp.h (UT_TYPE): Define.
9500
9501 2001-05-24  Jim Meyering  <meyering@lucent.com>
9502
9503         * argmatch.c: Include "quote.h".
9504         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9505         quote function.  Reported by Göran Uddeborg.
9506
9507 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9508
9509         * dirname.c (dir_name): Compute append_dot using path, not newpath
9510         which is not yet declared.
9511
9512 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9513
9514         * Makefile.am (libfetish_a_SOURCES):
9515         Add strftime.c, since we now compile it on all hosts.
9516
9517         * strftime.c (my_strftime):
9518         Define to nstrftime if emacs, but only if my_strftime is not defined.
9519         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9520         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9521         Add one more extra argument: a nanoseconds value.
9522         All uses changed.
9523         (ns): New macro.
9524         (my_strftime function): Add %N format.
9525         (emacs_strftimeu): Renamed from emacs_strftime,
9526         with extra ut argument.
9527
9528 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9529
9530         dirname code cleanup.  base_name now behaves more compatibly
9531         with POSIX basename when given file names that have trailing
9532         slashes, and similarly for dir_name.  Add new primitives
9533         base_len and dir_len.  Put the directory-name-related decls
9534         into dirname.h.
9535
9536         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9537         * backupfile.c (base_name): Likewise.
9538         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9539         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9540         * makepath.c (strip_trailing_slashes): Likewise.
9541         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9542         Likewise.
9543         * rename.c (strip_trailing_slashes): Likewise.
9544         * same.c (base_name): Likewise.
9545         * stripslash.c (ISSLASH): Likewise.
9546
9547         * addext.c: Include <dirname.h> after size_t is defined.
9548         * backupfile.c: Likewise.
9549
9550         * addext.c (addext): Use base_len to trim redundant
9551         trailing slashes instead of doing it ourselves.
9552         But do not trim the last slash if it is not redundant.
9553
9554         * backupfile.c (find_backup_file_name,
9555         max_backup_version): Use base_len instead of rolling it ourselves.
9556         Handle the case of "" and (on DOS) "C:" correctly.
9557
9558         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9559         Include <string.h>, <dirname.h>.
9560         (base_name): Allow file names ending in slashes, other than names
9561         that are all slashes.  In this case, return the basename followed
9562         by the slashes.  This is more general, and can be used in places
9563         where the original base_name purposely had an assertion failure.
9564         (base_len): New function.
9565
9566         * dirname.c: Include <string.h> instead of <stdlib.h>.
9567         Do not include <assert.h>; no longer needed.
9568         Include xalloc.h.
9569         (memrchr): Remove decl.
9570         (dir_name_r): Remove.
9571         (dir_len): Renamed from dirlen.  All callers changed.
9572         Rewrite in terms of base_name, for simplicity and consistency.
9573         (dir_name): Never return NULL.  All callers changed.
9574         Do not include <stdlib.h> in test program; no longer needed.
9575         return 0; is fine for test program.
9576
9577         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9578         New macros.
9579         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9580
9581         * path-concat.c (path_concat): Use base_len to compute
9582         base length, not strlen; this means we cannot rely on memcpy
9583         to null-terminate.
9584
9585         * same.c (STREQ): Remove.
9586         (same_name): Handle the case where the basename ends in trailing '/'.
9587
9588         * stripslash.c (strip_trailing_slashes): Return nonzero if
9589         a slash was stripped.  Do not strip the last slash after a
9590         file system prefix.
9591
9592 2001-04-08  Jim Meyering  <meyering@lucent.com>
9593
9594         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9595         recomputed; that's necessary when the offset spans a DST transition.
9596         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9597
9598 2001-04-02  Jim Meyering  <meyering@lucent.com>
9599
9600         * regex.h, regex.c: Update from GNU libc.
9601
9602 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9603
9604         * version-etc.c (version_etc_copyright): Update to 2001.
9605
9606 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9607
9608         * tempname.c (uint64_t): Define to uintmax_t if
9609         not defined, and if UINT64_MAX is not defined.
9610         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9611         Reported by John David Anglin.
9612
9613 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9614
9615         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9616         alias if codeset is empty.
9617         * config.charset (BeOS): Use wildcard syntax.
9618
9619 2001-03-13  Jim Meyering  <meyering@lucent.com>
9620
9621         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9622         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9623         From Bruno Haible.
9624
9625 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9626
9627         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9628         Don't return NULL.
9629         * unicodeio.c (print_unicode_char): Simplify accordingly.
9630
9631 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9632
9633         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9634         support for DOS/DJGPP.
9635
9636 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9637
9638         * Makefile.am (libfetish_a_SOURCES):
9639         Add dup-safer.c, fopen-safer.c.
9640         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9641
9642         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9643
9644 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9645
9646         The mkstemp replacement is taken from glibc 2.2.2, with some
9647         portability fixes for use outside glibc, as follows:
9648
9649         * tempname.c (struct_stat64): New macro.
9650         (direxists, __gen_tempname): Use it.
9651         This avoids a portability problem with Solaris 8.
9652
9653         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9654         (<stddef.h>, <stdint.h>, <string.h>):
9655         Include only if STDC_HEADERS || _LIBC.
9656         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9657         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9658         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9659         (__set_errno): Define this macro if <errno.h> doesn't.
9660         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9661         Define these macros if <stdio.h> doesn't.
9662         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9663         Define these macros if <sys/stat.h>
9664         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9665         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9666         __xstat64): Define if not _LIBC.
9667         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9668         (__gen_tempname): Invoke gettimeofday only if
9669         HAVE_GETTIMEOFDAY || _LIBC;
9670         otherwise, fall back on plain "time".
9671         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9672
9673         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9674
9675         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9676
9677 2001-02-17  Jim Meyering  <meyering@lucent.com>
9678
9679         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9680         around included file name.
9681
9682         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9683
9684         * strftime.c: Update from GNU libc (the only changes were to comments).
9685
9686 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9687
9688         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9689
9690 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9691
9692         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9693         Remove workaround macros for hosts that have mbrtowc but not
9694         mbstate_t, as we now insist on proper declarations for both
9695         before using mbrtowc.
9696
9697 2001-02-17  Jim Meyering  <meyering@lucent.com>
9698
9699         * regex.c: Update from libc.
9700
9701 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9702
9703         * alloca.c (malloc): Undef before defining, since stdlib.h
9704         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9705         Reported by Mark Hounschell via Paul Eggert.
9706
9707 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9708
9709         * config.charset: Update for FreeBSD 4.2.
9710
9711 2001-01-26  Jim Meyering  <meyering@lucent.com>
9712
9713         * quotearg.c: Include stddef.h.
9714         * quote.c: Include stddef.h.
9715         Reported by Axel Kittenberger.
9716
9717         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9718         line in double quotes so that it evokes a better diagnostic.
9719         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9720         Reported by Axel Kittenberger.
9721
9722 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9723
9724         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9725         to avoid a warning.  Add back 'const' to inptr.
9726
9727 2001-01-16  Jim Meyering  <meyering@lucent.com>
9728
9729         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9730         From Bruno Haible.
9731
9732 2001-01-14  Jim Meyering  <meyering@lucent.com>
9733
9734         * rename.c: New file.  From Volker Borchert.
9735         Include stdlib.h, string.h or strings.h, and xalloc.h.
9736         Use strip_trailing_slashes rather than open-coding it.
9737
9738 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9739
9740         * strftime.c: Sync with glibc time/strftime.c 1.81.
9741
9742 2001-01-03  Jim Meyering  <meyering@lucent.com>
9743
9744         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9745         local `inptr' to avoid warning with some system declarations of iconv.
9746
9747 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9748
9749         * modechange.c: Do not assume that mode_t uses the
9750         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9751         the other-execute bit of FOO even if S_IXOTH != 1.
9752
9753         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9754         WOTH, XOTH, ALLM): New macros.
9755         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9756          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9757         Use them.
9758         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9759         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9760         (mode_compile):
9761         No need to use uintmax_t; unsigned long is long enough.
9762         Don't bother to get suffix since we don't use it.
9763
9764 2000-12-24  Jim Meyering  <meyering@lucent.com>
9765
9766         * hash.c (is_prime): Return explicit boolean values.
9767         (hash_get_first): Return NULL to appease Irix5.6's 89.
9768         Reported by Nelson Beebe.
9769
9770 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9771
9772         * localcharset.c (locale_charset): Add support for Win32.
9773
9774 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9775
9776         * physmem.h, physmem.c: New files.
9777
9778         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9779         (noinst_HEADERS): Add physmem.h.
9780
9781         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9782         't' for compatibility with Solaris 8 sort.
9783
9784 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9785
9786         * config.charset: Add support for BeOS.
9787
9788 2000-12-16  Jim Meyering  <meyering@lucent.com>
9789
9790         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9791         SHELLS_FILE to a file name that's useful on djgpp systems.
9792         Include stdlib.h.
9793         (ADDITIONAL_DEFAULT_SHELLS): Define.
9794         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9795         Based mostly on a patch from Prashant TR.
9796
9797 2000-12-16  Jim Meyering  <meyering@lucent.com>
9798
9799         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9800         N and M) would have treated it like `chown N:N FILE'.
9801
9802         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9803
9804 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9805
9806         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9807         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9808         to the list of canonical encodings. Rename EUC-CN to GB2312.
9809
9810 2000-12-08  Andreas Schwab  <schwab@suse.de>
9811
9812         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9813         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9814
9815 2000-12-07  Jim Meyering  <meyering@lucent.com>
9816
9817         * stripslash.c (ISSLASH): Define.
9818         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9819         From Prashant TR.
9820
9821         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9822         (dir_name_r): Declare this function as static.
9823         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9824         manifest itself on a name containing a mix of slashes and
9825         backslashes.
9826         Make this function work with names starting with a DOS-style
9827         drive letter and colon prefix.
9828         (dir_name): Append `.' if necessary.
9829         Based mostly on patches from Prashant TR and Eli Zaretskii.
9830
9831         * dirname.h (dir_name_r): Remove prototype.
9832
9833 2000-12-05  Jim Meyering  <meyering@lucent.com>
9834
9835         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9836
9837 2000-12-04  Jim Meyering  <meyering@lucent.com>
9838
9839         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9840         Also include memory.h, stdlib.h, unistd.h if appropriate.
9841         Reported by Andreas Jaeger (conflicting declaration of malloc).
9842
9843 2000-12-02  Jim Meyering  <meyering@lucent.com>
9844
9845         * closeout.h: Make idempotent, to avoid some obscure warnings.
9846
9847 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9848
9849         * memrchr.c: Include <config.h> before any system include file.
9850
9851 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9852
9853         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9854
9855 2000-11-26  Jim Meyering  <meyering@lucent.com>
9856
9857         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9858
9859 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9860
9861         * strftime.c (my_strftime): Do not invoke mbrlen with a
9862         size of (size_t) -1; it's not portable.
9863
9864 2000-11-17  Akim Demaille  <akim@epita.fr>
9865
9866         * obstack.h: Formatting changes.
9867         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9868         prevent type checking.
9869         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9870         cast the value to (void *): assigning a `foo *' to a `void *'
9871         variable is valid.
9872         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9873
9874 2000-11-17  Jim Meyering  <meyering@lucent.com>
9875
9876         * strstr.c: Update from GNU libc.
9877
9878 2000-11-16  Jim Meyering  <meyering@lucent.com>
9879
9880         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9881
9882 2000-11-11  Jim Meyering  <meyering@lucent.com>
9883
9884         * error.c: Add a couple #includes, merging from GNU libc version.
9885
9886 2000-11-10  Jim Meyering  <meyering@lucent.com>
9887
9888         * obstack.h: Update from GNU libc.
9889         * obstack.c: Likewise.
9890
9891 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9892
9893         * getusershell.c (setusershell): Use rewind rather than
9894         fseek/fseeko, to avoid configuration hassles with fseeko.
9895         Don't bother opening SHELLS_FILE if shellstream is NULL;
9896         it's not necessary.
9897
9898 2000-11-05  Jim Meyering  <meyering@lucent.com>
9899
9900         * makepath.h (make_dir): Declare.
9901         * makepath.c (make_dir): Remove `static' attribute.
9902         Tweak a comment.
9903
9904 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9905
9906         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9907         last one in a bucket, advance to the next bucket.
9908
9909 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9910
9911         * fnmatch.c: Do not comment out all the code if we are using
9912         the GNU C library, because in some cases we are replacing buggy
9913         code in the GNU C library itself.
9914
9915 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9916
9917         * error.h, getline.h, modechange.h:
9918         Remove "2000" from Copyright line, as the file hasn't been
9919         changed this year other than in the copyright notice.
9920
9921         * xalloc.h: Add "2000" to Copyright line, as this file
9922         was changed this year.
9923
9924 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9925
9926         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9927         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9928         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9929
9930 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9931
9932         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9933         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9934         doesn't define __restrict_arr.
9935
9936 2000-10-29  Jim Meyering  <meyering@lucent.com>
9937
9938         * xstat.in: Fix grammar in comment.
9939
9940 2000-10-28  Jim Meyering  <meyering@lucent.com>
9941
9942         * memchr.c: Update from libc.
9943         Adjust for portability:
9944         [HAVE_STDLIB_H]: Include stdlib.h.
9945         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9946         Undef __memchr, too.
9947         [!weak_alias]: Define __memchr to memchr.
9948
9949         * regex.c: Update from libc.
9950         * regex.h: Likewise.
9951         * getopt1.c: Likewise.
9952         * memcmp.c: Likewise.
9953
9954         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9955         Avoid using fseek, when possible -- it's broken by design.
9956         Patch by Ulrich Drepper.
9957
9958 2000-10-26  Jim Meyering  <meyering@lucent.com>
9959
9960         * strftime.c: Update from libc.
9961
9962 2000-10-25  Jim Meyering  <meyering@lucent.com>
9963
9964         * obstack.c: Update from libc.
9965
9966 2000-10-23  Jim Meyering  <meyering@lucent.com>
9967
9968         * hard-locale.c (hard_locale): Revert last change -- it was simply
9969         wrong.  That set_locale call must not have any side effects.
9970         From Paul Eggert.
9971
9972 2000-10-22  Jim Meyering  <meyering@lucent.com>
9973
9974         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9975         [CYCLIC]: Remove now-unused definition.
9976
9977         * save-cwd.c (O_DIRECTORY): Define, if needed.
9978         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9979         Suggestion from Ulrich Drepper.
9980
9981 2000-10-21  Jim Meyering  <meyering@lucent.com>
9982
9983         * dirname.c (dir_name_r): New function, factored out of dir_name.
9984         (dir_name): Use dir_name_r.
9985         * dirname.h (dir_name_r): Declare it.
9986
9987 2000-10-21  Jim Meyering  <meyering@lucent.com>
9988
9989         * dirname.c (memrchr): Declare if necessary.
9990         (dir_name): Remove the restriction that there be no
9991         trailing slashes.  Now, this code skips past them, effectively
9992         ignoring them.
9993         [TEST_DIRNAME] (main): New unit tests.
9994
9995         * memrchr.c: New file from GNU libc.
9996         Undef __memrchr, too.
9997         [!weak_alias]: Define __memrchr to memrchr.
9998         Guard weak_alias use with `#ifdef weak_alias'.
9999
10000 2000-10-17  Jim Meyering  <meyering@lucent.com>
10001
10002         * quote.h (PARAMS): Define and use.
10003         Reported by Akim Demaille.
10004
10005         * getopt.c: Update from libc.
10006
10007 2000-10-16  Jim Meyering  <meyering@lucent.com>
10008
10009         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10010         From Jan Fedak.
10011
10012 2000-09-25  Jim Meyering  <meyering@lucent.com>
10013
10014         * md5.h (rol): Define (from GnuPG).
10015
10016         * sha.c: Give credit (GnuPG) where due.
10017         (M): Use rol rather than open-coding it.
10018         Add a FIXME comment.
10019
10020 2000-09-21  Jim Meyering  <meyering@lucent.com>
10021
10022         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10023         Reported by Michael Stone.
10024
10025 2000-09-20  Jim Meyering  <meyering@lucent.com>
10026
10027         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10028         (noinst_HEADERS): Add sha.h.
10029         Based on code from Scott G. Miller and from GnuPG.
10030
10031 2000-09-15  Jim Meyering  <meyering@lucent.com>
10032
10033         * regex.c: Update from libc.
10034
10035 2000-09-10  Jim Meyering  <meyering@lucent.com>
10036
10037         * getopt.c (_getopt_internal): Update from glibc.
10038
10039 2000-09-09  Jim Meyering  <meyering@lucent.com>
10040
10041         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10042         think it should be used as a general replacement for isascii.
10043         * fnmatch.c: Likewise.
10044         * mbswidth.c: Likewise
10045         * regex.c: Likewise.
10046
10047         Don't use atoi.
10048         * userspec.c: Include sys/param.h and limits.h.
10049         Include xstrtol.h.
10050         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10051         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10052         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10053         UID, GID.  Check range.
10054
10055 2000-09-06  Jim Meyering  <meyering@lucent.com>
10056
10057         * getopt.c (_getopt_internal): Update from glibc.
10058
10059 2000-08-30  Jim Meyering  <meyering@lucent.com>
10060
10061         * strftime.c: Merge in changes from GNU libc.
10062
10063 2000-08-26  Jim Meyering  <meyering@lucent.com>
10064
10065         * closeout.c: Include "__fpending.h".
10066         (close_stdout_status): Return right away if there's nothing to flush.
10067
10068         * Makefile.am (noinst_HEADERS): Add __fpending.h.
10069         * __fpending.c: New file.
10070         * __fpending.h: New file.
10071
10072 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10073
10074         Standardize on "memory exhausted" instead of "Memory exhausted"
10075         or "virtual memory exhausted".
10076         * obstack.c (print_and_abort): Use "memory exhausted", not
10077         "virtual memory exhausted".
10078         * same.c (same_name): Invoke xalloc_die instead of printing
10079         our own message.
10080         * userspec.c (parse_user_spec): Likewise.
10081         * bumpalloc.h: comment fix
10082         * same.c, userspec.c: Include xalloc.h.
10083
10084         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10085         not char *const and pointing to a constant array.
10086         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10087         (xrealloc): Comment fix.
10088
10089         * userspec.c (parse_user_spec):
10090         Don't translate a message until just before returning,
10091         to avoid unnecessary translation.
10092
10093 2000-08-07  Jim Meyering  <meyering@lucent.com>
10094
10095         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10096         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10097         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10098         getgroups.c, gethostname.c, getopt.h, group-member.c,
10099         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10100         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10101         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10102         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10103         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10104         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10105         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10106         yesno.c: Back out Copyright date changes for each file with no change
10107         this year.  This eases coordination with other programs using the same
10108         source code modules.  From Paul Eggert.
10109
10110 2000-08-03  Greg McGary  <greg@mcgary.org>
10111
10112         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10113         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10114         (EXTEND_BUFFER): Use them.
10115
10116 2000-08-01  Jim Meyering  <meyering@lucent.com>
10117
10118         * dirname.c (ISSLASH): Define.
10119         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10120         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10121         both `\' and `/' may be use as path separators.
10122         Based on a patch from Prashant TR.
10123
10124 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10125
10126         * quotearg.c (quotearg_n_options): Don't make the initial
10127         slot vector a constant, since it might get modified.
10128
10129 2000-07-31  Jim Meyering  <meyering@lucent.com>
10130
10131         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10132         * obstack.c (print_and_abort): Likewise.
10133
10134 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10135
10136         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10137         buffer, so that the caller can always quote one small
10138         component of a "memory exhausted" message in slot 0.
10139         From a suggestion by Jim Meyering.
10140
10141 2000-07-30  Jim Meyering  <meyering@lucent.com>
10142
10143         * makepath.c (make_path): Quote the other instance, too.
10144
10145         * quotearg.c (N_STATIC_SLOTVECS): Define.
10146         (STATIC_BUF_SIZE): Define.
10147         (quotearg_n_options): Use only statically allocated storage when
10148         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10149         than STATIC_BUF_SIZE.
10150
10151 2000-07-29  Jim Meyering  <meyering@lucent.com>
10152
10153         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10154         * dirname.c (dir_name): Likewise.
10155
10156         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10157
10158         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10159         (dir_name): Assert that there are no trailing slashes.
10160
10161 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10162
10163         * mbswidth.h (mbswidth): Add a flags argument.
10164         (mbswidth): New declaration.
10165         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10166         * mbswidth.c (mbswidth): Add a flags argument.
10167         (mbsnwidth): New function.
10168
10169 2000-07-24  Jim Meyering  <meyering@lucent.com>
10170
10171         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10172
10173 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10174
10175         * mbswidth.c (_XOPEN_SOURCE):
10176         Don't define; this causes problems on Solaris 7.
10177         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10178
10179 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10180
10181         * quotearg.c:
10182         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10183         so that mbstate_t is always defined.
10184
10185         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10186         be 1 in at least one GCC installation, and this configuration
10187         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10188         performance on hosts that have mbrtowc but have only unibyte
10189         locales, but I assume these hosts are rare.
10190
10191 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10192
10193         * quotearg.c: Streamline by invoking multibyte code only if needed.
10194         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10195         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10196         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10197         invoke multibyte primitives.
10198
10199 2000-07-23  Jim Meyering  <meyering@lucent.com>
10200
10201         * basename.c (base_name): Add an assertion.
10202
10203 2000-07-15  Bruno Haible  <clisp.cons.org>
10204
10205         * quotearg.c: When the system forces us to redefine mbstate_t,
10206         shadow its mbsinit function.
10207
10208 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10209
10210         * mbswidth.h: New file.
10211         * mbswidth.c: New file.
10212         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10213         (noinst_HEADERS): Add mbswidth.h.
10214
10215 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10216
10217         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10218         and IRIX 6.
10219
10220 2000-07-15  Jim Meyering  <meyering@lucent.com>
10221
10222         * makepath.c: Include quote.h.
10223         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10224         corresponding argument in a `quote (...)' call.
10225         Give better diagnostics.
10226
10227         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10228         (noinst_HEADERS): Add quote.h.
10229
10230         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10231         from tar's src/misc.c.
10232         * quote.h: New file.  Prototypes for same.
10233
10234 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10235
10236         From a suggestion by Bruno Haible.
10237         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10238         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10239         to decide whether to define the BeOS workaround macro;
10240         this adjusts to the change to AC_MBSTATE_T.
10241
10242 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10243
10244         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10245
10246         * quotearg.c (quoting_style_args, quoting_style_vals,
10247         quotearg_buffer_restyled): Add support for
10248         clocale_quoting_style.  Undo previous change to
10249         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10250         and "{RIGHT QUOTATION MARK}" msgids.
10251
10252 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10253
10254         The old behavior of quoting `like this' doesn't look good with
10255         newer, ISO-style fonts.  See:
10256         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10257
10258         Instead, quote "like this" by default.  Let the translator
10259         tailor the locale-specific quoting behavior by providing
10260         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10261
10262         * quotearg.c (N_): New macro.
10263         (gettext_default): New function.
10264         (quotearg_buffer_restyled): Use
10265         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10266         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10267
10268 2000-07-09  Jim Meyering  <meyering@lucent.com>
10269
10270         * Most files: Update copyright dates to include 2000.
10271
10272 2000-07-08  Jim Meyering  <meyering@lucent.com>
10273
10274         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10275         if not defined.
10276         (xgethostname): Remove now-unnecessary #ifdef.
10277         Move declaration of `err' into loop where it's used.
10278
10279 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10280
10281         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10282         by allocating a larger buffer. Test the gethostname return value for
10283         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10284         returns an error and ENAMETOOLONG isn't defined.
10285
10286 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10287         and Bruno Haible  <haible@clisp.cons.org>
10288
10289         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10290
10291 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10292
10293         * quotearg.c (struct quoting_options): Simplify quote_these_too
10294         dimension.
10295
10296 2000-07-03  Jim Meyering  <meyering@lucent.com>
10297
10298         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10299         Reported by Bruno Haible.
10300
10301 2000-07-04  Jim Meyering  <meyering@lucent.com>
10302
10303         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10304         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10305         lacks mbrtowc.
10306
10307 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10308         and Bruno Haible  <haible@clisp.cons.org>
10309
10310         * quotearg.c (mbrtowc):
10311         Assign to *pwc, and return 1 only if result is nonzero.
10312         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10313
10314 2000-07-03  Jim Meyering  <meyering@lucent.com>
10315
10316         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10317         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10318         From Bob Proulx.
10319
10320 2000-07-02  Jim Meyering  <meyering@lucent.com>
10321
10322         * quotearg.c (mbstate_t): Don't define here.
10323
10324 2000-07-02  Jim Meyering  <meyering@lucent.com>
10325
10326         * nanosleep.c (SIGCONT): Define if not already defined.
10327
10328 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10329
10330         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10331         per change in ../m4/ls-mntd-fs.m4.
10332         (read_filesystem_list): Ignore symbolic links.
10333
10334 2000-06-29  Jim Meyering  <meyering@lucent.com>
10335
10336         * same.c: Include <string.h> or <strings.h>, as appropriate,
10337         for declaration of strcmp.
10338
10339         * long-options.c: Include <stdlib.h>, for declaration of exit.
10340
10341         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10342         Avoid warning by casting result to `char *' to remove `const'.
10343
10344 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10345
10346         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10347
10348 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10349
10350         savedir now sets errno on failure and invokes xmalloc to get memory.
10351         Fix a couple of other minor bugs while we're at it.
10352
10353         * savedir.c (<unistd.h>): Do not include; there's no need.
10354         (NAMLEN): Remove macro.
10355         (malloc, realloc): Remove decls.
10356         (stpcpy): Likewise.
10357         ("xalloc.h"): Include.
10358         (NAME_SIZE_DEFAULT): New macro.
10359         (savedir): Use xmalloc / xrealloc to allocate memory.
10360         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10361         Skip "" directory entries.
10362         Use strlen to calculate directory entry length, since the old method
10363         is rarely used these days and isn't worth supporting.
10364         Don't use a pointer after freeing it.
10365         Check for integer overflow when calculating allocation size.
10366         Use memcpy to copy entries, instead of stpcpy.
10367         Set errno properly when returning NULL.
10368         Check for readdir error.
10369
10370 2000-06-26  Jim Meyering  <meyering@lucent.com>
10371
10372         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10373
10374 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10375
10376         * getusershell.c (xmalloc, xrealloc): Remove functions.
10377         Include xalloc.h.
10378         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10379
10380 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10381
10382         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10383
10384 2000-06-24  Jim Meyering  <meyering@lucent.com>
10385
10386         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10387
10388 2000-06-21  Jim Meyering  <meyering@lucent.com>
10389
10390         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10391
10392 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10393
10394         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10395         (mbrtowc, mbstate_t): Define substitutes if
10396         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10397         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10398         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10399
10400 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10401
10402         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10403         than 1024, return a memory chunk of least possible size, instead
10404         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10405         Use free/xmalloc instead of xrealloc to avoid copying for very long
10406         paths.
10407
10408 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10409
10410         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10411         address, not strdup.  Include <stdlib.h> and don't declare free().
10412
10413 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10414
10415         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10416         the empty string.
10417
10418 2000-06-21  Jim Meyering  <meyering@lucent.com>
10419
10420         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10421         (noinst_HEADERS): Add getstr.h.
10422
10423         * getline.c (getstr): Move into a separate file.
10424         * getstr.c (getstr): New file, extracted from getline.c, with
10425         the following changes: new parameter, delim2; both delim[12]
10426         parameters have type `int', not `char'.  The latter would lose
10427         with 8-bit delimiters.
10428         * getstr.h: New file.
10429
10430 2000-06-19  Jim Meyering  <meyering@lucent.com>
10431
10432         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10433
10434 2000-06-18  Jim Meyering  <meyering@lucent.com>
10435
10436         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10437         Besides, these days every porting target provides a mkdir function.
10438
10439         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10440         (this snippet comes from src/system.h).
10441
10442 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10443
10444         * human.c (adjust_value): New function.
10445         (human_readable_inexact): Apply rounding style even when
10446         printing approximate values.
10447
10448 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10449
10450         * human.c (human_readable_inexact): Allow an input block
10451         size that is not a multiple of the output block size, and vice versa.
10452         Reported by Piergiorgio Sartor.
10453
10454 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10455
10456         * getdate.y (get_date): Apply relative times after time
10457         zone indicator, not before.  Reported by Todd A. Jacobs.
10458
10459 2000-06-13  Jim Meyering  <meyering@lucent.com>
10460
10461         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10462
10463         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10464
10465 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10466
10467         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10468
10469 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10470
10471         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10472
10473 2000-06-04  Jim Meyering  <meyering@lucent.com>
10474
10475         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10476         SunOS 4.1.4 for which gid_t is an unsigned type.
10477
10478 2000-06-03  Jim Meyering  <meyering@lucent.com>
10479
10480         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10481
10482 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10483
10484         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10485         newer, don't install charset.alias.
10486         * config.charset: Change the Linux/glibc rules so they become empty
10487         on glibc-2.1 or newer.
10488
10489 2000-06-02  Jim Meyering  <meyering@lucent.com>
10490
10491         * mountlist.c: Back out last change.  Instead, do this...
10492         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10493         member using the same `ignore'-testing code.
10494         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10495         fs_type strings.
10496         From Mark D. Roth.
10497
10498 2000-05-29  Jim Meyering  <meyering@lucent.com>
10499
10500         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10501         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10502
10503 2000-05-22  Jim Meyering  <meyering@lucent.com>
10504
10505         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10506
10507 2000-05-18  Jim Meyering  <meyering@lucent.com>
10508
10509         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10510         back, too, since it may have been modified by allocate_entry.
10511         (hash_delete): Rewrite to use neither the assignment operator
10512         nor the comma operator in an if-expression.
10513
10514 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10515
10516         * closeout.c:
10517         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10518         Remove; no longer needed.
10519         "quotearg.h": Add include.
10520         (file_name): Do not bother to explicitly initialize to NULL; it's less
10521         efficient on some hosts.
10522         (close_stdout_status): Remove test as to whether stdout was already
10523         closed; it breaks for the case "echo x | sort >&-".
10524         Quote file name colons.
10525         Do not assume that _("write error") lacks format strings.
10526
10527 2000-05-15  Jim Meyering  <meyering@lucent.com>
10528
10529         * version-etc.c (version_etc_copyright): Update the copyright string
10530         used in all --version output.
10531
10532 2000-05-14  Jim Meyering  <meyering@lucent.com>
10533
10534         * closeout.c (close_stdout_set_file_name): New function.
10535         (close_stdout_status): Use new file-scoped global.
10536         Return right away if fstat says the stdout file descriptor is invalid.
10537         * closeout.h (close_stdout_set_file_name): Declare.
10538
10539 2000-05-10  Jim Meyering  <meyering@lucent.com>
10540
10541         * closeout.c [default_exit_status]: New file-scoped variable.
10542         (close_stdout_set_status): New function.
10543         * closeout.h (close_stdout_set_status): Declare.
10544
10545 2000-05-08  Jim Meyering  <meyering@lucent.com>
10546
10547         * long-options.c: Don't include closeout.h.
10548         (parse_long_options): Don't call close_stdout for --version.
10549
10550 2000-05-06  Jim Meyering  <meyering@lucent.com>
10551
10552         * strnlen.c: Undefine __strnlen and strnlen.
10553         [!weak_alias]: Define __strnlen to strnlen.
10554
10555         * atexit.c: New file, from libiberty.
10556
10557 2000-05-06  Jim Meyering  <meyering@lucent.com>
10558
10559         * closeout.c (close_stdout_status): Also check for errors on the
10560         stderr stream.
10561
10562 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10563
10564         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10565         instead of xmalloc, xrealloc, path_concat.
10566         (locale_charset): Treat empty environment variables as absent.
10567         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10568
10569 2000-05-04  Jim Meyering  <meyering@lucent.com>
10570
10571         * getopt.c: Update from glibc.
10572         * obstack.c: Likewise.
10573         * obstack.h: Likewise.
10574         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10575
10576         * regex.h: Likewise.
10577         * strndup.c: Likewise.
10578         * strnlen.c: New file, from glibc.
10579
10580 2000-05-01  Jim Meyering  <meyering@lucent.com>
10581
10582         * full-write.c (full_write): Remove `FIXME' part of comment.
10583
10584 2000-04-29  Jim Meyering  <meyering@lucent.com>
10585
10586         * path-concat.c: Declare strdup only if it's not defined.
10587         * canon-host.c: Likewise.
10588
10589 2000-04-28  Jim Meyering  <meyering@lucent.com>
10590
10591         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10592         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10593         included first, then limits.h is included by locale.h by libintl.h.
10594         From John David Anglin.
10595
10596 2000-04-25  Jim Meyering  <meyering@lucent.com>
10597
10598         * makepath.c (S_IRWXUGO): Define.
10599         (make_path): Always perform explicit chmod if MODE specifies any
10600         of the `special' permission bits.  Prompted by a bug report against
10601         install from Mate Wierdl and Joost van Baal.
10602
10603 2000-04-18  Jim Meyering  <meyering@lucent.com>
10604
10605         * README: New file.
10606
10607         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10608         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10609
10610 2000-04-17  Jim Meyering  <meyering@lucent.com>
10611
10612         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10613         the definition of it to rpl_strftime also defined-away the system's
10614         declaration.
10615
10616 2000-04-15  Jim Meyering  <meyering@lucent.com>
10617
10618         Use `C' to denote so-called `contiguous' files, the same way
10619         that tar does.
10620         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10621         (ftypelet): Use S_ISCTG.
10622         From Michael Deutschmann.
10623
10624 2000-04-14  Jim Meyering  <meyering@lucent.com>
10625
10626         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10627
10628 2000-04-08  Jim Meyering  <meyering@lucent.com>
10629
10630         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10631         names don't conflict.  Reported by Eli Zaretskii.
10632
10633 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10634
10635         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10636         bug.  Deal with the different error behavior of Irix iconv.
10637
10638 2000-04-07  Jim Meyering  <meyering@lucent.com>
10639
10640         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10641         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10642
10643 2000-04-05  Jim Meyering  <meyering@lucent.com>
10644
10645         Portability tweaks required for ultrix4.3.
10646         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10647         * readutmp.c: Include sys/types.h before sys/stat.h.
10648         * canon-host.c: Declare strdup.
10649         * path-concat.c: Likewise.
10650         From John David Anglin.
10651
10652 2000-04-04  Jim Meyering  <meyering@lucent.com>
10653
10654         Be more DOS 8.3-friendly.
10655         * ref-add.sin: Renamed from ref-add.sed.in.
10656         * ref-del.sin: Renamed from ref-del.sed.in.
10657         * Makefile.am: Reflect renaming.
10658         Reported by Eli Zaretskii.
10659
10660         Use a temporary file name that won't clash with `charset.alias'
10661         in the DOS 8.3 name space.
10662         * Makefile.am (charset_tmp): Define.
10663         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10664         (uninstall-local): Likewise.
10665         Reported by Eli Zaretskii.
10666
10667 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10668
10669         * time/strftime.c (my_strftime): Make sure we call the system
10670         strftime, not ourselves, when invoking the underlying strftime.
10671
10672 2000-03-24  Jim Meyering  <meyering@lucent.com>
10673
10674         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10675         (charset_alias): Define.
10676         (install-exec-local): Factor out common code.
10677         (uninstall-local): Split lines longer than 80.
10678         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10679         (SUFFIXES): Define.
10680         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10681         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10682
10683 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10684
10685         * config.charset: Output a line containing "Packages using this file".
10686         * ref-add.sed.in, ref-del.sed.in: New files.
10687         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10688         ref-del.sed): New rules.
10689
10690 2000-03-17  Jim Meyering  <meyering@lucent.com>
10691
10692         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10693         Otherwise, include <strings.h>
10694
10695 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10696
10697         * unicodeio.c (utf8_wctomb): New function.
10698         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10699         format instead of in UCS-4 with platform dependent endianness.
10700
10701 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10702
10703         * savedir.c (savedir): Work even if directory size is
10704         negative; this can happen with some screwy NFS configurations.
10705
10706 2000-03-06  Jim Meyering  <meyering@lucent.com>
10707
10708         * localcharset.c (get_charset_aliases): Don't try to free file_name
10709         if it's NULL (because we ran out of memory).  From Bruno Haible.
10710
10711 2000-03-05  Jim Meyering  <meyering@lucent.com>
10712
10713         * localcharset.c ("path-concat.h"): Include.
10714         (get_charset_aliases): Use path_concat instead of ANSI string
10715         concatenation.
10716
10717         * unicodeio.h (PARAMS): Define.
10718         Use it to guard prototype.
10719
10720 2000-03-04  Jim Meyering  <meyering@lucent.com>
10721
10722         * Makefile.am (install-exec-local): Create $(libdir) before installing
10723         into it.
10724         (uninstall-local): Uncomment this rule so `make distcheck' works
10725         once again.
10726
10727         * unicodeio.c (<errno.h>): Include it.
10728         (errno): Declare if not defined.
10729
10730         * localcharset.c: Add Bruno's comment justifying use of volatile.
10731
10732         * config.charset: New version, incorporating remarks from a linux
10733         i18n mailing list.  From Bruno Haible.
10734
10735 2000-03-02  Jim Meyering  <meyering@lucent.com>
10736
10737         * Makefile.am (EXTRA_DIST): Add config.charset.
10738
10739 2000-03-01  Jim Meyering  <meyering@lucent.com>
10740
10741         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10742         * unicodeio.c: Likewise.
10743
10744 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10745
10746         * config.charset: New file.
10747         * localcharset.c: New file.
10748         * unicodeio.h, unicodeio.c: New files.
10749         * Makefile.am (DEFS): Add -DLIBDIR=...
10750         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10751         (noinst_HEADERS): Add unicodeio.h.
10752         (all-local, install-exec-local, charset.alias): New targets.
10753
10754 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10755
10756         * quotearg.c (ALERT_CHAR): New macro.
10757         (quotearg_buffer_restyled): Use it.
10758
10759 2000-02-27  Jim Meyering  <meyering@lucent.com>
10760
10761         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10762         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10763
10764         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10765         not `#if STDC_HEADERS'.
10766         Declare malloc if needed.
10767
10768         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10769         now that autoconf always defines the HAVE_DECL_ symbols.
10770         * human.c: Likewise.
10771         * same.c: Likewise.
10772         * strtoumax.c: Likewise.
10773
10774         * backupfile.c: Arrange for cpp to fail if the configure-time
10775         declaration check was not run.
10776         * hash.c: Likewise.
10777         * human.c: Likewise.
10778         * same.c: Likewise.
10779         * strtoumax.c: Likewise.
10780
10781         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10782         then first look up the entire `.'-containing string as a login name.
10783
10784 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10785
10786         * getdate.y: Handle two-digit years with leading zeros correctly.
10787         (textint): New typedef.
10788         (parser_control): Member year changed from int to textint.
10789         All uses changed.
10790         (YYSTYPE): Removed; replaced by %union with int and textint members.
10791         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10792         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10793         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10794         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10795         (date, number, to_year): Use width of number in digits, not its value,
10796         to determine whether it's a 2-digit year, or a 2-digit time.
10797         (yylex): Store number of digits of numeric tokens.
10798         Reported by John Kendall.
10799
10800         (parser_control): Changed from struct parser_control to typedef (for
10801         consistency).  All uses changed.
10802
10803         (tID): Removed; not used.
10804         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10805
10806 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10807
10808         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10809         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10810
10811 2000-02-12  Jim Meyering  <meyering@lucent.com>
10812
10813         * userspec.c (ISDIGIT): Define it.
10814         (isdigit): Remove definition.
10815         (is_number): Use ISDIGIT, not isdigit.
10816         <libintl.h>: Include.
10817         (_ and N_): Define.
10818         (parse_user_spec): Mark translatable strings.
10819
10820 2000-02-10  Jim Meyering  <meyering@lucent.com>
10821
10822         With these changes, nanosleep.[ch] are finally enough like the other
10823         lib/* replacement files to compile on a few more losing systems.
10824
10825         * nanosleep.h: Don't include config.h.
10826         Remove prototype from declaration of nanosleep.
10827         (PARAMS): Remove now-unneeded definition.
10828         * nanosleep.c: #undef nanosleep.
10829         (rpl_nanosleep): Rename from nanosleep.
10830
10831 2000-02-03  Jim Meyering  <meyering@lucent.com>
10832
10833         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10834         rather than with `#if HAVE_UTMPNAME'.
10835
10836 2000-02-01  Jim Meyering  <meyering@lucent.com>
10837
10838         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10839
10840 2000-01-31  Jim Meyering  <meyering@lucent.com>
10841
10842         * nanosleep.h (nanosleep): Guard declaration with
10843         `#if ! HAVE_DECL_NANOSLEEP'.
10844         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10845         the declaration in that vendor's sys/timers.h.
10846         Reported by Christian Krackowizer.
10847
10848         * quotearg.c (ISASCII): Add #undef and move definition to follow
10849         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10850         (ISPRINT): Likewise.
10851         Reported by Tom Tromey.
10852
10853 2000-01-30  Jim Meyering  <meyering@lucent.com>
10854
10855         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10856         uses of ->ut_name.  The latter doesn't work with new Linux header files
10857         where only utmpx.ut_user is declared.
10858
10859         * readutmp.h (UT_USER): Define.
10860
10861 2000-01-23  Jim Meyering  <meyering@lucent.com>
10862
10863         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10864         obstack.c.
10865
10866 2000-01-22  Jim Meyering  <meyering@lucent.com>
10867
10868         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10869         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10870         Required for some AIX systems.  Reported by Christian Krackowizer.
10871         [TESTING] (main): New function.
10872
10873         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10874         * dirname.c (dir_name): Support for DOS-style file names with drive
10875         letters.
10876
10877         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10878
10879         * strverscmp.c (ISDIGIT): Define.
10880         (strverscmp): Use ISDIGIT, not isdigit.
10881
10882 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10883
10884         * nanosleep.c (nanosleep):
10885         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10886         POSIX.1 doesn't require SA_INTERRUPT and some systems
10887         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10888         it's been part of POSIX.1 since day 1 (in 1988).
10889
10890 2000-01-17  Jim Meyering  <meyering@lucent.com>
10891
10892         * interlock: Remove unused file.  Reported by François Pinard.
10893
10894 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10895
10896         * quotearg.c (quotearg_buffer_restyled): Do not quote
10897         alert, backslash, formfeed, and vertical tab unnecessarily in
10898         shell quoting style.
10899
10900
10901 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10902 Free Software Foundation, Inc.
10903 Copying and distribution of this file, with or without modification,
10904 are permitted provided the copyright notice and this notice are preserved.