Handle the Woe32 SIGBREAK too.
[gnulib.git] / lib / ChangeLog
1 2006-10-04  Bruno Haible  <bruno@clisp.org>
2
3         * fatal-signal.c (fatal_signals) [WOE32]: Add the SIGBREAK signal.
4
5 2006-10-03  Bruno Haible  <bruno@clisp.org>
6
7         * gl_oset.h (gl_setelement_threshold_fn): New type.
8         (gl_oset_search_atleast): New declaration.
9         (struct gl_oset_implementation): Add field 'search_atleast'.
10         (gl_oset_search_atleast): New inline function.
11         * gl_oset.c (gl_oset_search_atleast): New function.
12         * gl_array_oset.c (gl_array_search_atleast): New function.
13         (gl_array_oset_implementation): Update.
14         * gl_anytree_oset.h (gl_tree_search_atleast): New function.
15         * gl_avltree_oset.c (gl_avltree_oset_implementation): Update.
16         * gl_rbtree_oset.c (gl_rbtree_oset_implementation): Update.
17
18 2006-10-04  Jim Meyering  <jim@meyering.net>
19
20         * fts.c (fts_open): Tiny comment change.
21
22 2006-10-03  Bruno Haible  <bruno@clisp.org>
23
24         * gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Renamed
25         from gl_avltreehash_list_implementation.
26
27 2006-10-03  Bruno Haible  <bruno@clisp.org>
28
29         * gl_oset.c (gl_oset_add): Fix return type.
30
31 2006-10-02  Dmitry V. Levin  <ldv@altlinux.org>
32
33         * fts.c (fts_close, fts_build, fts_palloc): Remove redundant checks.
34
35 2006-10-02  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
36
37         * quotearg.c (mbstate_t) [!HAVE_MBRTOWC]: #define to int.
38
39 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
40
41         Work around bug in Solaris 10 /proc file system:
42         /proc/self/fd/NNN/.. isn't the parent directory of
43         the directory whose file descriptor is NNN.  This needs to
44         be worked around at run time, not compile time, since a
45         program might be built on Solaris 8, where things work, and
46         run on Solaris 10.
47         * openat-priv.h (BUILD_PROC_NAME): Remove.  All callers changed
48         to use the following interface instead:
49         (OPENAT_BUFFER_SIZE): New macro.
50         (openat_proc_name): New function.
51         * at-func.c (AT_FUNC_NAME): Adjust to above changes.
52         * openat.c (openat_permissive, openat_needs_fchdir, fdopendir):
53         Likewise.
54         * openat-proc.c: New file.
55
56 2006-09-29  Bruno Haible  <bruno@clisp.org>
57
58         * fwriteerror.h (fwriteerror_no_ebadf): New declaration.
59         * (do_fwriteerror): Renamed from fwriteerror. Add ignore_ebadf
60         argument. Set stdout_closed before testing for ferror, not after.
61         (fwriteerror, fwriteerror_no_ebadf): New functions.
62
63 2006-09-28  Bruno Haible  <bruno@clisp.org>
64
65         * strndup.h: Simplify the redefinition of strndup.
66         (_GL_CONCAT, _GL_XCONCAT, __STRNDUP_ID): Remove macros.
67
68 2006-09-28  Bruno Haible  <bruno@clisp.org>
69
70         * gl_avltreehash_list.c: Include <stdint.h> instead of size_max.h.
71         * gl_linkedhash_list.c: Likewise.
72         * gl_rbtreehash_list.c: Likewise.
73
74 2006-09-28  Jim Meyering  <jim@meyering.net>
75
76         * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c".
77         Include <unistd.h>.
78
79 2006-09-27  Jim Meyering  <jim@meyering.net>
80
81         This file could end up with a definition for a function
82         named __strndup, rather than rpl_strndup on a system with
83         incomplete weak_alias support.
84         * strndup.c (strndup): Rename from __strndup.
85         Remove #defines that used to map __strndup to strndup.
86         Don't use K&R prototypes.
87         Remove LIBC-related code, since this file is not sync'd with glibc.
88         * strndup.h: Revamp, accordingly.
89
90 2006-09-27  Paul Eggert  <eggert@cs.ucla.edu>
91
92         * canon-host.c (canon_host_r): Work around bug in Darwin 7.9.0
93         getaddrinfo.
94
95         * __fpending.h: Don't include <stdio_ext.h> unless
96         HAVE_DECL___FPENDING.  This avoids a bug with lsbcc, where
97         it causes <stdio_ext.h> to cause a compile-time error.
98         Problem reported by Nelson H. F. Beebe.
99         * getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
100         of HAVE_DECL___PENDING.
101
102 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
103
104         * savewd.c: Include <signal.h>, for 'raise'.
105
106 2006-09-26  Eric Blake  <ebb9@byu.net>
107
108         * verror.c: Include <config.h> unconditionally.
109
110 2006-09-22  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
111
112         * gl_anylinked_list2.h [lint] (gl_linked_iterator)
113         (gl_linked_iterator_from_to): Initialize struct completely.
114         * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
115         (gl_tree_iterator_from_to): Likewise
116         * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
117         * gl_array_list.c [lint] (gl_array_iterator)
118         (gl_array_iterator_from_to): Likewise.
119         * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
120         * gl_carray_list.c [lint] (gl_carray_iterator)
121         (gl_carray_iterator_from_to): Likewise.
122
123         * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
124         * md4.c (md4_process_block): Remove unused variable.
125         * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
126         parentheses for clarity.
127
128 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
129
130         Import this patch from libc:
131
132         2006-09-06  Jakub Jelinek  <jakub@redhat.com>
133
134         * regex_internal.c (re_string_reconstruct): Handle
135         offset < pstr->valid_raw_len && pstr->offsets_needed case.
136         Ensure no bytes read before raw_mbs array.  Pass a saved copy of
137         pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
138         re_string_context_at.
139
140 2006-09-20  Bruno Haible  <bruno@clisp.org>
141
142         * mkdtemp.c: Import from libc.
143         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
144                 * sysdeps/posix/tempname.c (__gen_tempname): Change
145                 attempts_min into a macro.  Use preprocessor to decide how to
146                 initialize attempts [Coverity CID 67].
147         2001-11-27  Paul Eggert  <eggert@twinsun.com>
148                 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
149                 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
150
151 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
152
153         * mkstemp.h: New file, since some standard headers
154         #define mkstemp.
155         * mkstemp.c: Revamp to put the !_LIBC code together.
156         Include "mkstemp.h".
157         Make the _LIBC code resemble glibc original more,
158         e.g., use K&R style.
159         * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
160         (mkstemp): Remove, since mkstemp.h does this for us.
161         * stdlib--.h: Include mkstemp.h.
162
163         Import this patch from libc:
164
165         2006-04-07  Ulrich Drepper  <drepper@redhat.com>
166
167         * tempname.c (__gen_tempname): Change attempts_min
168         into a macro.  Use preprocessor to decide how to initialize
169         attempts [Coverity CID 67].
170
171 2006-09-18  Bruno Haible  <bruno@clisp.org>
172
173         * javaversion.c: Include configmake.h.
174
175 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
176
177         * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
178         that prevented coreutils 6.1 from building.  Problem reported
179         by Petter Reinholdtsen.
180
181 2006-09-18  Jim Meyering  <jim@meyering.net>
182
183         * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
184
185 2006-09-15  Paul Eggert  <eggert@cs.ucla.edu>
186
187         * dirchownmod.c: Don't include fcntl.h; no longer needed.
188         (dirchownmod): New arg FD.  All callers changed.
189         Use FD rather than opening the directory ourself, as opening is
190         now the caller's responsibility.
191         * dirchownmod.h: Likewise.
192         * mkancesdirs.c: Include <sys/types.h>, for portability to older
193         hosts that require <sys/types.h> before <sys/stat.h>.  Include
194         fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
195         (test_dir): Remove.
196         (mkancesdirs): Return length of prefix of FILE that has already
197         been made, or -2 if there is a child doing the work.  Redo
198         algorithm so that it is O(N) rather than O(N**2).  Optimize away
199         ".", and treat ".." specially since it might stray back into
200         already-created areas.  Use a subprocess if necessary.  New arg
201         WD; all users changed.  MAKE_DIR function should now return 1
202         if it creates a directory that is not readable.  Return -2 if
203         a child process is spun off.
204         * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
205         Adjust signature to match code.
206         * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
207         (make_dir_parents): Use a subprocess if necessary.  New arg WD;
208         all users changed.
209         * savewd.c, savewd.h: New files.
210
211 2006-09-15  Jim Meyering  <jim@meyering.net>
212
213         * rename-dest-slash.c (has_trailing_slash): Use
214         FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
215         (rpl_rename_dest_slash): Perform the cheaper trailing slash
216         test before testing whether SRC is a directory.
217         Suggestions from Bruno Haible.
218
219         Avoid a warning about an unused variable.
220         * regex_internal.c (re_dfa_add_node): Move declaration of "type"
221         into the #ifdef block where it's used.
222
223         * rename-dest-slash.c: New file.
224
225 2006-09-14  Bruno Haible  <bruno@clisp.org>
226
227         * allocsa.c: Include <config.h> unconditionally.
228         * asnprintf.c: Likewise.
229         * asprintf.c: Likewise.
230         * c-strcasecmp.c: Likewise.
231         * c-strcasestr.c: Likewise.
232         * c-strncasecmp.c: Likewise.
233         * c-strstr.c: Likewise.
234         * classpath.c: Likewise.
235         * clean-temp.c: Likewise.
236         * concatpath.c: Likewise.
237         * copy-file.c: Likewise.
238         * csharpcomp.c: Likewise.
239         * csharpexec.c: Likewise.
240         * execute.c: Likewise.
241         * fatal-signal.c: Likewise.
242         * findprog.c: Likewise.
243         * fwriteerror.c: Likewise.
244         * gl_array_list.c: Likewise.
245         * gl_array_oset.c: Likewise.
246         * gl_avltree_list.c: Likewise.
247         * gl_avltree_oset.c: Likewise.
248         * gl_avltreehash_list.c: Likewise.
249         * gl_carray_list.c: Likewise.
250         * gl_linked_list.c: Likewise.
251         * gl_linkedhash_list.c: Likewise.
252         * gl_list.c: Likewise.
253         * gl_oset.c: Likewise.
254         * gl_rbtree_list.c: Likewise.
255         * gl_rbtree_oset.c: Likewise.
256         * gl_rbtreehash_list.c: Likewise.
257         * imaxabs.c: Likewise.
258         * imaxdiv.c: Likewise.
259         * javacomp.c: Likewise.
260         * javaexec.c: Likewise.
261         * javaversion.c: Likewise.
262         * linebreak.c: Likewise.
263         * localcharset.c: Likewise.
264         * lock.c: Likewise.
265         * mbchar.c: Likewise.
266         * mbswidth.c: Likewise.
267         * mkdtemp.c: Likewise.
268         * pipe.c: Likewise.
269         * printf-args.c: Likewise.
270         * printf-parse.c: Likewise.
271         * progname.c: Likewise.
272         * progreloc.c: Likewise.
273         * readlink.c: Likewise.
274         * sh-quote.c: Likewise.
275         * stpcpy.c: Likewise.
276         * stpncpy.c: Likewise.
277         * strcasecmp.c: Likewise.
278         * strcasestr.c: Likewise.
279         * strcspn.c: Likewise.
280         * striconv.c: Likewise.
281         * strncasecmp.c: Likewise.
282         * strnlen1.c: Likewise.
283         * strstr.c: Likewise.
284         * strtok_r.c: Likewise.
285         * tls.c: Likewise.
286         * tmpdir.c: Likewise.
287         * unicodeio.c: Likewise.
288         * unsetenv.c: Likewise.
289         * vasnprintf.c: Likewise.
290         * vasprintf.c: Likewise.
291         * wait-process.c: Likewise.
292         * xallocsa.c: Likewise.
293         * xsetenv.c: Likewise.
294         * xstriconv.c: Likewise.
295
296 2006-09-13  Eric Blake  <ebb9@byu.net>
297
298         * getopt.c: Fix typo in last commit.
299
300 2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
301
302         * _fpending.c: Include <config.h> unconditionally, since we no
303         longer worry about uses that don't define HAVE_CONFIG_H.
304         * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
305         * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
306         * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
307         * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
308         * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
309         * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
310         * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
311         * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
312         * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
313         * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
314         * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
315         * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
316         * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
317         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
318         * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
319         * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
320         * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
321         * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
322         * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
323         * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
324         * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
325         * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
326         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
327         * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
328         * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
329         * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
330         * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
331         * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
332         * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
333         * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
334         * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
335         * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
336         * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
337         * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
338         Likewise.
339
340 2006-09-12  Jim Meyering  <jim@meyering.net>
341
342         * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
343         compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
344         Reported by Nelson H. F. Beebe.
345
346 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
347
348         * argp-help.c (argp_doc): Make sure NULL is not passed to
349         dgettext.
350
351 2006-09-10  Bruno Haible  <bruno@clisp.org>
352
353         * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
354
355 2006-09-10  Sergey Poznyakoff  <gray@gnu.org.ua>
356
357         * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
358         program_invocation_name and program_invocation_short_name are
359         initialized.
360         * argp-namefrob.h: Move declarations of program_invocation_name
361         and program_invocation_short_name to argp.h, so they are visible
362         to user programs.
363         * argp.h: Likewise
364
365 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
366
367         * argp.h (struct argp): Document the N_("..") "\v" N_("..")
368         convention.  Text proposed by Bruno Haible.
369         (struct argp_option): Document the use of N_() wrappers.
370
371         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
372         and translate the two parts separately, instead of feeding
373         the whole string to gettext.  This allows to exclude
374         '\v' from the strings visible to the translator by writing doc
375         strings as N_("..") "\v" N_("..").
376
377 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
378
379         * mktime.c (guess_time_tm): Fix bug where mktime
380         returned the maximum time_t value rather than (time_t) -1.
381         Problem originally reported by William Bardwell
382         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
383
384         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
385         Moved to here ...
386         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
387         ... from here.
388
389 2006-09-06  Bruno Haible  <bruno@clisp.org>
390
391         * striconv.h: New file.
392         * striconv.c: New file, merging iconvme.c with GNU gettext's
393         iconvstring.c.
394         * xstriconv.h: New file.
395         * xstriconv.c: New file.
396
397 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
398
399         * argz_.h: Sync from Libtool.
400
401         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
402                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
403
404         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
405
406 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
407
408         * trim.h: New file.
409         * trim.c: New file.
410
411 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
412
413         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
414         Problem reported by Ralf Wildenhues in
415         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
416
417         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
418         HAVE_STRUCT_STATFS_F_FSTYPENAME.
419
420 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
421
422         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
423         or stdbool.h, because they might not exist while configuring.
424
425         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
426         Don't include unistd.h or limits.h; not needed, since chdir-long.h
427         does that for us.
428         (O_DIRECTORY): Remove.
429
430 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
431
432         Work around a bug in both the Linux and SunOS 64-bit kernels:
433         nanosleep mishandles sleeps for longer than 2**31 seconds.
434         Problem reported by Frank v Waveren in
435         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
436         * nanosleep.c (BILLION): New constant.
437         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
438         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
439
440 2006-08-30  Jim Meyering  <jim@meyering.net>
441
442         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
443         the parameter.
444
445 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
446
447         * isapipe.c, isapipe.h: New files.
448
449 2006-08-29  Eric Blake  <ebb9@byu.net>
450
451         * error.c (error_at_line, print_errno_message): Match libc, after
452         resolution of upstream bug 3044.
453
454 2006-08-29  Bruno Haible  <bruno@clisp.org>
455
456         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
457
458 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
459
460         Sync from Libtool:
461
462         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
463
464         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
465         sharing with gnulib.  Report by Eric Blake.
466
467 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
468
469         * fcntl_.h: New file.
470         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
471         the fcntl module.
472         * dirchownmod.c: Likewise.
473         * fts.c: Likewise.
474
475         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
476         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
477         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
478         just before including <inttypes.h>, to avoid circular inclusion.
479
480 2006-08-28  Bruno Haible  <bruno@clisp.org>
481
482         * inttypes_.h (SCNX*): Remove definitions.
483         Reported by Eric Blake.
484
485 2006-08-26  Bruno Haible  <bruno@clisp.org>
486
487         * vasnprintf.c (EOVERFLOW): Remove definition.
488         (VASNPRINTF): Return a string of length > INT_MAX without failing.
489         * vasprintf.c: Include errno.h, limits.h.
490         (EOVERFLOW): New fallback definition.
491         (vasprintf): Test here whether the string length is > INT_MAX.
492         * vsnprintf.c: Include errno.h, limits.h.
493         (EOVERFLOW): New fallback definition.
494         (vsnprintf): Fix bug when generated string was too long for the buffer.
495         Test here whether the string length is > INT_MAX.
496
497 2006-08-26  Bruno Haible  <bruno@clisp.org>
498             Simon Josefsson  <jas@extundo.com>
499
500         BeOS portability.
501         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
502
503 2006-08-28  Bruno Haible  <bruno@clisp.org>
504
505         * c-strstr.h: New file, from GNU gettext.
506         * c-strstr.c: New file, from GNU gettext.
507
508 2006-08-26  Bruno Haible  <bruno@clisp.org>
509
510         * inttypes_.h: New file.
511         * inttypes.h: Remove file.
512         * stdint_.h: Include <inttypes.h> through its absolute filename.
513
514         * imaxabs.c: New file.
515
516         * imaxdiv.c: New file.
517
518 2006-08-22  Bruno Haible  <bruno@clisp.org>
519
520         * readutmp.h: Skip most definitions if neither <utmp.h> nor
521         <utmpx.h> exists.
522
523 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
524
525         BeOS portability.
526         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
527         Problem reported by Bruno Haible.
528
529 2006-08-21  Bruno Haible  <bruno@clisp.org>
530
531         BeOS portability.
532         * mbchar.h: Include <wctype.h> only if it exists.
533
534 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
535
536         * cycle-check.h: Include <stdint.h> unconditionally, since we
537         now assume the stdint module.  Do not include inttypes.h.
538         * fsusage.h: Likewise.
539         * getndelim2.c: Likewise.
540         * human.h: Likewise.
541         * inttostr.h: Likewise.
542         * obstack.c: Likewise.
543         * regex_internal.h: Likewise.
544         * tempname.c: Likewise.
545         * utimecmp.c: Likewise.
546         * xstrtol.h: Likewise.
547
548         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
549
550         * strtoimax.c: Adjust to macro name changes in Autoconf,
551         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
552         * xtime.h: Likewise.
553
554 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
555
556         * fchmodat.c: New file, from coreutils.  This was inadvertently
557         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
558
559 2006-08-18  Bruno Haible  <bruno@clisp.org>
560
561         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
562         (ME_DUMMY): Treat "kernfs" as a dummy.
563         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
564
565 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
566
567         Update from coreutils.
568
569         * __fpending.h: Add copyright notice.
570         * fprintftime.h: Likewise.
571         * savedir.c: Use (C) in copyright notice.
572         * savedir.h: Likewise.
573
574         2006-08-15  Jim Meyering  <jim@meyering.net>
575
576         * at-func.c: New file, with the logic of all emulated at-functions.
577         * openat-priv.h: Include <errno.h> and define ENOSYS,
578         in support of the EXPECTED_ERRNO macro.
579         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
580         Instead, define the appropriate symbols and include "at-func.c".
581         * mkdirat.c (mkdirat): Likewise.
582         * fchmodat.c (fchmodat): Likewise.
583         (ENOSYS): Remove definition.
584         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
585         Don't include "unistd--.h" -- it wasn't ever used.
586
587         2006-01-17  Jim Meyering  <jim@meyering.net>
588
589         Rewrite fts.c not to change the current working directory,
590         by using openat, fstatat, fdopendir, etc..
591
592         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
593         (HAVE_OPENAT_SUPPORT): Define.
594         [_LIBC] (fchdir): Don't undef or define; no longer used.
595         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
596         Now, this `function' always succeeds, and consumes its file descriptor
597         parameter -- so callers must not close such FDs.  Update callers.
598         (diropen_fd, opendirat, cwd_advance_fd): New functions.
599         (diropen): Add parameter, SP.  Adjust all callers.
600         Implement using diropen_fd, rather than open.
601         (fts_open): Initialize new member, fts_cwd_fd.
602         Remove fts_rft-setting code.
603         (fts_close): Close fts_cwd_fd, if necessary.
604         (__opendir2): Define in terms of opendir or opendirat,
605         depending on whether the FST_NOCHDIR flag is set.
606         (fts_build): Since fts_safe_changedir consumes its FD, and since
607         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
608         and close the dup'd file descriptor upon failure.
609         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
610         (fts_safe_changedir): Tweak semantics to reflect that this function
611         now calls cwd_advance_fd and hence consumes its FD argument.
612         * fts_.h [struct FTS] (fts_cwd_fd): New member.
613         [struct FTS] (fts_rft): Remove now-unused member.
614         [struct FTS] (fts_cycle.state): Improve comment.
615
616         * openat.c (openat_needs_fchdir): New function.
617         * openat.h (openat_needs_fchdir): Declare it.
618
619 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
620
621         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
622         Problem and fix reported by Pádraig Brady in
623         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
624
625 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
626
627         * memcoll.c (memcoll): Optimize for the common case where the
628         arguments are bytewise equal.
629
630 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
631
632         Change copyright notice from LGPL 2 to GPL 2, since that's the
633         standard form used in the gnulib repository.
634         * lock.c: LGPL -> GPL.
635         * lock.h: Likewise.
636         * strnlen1.c: Likewise.
637         * strnlen1.h: Likewise.
638         * tls.c: Likewise.
639         * tls.h: Likewise.
640         * tmpdir.c: Likewise.
641
642         * TODO: Remove; this belongs only in coreutils.
643
644 2006-08-14  Eric Blake  <ebb9@byu.net>
645
646         Import the following change from libc:
647
648         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
649
650         Upstream bug 2997.
651         * misc/error.c: Add space between program name and message if file
652         name is missing.
653
654 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
655
656         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
657         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
658
659         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
660         in wchar_t.  Problem reported by Eric Blake.
661
662         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
663         LEN is smaller than SIZE.  Suggested by Bruno Haible.
664         Also, help the compiler to keep LEN in a register.
665
666 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
667
668         * .cppi-disable: Add snprintf.h, socket_.h.
669         * snprintf.c: Include <errno.h> and <limits.h>.
670         (EOVERFLOW): Define if the system does not.
671         Do not include "minmax.h"; it wasn't used.
672         (snprintf): Don't assume size_t promotes to an unsigned type.
673         Fix bug when generated string was too long for the buffer: the
674         buffer's contents are supposed to be the initial prefix of the
675         output.  Don't assume vasnprintf returns EOVERFLOW if the size
676         exceeds INT_MAX; do the check ourselves.
677
678         Import the following changes from libc:
679
680         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
681
682         * posix/regex_internal.c (re_string_skip_chars): If no character has
683         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
684         to the byte which couldn't be converted.
685         (re_string_reconstruct): Don't clear valid_raw_len before calling
686         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
687         tip_context using re_string_context_at.
688
689         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
690
691         * posix/regex.h: g++ still cannot handled [restrict].
692
693         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
694
695         * posix/regex.h: Remove special handling for VMS.
696
697 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
698
699         Sync from coreutils.
700
701         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
702
703         * mountlist.c [ME_REMOTE]: Filter out cifs.
704         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
705
706 2006-08-08  Eric Blake  <ebb9@byu.net>
707
708         * verror.c (verror_at_line): Work around glibc bug 2997, so that
709         verror_at_line output complies with GNU Coding Standards even when
710         file is NULL.
711
712 2006-08-08  Eric Blake  <ebb9@byu.net>
713
714         * verror.h, verror.c: New files.
715
716 2006-08-07  Bruno Haible  <bruno@clisp.org>
717
718         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
719         versions of AIX.
720         Reported by Ralf Wildenhues.
721
722 2006-08-06  Eric Blake  <ebb9@byu.net>
723
724         * error.h: Fold in some upstream changes from glibc.
725         * error.c: Likewise.
726
727 2006-07-29  Bruno Haible  <bruno@clisp.org>
728
729         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
730
731 2006-07-29  Bruno Haible  <bruno@clisp.org>
732
733         * setenv.c: Undo unintended modification done on 2006-02-27.
734
735 2006-07-28  Eric Blake  <ebb9@byu.net>
736
737         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
738         macro expansion.
739
740 2006-07-28  Simon Josefsson  <jas@extundo.com>
741
742         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
743         #include's.
744
745 2006-07-28  Simon Josefsson  <jas@extundo.com>
746
747         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
748         #include's.
749
750 2006-07-28  Bruno Haible <bruno@clisp.org>
751
752         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
753
754 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
755
756         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
757         arpa/inet.h.
758
759 2006-07-28  Bruno Haible  <bruno@clisp.org>
760
761         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
762         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
763         fallbacks.
764         Avoids link error on FreeBSD 4.x.
765         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
766
767         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
768         encoding.
769         * mbswidth.c (iswcntrl): Likewise.
770
771 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
772
773         * modechange.c (mode_compile): Numeric modes now affect setuid and
774         setgid on directories only if they set these bits.
775         * modechange.h: Remove obsolete comment about masks.
776
777 2006-07-27  Bruno Haible  <bruno@clisp.org>
778
779         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
780         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
781         defined.
782
783 2006-07-26  Eric Blake  <ebb9@byu.net>
784
785         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
786         like mingw that lack mkstemp.
787         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
788         avoid compilation warning on mingw.
789
790 2006-07-25  Bruno Haible  <bruno@clisp.org>
791
792         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
793         <stdarg.h> or config.h.
794
795 2006-07-24  Bruno Haible  <bruno@clisp.org>
796
797         * clean-temp.h: New file, from GNU gettext.
798         * clean-temp.c: New file, from GNU gettext.
799
800 2006-07-24  Bruno Haible  <bruno@clisp.org>
801
802         * tmpdir.h: New file, from GNU gettext.
803         * tmpdir.c: New file, from GNU gettext.
804
805 2006-07-23  Bruno Haible  <bruno@clisp.org>
806
807         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
808         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
809         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
810         gl_linked_remove_at): Use it.
811
812 2006-07-23  Eric Blake  <ebb9@byu.net>
813
814         * tmpfile-safer.c: New file.
815         * stdio-safer.h (fopen_safer): Add prototype.
816         * stdio--.h (tmpfile): Make safer.
817
818 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
819
820         * close-stream.c, close-stream.h: New files.
821
822 2006-07-22  Bruno Haible  <bruno@clisp.org>
823
824         Merge from GNU gettext 0.15.
825
826         2005-07-05  Bruno Haible  <bruno@clisp.org>
827
828                 * printf-args.c (printf_fetchargs): Work around broken
829                 definition of wint_t on mingw.
830
831         2005-02-12  Bruno Haible  <bruno@clisp.org>
832
833                 * xallocsa.h: Add extern "C" for C++.
834
835         2006-05-17  Bruno Haible  <bruno@clisp.org>
836
837                 Cygwin portability.
838                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
839
840         2006-04-30  Bruno Haible  <bruno@clisp.org>
841
842                 * progreloc.c: Include <mach-o/dyld.h> if available.
843                 (find_executable): Use _NSGetExecutablePath when possible.
844
845         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
846
847                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
848                 function.
849
850         2005-12-29  Bruno Haible  <bruno@clisp.org>
851
852                 * progreloc.c (set_program_name_and_installdir): Fix
853                 compilation error.
854
855         2005-12-04  Bruno Haible  <bruno@clisp.org>
856
857                 Cygwin portability.
858                 * progreloc.c: Include <windows.h> also on Cygwin.
859                 (find_executable): Add support for Cygwin.
860                 (set_program_name_and_installdir): Handle also platforms with
861                 nonempty EXEEXT.
862
863         2006-07-11  Bruno Haible  <bruno@clisp.org>
864
865                 * javacomp.c: Fix a comment.
866                 Reported by Jim Meyering.
867
868         2006-04-30  Bruno Haible  <bruno@clisp.org>
869
870                 * javacomp.h (compile_java_class): Add source_version,
871                 target_version arguments.
872                 * javacomp.c: Rewritten to choose only a compiler that
873                 respects the specified source_version and target_version.
874
875         2006-06-27  Bruno Haible  <bruno@clisp.org>
876
877                 Assume correct S_ISDIR macro.
878                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
879
880         2006-07-22  Bruno Haible  <bruno@clisp.org>
881
882                 * javaversion.h: New file, from GNU gettext.
883                 * javaversion.c: New file, from GNU gettext.
884                 * javaversion.java: New file, from GNU gettext.
885                 * javaversion.class: New file, from GNU gettext.
886
887         2006-05-17  Bruno Haible  <bruno@clisp.org>
888
889                 Cygwin portability.
890                 * javaexec.c (execute_java_class): Test for jview program
891                 also on Cygwin.
892
893         2006-04-09  Bruno Haible  <bruno@clisp.org>
894
895                 * fatal-signal.c: Don't include string.h.
896                 (at_fatal_signal): Use a copying loop instead of memcpy.
897
898         2005-12-04  Bruno Haible  <bruno@clisp.org>
899
900                 * csharpexec.c: Add support for 'clix' launcher (untested).
901                 (execute_csharp_using_sscli): New function.
902                 (execute_csharp_program): Call it.
903
904         2006-06-21  Bruno Haible  <bruno@clisp.org>
905
906                 Avoid warnings from recent versions of mcs.
907                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
908                 -o, -L, -r any more. Use options documented since mcs-1.0
909                 instead. Similarly for -g.
910
911         2005-07-09  Bruno Haible  <bruno@clisp.org>
912
913                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
914                 add a .dll suffix.
915                 Reported by Mark Junker <mjscod@gmx.de>.
916
917         2006-06-17  Bruno Haible  <bruno@clisp.org>
918
919                 * config.charset: Update for NetBSD 3.0.
920
921         2006-05-17  Bruno Haible  <bruno@clisp.org>
922
923                 Cygwin portability.
924                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
925
926         2006-05-16  Bruno Haible  <bruno@clisp.org>
927
928                 * localcharset.c [CYGWIN]: Include <windows.h>.
929                 (get_charset_aliases): For Cygwin, return the same CPxxx
930                 aliases list as under WIN32.
931                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
932                 the environment variables. Fall back to GetACP().
933
934         2006-04-05  Bruno Haible  <bruno@clisp.org>
935
936                 * config.charset: Update Juan Manuel Guerrero's address.
937
938         2005-02-12  Bruno Haible  <bruno@clisp.org>
939
940                 * allocsa.h: Add extern "C" for C++.
941
942         2005-02-10  Bruno Haible  <bruno@clisp.org>
943
944                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
945                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
946
947         2006-07-22  Bruno Haible  <bruno@clisp.org>
948
949                 * gettext.h: Update to GNU gettext-0.15.
950
951 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
952         and Simon Josefsson <jas@extundo.com>
953
954         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
955
956         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
957
958 2006-07-21  Eric Blake  <ebb9@byu.net>
959
960         * stdlib-safer.h: New file from coreutils, required by
961         stdlib--.h.
962
963 2006-07-19  Derek R. Price  <derek@ximbiot.com>
964
965         * getaddrinfo.h: Don't define unimplemented AI_* flags.
966         Reindent and repaginate.
967
968 2006-07-17  Bruno Haible  <bruno@clisp.org>
969
970         * gl_list.h: New file.
971         * gl_list.c: New file.
972         * gl_array_list.h: New file.
973         * gl_array_list.c: New file.
974         * gl_carray_list.h: New file.
975         * gl_carray_list.c: New file.
976         * gl_linked_list.h: New file.
977         * gl_linked_list.c: New file.
978         * gl_anylinked_list1.h: New file.
979         * gl_anylinked_list2.h: New file.
980         * gl_avltree_list.h: New file.
981         * gl_avltree_list.c: New file.
982         * gl_anyavltree_list1.h: New file.
983         * gl_anyavltree_list2.h: New file.
984         * gl_rbtree_list.h: New file.
985         * gl_rbtree_list.c: New file.
986         * gl_anyrbtree_list1.h: New file.
987         * gl_anyrbtree_list2.h: New file.
988         * gl_anytree_list1.h: New file.
989         * gl_anytree_list2.h: New file.
990         * gl_linkedhash_list.h: New file.
991         * gl_linkedhash_list.c: New file.
992         * gl_anyhash_list1.h: New file.
993         * gl_anyhash_list2.h: New file.
994         * gl_avltreehash_list.h: New file.
995         * gl_avltreehash_list.c: New file.
996         * gl_rbtreehash_list.h: New file.
997         * gl_rbtreehash_list.c: New file.
998         * gl_anytreehash_list1.h: New file.
999         * gl_anytreehash_list2.h: New file.
1000
1001         * gl_oset.h: New file.
1002         * gl_oset.c: New file.
1003         * gl_array_oset.h: New file.
1004         * gl_array_oset.c: New file.
1005         * gl_avltree_oset.h: New file.
1006         * gl_avltree_oset.c: New file.
1007         * gl_rbtree_oset.h: New file.
1008         * gl_rbtree_oset.c: New file.
1009         * gl_anytree_oset.h: New file.
1010
1011 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
1012
1013         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
1014         New files.
1015         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
1016         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
1017         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
1018         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
1019         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
1020         callers changed.  Revamp internals significantly, by not
1021         attempting to create directories that are temporarily more
1022         permissive than the final results.  Do not attempt to use
1023         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
1024         This removes some race conditions, fixes some bugs, and simplifies
1025         things.  Use new dirchownmod function to do owner and mode changes.
1026         * mkdir-p.h: Likewise.
1027         * modechange.c (octal_to_mode): New function.
1028         (struct mode_change): New member mentioned.
1029         (make_node_op_equals): New arg mentioned.  All callers changed.
1030         (mode_compile): Keep track of which mode bits the user has explicitly
1031         mentioned.
1032         (mode_adjust): New arg DIR, so that we implement the X op correctly.
1033         New arg PMODE_BITS, to keep track of which mode bits the user
1034         mentioned; it treats S_ISUID and S_ISGID speciall.
1035         All callers changed.
1036         * modechange.h: Likewise.
1037
1038 2006-07-11  Derek R. Price  <derek@ximbiot.com>
1039
1040         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
1041
1042 2006-07-10  Derek R. Price  <derek@ximbiot.com>
1043
1044         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
1045         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
1046         macros into the GNU _D_EXACT_NAMLEN.
1047         * savedir.c:  Likewise.
1048         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
1049
1050 2006-07-09  Jim Meyering  <jim@meyering.net>
1051
1052         * argp-pv.c: Remove a doubled word in a comment.
1053         * check-version.c (check_version): Likewise.
1054         * javacomp.c (compile_java_class): Likewise.
1055
1056 2006-07-08  Jim Meyering  <jim@meyering.net>
1057
1058         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
1059
1060 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
1061
1062         * getaddrinfo.c: Changes to compile under MSVC6: changed
1063         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
1064         brackets.  Other minor changes to suppress some compiler
1065         warnings.
1066
1067 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1068
1069         * getloadavg.c: Use __VMS, not VMS.
1070         * getopt.c: Likewise.
1071         * getpagesize.h: Likewise.
1072         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
1073         probably does not work.
1074
1075 2006-07-06  Derek R. Price  <derek@ximbiot.com>
1076         and Paul Eggert  <eggert@cs.ucla.edu>
1077
1078         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
1079         Don't worry about this obsolete case any more.
1080         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
1081         directories.
1082         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
1083         worry about this obsolete case any more.
1084         * fts.c: Likewise.
1085         * getcwd.c: Likewise.
1086         * glob.h: Likewise.
1087         * savedir.c: Likewise.
1088
1089 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1090
1091         * .cppi-disable: Add wcwidth.
1092         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
1093         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
1094         (ISGRAPH): Remove.  All uses changed to isgraph.
1095         (FOLD) [!defined _LIBC]: Remove special case.
1096         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
1097         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
1098         HAVE_ISBLANK.
1099         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
1100
1101 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1102
1103         * strtod.c (strtod): cast the argument of tolower to unsigned char.
1104
1105 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
1106
1107         * memcasecmp.c: Include <limits.h>.
1108         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1109         * strtod.c (strtod): Don't assume isspace works on negative chars.
1110         Don't assume isdigit succeeds only on '0' through '9'.
1111
1112 2006-07-05  Derek R. Price  <derek@ximbiot.com>
1113
1114         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1115         All uses of is_space replaced by isspace.
1116         * exit.h: Don't talk about STDC_HEADERS.
1117         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
1118         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1119         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
1120         replaced by isprint etc.
1121         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1122         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1123         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1124         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1125         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1126         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1127
1128 2006-07-05  Eric Blake  <ebb9@byu.net>
1129
1130         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1131         missing from netdb.h.
1132         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1133
1134 2006-06-27  Bruno Haible  <bruno@clisp.org>
1135
1136         Assume ANSI C header files and <ctype.h> functions.
1137         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1138         (mbsnwidth): Use isprint, iscntrl instead.
1139
1140 2006-07-03  Jim Meyering  <jim@meyering.net>
1141
1142         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1143         macro is used before the first cycle_check call.
1144
1145 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1146
1147         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1148         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
1149         reported by Mark D. Baushke, one in
1150         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1151
1152         Merge from coreutils.
1153
1154         * .cppi-disable: Add stdint_.h.
1155         * .cvsignore: Add stdint.h.
1156
1157         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
1158
1159         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1160         both double and long double versions.
1161         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
1162         * xstrtold.c: New file.
1163         * xstrtod.h (xstrtold): New decl.
1164
1165         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1166
1167         * filemode.c (setst): Remove.
1168         (strmode): Rewrite to avoid setst.  This makes the code shorter,
1169         (arguably) clearer, and the generated code is a bit smaller on my
1170         Debian GNU/Linux stable x86 host.
1171
1172         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
1173
1174         * filemode.c: Include "filemode.h" first, to test the interface.
1175         Assume that filemode.h includes sys/types.h and sys/stat.h.
1176         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1177         (ftypelet): Reorder to put common cases first, for efficiency.
1178         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
1179         to do 'M'.
1180         (strmode): Renamed from mode_string, and now stores 12 bytes instead
1181         of 10, for compatibility with FreeBSD.  All callers changed.
1182         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1183         that can't be deduced solely from st_mode.  First arg is now a const
1184         pointer.
1185         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1186         (strmode): Renamed from mode_string.
1187         (filemodestring): New decl.
1188         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1189         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1190         (S_ISPORT, S_ISWHT): New macros, if not already defined.
1191
1192         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1193
1194         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1195         fsusage.h now does that.  Include fsusage.h first, to test interface.
1196         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
1197         at most one method (the old code could have generated decls that
1198         didn't conform to C89, not that this was ever exercised).
1199         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1200
1201         2006-03-19  Jim Meyering  <jim@meyering.net>
1202
1203         Work even in a chroot where d_ino values for entries in "/"
1204         don't match the stat.st_ino values for the same names.
1205         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1206         number, iterate through all entries again, using lstat instead.
1207         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1208         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1209
1210         * getcwd.c (__getcwd): Clarify a comment.
1211         Use memcpy in place of a call to strcpy.
1212
1213         2006-03-12  Jim Meyering  <jim@meyering.net>
1214
1215         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1216         that of the current directory (which we're about to chdir ".." out of),
1217         then save the dev-ino of the parent, instead.
1218
1219         * same-inode.h (SAME_INODE): New file/macro.
1220         * chdir-safer.c (SAME_INODE): Remove definition.
1221         Include "same-inode.h", instead.
1222         * same.c: Likewise.
1223         * cycle-check.h: Include "same-inode.h".
1224         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1225         * cycle-check.c (SAME_INODE): Remove definition.
1226         * root-dev-ino.h: Include "same-inode.h".
1227
1228         2006-03-11  Eric Blake  <ebb9@byu.net>
1229
1230         * same.c (same_name): s/base_name/last_component/
1231         * backupfile.c (check_extension, numbered_backup): Likewise.
1232         * filenamecat.c (file_name_concat): Likewise.
1233
1234         2006-03-11  Eric Blake  <ebb9@byu.net>,
1235                     Paul Eggert  <eggert@cs.ucla.edu>
1236
1237         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1238         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1239         drive prefix.
1240         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1241         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1242         (last_component): New method.
1243         * dirname.c (dir_len): Determine when drive letters need a
1244         subsequent slash.  Preserve // when it is special.
1245         (dir_name): Don't append dot when drive letter is absolute.
1246         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1247         * basename.c (base_name): New semantics - malloc the result.
1248         Preserve // when it is special.  Preserve relative files that look
1249         like drive letters.
1250         (base_len): Preserve // when it is special.
1251         (last_component): New method, similar to old base_name semantics.
1252         * stripslash.c (strip_trailing_slashes): Use last_component, not
1253         base_name.  Strip redundant slashes from ///.
1254
1255 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
1256
1257         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1258         both are 64 bits, since this seems to be the tradition, and this
1259         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
1260         we ever run into a host that prefers long long to long in this
1261         case, we'll need another configure-time test.  Problem reported by
1262         Jim Meyering.
1263
1264 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1265
1266         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1267         possible collision with system files.
1268         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1269         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1270         WCHAR_MIN and WCHAR_MAX in this case.
1271         (<stddef.h>): Do not include; no longer needed.
1272         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1273         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1274         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1275         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1276         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1277         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1278         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1279         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1280         !defined(__c99))]: Include in this case too, since it's harmless
1281         now.
1282         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1283         dangerous to do so.
1284         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1285         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1286         (_STDINT_MIN, _STDINT_MAX): New macros.
1287         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1288         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1289         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1290         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1291         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1292         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1293         macros, not typedefs; this simplifies things quite a bit.
1294         Use long int for all types narrower than int64_t.
1295         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1296         Define in terms of long long int or int64_t or long int,
1297         not int64_t or int32_t.  This saves some compile-time testing.
1298         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1299         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1300         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1301         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1302         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1303         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1304         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1305         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1306         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1307         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1308         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1309         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1310         undef any previous version and define our own version, for
1311         simplicity and consistency with the new macros for types.
1312         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1313         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1314         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1315         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
1316         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1317         @WINT_T_SUFFIX@ to keep things simple here.
1318         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1319         Simplify by assuming typical 8/16/32/64 host, since we're
1320         already doing that elsewhere anyway.
1321         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1322         and assume long long int is 64 bits if available.  This
1323         speeds up 'configure'.
1324
1325 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
1326
1327         * getaddrinfo.c: fixed typo
1328
1329 2006-06-29  Eric Blake  <ebb9@byu.net>
1330
1331         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1332         unused static function.
1333
1334 2006-06-29  Eric Blake  <ebb9@byu.net>
1335
1336         * stat_.h: New file.
1337
1338 2006-06-29  Derek R. Price  <derek@ximbiot.com>
1339
1340         * strftime.c: Assume strftime() exists.
1341
1342 2006-06-28  Bruno Haible  <bruno@clisp.org>
1343
1344         * getaddrinfo.h: Fix POSIX URL.
1345         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1346         (use_win32_p): Make static.
1347         (getaddrinfo): Reject service name if it is empty or does not consist
1348         solely of decimal digits, or if its value is > 65535.
1349         (getnameinfo): Remove useless casts.
1350
1351 2006-06-28  Derek R. Price  <derek@ximbiot.com>
1352
1353         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
1354         Autoconf 2.60 says this stuff was obsolete.
1355
1356 2006-05-12  Bruno Haible  <bruno@clisp.org>
1357
1358         * mkdtemp.c [MINGW]: Include <io.h>.
1359         (mkdir): Define using _mkdir.
1360
1361 2006-06-28  Bruno Haible  <bruno@clisp.org>
1362
1363         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1364         declaration for wcwidth.
1365         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1366
1367 2006-06-28  Eric Blake  <ebb9@byu.net>
1368
1369         * xvasprintf.h: Fix comments.
1370
1371 2006-06-28  Eric Blake  <ebb9@byu.net>
1372
1373         * mbchar.h (wcwidth): Include wcwidth.h.
1374         * mbswidth.c (wcwidth): Move from here...
1375         * wcwidth.h: ...to this new file.
1376
1377 2006-06-28  Simon Josefsson  <jas@extundo.com>
1378
1379         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1380         functions there.  It will succeed on Windows XP, but on Windows
1381         2000 and (presumably) earlier, it will fail, and use the internal
1382         re-implementation.
1383         (use_win32_p): New function.
1384         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1385         Support AI_NUMERICSERV to disable getservbyname.
1386         (getnameinfo): New function, only supports
1387         NI_NUMERICHOST|NI_NUMERICSERV for now.
1388
1389         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1390         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1391         getnameinfo.
1392
1393 2006-06-27  Bruno Haible  <bruno@clisp.org>
1394
1395         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1396
1397 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1398
1399         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1400         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1401         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1402
1403 2006-06-26  Bruno Haible  <bruno@clisp.org>
1404
1405         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1406         WCHAR_MAX.
1407         Reported by Mark D. Baushke and Larry Jones.
1408
1409 2006-06-26  Bruno Haible  <bruno@clisp.org>
1410
1411         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1412         in pre-C99 mode.
1413         Suggested by Mark D. Baushke and Larry Jones.
1414
1415 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1416
1417         * stdint_.h: Treat BSD/OS like OpenBSD.
1418
1419 2006-06-23  Bruno Haible  <bruno@clisp.org>
1420
1421         * stdint_.h: Treat IRIX like OpenBSD.
1422
1423 2006-06-23  Bruno Haible  <bruno@clisp.org>
1424
1425         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1426         ISO C 99 Technical Corrigendum 1.
1427
1428 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1429
1430         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1431         Some compiler complained about some of them.  Problem reported by
1432         Larry Jones in
1433         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1434
1435 2006-06-21  Simon Josefsson  <jas@extundo.com>
1436
1437         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1438         variable.
1439
1440         * socket_.h: Don't define WINVER.
1441
1442         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1443         slightly modified to work in gnulib.
1444
1445 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1446
1447         * read-file.c (fread_file): Start with buffer allocation of
1448         0 bytes rather than 1 byte; this simplifies the code.
1449         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1450         code to free buffer and save/restore errno.
1451         (internal_read_file): Remove unused local.
1452
1453 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1454
1455         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1456         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1457         Problem reported by Denis Excoffier in
1458         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1459
1460 2006-06-19  Simon Josefsson  <jas@extundo.com>
1461
1462         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1463
1464 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1465
1466         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1467
1468 2006-06-17  Bruno Haible  <bruno@clisp.org>
1469
1470         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1471
1472 2006-06-17  Bruno Haible  <bruno@clisp.org>
1473
1474         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1475         problem on Solaris 2.5.1.
1476
1477 2006-06-16  Eric Blake  <ebb9@byu.net>
1478
1479         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1480         * unicodeio.c [!defined errno]: Likewise.
1481         * strtol.c [!defined errno]: Likewise.
1482         * strtod.c [!defined errno]: Likewise.
1483
1484 2006-06-15  Bruno Haible  <bruno@clisp.org>
1485
1486         * stdint_.h: Rewritten to be fully auto-configured.
1487         Fixes bug on HP-UX/IA64.
1488
1489 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1490
1491         * getdate.y (__attribute__): Don't define if already defined.
1492         Problem reported by Larry Jones.
1493         * utimens.c (__attribute__): Likewise.
1494
1495 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1496
1497         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1498         reported by Andreas Schwab.
1499
1500 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1501             Bruno Haible  <bruno@clisp.org>
1502
1503         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1504
1505 2006-05-26  Martin Lambers  <marlam@marlam.de>
1506
1507         * getpass.c: Updates the test for the native W32 API, and adds
1508         missing includes, thus fixing compilation warnings.
1509
1510 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1511
1512         * tempname.c (small_open, large_open): New macros.
1513         (__open, __open64) [!_LIBC]: Remove.
1514         (__gen_tempname): Use small_open and large_open instead of __open
1515         and __open64.  This fixes a portability bug on HP-UX 11.11i
1516         reported by Simon Wing-Tang in
1517         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1518
1519 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1520
1521         * exclude.c (exclude_fnmatch): New function.
1522         (excluded_file_name): Call exclude_fnmatch.
1523         * exclude.h (excluded_file_name): New prototype
1524
1525 2006-05-24  Bruno Haible  <bruno@clisp.org>
1526
1527         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1528         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1529         Reported by Thorsten Maerz <torte@netztorte.de> via
1530         Aaron Stone <aaron@serendipity.cx>.
1531
1532 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1533
1534         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1535         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1536         (my_usleep): Don't mishandle maximum value.
1537
1538 2006-05-19  Jim Meyering  <jim@meyering.net>
1539
1540         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1541
1542 2006-05-17  Bruno Haible  <bruno@clisp.org>
1543
1544         Cygwin portability.
1545         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1546
1547 2006-05-17  Bruno Haible  <bruno@clisp.org>
1548
1549         * stdint_.h: Fix recognition of Cygwin.
1550
1551 2006-05-11  Jim Meyering  <jim@meyering.net>
1552
1553         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1554
1555 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1556
1557         * crc.c (crc32_update): Remove unnecessary L suffix.
1558         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1559         unwanted sign propagation, e.g., on hosts with 64-bit int.
1560         There still are some problems with reeelly weird theoretical hosts
1561         (e.g., 33-bit int) but it's not worth worrying about now.
1562         * sha1.c (rol): Likewise.
1563         (K1, K2, K3, K4): Remove unnecessary L suffix.
1564
1565 2006-05-10  Bruno Haible  <bruno@clisp.org>
1566
1567         * des.c: Cast to avoid warnings.
1568
1569 2006-05-10  Simon Josefsson  <jas@extundo.com>
1570
1571         * md4.c: Typo fix, update copyright years.
1572         (K1, K2): Don't use L because it turn computations into 64-bit on
1573         64-bit platforms.
1574
1575 2006-05-09  Bruno Haible  <bruno@clisp.org>
1576
1577         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1578         (EOVERFLOW): Define fallback value.
1579         (xstrcat): New function.
1580         (xvasprintf): Recognize the special case of a string concatenation.
1581
1582 2006-05-01  Bruno Haible  <bruno@clisp.org>
1583
1584         * stdint_.h: Shorter URL.
1585         * inttypes.h: Likewise.
1586
1587 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1588
1589         * verify.h: Document the internals better.  Most of this change
1590         was written by Bruno Haible.
1591
1592 2006-04-29  Bruno Haible  <bruno@clisp.org>
1593
1594         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1595         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1596
1597 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1598
1599         * getdate.y (get_date): When adding relative date, start with the
1600         initial time, not with the result of the first mktime call.
1601
1602 2006-04-23  Bruno Haible  <bruno@clisp.org>
1603
1604         * copy-file.c: Include <unistd.h> unconditionally.
1605         * execute.c: Likewise.
1606         * fatal-signal.c: Likewise.
1607         * findprog.c: Likewise.
1608         * mkdtemp.c: Likewise.
1609         * pipe.h: Likewise.
1610         * pipe.c: Likewise.
1611         * wait-process.h: Likewise.
1612
1613 2006-04-23  Bruno Haible  <bruno@clisp.org>
1614
1615         * fwriteerror.c (fwriteerror): Call fclose also when an error
1616         condition was already detected.
1617         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1618
1619 2006-04-19  Derek Price  <derek@ximbiot.com>
1620             Eric Blake  <ebb9@byu.net>
1621
1622         * inttypes.h: Correct grammar in comment.
1623
1624 2006-04-18  Derek Price  <derek@ximbiot.com>
1625             Paul Eggert  <eggert@cs.ucla.edu>
1626
1627         * inttypes.h: New file.
1628         * strtoimax.c: Assume <inttypes.h>.
1629
1630 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1631
1632         * utimens.c (futimens): glibc futimesat messes up if /proc
1633         isn't mounted.  Problem reported by Kir Kolyshkin.
1634
1635 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1636
1637         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1638         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1639         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1640
1641 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1642
1643         Merge regex changes from libc, removing some of our
1644         POSIX-conformance changes that were rejected and redoing them in a
1645         less-intrusive way.
1646
1647         * regcomp.c (re_compile_internal, init_dfa):
1648         Length arg is now size_t, not Idx.  All uses changed.
1649         (peek_token): Forward decl now says internal_function.
1650         (__re_error_msgid, __re_error_msgid_idx):
1651         Now static rather than extern with attribute_hidden.
1652         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1653         For some reason libc prefers K&R style defns for external functions.
1654         (regerror) [!defined _LIBC]: Likewise.
1655         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1656         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1657         (build_range_exp, build_collating_symbol):
1658         Use K&R-style defn.
1659         (re_compile_fastmap): Use '\0' to memset, not 0.
1660         (utf8_sb_map): Make the calculations more obvious.
1661         (init_dfa, parse_bracket_exp, build_charclass_op):
1662         Call calloc and cast result, as glibc does.
1663         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1664         (build_range_exp, build_collating_symbol):
1665         Now internal functions.
1666
1667         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1668
1669         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1670         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1671         Don't depend on VMS; depend on __VMS instead, for POSIX
1672         namespace cleanness.
1673         (regoff_t): Define to ssize_t, not long int.
1674
1675         Remove the REG_ macros named below.  Instead, make the old names
1676         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1677         __USE_GNU_REGEX.
1678         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1679         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1680         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1681         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1682         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1683         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1684         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1685         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1686         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1687         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1688         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1689         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1690         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1691         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1692         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1693         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1694         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1695         (REG_NREGS):
1696         Remove.  All uses replaced by the old RE_* names.
1697         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1698         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1699         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1700         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1701         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1702         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1703         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1704         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1705         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1706         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1707         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1708         Don't bother having these macros be independent of each others'
1709         values, since they no longer exist in the POSIX name space.
1710
1711         Rename the following member names back to their old names,
1712         unless !__USE_GNU_REGEX.  All uses changed back.
1713         (buffer): Renamed from re_buffer.
1714         (allocated): Renamed from re_allocated.
1715         (used): Renamed from re_used.
1716         (syntax): Renamed from re_syntax.
1717         (fastmap): Renamed from re_fastmap.
1718         (translate): Renamed from re_translate.
1719         (can_be_null): Renamed from re_can_be_null.
1720         (regs_allocated): Renamed from re_regs_allocated.
1721         (fastmap_accurate): Renamed from re_fastmap_accurate.
1722         (no_sub): Renamed from re_no_sub.
1723         (not_bol): Renamed from re_not_bol.
1724         (not_eol): Renamed from re_not_eol.
1725         (newline_anchor): Renamed from re_newline_anchor.
1726         (num_regs): Renamed from rm_num_regs.
1727         (start): Renamed from rm_start.
1728         (end): Renamed from rm_end.
1729
1730         (free_state): Move up a bit.
1731
1732         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1733         #define to be empty.
1734         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1735         when that is what is intended.
1736         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1737         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1738         (MAX): New macro.
1739         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1740         All uses changed back to re_malloc, etc.  It's now the caller's
1741         responsibility to check for overflow; all callers changed.
1742         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1743         (re_x2nrealloc): Remove.
1744         (free_state): Remove decl.
1745
1746         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1747         (re_set_registers, re_exec):
1748         Use K&R-style defn.
1749
1750         2006-01-31  Roland McGrath  <roland@redhat.com>
1751
1752         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1753         Reported by Mike Frysinger <vapier@gentoo.org>.
1754
1755         2006-01-15  Andreas Jaeger  <aj@suse.de>
1756
1757         [BZ #1950]
1758         * regex_internal.c (re_string_reconstruct): Adjust for
1759         build_wcs_upper_buffer change.
1760         (build_wcs_upper_buffer): Change return type.
1761
1762         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1763
1764         * regex_internal.h: Include <stdint.h> if available.
1765
1766         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1767
1768         * regex_internal.h (SIZE_MAX): Provide a default definition.
1769
1770         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1771
1772         * regcomp.c: Adjust for changed secondary hash function.
1773
1774         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1775
1776         * regex.h: Pretty printing.
1777         Clean up namespace a bit.
1778
1779         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1780
1781         * regexec.c (update_cur_sifted_state, check_arrival,
1782         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1783
1784         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1785                     Ulrich Drepper  <drepper@redhat.com>
1786
1787         [BZ #1302]
1788         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1789         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1790
1791         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1792
1793         [BZ #281]
1794         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1795         * regcomp.c: Remove unnecessary uses of
1796         unsigned RE_TRANSLATE_TYPE.
1797         * regex_internal.h: Likewise.
1798         * regex_internal.c: Likewise.
1799         * regexec.c: Likewise.
1800         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1801
1802         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1803
1804         * regexec.c (find_recover_state): Remove unnecessary
1805         initialization.
1806         (transit_state_bkref): Make DFA a const pointer.
1807         (get_subexp): Likewise.
1808         (check_arrival): Likewise.
1809         (update_cur_sifted_state): Likewise.
1810         (re_search_internal): Likewise.
1811         (prune_impossible_nodes): Likewise.
1812         (acquire_init_state_context): Likewise.
1813         (proceed_next_node): Likewise.
1814         (set_regs): Likewise.
1815         (free_fail_stack_return): Likewise.
1816         (check_arrival_expand_ecl): Mark DFA parameter as const.
1817         (check_arrival_expand_ecl_sub): Likewise.
1818         (check_subexp_limits): Likewise.
1819         (sub_epsilon_src_nodes):  Likewise.
1820         (add_epsilon_src_nodes):  Likewise.
1821         (merge_state_array): Likewise.
1822         (update_regs): Likewise.
1823         (build_trtable): Likewise.
1824         (sift_states_backward): Mark MCTX parameter as const.
1825         (build_sifted_states): Likewise.
1826         (update_cur_sifted_state): Likewise.
1827         (sift_states_mkref): Likewise.
1828         (check_arrival_expand_ecl): Mark eclosure as const.
1829         (check_dst_limits_calc_pos_1): Likewise.
1830         * regex_internal.h (re_match_context_t): Make dfa a const
1831         pointer.
1832
1833         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1834
1835         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1836         (transit_state_sb): Likewise.
1837         (transit_state_mb): Likewise.
1838         (sift_states_iter_mb): Likewise.
1839         (check_arrival_add_next_nodes): Likewise.
1840         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1841         [_LIBC] (re_search_2_stub): Use mempcpy.
1842
1843         * regex_internal.c (re_string_reconstruct): Avoid calling
1844         mbrtowc for very simple UTF-8 case.
1845
1846         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1847         a pointer-to-const.
1848         (re_acquire_state_context): Likewise.
1849         * regex_internal.h: Adjust prototypes.
1850
1851         * regex.c: Prevent using C++ compilers.
1852
1853         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1854         (re_acquire_state_context): Likewise.
1855
1856 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1857             Bruno Haible  <bruno@clisp.org>
1858
1859         * stdint_.h: On OpenBSD, don't redefine types already included in
1860         <sys/types.h> and <inttypes.h>.
1861
1862 2006-03-24  Eric Blake  <ebb9@byu.net>
1863
1864         * time_r.c (copy_string_result): Remove, as it is no longer used.
1865
1866 2006-03-24  Simon Josefsson  <jas@extundo.com>
1867
1868         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1869         including some doc fixes.
1870         (base64_encode_alloc): Fix +1 bug on allocation failures.
1871
1872 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1873
1874         * base64.c (base64_encode): Do not read past end of array with
1875         unsanitized input on systems with CHAR_BIT > 8.
1876
1877 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1878
1879         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1880         Typedef to long int, not to off_, as POSIX will likely change
1881         in that direction.
1882
1883 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1884
1885         * argp-help.c (validate_uparams): Fix typo
1886         * argp-parse.c (argp_default_options): Consistently begin help
1887         messages with a lowercase letter.
1888
1889 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1890
1891         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1892         overrun buffers and shouldn't be used (much as gets shouldn't be
1893         used).
1894         * time_r.c (asctime_r, ctime_r): Likewise.
1895
1896 2006-03-08  Simon Josefsson  <jas@extundo.com>
1897
1898         * gc-gnulib.c (randomize): Don't open files called 'no', they
1899         signal that configure disabled the device.
1900
1901 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1902
1903         * c-stack.c: Include unistd.h unconditionally, since we now assume
1904         the unistd module.
1905         * getlogin_r.c: Likewise.
1906         * getlogin_r.h: Likewise.
1907         * glob.c: Likewise.
1908         * pagealign_alloc.c: Likewise.
1909         * unistd_.h: Remove; no longer needed.
1910
1911 2006-03-07  Simon Josefsson  <jas@extundo.com>
1912
1913         * unistd_.h: New file.
1914
1915 2006-03-07  Simon Josefsson  <jas@extundo.com>
1916
1917         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1918
1919 2006-03-01  Simon Josefsson  <jas@extundo.com>
1920
1921         * readline.c: Fix typo, tiny patch from Stepan Kasal
1922         <kasal@ucw.cz>.
1923
1924 2006-02-28  Simon Josefsson  <jas@extundo.com>
1925
1926         * getopt.c: Protect #include of unistd.h, for MSVS.
1927
1928 2006-02-27  Simon Josefsson  <jas@extundo.com>
1929
1930         * base64.h: Indent #define's.  From Jim Meyering
1931         <jim@meyering.net>.
1932
1933 2006-02-27  Jim Meyering  <jim@meyering.net>
1934
1935         Revert the change of 2006-02-24, so these files can continue
1936         to be sync'd from gettext.
1937         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1938         of `config.h'.
1939
1940 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1941
1942         * glob.c: Say "invalid" rather than "illegal" in comments.
1943
1944 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1945
1946         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1947
1948 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1949
1950         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1951         AT_FDCWD exceeds INT_MAX.
1952         * openat.h (AT_FDCWD): Likewise.
1953
1954 2006-02-14  Jim Meyering  <jim@meyering.net>
1955
1956         Sync from coreutils.
1957
1958         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1959         failure on deficient systems, and simplify gnulib lgpl dependencies.
1960         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1961         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1962
1963         * xalloc-die.c: Remove unused definition of N_.
1964
1965 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1966
1967         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1968
1969 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1970
1971         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1972         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1973
1974 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1975
1976         * argp-namefrob.h: Restore changes accidentally lost during the
1977         "autoupdate" on 2005-12-12.
1978
1979 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1980
1981         * fnmatch.c (L_): Renamed from L, to work around a bug in
1982         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1983         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1984         All uses changed.
1985
1986 2006-01-26  Simon Josefsson  <jas@extundo.com>
1987
1988         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1989         prototype is visible on mingw32.
1990
1991         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1992         for mingw32.
1993
1994         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1995         mingw32).
1996
1997 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1998
1999         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
2000         attempt to open for write; this always fails, at least on POSIX
2001         hosts.  This reinstates the 2006-01-09 change, which was
2002         inadvertently removed.
2003
2004 2006-01-26  Bruno Haible  <bruno@clisp.org>
2005             Paul Eggert  <eggert@cs.ucla.edu>
2006
2007         * stdbool_.h (_Bool)
2008         [(! (defined __cplusplus || defined __BEOS__)
2009           && !defined __GNUC__
2010           && !(defined __HP_cc || defined __xlc__
2011                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
2012                || defined __sgi))]:
2013         #define to signed char in these cases too; this simplifies
2014         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
2015         etc., separately) and makes it more conservative.
2016
2017 2006-01-21  Jim Meyering  <jim@meyering.net>
2018
2019         Sync from the stable (b5) branch of coreutils:
2020
2021         * fts.c (fts_children): Don't let close() clobber errno from
2022         failed fchdir().
2023
2024         * fts.c (fts_stat): When following a symlink-to-directory,
2025         don't necessarily interpret stat-fails+lstat-succeeds as indicating
2026         a dangling symlink.  That can also happen at least for ELOOP.
2027         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2028         FYI, this bug predates the inclusion of fts.c in coreutils.
2029
2030         * fts.c (fts_open): Put new maxarglen declaration and uses
2031         in their own block, so pre-c99 compilers don't object.
2032
2033         Avoid the double-free (first in fts_read, second in fts_close) that
2034         would occur when an `active' directory is made inaccessible (e.g.,
2035         via chmod a-x) during a traversal.
2036         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2037         before returning.  Reproduce this failure by
2038         mkdir -p a/b; cd a; chmod a-x . b
2039         Reported by Stavros Passas.
2040
2041 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2042
2043         * argp-namefrob.h: Bugfix. Remove stray #
2044
2045 2006-01-25  Bruno Haible  <bruno@clisp.org>
2046
2047         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
2048         warnings.
2049         Reported by Paul Eggert.
2050
2051 2006-01-25  Jim Meyering  <jim@meyering.net>
2052
2053         * fileblocks.c: Remove more useless parentheses.
2054         * readutmp.h: Likewise.
2055
2056 2006-01-24  Bruno Haible  <bruno@clisp.org>
2057
2058         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
2059         has it.
2060         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
2061         2005-11-26.
2062
2063         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
2064         to avoid problems with the built-in _Bool type.
2065         Reported by Paul Eggert on 2005-11-26.
2066
2067 2006-01-24  Jim Meyering  <jim@meyering.net>
2068
2069         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
2070
2071 2006-01-24  Simon Josefsson  <jas@extundo.com>
2072
2073         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
2074         Bruno.
2075
2076 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
2077
2078         Work around porting bugs reported by Dieter in
2079         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
2080         * getopt.c (_NOPROTO): Remove; no longer needed.
2081         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
2082         Include "getopt.h" first, to check interface.
2083         (getenv): Declare only if defined HAVE_DECL_GETENV &&
2084         !HAVE_DECL_GETENV.
2085         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
2086         (__strndup): Revert to K&R-style function dfns, the glibc style.
2087         * strnlen.c: Don't claim it's taken from glibc; it's not.
2088         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
2089         Include strnlen.h first, to get prototype properly.
2090         (strnlen): Renamed from __strnlen.
2091         Remove weak alias.
2092
2093 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
2094
2095         These changes imported from libc.
2096         * getopt.c: Use __fxprintf instead of inline stream orientation
2097         test and two separate function calls.
2098         * strndup.c (__strndup): Add libc_hidden_def.
2099
2100 2006-01-22  Bruno Haible  <bruno@clisp.org>
2101
2102         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
2103         temporary buffer for sprintf, take into account the precision also
2104         for 'd', 'i', 'u', 'o', 'x', 'X'.
2105
2106 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
2107
2108         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2109         to pacify gcc -Wswitch-default.
2110
2111 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2112
2113         * argp-help.c (usage_long_opt): Do not print DOC options.
2114         (__argp_base_name): Removed
2115         * argp-namefrob.h (__argp_basename): Removed definition. Was a
2116         typo.
2117         (__argp_base_name): Provide macro definition or extern declaration
2118         depending on the configuration
2119
2120 2006-01-20  Simon Josefsson  <jas@extundo.com>
2121
2122         * inet_ntop.h: Unconditionally include sys/socket.h.
2123
2124 2006-01-19  Simon Josefsson  <jas@extundo.com>
2125
2126         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2127
2128 2006-01-12  Simon Josefsson  <jas@extundo.com>
2129
2130         * base64.c: Fix warning, reported by Bruno Haible
2131         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2132
2133 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2134
2135         Sync from coreutils.
2136         * md5.c: Fix commentary typos.
2137         (alignof, UNALIGNED_P): No need for a GCC-specific version.
2138         * md5.h (__attribute__): Remove; unused.
2139         * sha1.c: Fix commentary to match md5 better.
2140         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2141         so that we don't need to worry about alignment.  All uses changed.
2142         This merges the 2005-10-28 md5 change into sha1.
2143
2144 2006-01-11  Jim Meyering  <jim@meyering.net>
2145
2146         Sync from coreutils.
2147         * md5.c (OP): Fix spacing.
2148
2149 2006-01-11  Simon Josefsson  <jas@extundo.com>
2150
2151         * stdint_.h (SIZE_MAX): Add missing (.
2152
2153 2006-01-10  Bruno Haible  <bruno@clisp.org>
2154
2155         * argp.h (__const): Remove macro. Use const instead.
2156         * argp-fmtstream.h (__const): Likewise.
2157         * glob_.h (__const): Remove macro.
2158         * glob-libc.h: Use const instead of __const.
2159
2160 2006-01-10  Jim Meyering  <jim@meyering.net>
2161
2162         Avoid the double-free (first in fts_read, second in fts_close) that
2163         would occur when an `active' directory is made inaccessible (e.g.,
2164         via chmod a-x) during a traversal.
2165         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2166         before returning.  Reproduce this failure by
2167         mkdir -p a/b; cd a; chmod a-x . b
2168         Reported by Stavros Passas.
2169
2170         Sync from coreutils.
2171         * sha1.c: Tweak grammar in a comment.
2172
2173 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
2174
2175         * regex_internal.h (BITSET_WORD_BITS):
2176         Work around a bug in 64-bit PGC (before version 6.1-2), where the
2177         preprocessor mishandles large unsigned values as if they were signed.
2178         Problem reported by Claudio Fontana in
2179         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2180
2181 2006-01-10  Simon Josefsson  <jas@extundo.com>
2182
2183         * socket_.h: New file.
2184
2185 2006-01-10  Bruno Haible  <bruno@clisp.org>
2186
2187         * localcharset.c: Update from GNU gettext.
2188
2189 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2190
2191         Sync from coreutils.
2192         * chdir-long.c (cdb_free): Don't bother trying to open directory
2193         for write access: POSIX says that must fail.
2194         * fts.c (diropen): Likewise.
2195         * save-cwd.c (save_cwd): Likewise.
2196         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2197         well, for minor improvements on hosts that lack O_DIRECTORY.
2198         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2199         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2200         Fall back on chown if open failed with EACCES.
2201
2202         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2203         Report an error at compile-time if only a 1-second nominal clock
2204         resolution is found.
2205
2206         * lchmod.h: New file.
2207         * mkdir-p.c: Include lchmod.h, lchown.h.
2208         (make_dir_parents): Use lchown rather than chown, and
2209         lchmod rather than chmod.
2210
2211         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2212         too.  Problem with "none" reported by Bob Proulx.  Problem with
2213         "proc" reported by n0dalus.
2214
2215         * mountlist.c: Include <limits.h>.
2216         (dev_from_mount_options)
2217         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2218         New function.  It no longer assumes "dev=" has the System V meaning
2219         on Linux (since it doesn't).  It also parses "dev=" more carefully.
2220         (read_file_system_list)
2221         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2222         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2223         dev= in that case.
2224
2225         * posixtm.h (PDS_PRE_2000): New macro.
2226         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2227         All usages changed.  Reject dates outside the range 1969-1999 if
2228         PDS_PRE_2000 is used.
2229
2230 2006-01-09  Jim Meyering  <jim@meyering.net>
2231
2232         Sync from coreutils.
2233
2234         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2235
2236         * chdir-safer.h, chdir-safer.c: New files.
2237
2238         * modechange.c (mode_compile): Reject an invalid mode string
2239         that starts with an octal digit.  From Andreas Gruenbacher.
2240
2241         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2242         and dup to open_safer and dup_safer, respectively.
2243         (openat_permissive): Fix typo in comment.
2244
2245         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2246         "gettext.h"; either no longer needed or are guaranteed by openat.h.
2247         (_): Remove; no longer needed.
2248         (openat): Renamed from rpl_openat; no need for rpl_openat
2249         since openat.h renames openat for us.
2250         Replace most of the body with a call to openat_permissive,
2251         to avoid duplicate code.
2252         Port to (probably hypothetical) environments were mode_t is
2253         wider than int.
2254         (openat_permissive): Require mode arg, so that we can check
2255         types better.  Put it just after flags.  Change cwd failure
2256         indicator from pointer-to-bool to pointer-to-errno-value.
2257         All callers changed.
2258         Invoke openat_save_fail and/or openat_restore_fail if
2259         cwd_errno is null, so that openat can call us.
2260         (openat_permissive, fdopendir, fstatat, unlinkat):
2261         Simplify errno handling to avoid some duplicate code,
2262         as it's OK to set errno on success.
2263         * openat.h: Revamp code so that function macros depend on
2264         __OPENAT_PREFIX only, not also on AT_FDCWD.
2265         (openat_ro): Remove.  Caller changed to use openat_permissive.
2266         (openat_permissive): Now a macro, if not a function.
2267         (openat_restore_fail, openat_save_fail): Now always functions,
2268         since mkdirat needs them even if __OPENAT_PREFIX is defined.
2269
2270         * openat-priv.h: New file, defining macros used by mkdirat.c
2271         and openat.c.
2272         * mkdirat.c: Include openat-priv.h.
2273         Remove definitions of macros defined therein.
2274         * openat.c: Likewise.
2275
2276         * mkdirat.c (mkdirat): New file and function.
2277         * openat.h (mkdirat): Declare.
2278
2279         * openat.c (fdopendir): Don't change errno when returning non-NULL.
2280
2281         * openat.h (openat_permissive): Declare.
2282         (openat_ro): Define.
2283
2284         * openat.c (EXPECTED_ERRNO): New macro.
2285         (openat_permissive): New function -- used in remove.c rewrite.
2286         (all functions): Set errno just before returning, only if there
2287         was an actual failure.
2288         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2289
2290         Emulate openat-family functions using Linux's procfs, if possible.
2291         Idea and some code based on Ulrich Drepper's glibc changes.
2292
2293         * openat.c: (BUILD_PROC_NAME): New macro.
2294         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2295         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2296         before falling back on save_cwd and restore_cwd.
2297         (fdopendir, fstatat, unlinkat): Likewise.
2298
2299         * openat.c (fstatat, unlinkat): Perform the syscall directly,
2300         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2301
2302         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2303         as second argument to va_arg.  Otherwise, some versions of gcc
2304         warn that `if this code is reached, the program will abort'.
2305
2306 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
2307
2308         Sync from coreutils.
2309
2310         Add POSIX ACL support
2311         * acl.h (copy_acl, set_acl): Add declarations.
2312         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2313         systems other than Linux.
2314         (chmod_or_fchmod): New function: use fchmod when possible,
2315         and chmod otherwise.
2316         (file_has_acl): Add a POSIX ACL implementation, with a
2317         Linux-specific subcase.
2318         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2319         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
2320         acls are unsupported.
2321         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2322         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
2323         are unsupported.
2324
2325 2006-01-09  Bruno Haible  <bruno@clisp.org>
2326
2327         * sysexit_.h (EX_OK): New macro.
2328         Suggested by Martin Lambers <marlam@marlam.de>.
2329
2330 2006-01-09  Bruno Haible  <bruno@clisp.org>
2331
2332         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2333         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2334         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2335         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2336
2337 2006-01-09  Bruno Haible  <bruno@clisp.org>
2338
2339         * stdint_.h (SIZE_MAX): Write the value without involving negative
2340         numbers.
2341
2342 2005-10-16  Bruno Haible  <bruno@clisp.org>
2343
2344         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2345         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2346
2347 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2348
2349         * strftime.c (tzname): Don't declare if it is already #defined.
2350         Problem reported for Mingw by Mark Junker.
2351
2352 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
2353
2354         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2355         long int, not int, for nanosecond counts, so that people who are
2356         used to POSIX struct timespec won't be surprised.  Reported by Jim
2357         Meyering.
2358
2359 2005-12-16  Jim Meyering  <jim@meyering.net>
2360
2361         * fprintftime.c, fprintftime.h: New files.
2362
2363 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2364
2365         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2366         * argp-help.c (fill_in_uparams): Check if the constructed
2367         struct uparams is valid. Fall back to the default values if it is
2368         not.
2369
2370 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2371
2372         * argp-help.c (__argp_base_name): New function
2373         (__argp_short_program_name): Rewrite using __argp_base_name
2374         * argp-namefrob.h: Define program_invocation_name and
2375         program_invocation_short_name if requested
2376         (__argp_base_name): Add prototype
2377         * argp-parse.c (argp_def): Use gettext wrappers
2378         (argp_default_parser): Use __argp_base_name
2379         * argp-pin.c: New file. Defines program_invocation_name and
2380         program_invocation_short_name on systems that lack them.
2381
2382 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2383
2384         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2385         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2386         porting problem reported by Georg Schwarz in
2387         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2388
2389 2005-07-09  Bruno Haible  <bruno@clisp.org>
2390
2391         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2392         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2393         Reported by Mark Junker <mjscod@gmx.de>.
2394
2395 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2396
2397         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2398         (uintmax_t) [defined uintmax_t]: Do not declare.
2399         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2400         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2401         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2402         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2403         sake of portability to weird hosts that C allows (though we don't
2404         know of any practical examples).
2405
2406         * savedir.h (fdsavedir): New decl.
2407         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2408         contains most of the former guts of savedir.
2409         (savedir): Use savedirstream.
2410         Include "openat.h".
2411
2412 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2413
2414         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2415         coreutils no longer futzes with rounding modes.
2416
2417 2005-11-14  Jim Meyering  <jim@meyering.net>
2418
2419         * mkstemp-safer.c: Include <config.h>, required for possible
2420         replacement of mkstemp.
2421
2422 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2423
2424         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2425         business.
2426         (gethrxtime) [! (HAVE_NANOUPTIME
2427         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2428         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2429         our own approximation.
2430
2431 2005-11-10  Simon Josefsson  <jas@extundo.com>
2432
2433         * readline.c: Remove EOL.
2434
2435 2005-11-08  Eric Blake  <ebb9@byu.net>
2436
2437         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2438
2439 2005-11-08  Eric Blake  <ebb9@byu.net>
2440
2441         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2442
2443 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2444
2445         Fix porting problem reported by Theodoros V. Kalamatianos.
2446         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2447         Don't assume that futimes failing means we must fail.
2448
2449 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2450
2451         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2452         leave errno alone.  Problem reported by Dmitry V. Levin.
2453
2454 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2455
2456         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2457         errno alone.  Problem reported by Frederic Jolliton.
2458
2459 2005-10-28  Simon Josefsson  <jas@extundo.com>
2460
2461         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2462         "restrict" keywords, as per POSIX.  Protect the function
2463         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2464         Don't use K&R prototypes.  Check the sprintf return values.
2465         Re-define EAFNOSUPPORT if not present.  Indent.
2466
2467         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2468         suggested by Bruno Haible <bruno@clisp.org>.
2469
2470         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2471
2472         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2473
2474         * gc-libgcrypt.c: Add MD2 (which is not available through
2475         libgcrypt).
2476
2477         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2478
2479         * md2.h, md2.c: New files.
2480
2481 2005-10-24  Simon Josefsson  <jas@extundo.com>
2482
2483         * md4.h: Shrink buffer size, now that we changed the type.
2484
2485 2005-10-22  Simon Josefsson  <jas@extundo.com>
2486
2487         * arcfour.h, arcfour.c: Use fixed size indices in the
2488         arcfour_context struct (simplify test vector testing in GNU
2489         Shishi).
2490
2491 2005-10-22  Simon Josefsson  <jas@extundo.com>
2492
2493         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2494         suggested by Bruno Haible <bruno@clisp.org>.
2495
2496 2005-10-22  Simon Josefsson  <jas@extundo.com>
2497
2498         * crc.h: Include stddef.h, for size_t.
2499
2500 2005-10-21  Simon Josefsson  <jas@extundo.com>
2501
2502         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2503         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2504
2505 2005-10-21  Simon Josefsson  <jas@extundo.com>
2506
2507         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2508         block.
2509
2510 2005-10-21  Simon Josefsson  <jas@extundo.com>
2511
2512         * gc-gnulib.c: Support ARCTWO in CBC mode.
2513
2514 2005-10-21  Simon Josefsson  <jas@extundo.com>
2515
2516         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2517         <bruno@clisp.org>.
2518
2519         * hmac-sha1.c (hmac_sha1): Likewise.
2520
2521         * crc.c (crc32_update): Actually use crc parameter, suggested by
2522         Bruno Haible <bruno@clisp.org>.
2523
2524         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2525         <bruno@clisp.org>.
2526
2527 2005-10-21  Simon Josefsson  <jas@extundo.com>
2528
2529         * des.h, des.c: New files.
2530
2531         * gc-gnulib.c: Support DES.c
2532
2533 2005-10-21  Simon Josefsson  <jas@extundo.com>
2534
2535         * arctwo.h, arctwo.c: New files.
2536
2537         * gc-gnulib.c: Support ARCTWO.
2538
2539 2005-10-21  Simon Josefsson  <jas@extundo.com>
2540
2541         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2542
2543 2005-10-19  Simon Josefsson  <jas@extundo.com>
2544
2545         * gc-gnulib.c: Support ARCFOUR.
2546
2547 2005-10-19  Simon Josefsson  <jas@extundo.com>
2548
2549         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2550         support.
2551
2552         * gc.h: Add ECB enum type.
2553
2554         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2555
2556 2005-10-19  Simon Josefsson  <jas@extundo.com>
2557
2558         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2559
2560 2005-10-18  Simon Josefsson  <jas@extundo.com>
2561
2562         * md4.h, md4.c: New files, based on md5.?.
2563
2564 2005-10-17  Simon Josefsson  <jas@extundo.com>
2565
2566         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2567
2568         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2569
2570 2005-10-17  Simon Josefsson  <jas@extundo.com>
2571
2572         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2573
2574 2005-10-17  Simon Josefsson  <jas@extundo.com>
2575
2576         * gc.h, gc-libgcrypt.c: Add ciphers.
2577
2578 2005-10-17  Simon Josefsson  <jas@extundo.com>
2579
2580         * sha1.c: Use uint32_t instead of md5_uint32.t
2581
2582         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2583         md5.h.
2584
2585         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2586
2587         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2588
2589 2005-10-15  Simon Josefsson  <jas@extundo.com>
2590
2591         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2592
2593         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2594
2595 2005-10-14  Simon Josefsson  <jas@extundo.com>
2596
2597         * arcfour.h, arcfour.c: New files.
2598
2599 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2600
2601         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2602         include <wchar.h>; no longer needed.
2603
2604 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2605         and  Ulrich Drepper  <drepper@redhat.com>
2606
2607         Import from libc.
2608         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2609         instead of inline stream orientation test and two separate
2610         function calls.  Pay no attention to USE_IN_LIBIO.
2611
2612 2005-10-14  Roland McGrath  <roland@redhat.com>
2613
2614         Import from libc.  [BZ #1331]
2615         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2616         macro argument.
2617         Reported by Matej Vela <vela@debian.org>.
2618
2619 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2620
2621         * mkdir-p.c (make_dir_parents): Don't report an error if an
2622         intermediate directory is in a read-only file system.  Problem
2623         reported by Eric Blake.
2624
2625 2005-10-13  Simon Josefsson  <jas@extundo.com>
2626
2627         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2628         Move memory allocation outside of loop.
2629
2630 2005-10-12  Simon Josefsson  <jas@extundo.com>
2631
2632         * gc-pbkdf2-sha1.c: New file.
2633
2634         * gc.h: Add gc_pbkdf2_sha1 prototype.
2635
2636 2005-10-12  Simon Josefsson  <jas@extundo.com>
2637
2638         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2639         suggested by Bruno Haible <bruno@clisp.org>.
2640
2641 2005-10-12  Simon Josefsson  <jas@extundo.com>
2642
2643         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2644
2645         * gc-gnulib.c (gc_hmac_sha1): New function.
2646
2647 2005-10-12  Simon Josefsson  <jas@extundo.com>
2648
2649         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2650
2651 2005-10-12  Simon Josefsson  <jas@extundo.com>
2652
2653         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2654         GC_USE_HMAC_MD5, respectively.
2655
2656         * gc-libgcrypt.c (gc_md5): Fix assert call.
2657         (gc_md5): Fix typo.
2658
2659         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2660
2661         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2662
2663         * gc-gnulib.c (gc_hash_buffer): Ditto.
2664
2665 2005-10-11  Bruno Haible  <bruno@clisp.org>
2666
2667         * c-strcasestr.h: New file, from GNU gettext.
2668         * c-strcasestr.c: New file, from GNU gettext.
2669
2670 2005-10-11  Bruno Haible  <bruno@clisp.org>
2671
2672         * c-strcase.h: New file, from GNU gettext.
2673         * c-strcasecmp.c: New file, from GNU gettext.
2674         * c-strncasecmp.c: New file, from GNU gettext.
2675
2676 2005-10-11  Simon Josefsson  <jas@extundo.com>
2677
2678         * crc.h, crc.c: New files.
2679
2680         * gc.h (gc_hash_buffer): Add doc.
2681
2682 2005-10-08  Simon Josefsson  <jas@extundo.com>
2683
2684         * gc.h: Add gc_hash and gc_hash_buffer.
2685
2686         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2687
2688         * gc-libgcrypt.c (gc_hash_buffer): Add.
2689
2690 2005-10-11  Bruno Haible  <bruno@clisp.org>
2691
2692         * strcasecmp.c: Include limits.h.
2693         (strcasecmp): Avoid integer overflow on exotic platforms.
2694         * strncasecmp.c: Include limits.h.
2695         (strncasecmp): Avoid integer overflow on exotic platforms.
2696         Reported by Paul Eggert.
2697
2698 2005-10-06  Simon Josefsson  <jas@extundo.com>
2699
2700         * hmac-md5.c: New file.
2701
2702         * hmac.h: New file.
2703
2704 2005-10-06  Simon Josefsson  <jas@extundo.com>
2705
2706         * memxor.c (memxor): Avoid casts and warnings.
2707
2708 2005-10-05  Derek Price  <derek@ximbiot.com>
2709
2710         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2711
2712 2005-10-05  Simon Josefsson  <jas@extundo.com>
2713
2714         * memxor.c (memxor): Fix compiler error.
2715
2716         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2717         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2718
2719         * memxor.h, memxor.c: New files.
2720
2721         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2722         we assume all systems have it, suggested by Jim Meyering
2723         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2724         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2725         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2726         same reasons.
2727
2728 2005-10-04  Bruno Haible  <bruno@clisp.org>
2729
2730         * verify.h (verify_true): Provide alternative definition for C++.
2731
2732 2005-10-04  Simon Josefsson  <jas@extundo.com>
2733
2734         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2735         D. Baushke" <mdb@gnu.org>.
2736
2737 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2738
2739         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2740         (SSIZE_MAX): New macro, if not already defined.
2741         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2742         than 2 GiB.
2743
2744 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2745
2746         * exclude.c: Include verify.h.
2747         (verify): Remove.  All callers changed to use verify.h's version.
2748         * strtoimax.c: Likewise.
2749         * utimecmp.c: Likewis.e
2750
2751         Sync from coreutils.
2752         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2753         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2754         * .cvsignore: Add fts.h, search.h, t-fpending.
2755         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2756         bother returning ENOSYS if settimeofday or stime fails; just let
2757         them return whatever errno they want to return.
2758         * utimens.c: Include unistd.h, for dup2.
2759         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2760         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2761
2762 2005-10-02  Jim Meyering  <jim@meyering.net>
2763
2764         Sync from coreutils.
2765         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2766         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2767         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2768         Remove AT_FDCWD test.
2769         Do not consume the fd unless successful.
2770         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2771         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2772         block, so that we don't even try to compile it if settimeofday is
2773         available.  This works around a compilation failure on OSF1 V5.1,
2774         due to stime requiring a `long int*' while tv_sec is `int'.
2775
2776 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2777
2778         * getdelim.c (getdelim): Remove unused variables.
2779
2780 2005-10-01  Simon Josefsson  <jas@extundo.com>
2781
2782         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2783         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2784         AI_* and EAI_* definitions.  Protect function declarations.
2785
2786 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2787
2788         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2789         so that the code works even with ancient cpp.  Portability problem
2790         with GCC 2.7.2.1 reported by Thomas M.Ott.
2791
2792 2005-09-27  Jim Meyering  <jim@meyering.net>
2793
2794         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2795
2796         * intprops.h (signed_type_or_expr__): Define.
2797         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2798         for unsigned types.
2799
2800 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2801
2802         * verify.h (verify_expr): Remove, replacing with:
2803         (verify_true): New macro that returns true instead of void.
2804         (verify_type__): Remove.
2805         (verify): Use verify_true rather than verify_type__.
2806
2807 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2808
2809         * utimens.c (ENOSYS): Define if not already defined.
2810         (futimens): Support having a null PATH if the file descriptor
2811         is nonnegative.
2812
2813         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2814         Remove.
2815         (__attribute): Define to empty unless GCC 3.1 or later.
2816         This works around a core dump on OpenBSD 3.4, which has GCC
2817         2.95.3, which dumps core when given __attribute__(()).  It also
2818         simplifies other tests, since we really don't want to bother with
2819         worrying about which ancient version of GCC supported what.
2820         Original problem reported by Yoann Vandoorselaere, with part of
2821         the fix suggested by Derek Price.
2822
2823 2005-09-24  Jim Meyering  <jim@meyering.net>
2824
2825         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2826         so we can once again use a positive bitfield width of 1 -- now we
2827         don't have to explain why we were using a bitfield width of 2.
2828
2829 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2830
2831         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2832         Problem reported by Eric Blake.
2833         (getaddrinfo): Initialize se so that it's not garbage.
2834         Redo internal storage allocation so that it doesn't make unportable
2835         assumptions about alignment.
2836         Fix a memory leak.
2837
2838         * utimens.c (futimens): Use futimesat if available.
2839         Prefer it to futimes since it doesn't have the futimes bug.
2840
2841         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2842         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2843         Instead, declare a function that returns a pointer to an array,
2844         and use verify_type__ to declare the size of the array.
2845         Problem and germ of a solution reported by Bruno Haible.
2846         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2847         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2848
2849 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2850
2851         Sync from coreutils.
2852
2853         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2854         stat-time.h.
2855         * argmatch.h: Include verify.h
2856         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2857         (ARGMATCH_ASSERT): Remove; unused.
2858         * canonicalize.c: Assume STDC_HEADERS.
2859         * exclude.c: Include "strcase.h".
2860         * regex_internal.h [!defined _LIBC]: Likewise.
2861         * getusershell.c: Include stdio--.h rather than stdio.h
2862         and stdio-safer.h.
2863         (getusershell): Call fopen, not fopen_safer.
2864         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2865         Do not include unistd-safer.h.
2866         (save_cwd): Don't call fd_safer; no longer needed
2867         now that we include fcntl--.h.
2868
2869         * getdate.y (relative_time): New type.
2870         (RELATIVE_TIME_0): New constant.
2871         (parser_control): Use relative_time instead of doing it ourselves.
2872         (%union): Add new relative_time rel member.
2873         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2874         Now typeless.
2875         (relunit, relunit_snumber): Now of type rel.
2876         (zone, rel, relunit, get_date): Adjust to above changes.
2877
2878         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2879         Do not include unistd-safer.h.
2880         (getloadavg): Don't call fd_safer; no longer needed
2881         now that we include fcntl--.h.
2882
2883         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2884         (make_dir_parents): Treat ENOSYS like EEXIST.
2885
2886         Improve quality of diagnostics on restore_cwd failure.
2887         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2888         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2889         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2890         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2891         each time through the loop.  Do not diagnose restore_cwd failure;
2892         that is the caller's job (and perhaps the caller does not care).
2893
2894         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2895         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2896         If the file already exists but is not a directory, don't bother
2897         to try to make its parents.
2898         Close potential file descriptor leak if we can't chdir("/") (!).
2899         Don't always return true if chdir($PWD) fails; return true only
2900         if the requested action was done successfully (except for the
2901         chdir($PWD)).
2902         Don't log final directory unless we actually made it.
2903         Refactor to avoid duplicate code to fix up permissions.
2904         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2905
2906         * strftime.c (my_strftime): Rewrite the previous change slightly,
2907         to make it a bit faster and (I hope) clearer.
2908         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2909         Fix bug in formats like %2N.
2910
2911         * verify.h: New file.
2912
2913 2005-09-22  Jim Meyering  <jim@meyering.net>
2914
2915         Sync from coreutils.
2916
2917         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2918
2919         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2920         the .tm_year member, since otherwise gcc-4.0 would now warn about
2921         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2922
2923         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2924         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2925
2926         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2927         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2928         when run in a time zone for which daylight savings time is in effect
2929         for the starting date.
2930
2931         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2932         stop us from restricting permissions of just-created absolute-named
2933         directories.
2934         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2935         to restore initial working directory.
2936         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2937         to tell caller if/when we change the working directory and are
2938         unable to return to the initial one.
2939         * mkdir-p.h (make_dir_parents): Update prototype.
2940         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2941         `return false'.  This fixes a bug introduced on 2004-07-30.
2942
2943         * openat.c (fdopendir): Be sure to close the supplied
2944         file descriptor before returning.  This makes our replacement
2945         implementation a little closer to Solaris's, where fdopendir
2946         ties the file descriptor to the returned DIR* pointer.
2947         * openat.c (unlinkat): New function.
2948         * openat.h (unlinkat): Add prototype.
2949         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2950         (openat_restore_fail): Rename from openat_restore_die.
2951         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2952
2953         Provide an alternative to exiting immediately upon save_cwd or
2954         restore_cwd failure.  Now, an application can arrange e.g.,
2955         to perform a longjump in that case.
2956         * openat.c: Include dirname.h.
2957         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2958         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2959         and openat_restore_die rather than calling error directly.
2960         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2961
2962         * openat-die.c (openat_save_die, openat_restore_die): New file.
2963         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2964
2965         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2966         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2967                             int utc, int nanoseconds);
2968         Background:
2969         date should not have to allocate a megabyte of virtual memory to
2970         handle a format argument like +%1048575T.  When implemented with
2971         strftime, it must allocate such a buffer, use strftime to fill it
2972         in, print it, then free it.
2973         With fprintftime, it simply prints everything and exits.
2974         With no need for memory allocation, that's one fewer way to fail.
2975         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2976         optional field width, not before, so we accept %9:z, not %:9z.
2977         (my_strftime): Be sure to use L_('x') for literals.
2978
2979         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2980         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2981         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2982         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2983         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2984         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2985         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2986         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2987         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2988
2989         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2990         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2991         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2992         and don't include <sys/file.h>).
2993
2994 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2995
2996         Sync from coreutils.
2997
2998         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2999         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
3000         [!LDAV_DONE]: Avoid unused variable warning.
3001
3002 2005-09-21  Bruno Haible  <bruno@clisp.org>
3003
3004         * unicodeio.h (unicode_to_mb): New declaration.
3005
3006 2005-09-20  Derek Price  <derek@ximbiot.com>
3007
3008         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
3009
3010 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3011
3012         Use a consistent style for including <config.h>.
3013         * __fpending.c, acl.c, argmatch.c,
3014         argp-help.c, argp-parse.c,
3015         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
3016         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
3017         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
3018         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
3019         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
3020         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
3021         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
3022         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
3023         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
3024         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
3025         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
3026         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
3027         modechange.c, mountlist.c, open-safer.c, physmem.c,
3028         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
3029         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
3030         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
3031         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
3032         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
3033         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
3034         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
3035         userspec.c, utimecmp.c, version-etc-fsf.c,
3036         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
3037         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
3038         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
3039         Standardize inclusion of config.h.
3040         * __fpending.h, dirfd.h, getdate.h, human.h,
3041         inttostr.h:  Removed inclusion of config.h from header files.
3042         * inttostr.c:  Adjusted in-tree users.
3043         * timespec.h: Remove superfluous warning to include config.h.
3044         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
3045         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
3046         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
3047         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
3048
3049 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3050
3051         * stat-time.h: New file.
3052         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
3053         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
3054         in a different way.
3055         (timespec_cmp): New function.
3056         * utimecmp.c: Include stat-time.h.
3057         (SYSCALL_RESOLUTION): Depend on whether various struct stat
3058         members exist, not on the obsolescent ST_MTIM_NSEC.
3059         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
3060
3061 2005-09-15  Derek Price  <derek@ximbiot.com>
3062             Paul Eggert  <eggert@cs.ucla.edu>
3063
3064         * regcomp.c, regexec.c, regex_internal.c: Back out previous
3065         changes, consolidating in...
3066         * regex_internal.h: ...this file.
3067
3068 2005-09-15  Derek Price  <derek@ximbiot.com>
3069
3070         * regex_internal.h: Blank `pure' for GNUC < 3.
3071         * regex_internal.c: Ditto, using this...
3072         (__GNUC_PREREQ): ...new macro.
3073         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
3074         (__GNUC_PREREQ): ...this new macro.
3075
3076         * strstr.h: Include string.h. Define strstr as a macro here.
3077
3078 2005-09-13  Derek Price  <derek@ximbiot.com>
3079
3080         * canon-host.c (canon_host_r): Set *cherror on memory allocation
3081         failure.
3082         Reported by Jim Meyering  <jim@meyering.net>.
3083
3084 2005-09-13  Jim Meyering  <jim@meyering.net>
3085
3086         * canon-host.c: Filter through gnu indent and reword comments slightly.
3087         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
3088
3089 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
3090
3091         * base64.c: Typo.
3092         (base64_encode): Put b64str in initialized data section.
3093
3094 2005-09-12  Derek Price  <derek@ximbiot.com>
3095
3096         Return usable errors from canon-host.
3097         * canon-host.h: New file.
3098         * canon-host.c (canon_host): Wrap...
3099         (canon_host_r): ...this new function, which now relies exclusively on
3100         getaddrinfo.
3101         (ch_strerror): New function.
3102         (last_cherror): New global.
3103         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
3104         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
3105         void *.
3106         (freeaddrinfo): Free ai->ai_canonname when set.
3107
3108 2005-09-12  Derek Price  <derek@ximbiot.com>
3109             Paul Eggert  <eggert@cs.ucla.edu>
3110
3111         * glob-libc.h: Renamed from glob_.h.  The new version is
3112         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3113         protecting things that should be done only in gnulib contexts.
3114         * glob_.h: New file, containing only the glob things needed for
3115         gnulib.
3116         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
3117         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3118         (glob, globfree, glob_pattern_p): Now defined simply in terms of
3119         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3120         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3121         and to respect the namespace rules better.
3122
3123 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3124
3125         Merge glibc and coreutils changes into gnulib, plus a few
3126         extra fixes.
3127         * md5.c: Use #error rather than a string.
3128         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
3129         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3130         (__attribute__): Define to empty for non recent-GCC.
3131         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3132         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3133         Renamed from their non-__ counterparts, with new macros replacing
3134         them if not _LIBC.  Add __THROW attribute.
3135         (rol): Remove.
3136         (struct md5_ctx): Align buffer if using GCC.
3137         * sha1.h (struct sha1_ctx): Likewise.
3138         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
3139         The old name was backwards.
3140         (NOTSWAP): Remove; not used.
3141         (rol): New macro, moved here from md5.h.
3142         (sha1_process_block): Remove a FIXME that doesn't make sense.
3143
3144 2005-09-12  Derek Price  <derek@ximbiot.com>
3145
3146         * gai_strerror.c: Include config.h when available.  Include
3147         getaddrinfo.h before other headers to test interface.
3148         Reported by Larry Jones <lawrence.jones@ugs.com>.
3149
3150 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3151
3152         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3153         definitions, since that's the preferred style in glibc.
3154         Fix a minor spacing issue, and update copyright notice to match glibc's.
3155
3156 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3157
3158         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3159
3160 2005-09-06  Simon Josefsson  <jas@extundo.com>
3161
3162         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3163         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
3164
3165 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3166
3167         Change bitset word type from unsigned int to unsigned long int,
3168         as this has better performance on typical 64-bit hosts.
3169         Port bitset code to hosts with unusual word sizes.
3170         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3171         (build_collating_symbol):
3172         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3173         argument is a bitset.  This is merely a style issue, but it makes
3174         it clearer that an entire array is expected.
3175         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3176         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3177         Port to the case where bitset_word is not the same as unsigned int.
3178         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3179         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3180         Likewise.
3181         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3182         (build_trtable, group_nodes_into_DFAstates):
3183         Likewise.
3184         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3185         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3186         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3187         * regexec.c (group_nodes_into_DFAstates): Likewise.
3188         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3189         * regcomp.c (optimize_subexps, lower_subexp):
3190         Work even if bitset_word has holes in its bitwise representation.
3191         * regex_internal.h (BITSET_WORD_BITS): Likewise.
3192         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3193         Likewise.
3194         * regex_internal.c (re_string_reconstruct):
3195         Don't assume UCHAR_MAX == 255.
3196         * regex_internal.h (bitset_set_all): Likewise.
3197         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3198         All uses changed.
3199         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
3200         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3201         All uses changed.
3202         (BITSET_WORD_MAX): New macro.
3203         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3204         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
3205         (bitset_empty, bitset_copy):
3206         Prefer sizeof (bitset) to multiplying it out ourselves.
3207         (bitset_not_merge): Remove; unused.
3208         (bitset_contain): Return bool, not unsigned int with one bit on.
3209         All callers changed.
3210         * regexec.c (build_trtable): Don't assume bitset has no stricter
3211         alignment than re_node_set; do this by defining a new internal
3212         type struct dests_alloc and using it to allocate memory.
3213
3214 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3215
3216         Check for arithmetic overflow when calculating sizes, to prevent
3217         some buffer-overflow issues.  These patches are conservative, in the
3218         sense that when I couldn't determine whether an overflow was possible,
3219         I inserted a run-time check.
3220         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3221         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3222         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3223         (re_xnrealloc, re_x2nrealloc): New inline functions.
3224         * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3225         (build_equiv_class, build_charclass): Check for arithmetic overflow
3226         in size expression calculations.
3227         * regex_internal.c (re_string_realloc_buffers):
3228         (build_wcs_upper_buffer, re_node_set_add_intersect):
3229         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3230         (re_dfa_add_node, register_state): Likewise.
3231         * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3232         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3233         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3234         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3235
3236 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3237
3238         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3239         to avoid a collision with bits/local_lim.h in glibc.
3240         All uses changed.  Problem reported by Dmitry V. Levin in
3241         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3242
3243         * regex_internal.c (build_wcs_upper_buffer): Fix portability
3244         bugs in int versus size_t comparisons.
3245         (re_string_context_at): Fix bug where the code assumed that
3246         Idx is signed.
3247
3248         Use bool where appropriate.
3249         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3250         All callers changed.
3251         (calc_eclosure_iter): Likewise, for ROOT arg.
3252         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3253         (build_charclass_op): Likewise, for NON_MATCH arg.
3254         * regex_internal.c (re_string_allocate, re_string_construct):
3255         (re_string_construct_common): Likewise, for ICASE arg.
3256         * regexec.c (re_search_2_stub, re_search_stub):
3257         Likewise, for RET_LEN arg.
3258         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3259         (set_regs): Likewise, for FL_BACKTRACK arg.
3260         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3261         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3262         (calc_eclosure_iter, parse_bracket_exp):
3263         Use bool for internal variables that are booleans.
3264         * regexec.c (re_search_internal, check_matching, proceed_next_node):
3265         (set_regs, build_sifted_states, sift_states_bkref):
3266         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3267         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3268         (find_collation_sequence_value):
3269         Likewise.
3270         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3271         (re_node_set_compare):
3272         Return bool, not int. All callers changed.
3273         * regexec.c (check_halt_node_context, check_dst_limits):
3274         (build_trtable, check_node_accept): Likewise.
3275         * regex_internal.h: Include stdbool.h.
3276
3277         Fix bugs uncovered when converting to bool.
3278         * regcomp.c (calc_eclosure_iter): Check for storage allocation
3279         failure instead of charging ahead blindly.
3280         * regex_internal.c (register_state): Likewise.
3281         * regexec.c (re_search_2_stub): Use simpler method than boolean
3282         for freeing internal storage.
3283         (group_nodes_into_DFA_states): Use unsigned int, not int, for
3284         bitset pieces used as boolean, to avoid undefined behavior
3285         on hosts that do int overflow checking.
3286
3287 2005-08-31  Derek Price  <derek@ximbiot.com>
3288
3289         * getdelim.c (getdelim): Return EOF on EOF.
3290         Reported by Larry Jones <lawrence.jones@ugs.com>.
3291
3292 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3293
3294         * regex_internal.c (re_string_reconstruct): Don't assume buffer
3295         lengths fit in regoff_t; this isn't true if regoff_t is the same
3296         width as size_t.
3297         * regex.c (re_search_internal): 5th arg is LAST_START
3298         (= START + RANGE) instead of RANGE.  This avoids overflow
3299         problems when regoff_t is the same width as size_t.
3300         All callers changed.
3301         (re_search_2_stub): Check for overflow when adding the
3302         sizes of the two strings.
3303         (re_search_stub): Check for overflow when adding START
3304         to RANGE; if it occurs, substitute the extreme value.
3305
3306 2005-08-31  Jim Meyering  <jim@meyering.net>
3307
3308         * regcomp.c (search_duplicated_node): Make first pointer arg
3309         a pointer-to-const.
3310         * regex_internal.c (create_ci_newstate, create_cd_newstate):
3311         (register_state): Likewise.
3312         * regexec.c (search_cur_bkref_entry, check_dst_limits):
3313         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3314         (group_nodes_into_DFAstates): Likewise.
3315
3316 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
3317
3318         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3319         old glibc regex code mishandles strings longer than 2**31 bytes.
3320         This patch fixes this when the regex code is used in gnulib
3321         (i.e., outside glibc).
3322
3323         This patch should not affect the use of the regex code inside
3324         glibc.  No doubt this problem also needs to be handled for glibc
3325         as well, but the result will be an incompatible change to the
3326         glibc ABI, and the old ABI will have to be supported too.  That
3327         can be the the subject for another patch.
3328
3329         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3330         governing whether the rest of this patch is active.  By default,
3331         the macro is disabled and the patch has no effect.
3332         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3333         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3334         (struct re_pattern_buffer, re_search, re_search_2, re_match):
3335         (re_match_2, re_set_registers): Use the new types.
3336         * regex_internal.h (Idx, re_hashval_t): New types.
3337         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3338         New macros.
3339         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3340         (re_string_context_at, bin_tree_t, re_dfastate_t):
3341         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3342         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3343         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3344         (re_string_char_size_at, re_string_wchar_at):
3345         (re_string_elem_size_at):
3346         Use the new types and macros to port to 64-bit hosts.
3347         Use unsigned types for internal values, so that the code
3348         mostly works even for arrays larger than SSIZE_MAX.
3349         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3350         (search_duplicated_node, calc_eclosure_iter, fetch_number):
3351         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3352         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3353         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3354         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3355         (calc_inveclosure, parse_dup_op, build_range_exp):
3356         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3357         (fetch_number, create_token_tree, mark_opt_subexp):
3358         Likewise.
3359         * regex_internal.c (re_string_construct_common, create_ci_newstate):
3360         (create_cd_newstate, re_string_allocate, re_string_construct):
3361         (re_string_realloc_buffers, build_wcs_upper_buffer):
3362         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3363         (re_string_reconstruct, re_string_peek_byte_case):
3364         (re_string_fetch_byte_case, re_string_context_at):
3365         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3366         (re_node_set_init_copy, re_node_set_add_intersect):
3367         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3368         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3369         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3370         (re_acquire_state, re_acquire_state_context, register_state):
3371         Likewise.
3372         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3373         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3374         (re_search_internal, re_search_2_stub, re_search_stub)
3375         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3376         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3377         (update_cur_sifted_state, check_dst_limits):
3378         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3379         (check_subexp_limits, sift_states_bkref, merge_state_array):
3380         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3381         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3382         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3383         (expand_bkref_cache, check_node_accept_bytes):
3384         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3385         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3386         (acquire_init_state_context, check_halt_node_context):
3387         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3388         (sift_states_backward, clean_state_log_if_needed):
3389         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3390         (find_recover_state, transit_state_sb, transit_state_mb):
3391         (transit_state_bkref, build_trtable, match_ctx_clean):
3392         Likewise.
3393         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3394         to work around an assumption that REG_MISSING is negative.
3395
3396         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3397         (seek_collating_symbol_entry) [defined _LIBC]:
3398         (lookup_collation_sequence_value) [defined _LIBC]:
3399         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3400         Use prototypes rather than old-style function definitions.
3401         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3402         (transit_state_sb) [0]:
3403         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3404
3405         * regexec.c (re_search_internal): Simplify update of rm_so and
3406         rm_eo.
3407
3408         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3409         (optimize_subexps, lower_subexp):
3410         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3411         since the signed shift might overflow.  Use 1u<<31 instead.
3412         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3413         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3414         Likewise.
3415
3416         * regcomp.c (optimize_subexps, lower_subexp):
3417         Use CHAR_BIT rather than 8, for clarity.
3418         * regexec.c (check_dst_limits_calc_pos_1):
3419         (check_subexp_matching_top): Likewise.
3420         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3421         have to worry about portability issues when shifting it left.
3422         Remove no-longer-needed test for table_size > 0.
3423         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3424         in a word, as the resulting behavior is undefined.
3425         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3426         in one case, a <= should have been an <, and in another case the
3427         whole test was missing.
3428         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3429         the standard name CHAR_BIT.
3430         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3431         this is not true on one's complement and signed-magnitude hosts.
3432
3433         * regex_internal.h (re_sub_match_top_t): Remove unused member
3434         next_last_offset.
3435         (struct re_dfa_t): Remove unused member states_alloc.
3436         * regcomp.c (init_dfa): Don't initialize unused members.
3437
3438 2005-08-31  Bruno Haible  <bruno@clisp.org>
3439
3440         * strstr.c: Include <stddef.h>, for NULL.
3441         * strcasestr.c: Likewise.
3442         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3443
3444 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3445
3446         * iconvme.h: Add prototype for iconv_alloc.
3447
3448 2005-08-29  Simon Josefsson  <jas@extundo.com>
3449
3450         * iconvme.c: Fix errno.
3451
3452 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3453
3454         * iconvme.c: Split iconv_string into iconv_alloc.
3455
3456 2005-08-27  Jim Meyering  <jim@meyering.net>
3457
3458         * fopen-safer.c: Merge minor changes from coreutils.
3459         * dup-safer.c: Likewise.
3460         * fd-safer.c: Likewise.
3461
3462         Merge from coreutils.
3463         * stdio--.h: New file.
3464         * stdlib--.h: New file.
3465         * mkstemp-safer.c: New file.
3466
3467         GNU tar needs these.
3468         * pipe-safer.c: New file.
3469         * creat-safer.c: New file.
3470         * fcntl--.h (creat): Define to creat_safer.
3471         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3472         * unistd--.h (pipe): Define to pipe_safer.
3473         * unistd-safer.h: Declare pipe_safer.
3474
3475 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3476
3477         * regex_internal.h: Remove all references to
3478         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3479         or better.
3480         (bitset_not, bitset_merge, bitset_not_merge):
3481         (bitset_mask, re_string_allocate, re_string_construct):
3482         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3483         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3484         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3485         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3486         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3487         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3488         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3489         (re_acquire_state_context):
3490         Remove unnecessary forward decls.
3491         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3492         Put __attribute at function definition,
3493         now that the function decl has been removed.
3494         * regex_internal.c (re_string_peek_byte_case):
3495         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3496         Likewise.
3497
3498 2005-08-26  Simon Josefsson  <jas@extundo.com>
3499
3500         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3501         Haible <bruno@clisp.org>.
3502
3503 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3504
3505         * regexec.c (set_regs): Don't alloca with an unbounded size.
3506
3507         alloca modernization/simplification for regex.
3508         * regex.c: Remove portability cruft for alloca.  This no longer
3509         needs to be at the start of the file, and can be moved into
3510         regex_internal.h and simplified.
3511         * regex_internal.h: Include <alloca.h>.
3512         (__libc_use_alloca) [!defined _LIBC]: New macro.
3513         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3514         now works outside glibc.
3515
3516 2005-08-24  Simon Josefsson  <jas@extundo.com>
3517
3518         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3519         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3520         GLIBC specific code.
3521
3522 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3523
3524         Make regex safe for g++.  This fixes one real bug (an "err"
3525         that should have been "*err").  g++ problem reported by
3526         Sam Steingold.
3527         * regex_internal.h (re_calloc): New macro, consistent with
3528         re_malloc etc.  All callers of calloc changed to use re_calloc.
3529         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3530         not int.  All callers changed.
3531         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3532         just use an array of size MB_LEN_MAX.
3533         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3534         (find_recover_state): Change "err" to "*err"; this fixes what
3535         appears to be a real bug.
3536         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3537         versus int.
3538
3539 2005-08-25  Jim Meyering  <jim@meyering.net>
3540
3541         * open-safer.c: Include <config.h>.
3542         Otherwise, we'd lose LARGEFILE support in any file using
3543         e.g. "fcntl--.h"
3544
3545 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3546
3547         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3548         * regex.h (regerror): Likewise.
3549
3550         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3551         requires this.  (The code never needed it.)
3552
3553         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3554         All uses of recently-renamed identifiers changed to use the new,
3555         POSIX-compliant names.  The code will build and run just fine
3556         without these changes, but it's better to eat our own dog food
3557         and use the standard-conforming names.
3558
3559         * regex.h: Fix a multitude of POSIX name space violations.
3560         These changes have an effect only for programs that define
3561         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3562         do not change anything for programs compiled in the normal way.
3563         Also, there is no effect on the ABI.
3564
3565         (_REGEX_SOURCE): New macro.
3566         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3567         defined and _GNU_SOURCE is not; this fixes a name space violation.
3568
3569         Rename the following macros to obey POSIX requirements.
3570         The old names are still visible as macros if _REGEX_SOURCE is defined.
3571         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3572         RE_BACKSLASH_ESCAPE_IN_LISTS.
3573         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3574         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3575         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3576         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3577         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3578         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3579         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3580         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3581         (REG_INTERVALS): renamed from RE_INTERVALS.
3582         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3583         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3584         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3585         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3586         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3587         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3588         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3589         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3590         RE_UNMATCHED_RIGHT_PAREN_ORD.
3591         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3592         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3593         (REG_DEBUG): renamed from RE_DEBUG.
3594         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3595         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3596         unusual, since we can't clash with the POSIX REG_ICASE.
3597         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3598         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3599         (REG_NO_SUB): renamed from RE_NO_SUB.
3600         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3601         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3602         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3603         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3604         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3605         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3606         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3607         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3608         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3609         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3610         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3611         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3612         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3613         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3614         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3615         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3616         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3617         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3618         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3619         (REG_FIXED): Renamed from REGS_FIXED.
3620         (REG_NREGS): Renamed from RE_NREGS.
3621
3622         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3623         of other REG_* macros, since POSIX says the user is allowed to
3624         #undef these macros selectively.
3625
3626         (reg_errcode_t): Update comment stating what other tables need
3627         to be consistent.
3628
3629         Rename the following enum values to obey POSIX requirements.
3630         The old names are still visible as macros.
3631         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3632         is not defined, since GNU is supposed to be a superset of POSIX as
3633         much as possible, and since we want reg_errcode_t to be a signed
3634         type for implementation consistency.
3635         (_REG_NOERROR): Renamed from REG_NOERROR.
3636         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3637         (_REG_BADPAT): Renamed from REG_BADPAT.
3638         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3639         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3640         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3641         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3642         (_REG_EBRACK): Renamed from REG_EBRACK.
3643         (_REG_EPAREN): Renamed from REG_EPAREN.
3644         (_REG_EBRACE): Renamed from REG_EBRACE.
3645         (_REG_BADBR): Renamed from REG_BADBR.
3646         (_REG_ERANGE): Renamed from REG_ERANGE.
3647         (_REG_ESPACE): Renamed from REG_ESPACE.
3648         (_REG_BADRPT): Renamed from REG_BADRPT.
3649         (_REG_EEND): Renamed from REG_EEND.
3650         (_REG_ESIZE): Renamed from REG_ESIZE.
3651         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3652         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3653         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3654         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3655         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3656
3657         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3658         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3659         changed.  But support the old name if the new one is not defined
3660         and if _REGEX_SOURCE.
3661
3662         Change the following member names in struct re_pattern_buffer.
3663         The old names are still supported if !_REGEX_SOURCE.
3664         The new names are always supported, regardless of _REGEX_SOURCE.
3665         (re_buffer): Renamed from buffer.
3666         (re_allocated): Renamed from allocated.
3667         (re_used): Renamed from used.
3668         (re_syntax): Renamed from syntax.
3669         (re_fastmap): Renamed from fastmap.
3670         (re_translate): Renamed from translate.
3671         (re_can_be_null): Renamed from can_be_null.
3672         (re_regs_allocated): Renamed from regs_allocated.
3673         (re_fastmap_accurate): Renamed from fastmap_accurate.
3674         (re_no_sub): Renamed from no_sub.
3675         (re_not_bol): Renamed from not_bol.
3676         (re_not_eol): Renamed from not_eol.
3677         (re_newline_anchor): Renamed from newline_anchor.
3678
3679         Change the following member names in struct re_registers.
3680         The old names are still supported if !_REGEX_SOURCE.
3681         The new names are always supported, regardless of _REGEX_SOURCE.
3682         (rm_num_regs): Renamed from num_regs.
3683         (rm_start): Renamed from start.
3684         (rm_end): Renamed from end.
3685
3686         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3687         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3688         Prepend __ to parameter names.
3689
3690         Undo yesterday's changes.
3691
3692 2005-08-24  Jim Meyering  <jim@meyering.net>
3693
3694         Sync from coreutils.
3695         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3696
3697 2005-08-21  Bruno Haible  <bruno@clisp.org>
3698
3699         * lock.h: Add multiple inclusion guard.
3700         * tls.h: Add multiple inclusion guard.
3701
3702 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3703
3704         * regex.h (REG_NOSYS)
3705         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3706         Define, since POSIX requires it as of 2001.
3707         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3708         New private symbol, used to keep the enum signed in all cases.
3709         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3710         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3711
3712         * regex_internal.c (re_string_skip_chars, register_state):
3713         (calc_state_hash):
3714         Remove forward decls; no longer needed now that we use prototypes.
3715         * regexec.c (acquire_init_state_context, check_halt_node_context):
3716         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3717         (clean_state_log_if_needed): Likewise.
3718
3719 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3720
3721         Fix problems reported by Sam Steingold in
3722         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3723         * regexec.c (sift_states_bkref): Fix portability bug: the code
3724         assumed that reg_errcode_t is a signed type, which is not
3725         necessarily true if _XOPEN_SOURCE is not defined.
3726         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3727         some compilers warn about it otherwise.
3728
3729 2005-08-20  Jim Meyering  <jim@meyering.net>
3730
3731         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3732         of unused local, dfa.
3733
3734 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3735
3736         * regcomp.c (create_initial_state): Remove duplicate decl.
3737         (init_word_char, create_initial_state, duplicate_node_closure):
3738         (fetch_token, peek_token_bracket, build_range_exp):
3739         (build_collating_symbol): Remove forward decls; no longer needed
3740         now that we use prototypes.
3741
3742         * regcomp.c:
3743         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3744         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3745         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3746         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3747         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3748         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3749         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3750         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3751         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3752         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3753         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3754         (build_charclass, build_charclass_op, fetch_number, create_tree):
3755         (create_token_tree, mark_opt_subexp, duplicate_tree):
3756         Use prototypes rather than old-style definitions.
3757
3758         * regex_internal.c:
3759         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3760         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3761         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3762         (re_string_reconstruct, re_string_peek_byte_case):
3763         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3764         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3765         (re_node_set_init_copy, re_node_set_add_intersect):
3766         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3767         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3768         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3769         (re_acquire_state, re_acquire_state_context, register_state):
3770         (create_ci_newstate, create_cd_newstate, free_state):
3771         Likewise.
3772         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3773         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3774         (re_search_internal, prune_impossible_nodes):
3775         (acquire_init_state_context, check_matching, static):
3776         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3777         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3778         (update_regs, sift_states_backward, build_sifted_states):
3779         (clean_state_log_if_needed, merge_state_array):
3780         (update_cur_sifted_state, add_epsilon_src_nodes):
3781         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3782         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3783         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3784         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3785         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3786         (check_arrival, check_arrival_add_next_nodes):
3787         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3788         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3789         (check_node_accept_bytes, check_node_accept, extend_buffers):
3790         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3791         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3792         (sift_ctx_init):
3793         Likewise.
3794
3795         * regex_internal.h:
3796         (re_string_allocate, re_string_construct, re_string_reconstruct):
3797         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3798         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3799         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3800         (re_string_context_at, re_string_peek_byte_case):
3801         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3802         is defined, since we now use prototypes always.
3803
3804         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3805         C89 or better.  All uses removed.
3806
3807 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3808
3809         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3810         [defined lint]: Suppress bogus uninitialized-variable warnings.
3811
3812         * regcomp.c (duplicate_node): Return new index, not an error code,
3813         and let the caller return REG_ESPACE if out of space.  This
3814         removes an uninitialied-variable warning with GCC 4.0.1, and also
3815         avoids taking the address of a local variable.  All callers
3816         changed.
3817
3818 2005-08-19  Jim Meyering  <jim@meyering.net>
3819
3820         * regexec.c (proceed_next_node): Redo local variables to
3821         avoid GCC shadowing warnings.
3822
3823 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3824
3825         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3826         (re_node_set_insert_last, re_dfa_add_node):
3827         Rename local variables to avoid GCC shadowing warnings.
3828
3829 2005-08-18  Bruno Haible  <bruno@clisp.org>
3830
3831         * strstr.c (strstr): Fix return value in multibyte case.
3832         * strcasestr.c (strcasestr): Likewise.
3833
3834 2005-08-17  Jim Meyering  <jim@meyering.net>
3835
3836         Make the %s format (seconds since the epoch) work for a negative
3837         number and when used with a zero-padded field width, e.g. %015s.
3838
3839         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3840         label so that it precedes the code to set `digits'.  Otherwise,
3841         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3842         print `00-22'.  Now, it prints `-0022', as it should.
3843
3844 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3845
3846         * regex.h: Remove useless space-before-tab.  From coreutils.
3847
3848 2005-08-17  Bruno Haible  <bruno@clisp.org>
3849
3850         * strcasestr.h: New file.
3851         * strcasestr.c: New file.
3852
3853 2005-08-17  Bruno Haible  <bruno@clisp.org>
3854
3855         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3856         * strstr.c: Completely rewritten, with multibyte locale support.
3857
3858 2005-08-17  Bruno Haible  <bruno@clisp.org>
3859
3860         * strcasecmp.c: Use mbuiter.h.
3861
3862 2005-08-17  Bruno Haible  <bruno@clisp.org>
3863
3864         * mbuiter.h: New file.
3865
3866 2005-08-16  Bruno Haible  <bruno@clisp.org>
3867
3868         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3869         (mbi_init): Update.
3870         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3871         NUL byte, not after it.
3872
3873 2005-08-16  Bruno Haible  <bruno@clisp.org>
3874
3875         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3876         the valid ones. Makes the comparison operations transitive:
3877         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3878         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3879
3880 2005-08-16  Bruno Haible  <bruno@clisp.org>
3881
3882         * strcase.h (strcasecmp): Add note in comments.
3883         * strncasecmp.c: Use code from strcasecmp.c.
3884         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3885         (strcasecmp): Work correctly in multibyte locales.
3886
3887 2005-08-16  Bruno Haible  <bruno@clisp.org>
3888
3889         * strnlen1.h: New file.
3890         * strnlen1.c: New file.
3891
3892 2005-08-16  Bruno Haible  <bruno@clisp.org>
3893
3894         * mbfile.h: New file.
3895
3896 2005-08-16  Bruno Haible  <bruno@clisp.org>
3897
3898         * mbiter.h: New file.
3899
3900 2005-08-16  Bruno Haible  <bruno@clisp.org>
3901
3902         * mbchar.h: New file.
3903         * mbchar.c: New file.
3904
3905 2005-08-16  Bruno Haible  <bruno@clisp.org>
3906
3907         * tls.h: New file, from GNU gettext.
3908         * tls.c: New file, from GNU gettext.
3909
3910 2005-08-15  Bruno Haible  <bruno@clisp.org>
3911
3912         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3913         is defined.
3914
3915 2005-08-14  Jim Meyering  <jim@meyering.net>
3916
3917         Sync from coreutils.
3918
3919         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3920         Use the hash-table-based cycle-detection code not just when
3921         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3922         Reported by James Youngman in
3923         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3924         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3925         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3926         This lets us compile with -DFTS_DEBUG, once again.
3927         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3928         * fts.c (fd_safer): Remove decl.
3929         Include fcntl--.h rather than unistd-safer.h
3930         (fts_safe_changedir): Don't call fd_safer; no longer needed
3931         now that we include fcntl--.h.
3932
3933 2005-08-11  Simon Josefsson  <jas@extundo.com>
3934
3935         * readline.h, readline.c: New file.
3936
3937 2005-08-11  Bruno Haible  <bruno@clisp.org>
3938
3939         * strnlen.h (strnlen): Change parameter name to match comment.
3940
3941 2005-08-10  Simon Josefsson  <jas@extundo.com>
3942
3943         * strndup.c: Use strnlen.h.
3944
3945         * strnlen.h: New file.
3946
3947 2005-08-02  Simon Josefsson  <jas@extundo.com>
3948
3949         * getline.h, getline.c: Rewrite.
3950
3951         * getdelim.h, getdelim.c: New files, ported from glibc.
3952
3953 2005-07-31  Bruno Haible  <bruno@clisp.org>
3954
3955         * lock.h (gl_lock_initializer): New macro.
3956         (gl_lock_define_initialized): Use it.
3957         (gl_rwlock_initializer): New macro.
3958         (gl_rwlock_define_initialized): Use it.
3959         (gl_recursive_lock_initializer): New macro.
3960         (gl_recursive_lock_define_initialized): Use it.
3961
3962 2005-07-26  Bruno Haible  <bruno@clisp.org>
3963
3964         * lock.h: Update from GNU gettext.
3965         * lock.c: Update from GNU gettext.
3966
3967 2005-07-18  Bruno Haible  <bruno@clisp.org>
3968
3969         * lock.h (gl_once_t): New type.
3970         (gl_once_define, gl_once): New macros.
3971         * lock.c (fresh_once): New variable.
3972         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3973         functions.
3974
3975 2005-07-18  Simon Josefsson  <jas@extundo.com>
3976
3977         * check-version.c (check_version): Accept identical versions too.
3978
3979 2005-07-18  Bruno Haible  <bruno@clisp.org>
3980
3981         * lock.h: New file, from GNU gettext.
3982         * lock.c: New file, from GNU gettext.
3983
3984 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3985
3986         * quotearg.c: Add translator comment suggested by Bruno Haible,
3987         with a minor change.
3988
3989 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3990
3991         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3992         copyright symbol and the year.
3993         * version-etc.c (COPYRIGHT_YEAR): New constant.
3994         (version_etc_va): Use parameterized copyright notice.
3995         Reword to conform to the current GNU coding standards.
3996
3997 2005-07-11  Simon Josefsson  <jas@extundo.com>
3998
3999         * size_max.h: New file.
4000
4001 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4002
4003         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
4004         block of defines.
4005
4006 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
4007        and  Paul Eggert  <eggert@cs.ucla.edu>
4008
4009         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
4010         in wint_t, not wchar_t.  Remove now-unnecessary cast.
4011
4012 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4013
4014         * regex.c, regex.h: Sync from libc.
4015         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
4016         New files, synced from libc, except that regex_internal.h
4017         currently has a small porting fix.
4018
4019 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
4020
4021         Remove the dependency of the strftime module on the tzset module.
4022         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
4023         Copy the input structure, to work around some of the bug with
4024         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
4025         Solaris releases, you should also use the tzset module, but we won't
4026         require it as a dependency any more since we don't want LGPLed code
4027         to depend on GPLed code.
4028
4029 2005-07-02  Jim Meyering  <jim@meyering.net>
4030
4031         * backupfile.c (backup_args): Change a `0' to NULL.
4032
4033 2005-07-01  Jim Meyering  <jim@meyering.net>
4034
4035         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
4036         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
4037         * save-cwd.c, tempname.c:
4038         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
4039         and don't include <sys/file.h>).
4040
4041 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
4042
4043         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4044         declares only 'struct timespec;' (!).
4045
4046 2005-06-29  Jim Meyering  <jim@meyering.net>
4047
4048         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
4049         type name.  Use the variable name instead.
4050         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
4051
4052 2005-06-28  Simon Josefsson  <jas@extundo.com>
4053
4054         * check-version.h, check-version.c: New files.
4055
4056 2005-06-28  Simon Josefsson  <jas@extundo.com>
4057
4058         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
4059         collision with global variable.  Better indentation.  Don't
4060         increment buffer pointer beyond buffer end.  Based on comments
4061         from Paul Eggert <eggert@cs.ucla.edu>.
4062
4063         * base64.h: Indent.
4064
4065 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4066
4067         * canon-host.c (canon-host): Append trailing "," to 0 in
4068         initializer of struct addrinfo, as an indication that we don't
4069         care how many members the structure has.
4070
4071 2005-06-24  Derek Price  <derek@ximbiot.com>
4072         and Bruno Haible  <bruno@clisp.org>
4073
4074         Remove stat module & update lstat.
4075         * stat.c: Remove this file...
4076         (slash_aware_lstat): ...moving this content and its support...
4077         * lstat.c (rpl_lstat): ...into here.
4078         * lstat.h: New file.
4079
4080 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4081
4082         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
4083         (ranged_convert): Don't save conversion in a temporary struct.
4084         This causes a warning with GCC 4.0.0, and anyway in the typical
4085         case it's not worth the extra 100 bytes or so of code.
4086         (ranged_convert, __mktime_internal): When calling a function via a
4087         pointer P, use P () rather than (*P) (), as we now assume C89 or
4088         better.
4089
4090 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4091
4092         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
4093         "who -r" failed to give output.  Problem reported by Tim Waugh.
4094
4095         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
4096         (xcalloc): Use it to avoid needless tests.
4097         Problem reported by Jim Meyering.
4098
4099 2005-06-16  Jim Meyering  <jim@meyering.net>
4100
4101         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
4102         when either N or S is zero.
4103
4104 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4105
4106         * argp.h (__option_is_short): Check upper limit of
4107         __key. Isprint() requires its argument to have the value
4108         of an unsigned char or EOF.
4109
4110 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4111
4112         * fnmatch.c (fnmatch): If there is an encoding error in a
4113         multibyte string or pattern, fall back on unibyte matching.
4114         Problem reported by James Youngman.
4115
4116 2005-06-08  Bruno Haible  <bruno@clisp.org>
4117
4118         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4119         warning on mingw.
4120
4121 2005-06-08  Bruno Haible  <bruno@clisp.org>
4122
4123         * csharpcomp.h: New file, from GNU gettext.
4124         * csharpcomp.c: New file, from GNU gettext.
4125         * csharpcomp.sh.in: New file, from GNU gettext.
4126
4127 2005-06-07  Derek Price  <derek@ximbiot.com>
4128
4129         Sync from CVS.
4130         * glob_.h: Indent nested #ifdef.
4131
4132 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4133
4134         Sync from coreutils.
4135         Use "file name" when talking about file names, instead of "filename"
4136         or "path", as per the GNU coding standards.
4137         * mkdir-p.c: Renamed from makepath.c.
4138         (make_dir_parents): Renamed from make_path.  All callers changed.
4139         * mkdir-p.h: Likewise.  All includers changed.
4140         * filenamecat.c: Renamed from path-concat.c.
4141         (file_name_concat): Renamed from path_concat.  All callers changed.
4142         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4143         * filenamecat.h: Likewise.  All includers changed.
4144         * acl.c: Don't use "path" or "filename" to mean "file name"
4145         in comments or local variable names.
4146         * basename.c: Likewise.
4147         * canonicalize.c, canonicalize.h: Likewise.
4148         * dirname.c, dirname.h: Likewise.
4149         * euidaccess.c: Likewise.
4150         * exclude.c: Likewise
4151         * fnmatch_.h, fnmatch_loop.c: Likewise.
4152         * fsusage.c, fsuage.h: Likewise.
4153         * fts.c, fts_.h: Likewise.
4154         * getcwd.c: Likewise.
4155         * getloadavg.c: Likewise.
4156         * mkstemp.c: Likewise.
4157         * mountlist.c, mountlist.h: Likewise.
4158         * openat.c, openat.h: Likewise.
4159         * readlink-stub.c: Likewise.
4160         * readutmp.c, readutmp.h: Likewise.
4161         * rename.c: Likewise.
4162         * rmdir.c: Likewise.
4163         * same.c: Likewise.
4164         * savedir.c: Likewise.
4165         * stripslash.c: Likewise.
4166         * tempname.c: Likewise.
4167         * xreadlink.c: Likewise.
4168         * exclude.c (excluded_file_name): Renamed from excluded_filename.
4169         All uses changed.
4170         * exclude.h: Likewise.
4171
4172         * euidaccess.c (getuid, getgid, getuid, getegid)
4173         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4174         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4175         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4176         * pathmax.h: Include <limits.h> unconditionally, since other
4177         files have been getting away with it for years (MORE/BSD 4.3
4178         is extinct now).
4179         * userspec.c (getpwnam, getgrnam, getgrgid)
4180         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4181
4182         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4183         Define to 256, not 255, as per modern POSIX.
4184
4185 2005-06-01  Bruno Haible  <bruno@clisp.org>
4186
4187         * csharpexec.h: New file, from GNU gettext.
4188         * csharpexec.c: New file, from GNU gettext.
4189         * csharpexec.sh.in: New file, from GNU gettext.
4190
4191 2005-05-31  Derek Price  <derek@ximbiot.com>
4192             Paul Eggert  <eggert@cs.ucla.edu>
4193
4194         Sync from cvs.
4195         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4196
4197 2005-05-29  Derek Price  <derek@ximbiot.com>
4198             Paul Eggert  <eggert@cs.ucla.edu>
4199
4200         * glob_.h, glob.c: New files.
4201
4202 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4203
4204         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4205
4206         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4207         the configuration hassle isn't worth it.
4208         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4209         (LONGEST_MODIFIER, PRIuMAX): Remove.
4210
4211 2005-05-27  Bruno Haible  <bruno@clisp.org>
4212
4213         * getlogin_r.h: Remove second include of <stddef.h>.
4214
4215 2005-05-25  Bruno Haible  <bruno@clisp.org>
4216             Derek Price  <derek@ximbiot.com>
4217
4218         * getlogin_r.h: Simplify API documentation.
4219
4220 2005-05-25  Derek Price  <derek@ximbiot.com>
4221             Paul Eggert  <eggert@cs.ucla.edu>
4222
4223         * getlogin_r.c, getlogin_r.h: New files.
4224
4225 2005-05-22  Bruno Haible  <bruno@clisp.org>
4226
4227         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4228         Also include <sys/param.h> if it defines MIN, MAX.
4229         Based on a patch by Derek Price <derek@ximbiot.com>.
4230
4231 2005-05-22  Bruno Haible  <bruno@clisp.org>
4232
4233         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4234         (INT64_MIN): Fix definition.
4235         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4236
4237         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4238         NEED_SIGNED_INT_TYPES.
4239
4240         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4241         HAVE_SYSTEM_INTTYPES.
4242
4243 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
4244
4245         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4246         so that unistd-safer.h (GPL'ed code) need not be included.
4247
4248 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
4249
4250         New fts module.
4251         * fts.c: Don't include "cycle-check.h" or "hash.h".
4252         (setup_dir, free_dir): New functions.
4253         (enter_dir, leave_dir): Define trivial
4254         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
4255         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
4256         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4257         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4258         Move to fts-cycle.c.
4259         (fts_open): Use setup_dir.
4260         (fts_close): Use free_dir.
4261         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4262         This adds a label and some gotos, but the alternatives were messier.
4263         Check for memory allocation failure when entering a dir.
4264         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4265         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4266         (FTS): New member fts_cycle, that is a union that contains the
4267         old active_dir_ht and cycle_state.  All uses changed to mention
4268         fts_cycle.ht and fts_cycle.state.
4269         * fts-cycle.c: New file, containing GPL'ed code migrated out of
4270         fts.c, with the following changes:
4271         (setup_dir, free_dir): New functions.
4272         (enter_dir): Now returns bool.  Return true if successful, false
4273         if memory exhausted.  All callers changed.
4274         Do not bother partly cleaning up on
4275         memory allocation failure; that is free_dir's job.
4276         However, free ad if hash_insert fails, to avoid memory leak.
4277         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4278         fts->fts_options to see which union member to use.
4279
4280 2005-05-20  Jim Meyering  <jim@meyering.net>
4281
4282         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4283         Now a macro, to pacify GCC.
4284
4285 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
4286
4287         * chown.c (rpl_chown): Return -1 on failure.
4288
4289 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4290
4291         * canonicalize.c: Include canonicalize.h first, to test interface.
4292         Include <stddef.h> unconditionally, since we assume C89 now.
4293         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4294         * fts.c: Include fts_.h first, to check interface.
4295         Do not include intprops.h; no longer needed.
4296         Include cycle-check.h and hash.h, since fts_.h no longer does.
4297         Remove unnecessary casts of closedir to void.
4298         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4299         decide whether to decrement nlinks.
4300         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4301         (FTS): Use struct hash_table * instead of Hash_table, so that
4302         we no longer need to include hash.h here.
4303
4304 2005-05-17  Jim Meyering  <jim@meyering.net>
4305
4306         * fts.c, fts_.h: New files, from coreutils.
4307
4308 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4309
4310         Sync from coreutils.
4311         * unlinkdir.c, unlinkdir.h: New files.
4312         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4313         regex.h, unlocked-io.h, xtime.h:
4314         White space changes only.
4315         * makepath.c (make_path): Port to hosts where leading "//" is special.
4316         * yesno.c: Include getline.h, not ctype.h.
4317         (yesno): Don't remove leading white space; POSIX doesn't allow it.
4318         Use getline to remove arbitrary restriction on response length.
4319
4320 2005-05-13  Bruno Haible  <bruno@clisp.org>
4321
4322         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4323         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4324         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4325         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4326         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4327         Add support for 64-bit integers in the MSVC compiler.
4328
4329 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
4330
4331         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4332         Change the initial comment to refer to GPL, not LGPL.
4333         gnulib-tool will change it to LGPL as needed.
4334
4335         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4336         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4337         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4338         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4339         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4340         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4341         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4342         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4343         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4344         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4345         concatpath.c, config.charset, copy-file.c, copy-file.h,
4346         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4347         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4348         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4349         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4350         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4351         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4352         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4353         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4354         full-read.c, full-read.h, full-write.c, full-write.h,
4355         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4356         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4357         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4358         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4359         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4360         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4361         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4362         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4363         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4364         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4365         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4366         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4367         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4368         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4369         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4370         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4371         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4372         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4373         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4374         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4375         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4376         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4377         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4378         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4379         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4380         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4381         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4382         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4383         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4384         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4385         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4386         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4387         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4388         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4389         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4390         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4391         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4392         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4393         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4394         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4395         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4396         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4397         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4398         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4399         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4400         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4401         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4402         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4403         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4404         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4405         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4406         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4407         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4408         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4409         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4410         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4411         Update FSF postal mail address.
4412
4413 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4414
4415         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4416         specified in ai_socktype. Fix invalid ai_protocol
4417         check. ai_protocol is usually set to 0 or depending on
4418         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4419         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4420         ai_socktype / ai_protocol in the returned addrinfo structure.
4421
4422 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4423             Bruno Haible  <bruno@clisp.org>
4424
4425         * inet_ntop.h: New file.
4426         * inet_ntop.c: New file, from glibc with modifications.
4427
4428 2005-05-08  Jim Meyering  <jim@meyering.net>
4429
4430         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4431
4432 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4433
4434         Merge from coreutils.  Among other things,
4435         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4436         * fd-safer.c: New file.
4437         * fcntl-safer.h, open-safer.c: Remove.
4438         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4439         * dup-safer.c: Include unistd-safer.h first.
4440         Don't include errno.h.
4441         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4442         * file-type.h: Don't assume invoker included sys/stat.h first.
4443         * file-type.c: Rely on file-type.h change.
4444         * getloadavg.c: Include unistd-safer.h.
4445         (getloadavg): Use safer open.
4446         * getusershell.c: Include "stdio-safer.h".
4447         (getusershell): Use safer fopen.
4448         * long-options.c (long_options): Use NULL rather than 0.
4449         * modechange.h (mode_free): Remove; all callers changed to invoke
4450         'free'.
4451         * modechange.c: Likewise.
4452         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4453         (MODE_DONE): New constant.
4454         (struct mode_change): Remove 'next' member.
4455         (make_node_op_equals): New function; like the old one of the
4456         same name, except it allocates an array.
4457         (mode_compile, mode_create_from_ref): Use it.
4458         (mode_compile): Allocate result as an array, not a linked list.
4459         Parse octal string ourself, so that we catch mistakes like "+0".
4460         (mode_adjust): Arg is an array, not a linked list.
4461         * modechange.c: Include stat-macros.h, xalloc.h.
4462         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4463         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4464         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4465         Remove.  This is now stat-macros.h's job.
4466         (talloc): Remove.  All callers replaced by xalloc, so that
4467         our invokers don't have to worry about reporting memory failures.
4468         (make_node_op_equals): Remove.
4469         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4470         New constants.
4471         (struct mode_change): Moved here from modechange.h.
4472         (mode_append_entry): Remove.
4473         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4474         apps to have incorrect behavior.  Use simpler algorithm for head
4475         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4476         Detect more invalid usages rather than having somewhat-random behavior.
4477         Don't insert an "a=" action, as that leads to incorrect behavior.
4478         (mode_compile, mode_create_from_ref): Return NULL on error instead
4479         of an enum, since now there's only one way to have an error.  All
4480         callers changed.
4481         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4482         at the correct time.  Simplify calculation of "+u" and its ilk.
4483         Don't mishandle "+X".
4484         (mode_free): Remove "register" and localize decls.
4485         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4486         (struct mode_change): Move to modechange.c; callers don't
4487         need to see this stuff.
4488         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4489         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4490         (mode_change, mode_adjust): Reflect the new signatures noted above.
4491         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4492         that might redefine system include files.
4493         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4494         (my_usleep): Use NULL rather than (void *) 0.
4495         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4496         Use siginterrupt to specify that system calls should be interrupted.
4497         (rpl_nanosleep): Move initialization of suspended closer to call of
4498         my_usleep.
4499         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4500         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4501         (desirable_utmp_entry): New function.
4502         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4503         using x2nrealloc, to simplify logic.
4504         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4505         size calculation.  Do not assume utmp file is a regular file.
4506         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4507         (READ_UTMP_CHECK_PIDS): New constant.
4508         * save-cwd.c: Include unistd-safer.h.
4509         (save_cwd): Use fd_safer.
4510         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4511         [!_LIBC] Include "stat-macros.h" instead.
4512         * unistd-safer.h (fd_safer): New decl.
4513
4514 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4515
4516         * byteswap_.h: New file.
4517
4518 2005-04-25  Albert Chin  <china@thewrittenword.com>
4519
4520         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4521         Toolkit C bug.
4522
4523 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4524
4525         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4526         that "UTC +1 second" continues to work.  Problem reported
4527         by Dmitry V. Levin.
4528         (relunit_snumber): New rule.
4529         (relunit): Use it.
4530
4531 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4532
4533         * getdate.y (universal_time_zone_table): New constant.
4534         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4535         universal_time_zone_table.
4536         (lookup_zone): Prefer universal_time_zone_table to
4537         local_time_zone_table, so that "GMT" time stamps are allowed in
4538         London during the summer.  Problem reported by Ian Abbott.
4539
4540 2005-04-12  Jim Meyering  <jim@meyering.net>
4541
4542         * human.c (humblock): Set *options even when returning due to
4543         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4544         warning from gcc-4.
4545
4546 2005-04-09  Jim Meyering  <jim@meyering.net>
4547
4548         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4549         -Wuninitialized: initialize tm0.tm_year.
4550
4551 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4552
4553         * getdate.y (parser_control): rels_seen is now a boolean, not a
4554         count, since there's no maximum.  All uses changed.
4555         Add member dsts_seen.
4556         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4557         not being INT_MAX.
4558         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4559         Use pc_rels_seen to decide whther a date is absolute.
4560
4561         * getdate.y (number): Don't overwrite year.
4562         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4563         check.
4564
4565 2005-04-02  Simon Josefsson  <jas@extundo.com>
4566
4567         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4568         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4569
4570 2005-03-27  Jim Meyering  <jim@meyering.net>
4571
4572         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4573
4574 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4575
4576         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4577         "one's complement" -> "ones' complement" in comment, as per Knuth.
4578         "value of type" -> "type or expression" in comment.
4579         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4580
4581 2005-03-26  Jim Meyering  <jim@meyering.net>
4582
4583         Comment nits.
4584         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4585         Correct typos: s/or/of/.
4586
4587 2005-03-23  Jim Meyering  <jim@meyering.net>
4588
4589         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4590
4591 2005-03-21  Jim Meyering  <jim@meyering.net>
4592
4593         Changes imported from coreutils.
4594
4595         * cycle-check.c: Don't include xalloc.h.
4596
4597         * path-concat.c: Don't include assert.h.
4598         (path_concat): Remove assertion that would have triggered
4599         for ABASE starting with more than one slash.
4600         Reported by Andreas Schwab.
4601
4602         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4603         properly when ABASE is an absolute file name.
4604         Correct the description of this function.
4605         Include <assert.h>.
4606         Add an assertion and a test driver.
4607         This fixes a bug introduced on 2004-07-02.
4608         Andreas Schwab reported the resulting failure of cp --parents:
4609         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4610
4611 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4612
4613         * strftime.c (my_strftime): If the underlying strftime returns 0
4614         (which shouldn't happen), generate nothing instead of returning 0
4615         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4616
4617 2005-03-16  Bruno Haible  <bruno@clisp.org>
4618
4619         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4620
4621 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4622
4623         * strftime.c (my_strftime): Prepend space to format so that we can
4624         reliably distinguish strftime failure from empty output on POSIX
4625         hosts.
4626
4627 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4628
4629         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4630         (iconv_string): Don't guess a size-zero buffer, as that might cause
4631         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4632         result would be 'too large', where 'too large' is (heuristically)
4633         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4634         overflow concerns.  This will prevent some unwanted malloc failures
4635         when the inputs are very large.
4636
4637 2005-03-15  Bruno Haible  <bruno@clisp.org>
4638
4639         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4640         'negate'.
4641
4642         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4643         variable.
4644
4645         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4646
4647 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4648
4649         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4650         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4651         intprops.h.
4652         * strtol.c: Likewise.
4653
4654 2005-03-14  Simon Josefsson  <jas@extundo.com>
4655
4656         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4657         <fx@gnu.org>.
4658
4659 2005-03-14  Jim Meyering  <jim@meyering.net>
4660
4661         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4662         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4663         to be nonzero so that we (and caller) can detect the difference
4664         between a valid zero-length expansion and an error return, even
4665         when the underlying strftime fails before writing anything into
4666         that location.
4667
4668 2005-03-10  Jim Meyering  <jim@meyering.net>
4669
4670         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4671         so that this module works on systems without fchdir.
4672
4673 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4674
4675         Factor int-properties macros into a single file, except for
4676         glibc-related files.
4677         * intprops.h: New file.
4678         * getloadavg.c: Include it instead of limits.h.
4679         (INT_STRLEN_BOUND): Remove.
4680         * human.c: Include intprops.h.
4681         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4682         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4683         * inttostr.h: Include intprops.h instead of limits.h.
4684         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4685         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4686         for consistency with intprops.h.
4687         (time_t_is_integer, twos_complement_arithmetic): Use them.
4688         * sig2str.h: Include <signal.h>, intprops.h.
4689         (INT_STRLEN_BOUND): Remove.
4690         * strftime.c (TYPE_SIGNED): Remove.
4691         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4692         * strtol.c: Adjust comments to match intprops.h.
4693         * userspec.c: Include intprops.h.
4694         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4695         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4696         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4697         instead of rolling our own expressions.
4698         * xstrtol.c: Include xstrtol.h first, to test interface.
4699
4700         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4701         instead of int.
4702         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4703         the right thing even if adding 1900 would overflow.  Similarly
4704         for tm_mon + 1 and tm_yday + 1.
4705         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4706         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4707         (DO_SIGNED_NUMBER): New macro.
4708         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4709
4710 2005-03-07  Bruno Haible  <bruno@clisp.org>
4711
4712         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4713
4714 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4715             Bruno Haible  <bruno@clisp.org>
4716
4717         * pagealign_alloc.h: New file.
4718         * pagealign_alloc.c: New file.
4719
4720 2005-01-28  Bruno Haible  <bruno@clisp.org>
4721
4722         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4723         stpncpy.c uses it.
4724
4725 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4726
4727         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4728         The workaround isn't strictly needed for POSIX conformance, and
4729         it's too much of a pain to configure and maintain.  We'll ask
4730         people to fix their kernels instead.
4731         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4732         (NANOSLEEP_BUG_WORKAROUND): Remove.
4733         (xnanosleep): Remove the workaround.
4734
4735 2005-02-12  Bruno Haible  <bruno@clisp.org>
4736
4737         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4738
4739 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4740
4741         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4742         * timespec.h (gettime): Return void, since it always
4743         succeeds now.  All uses changed.
4744         * gettime.c (gettime) Likewise.
4745         [HAVE_NANOTIME]: Prefer nanotime.
4746         Assume gettimeofday succeeds, as POSIX requires.
4747         Assime time () succeeds, since other code already does.
4748         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4749         (timespec_subtract): Remove.
4750         (NANOSLEEP_BUG_WORKAROUND): New constant.
4751         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4752         things considerably.  Use it only on GNU/Linux hosts, since the
4753         workaround shouldn't be needed elsewhere.
4754
4755 2005-02-24  Bruno Haible  <bruno@clisp.org>
4756
4757         * gettext.h: Update from GNU gettext 0.14.2.
4758
4759 2005-02-24  Bruno Haible  <bruno@clisp.org>
4760
4761         * localcharset.c: Update from GNU gettext 0.14.2.
4762         * config.charset: Update from GNU gettext 0.14.2.
4763
4764 2005-02-22  Simon Josefsson  <jas@extundo.com>
4765
4766         * iconvme.h, iconvme.c: New files, from libc.
4767
4768 2005-02-20  Neil Conway  <neilc@samurai.com>
4769
4770         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4771         returned by OSX/Darwin if the specified buffer is not large
4772         enough for the hostname.
4773
4774 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4775
4776         * memrchr.h: New file.
4777         * chdir-long.c: Include it.
4778         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4779         Don't bother including stddef.h.
4780
4781 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4782
4783         * argp-help.c (__argp_help): Create a fake struct argp_state and
4784         pass it to _help, otherwise the latter coredumps trying to
4785         dereference state.root_argp.
4786
4787 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4788
4789         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4790         inclusion.
4791         Include <sys/types.h>, for dev_t.
4792         (ME_DUMMY, ME_REMOTE): Move from here....
4793         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4794         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4795         Dmitry V. Levin.
4796         Include mountlist.h first, to test the interface.
4797
4798 2005-01-29  Bruno Haible  <bruno@clisp.org>
4799
4800         * progname.c (program_name): Initialize.
4801         Needed when linking statically on MacOS X.
4802
4803 2005-01-28  Bruno Haible  <bruno@clisp.org>
4804
4805         * javacomp.sh.in: New file, from GNU gettext.
4806         * javacomp.h: New file, from GNU gettext.
4807         * javacomp.c: New file, from GNU gettext.
4808
4809 2005-01-26  Bruno Haible  <bruno@clisp.org>
4810
4811         * javaexec.sh.in: New file, from GNU gettext.
4812         * javaexec.h: New file, from GNU gettext.
4813         * javaexec.c: New file, from GNU gettext.
4814
4815 2005-01-26  Simon Josefsson  <jas@extundo.com>
4816
4817         * gai_strerror.c: Use GPL in header.
4818
4819 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4820
4821         * argp-help.c (hol_entry_help): Avoid using non-constant
4822         initializers for struct pentry_state.
4823         (__argp_error): Check return value of __asprintf
4824         (__argp_failure): Translate error message
4825
4826         * argp-parse.c: Removed braces around the expansion of N_()
4827
4828 2005-01-21  Jim Meyering  <jim@meyering.net>
4829
4830         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4831         same value as for Solaris 9.
4832
4833         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4834         component length.  This included changing the parameter to be
4835         of type `char *' rather than `char const *'.
4836         * chdir-long.h (chdir_long): Update prototype.
4837
4838         * openat.c (fdopendir, fstatat): New functions.
4839         * openat.h: Include headers required for use of DIR and struct stat.
4840         [AT_SYMLINK_NOFOLLOW]: Define.
4841         (fdopendir, fstatat): Add prototypes.
4842
4843 2005-01-21  Bruno Haible  <bruno@clisp.org>
4844
4845         * classpath.h: New file, from GNU gettext.
4846         * classpath.c: New file, from GNU gettext.
4847
4848 2005-01-20  Simon Josefsson  <jas@extundo.com>
4849
4850         * version-etc-fsf.c: New file, with version_etc_copyright.
4851         * version-etc.c: Remove version_etc_copyright.
4852         * version-etc.h (version_etc_copyright): Use [] instead of * in
4853         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4854
4855 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4856
4857         * save-cwd.c (save_cwd): Remove code to support the case
4858         where fchdir is missing or flaky.
4859
4860 2005-01-20  Simon Josefsson  <jas@extundo.com>
4861
4862         * base64.h (isbase64): Add.
4863
4864         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4865         using a unsigned prototype, don't inline.
4866         (base64_decode): Use it.
4867
4868 2005-01-19  Bruno Haible  <bruno@clisp.org>
4869
4870         * sh-quote.h: New file, from GNU gettext.
4871         * sh-quote.c: New file, from GNU gettext.
4872
4873 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4874
4875         Merge changes from coreutils, as described below in several
4876         changelogs dated today.
4877
4878         * save-cwd.c: Include "save-cwd.h" before other include files.
4879         (O_DIRECTORY): Remove; not needed here, since "." must be
4880         a directory.  All uses removed.
4881         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4882         universal on Suns, and we also need to test for IRIX.
4883         Revamp code to use 'if' rather than '#if'.
4884         Avoid unnecessary comparison of cwd->desc to 0.
4885
4886         * utimens.c (futimens): Robustify the previous patch, by checking
4887         for known valid error numbers rather than observed invalid ones.
4888
4889 2005-01-18  Jim Meyering  <jim@meyering.net>
4890
4891         * version-etc.c (version_etc_copyright): Update copyright date.
4892
4893         * utimens.c (futimens): Account for the fact that futimes
4894         can also fail with errno == ENOSYS or errno == ENOENT.
4895         Patch from Dmitry V. Levin.
4896
4897         Change the name of the robust chdir function from chdir to chdir_long.
4898         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4899         (restore_cwd): Use chdir_long, not chdir.
4900         * chdir-long.c: Renamed from chdir.c.
4901         * chdir-long.h: Renamed from chdir.h.
4902         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4903         Hurd.
4904
4905 2005-01-18  Bob Proulx  <bob@proulx.com>
4906
4907         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4908         offsetof() macro construct to avoid compile failure with native HP-UX
4909         11.0 ANSI C compiler.
4910
4911 2005-01-06  Bruno Haible  <bruno@clisp.org>
4912
4913         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4914         because stpncpy.m4 takes care of it.
4915
4916 2004-01-24  Bruno Haible  <bruno@clisp.org>
4917
4918         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4919
4920 2003-10-09  Bruno Haible  <bruno@clisp.org>
4921
4922         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4923
4924 2005-01-06  Bruno Haible  <bruno@clisp.org>
4925
4926         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4927         * fwriteerror.c: Include <stdbool.h>.
4928         (fwriteerror): At the end, close the file stream. Record whether
4929         stdout was already closed.
4930
4931 2004-05-27  Bruno Haible  <bruno@clisp.org>
4932
4933         * execute.c (environ): Declare if needed.
4934         * pipe.c (environ): Likewise.
4935         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4936
4937 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4938
4939         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4940         definitions to be after all include files, to avoid collisions.
4941         Problem reported by Bob Proulx.
4942
4943 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4944
4945         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4946         not needed.  This removes a dependency on the gettext module.
4947         [defined _LIBC]: Do not include <libintl.h>; not needed.
4948
4949 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4950
4951         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4952         HAVE_DECL_STRTOLD.
4953
4954 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4955
4956         * argp-parse.c: Include <stddef.h>.
4957         (alignof, alignto): New macros.
4958         (parser_init): Don't assume that void * is aligned sufficiently
4959         for struct option.
4960
4961         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4962         need to extend the stack.
4963         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4964         large.
4965
4966 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4967
4968         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4969
4970 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4971
4972         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4973         Remove now-obsolete comment about AIX.
4974         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4975         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4976         (YYMAXDEPTH): New macro.
4977
4978 2004-12-18  Bruno Haible  <bruno@clisp.org>
4979
4980         * fatal-signal.c (fatal_signals): Make non-const.
4981         (init_fatal_signals): New function.
4982         (uninstall_handlers, install_handlers): Ignore signals that were set to
4983         SIG_IGN.
4984         (at_fatal_signal): Call init_fatal_signals.
4985         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4986         SIG_IGN.
4987         Reported by Paul Eggert.
4988
4989 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4990
4991         * getdate.y (textint): New member "negative".
4992         (time_zone_hhmm): New function.
4993         Expect 14 shift-reduce conflicts, not 13.
4994         (o_colon_minutes): New rule.
4995         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4996         (yylex): Set the "negative" member of signed numbers.
4997
4998 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4999
5000         Changes imported from coreutils.
5001         * hard-locale.c: Assume <locale.h> exists.
5002         Include "strdup.h".
5003         (GLIBC_VERSION): New macro.
5004         (hard_locale): Assume setlocale exists.
5005         Rewrite to avoid #ifdef.
5006         Use strdup rather than malloc + strcpy.
5007         * human.c: Assume <locale.h> exists.
5008         (human_readable): Assume localeconv exists.
5009
5010 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
5011
5012         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
5013         convert T2, not T.  (Imported from libc.)
5014
5015 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
5016
5017         * getcwd.c (is_ENAMETOOLONG): New macro.
5018         (__getcwd.c): Don't restore errno; glibc doesn't.
5019         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
5020         first, falling back to our code only if its results look suspicious.
5021         Ensure that the resulting buffer is only as large as necessary.
5022
5023         * readutmp.c: Include readutmp.h first.
5024         Include <errno.h>, since readutmp.h no longer does that.
5025         * readutmp.h: Don't include <errno.h>,
5026         <sys/param.h>, <time.h>; not needed to establish interface.
5027         (errno): Remove decl.
5028         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
5029         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
5030         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
5031
5032 2004-11-28  Simon Josefsson  <jas@extundo.com>
5033
5034         * base64.h, base64.c: New file.
5035
5036 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
5037
5038         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
5039
5040 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
5041
5042         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
5043         HP's ANSI C compiler.
5044         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
5045         Declaring int functions causes warnings on some modern systems and
5046         shouldn't be needed to compile on ancient ones.
5047         * same.c (MIN) [defined MIN]: Don't define, since it's already
5048         defined.
5049
5050         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
5051         with the following changes.
5052         (__set_errno): Parenthesize properly.
5053         Include <stdbool.h>.
5054         (MIN, MAX, MATCHING_INO): New macros.
5055         (__getcwd): Define with prototype, not K&R form.
5056         Use heuristics to allocate default buffer on stack if possible.
5057         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
5058         behavior, and to avoid the PATH_MAX limit when computing
5059         ../../../../...
5060         Use MATCHING_INO to compare inode number to file.
5061         Check for arithmetic overflow in size calculations.
5062         Fix bug in reallocation of dot array that caused getcwd to fail
5063         on directories nested deeper than 75.
5064         Be more careful about saving errno on error.
5065         Do not use realloc; use only free+malloc, as this is a bit
5066         more flexible and avoids a needless copy operation.
5067         Do not inspect st_dev and st_ino for symbolic links; POSIX
5068         doesn't specify the latter.
5069         Check for closedir errors.
5070         Avoid needless casts.
5071         Use "#ifdef weak_alias" around weak_alias, to be like other
5072         glibc code.
5073         The following changes to getcwd.c have effect only when used in
5074         gnulib; they have no effect inside glibc proper.
5075         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
5076         as alloca isn't used.
5077         (alloca, __alloca): Likewise.
5078         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
5079         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5080         unconditionally, as gnulib assumes C89 or better.
5081         Do not include <sys/param.h>.
5082         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
5083         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
5084         better.
5085         (NULL) [!defined NULL]: Remove; we assume C89 or better.
5086         Include <dirent.h> in a way that is compatible with modern Autoconf.
5087         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
5088         New macros, if not already defined.
5089         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
5090         Use "_LIBC", not "defined _LIBC", for consistency.
5091         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
5092         a mempcpy module.
5093         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
5094         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
5095         * xgetcwd.c: David MacKenzie's old code was removed, so give
5096         credit only to Jim Meyering and adjust the copyright dates.
5097         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
5098         <stdlib.h>, <unistd.h>, "pathmax.h".
5099         Instead, include "xgetcwd.h" (first) and "getcwd.h".
5100         (INITIAL_BUFFER_SIZE): Remove.
5101         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
5102
5103 2004-11-23  Jim Meyering  <jim@meyering.net>
5104
5105         * getopt_.h: Remove trailing blanks.
5106
5107 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
5108
5109         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5110         (futimens): New function, which uses futimes if available.
5111         (futimens, utimens): Support timespec==NULL, with same semantics
5112         as utime and utimens.
5113         * utimens.h (futimens): New decl.
5114
5115 2004-11-23  Jim Meyering  <jim@meyering.net>
5116
5117         * __fpending.c: Add comment.
5118
5119 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5120
5121         * getopt_.h: Re-addition of __getopt_argv_const caused
5122         redefinition warnings. To avoid them, include the defines
5123         in `#if !defined __need_getopt ... #endif'. The only place
5124         where __getopt_argv_const is used is in definitions
5125         of getopt_long and getopt_long_only below, which are as well
5126         protected by `#ifndef __need_getopt'.
5127         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5128         __need_getopt after including <stdio.h> and <unistd.h> These
5129         headers might have defined it.
5130
5131 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
5132
5133         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5134         New macros.
5135         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5136         optopt): Use them instead of invoking ## directly; otherwise, the
5137         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5138
5139 2004-11-19  Bruno Haible  <bruno@clisp.org>
5140
5141         * strtok_r.c: Move comments from here...
5142         * strtok_r.h: ... to here.
5143
5144 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
5145
5146         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5147         might fail.  Problem reported by Yoann Vandoorselaere.
5148         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5149         that mishandle size_t overflow.
5150
5151 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
5152
5153         * canon-host.c: Include "strdup.h".
5154         (canon_host): Use getaddrinfo if available, so that IPv6 works.
5155         Use strdup instead of malloc/strcpy to duplicate strings.
5156
5157         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5158         (human_space_before_unit): New constant.
5159         * human.c (human_readable): Support it.
5160
5161         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5162         (xgetcwd): Set errno correctly when failing.
5163         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5164         the failure is actually due to a PATH_MAX problem.
5165
5166         Further getopt changes to make it more likely that glibc will
5167         buy the changes back.
5168         * getopt.c (POSIXLY_CORRECT): New constant.
5169         (getopt): Use it, so to preserve glibc semantic
5170         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5171         when compiling for libc.
5172         * getopt_.h (__getopt_argv_const): Bring it back.
5173         (getopt_long, getopt_long_only): Use it.
5174
5175         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5176         New arg POSIXLY_CORRECT.  All callers changed.
5177         (getopt): Argv is now char * const *, as per standard.
5178         (_getopt_internal_r, _getopt_internal): Argv is now char **,
5179         not char *__getopt_argv_const *.
5180         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5181         _getopt_long_only_r): Likewise.
5182         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5183         * getopt_int.h (_getopt_internal, _getopt_internal_r,
5184         _getopt_long_r, _getopt_long_only_r): Likewise.
5185         * getopt_.h (__getopt_argv_const): Remove.
5186         (getopt): Argv is now char * const *, as per standard.
5187
5188         * getdate.y (tORDINAL): New token.
5189         (day, relunit): Allow it for relative times.
5190         (relative_time_table): Use tORDINAL for ordinals.
5191
5192 2004-11-15  Jim Meyering  <jim@meyering.net>
5193
5194         * closeout.c: Include "__fpending.h" once again.
5195         Include <stdbool.h>.
5196         (close_stdout): Don't fail just because stdout was closed initially,
5197         since some programs don't write to stdout in the normal course of
5198         operation (other than --version and --help), and we don't want this
5199         function to make e.g. `touch file >&-' fail.
5200         But do fail if it was closed and someone has tried to write to it.
5201         E.g., `printf foo >&-' must fail.
5202
5203 2004-11-11  Simon Josefsson  <jas@extundo.com>
5204
5205         * strtok_r.h, strtok_r.c: New file.
5206
5207 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
5208
5209         * getopt_.h (__getopt_argv_const): New macro, to be used so that
5210         we can stop lying to compilers about the constness of argv when we
5211         are compiled outside glibc.
5212         (getopt, getopt_long, getopt_long_only): Use it.
5213         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5214         getopt): Likewise.
5215         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5216         _getopt_long_only_r): Likewise.
5217         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5218         _getopt_long_only_r): Likewise.
5219
5220         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5221         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5222         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5223         the other external symbols.
5224         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5225         declaration, since the above renaming now works around collisions.
5226
5227 2004-11-11  Jim Meyering  <jim@meyering.net>
5228
5229         * linebreak.c: Remove trailing blanks.
5230         * alloca_.h: Likewise.
5231         * acosl.c: Likewise.
5232         * euidaccess.c: Likewise.
5233         * allocsa.h: Likewise.
5234
5235 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
5236
5237         * mktime.c (SHR): New macro, which is a portable
5238         substitute for >> that should work even on Crays.
5239         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5240         Problem reported by Mark D. Baushke in
5241         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5242         * getdate.y (SHR): Likewise.
5243         (tm_diff): Use it.
5244         * strftime.c (SHR): Likewise.
5245         (tm_diff): Use it.
5246         * quotearg.c (struct quoting_options): Use unsigned int for
5247         quote_these_too, so that right shifts are well defined.  All uses
5248         changed.
5249
5250 2004-11-10  Simon Josefsson  <jas@extundo.com>
5251
5252         * getaddrinfo.h, getaddrinfo.c: New files.
5253
5254 2004-11-10  Jim Meyering  <jim@meyering.net>
5255
5256         Ensure that no close failure goes unreported.
5257         * closeout.c (close_stdout): Always close stdout.  I.e., don't
5258         return early when it seems there's nothing to flush.
5259         Don't include __fpending.h.
5260
5261 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
5262
5263         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5264
5265 2004-11-05  Bruno Haible  <bruno@clisp.org>
5266
5267         * readlink.c: Include stddef.h, needed for size_t on Woe32.
5268         Reported by Mark D. Baushke <mdb@cvshome.org>.
5269
5270 2004-11-04  Bruno Haible  <bruno@clisp.org>
5271
5272         2004-09-11  Bruno Haible  <bruno@clisp.org>
5273                 * allocsa.valgrind: New file.
5274         2004-02-06  Bruno Haible  <bruno@clisp.org>
5275                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5276                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5277                 Reported by Christopher Seip <chris.seip@hp.com>.
5278
5279 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
5280
5281         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5282         with errno == ERANGE if the buffer is too small.
5283         Problem reported by Mark D. Baushke.
5284
5285 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5286
5287         * xreadlink.c (MAXSIZE): New macro.
5288         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
5289         size does not exceed MAXSIZE.  Avoid cast.
5290         As suggested by Mark D. Baushke in
5291         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5292         if readlink fails with buffer size just under MAXSIZE, try again
5293         with MAXSIZE.
5294
5295 2004-11-02  Derek R. Price  <derek@ximbiot.com>
5296         and  Paul Eggert  <eggert@cs.ucla.edu>
5297
5298         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5299         (get_date): Overparenthesize to avoid GCC warning.
5300
5301 2004-11-02  Bruno Haible  <bruno@clisp.org>
5302
5303         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5304         function returns void.
5305
5306 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
5307
5308         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5309         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5310         already declared.
5311
5312 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5313
5314         * getdate.y: Add support for TZ="foo" within a date string.
5315         Fix some bugs near time_t boundaries.  Reject dates with
5316         out-of-range components, e.g., "Sept 31".
5317         Include <stdlib.h>, "setenv.h", "xalloc.h".
5318         (ISDIGIT_LOCALE): Remove; unused.
5319         Note that the TZ and time functions used here are not reentrant.
5320         (mktime_ok, get_tz): New functions.
5321         (TZBUFSIZE): New constant.
5322         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
5323         This requires that we sometimes generate our own TZ="XXX..." setting.
5324
5325 2004-10-27  Derek R. Price  <derek@ximbiot.com>
5326
5327         * mktime.c (not_equal_tm): Remove redundant check.
5328
5329 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
5330
5331         * getdate.y: Use Bison 1.875 features, and some minor
5332         code cleanups.  This change does not affect semantics.
5333         Don't include <stdlib.h>; no longer needed.
5334         Don't include unlocked-io.h; only the "#if TEST" code uses
5335         stdio, and performance isn't crucial there.
5336         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5337         Bison 1.875 features as described below.
5338         All uses of "PC." replaced by "pc->".
5339         (YYSTYPE): Add a forward declaration.
5340         (yylex, yyerror): Use full prototypes in forward decls.
5341         Use "%pure-parser" rather than obsolescent "%pure_parser".
5342         Use %parse-param and %lex-param instead of obsolescent
5343         YYPARSE_PARAM and YYLEX_PARAM.
5344         (meridian_table, month_and_day_table, time_units_table,
5345         relative_time_table, time_zone_table, military_table,
5346         lookup_zone, lookup_word, get_date):
5347         Use NULL instead of 0 where appropriate.
5348         (to_hour): Avoid abort (), to avoid a dependency on
5349         stdlib.h.
5350         (yyerror, yylex): Now accepts parser_control * arg.
5351         (main) [TEST]: Use '\0' rather than 0 for char.
5352
5353 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
5354
5355         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5356         It's now the caller's responsibility to handle the case where
5357         !HAVE_GETPAGESIZE && !defined getpagesize.
5358
5359         * mktime.c (leapyear): Arg is long int, not int.
5360
5361 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5362
5363         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5364
5365 2004-10-12  Simon Josefsson  <jas@extundo.com>
5366
5367         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5368         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5369         to real functions.
5370
5371 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5372
5373         * vsnprintf.h: New file.
5374         * vsnprintf.c: New file.
5375
5376 2004-10-07  Bruno Haible  <bruno@clisp.org>
5377
5378         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5379         into the provided buffer.
5380
5381 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5382
5383         * diacrit.c, diacrit.h: Add GPL notice.
5384
5385         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5386         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5387         * logl.c (logl): Keep the code as similar to glibc as possible.
5388         This avoids a potential constant-folding bug.
5389
5390 2004-10-05  Bruno Haible  <bruno@clisp.org>
5391
5392         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5393
5394 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5395
5396         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5397         * xmalloc.c (xmemdup): Likewise.
5398         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5399         XFREE): Remove these long-obsolescent macros.
5400         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5401         * xstrdup.c: Remove.
5402
5403         * regex.c (re_comp): Cast gettext return value to char *,
5404         Problem reported by Martin Neitzel via Mark D. Baushke.
5405
5406 2004-10-04  Simon Josefsson  <jas@extundo.com>
5407
5408         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5409         '#ifdef USE_UNLOCKED_IO'.
5410
5411 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5412
5413         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5414         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5415         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5416         regex.c, sha1.c, version-etc.c, yesno.c:
5417         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5418         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5419         the includer's responsibility.
5420
5421         Sync from coreutils.
5422
5423         * modechange.c (mode_compile): Don't decrement a pointer that
5424         points to the start of a string, as the C Standard says the
5425         resulting behavior is undefined.
5426
5427         * backupfile.h (enum backuptype): Rename none -> no_backups,
5428         simple -> simple_backups, numbered_existing ->
5429         numbered_existing_backups, numbered -> numbered_backups
5430         to avoid shadowing problems.  All uses changed.
5431         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5432         * backupfile.c (check_extension, numbered_backup):
5433         Rename locals to avoid shadowing 'basename'.
5434         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5435         once.
5436
5437         * .cppi-disable: Add getopt_.h, getopt_int.h.
5438         * .cvsignore: Add getopt.h.
5439
5440 2004-10-04  Simon Josefsson  <jas@extundo.com>
5441
5442         * memmem.h: New file.
5443         * memmem.c: New file, taken from glibc.
5444
5445 2004-10-02  Jim Meyering  <jim@meyering.net>
5446
5447         * dirfd.h, getpagesize.h: Add copyright notice.
5448
5449 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5450
5451         * snprintf.c: Remove comments as to why each header is needed.
5452
5453 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5454
5455         * strsep.h: New file.
5456         * strsep.c: New file.
5457
5458 2004-10-01  Simon Josefsson  <jas@extundo.com>
5459
5460         * snprintf.c (snprintf): Handle size==0.
5461
5462 2004-10-01  Simon Josefsson  <jas@extundo.com>
5463             Bruno Haible  <bruno@clisp.org>
5464
5465         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5466         (snprintf): Declare 'args'.
5467
5468 2004-09-30  Simon Josefsson  <jas@extundo.com>
5469
5470         * snprintf.h, snprintf.c: New files.
5471
5472 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5473
5474         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5475         (hol_entry_help): Never translate an empty string.
5476         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5477         * argp.h (OPTION_NO_TRANS): New option.
5478
5479 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5480
5481         * xvasprintf.c: Include xalloc.h.
5482         (xvasprintf): Use xalloc_die, not xmalloc_die.
5483
5484 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5485
5486         * dummy.c: Change copyright notice to FSF, and license to GPL.
5487
5488 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5489
5490         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5491         Problem reported by Bruno Haible in:
5492         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5493
5494 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5495
5496         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5497         in case some system header has #define'd it.  Problem reported by
5498         Soeren D. Schulze in
5499         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5500
5501 2004-09-08  Bruno Haible  <bruno@clisp.org>
5502
5503         * stdint_.h: New file, taken from GNU clisp.
5504
5505 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5506
5507         * xvasprintf.h: New file.
5508         * xvasprintf.c: New file.
5509         * xasprintf.c: New file.
5510
5511 2004-09-08  Bruno Haible  <bruno@clisp.org>
5512
5513         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5514         is > INT_MAX.
5515         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5516
5517 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5518
5519         Import from coreutils.
5520         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5521         strings on unbounded length.  alloca's performance benefits aren't
5522         that important here.
5523         (V_STRDUP): Remove.
5524         (parse_with_separator): New function, with most of the internals
5525         of the old parse_user_spec.  Allow user to omit both user and group,
5526         for compatibility with FreeBSD.
5527         Clone only the user name, not the entire spec.
5528         Do not set *uid, *gid unless entirely successful.
5529         Avoid memory leak in some failing cases.
5530         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5531         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5532         (parse_user_spec): Rewrite to use parse_with_separator.
5533
5534 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5535
5536         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5537         its complicated substitute.
5538         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5539         and program_invocation_name.
5540         (__argp_basename) [!_LIBC]: Remove; the only use was
5541         replaced by its body.
5542         (__argp_short_program_name): Change condition from
5543         !defined __argp_short_program_name to
5544         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5545         to match argp-namefrob.h.
5546         (__argp_failure): Don't assume strerror_r returns char *.
5547         * argp-parse.c (N_): Define unconditionally.
5548         (argp_default_options): Fill out initializers with 0 to avoid
5549         gcc warnings.
5550
5551 2004-08-12  Simon Josefsson  <jas@extundo.com>
5552
5553         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5554         * getopt_.h: Renamed from getopt.h.
5555
5556 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5557
5558         Merge from coreutils.
5559
5560         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5561         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5562         for Reliant Unix 5.43.
5563
5564         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5565         (union fooround): Use uintmax_t, not long int.
5566         The rest is a merge from libc:
5567         [defined _LIBC]: Include <shlib-compat.h>.
5568         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5569
5570         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5571
5572         * strverscmp.c: Convert to UTF-8.
5573
5574 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5575
5576         * obstack.h (obstack_empty_p):
5577         Don't assume that chunk->contents is suitably aligned.
5578         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5579         Likewise. Problem reported by Benno in
5580         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5581
5582         * chown.c (rpl_chown): Work even if the file is writeable but not
5583         readable.  This could be improved further but it'd take some work.
5584
5585 2004-08-08  Simon Josefsson  <jas@extundo.com>
5586
5587         * xgethostname.c: Don't include error.h (not used).
5588
5589         * getpass.h: Add.
5590         * getpass.c: Include getpass.h first.
5591
5592 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5593
5594         * xalloc-die.c: New files.
5595         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5596         All uses removed.
5597         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5598         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5599         (_, N_, xalloc_die): Move to xalloc-die.c.
5600         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5601         so that we needn't mess with xalloc_msg_memory_exhausted.
5602
5603         * sha1.h: Renamed from sha.h.
5604         (SHA1_H): Renamed from _SHA_H.
5605         (sha1_ctx): Renamed from sha_ctx.
5606         (sha1_init_ctx): Renamed from sha_init_ctx.
5607         (sha1_process_block): Renamed from sha_process_block.
5608         (sha1_process_bytes): Renamed from sha_process_bytes.
5609         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5610         (sha1_read_ctx): Renamed from sha_read_ctx.
5611         (sha1_stream): Renamed from sha_stream.
5612         (sha1_buffer): Renamed from sha_buffer.
5613         * sha1.c: Likewise; renamed from sha.c.
5614         Do not include <sys/types.h>.
5615         Include <stddef.h> rather than <stdlib.h>.
5616
5617 2004-08-08  Bruno Haible  <bruno@clisp.org>
5618
5619         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5620         FILESYSTEM_PREFIX_LEN.
5621         * progreloc.c: Likewise.
5622         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5623
5624 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5625
5626         Merge from tar.
5627         * argp-help.c (make_hol, hol_append): Don't assume that
5628         SIZE_MAX is a valid preprocessor constant.
5629         (__argp_basename): Change from "#ifndef _LIBC"
5630         to "#ifndef __argp_short_program_name", so that
5631         we don't compile these functions for tar.
5632
5633         More merges from coreutils.
5634         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5635         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5636         yesno.h: New files.
5637         * addext.c: Remove; no longer needed.
5638         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5639         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5640         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5641         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5642         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5643         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5644         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5645         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5646         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5647         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5648         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5649         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5650         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5651         Import changes from coreutils.
5652
5653 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5654
5655         Merge from coreutils.
5656
5657         * .gdb-history: Remove; this doesn't belong here.
5658
5659         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5660         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5661         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5662
5663         * dirname.h: Include <stdbool.h>.
5664         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5665         for consistency with POSIX terminology.  All uses changed.
5666         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5667         (strip_trailing_slashes): Use bool for booleans.
5668         * stripslash.c (strip_trailing_slashes): Likewise.
5669
5670         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5671         sometimes returns a positive errno value even when it succeeds.
5672         (print_errno_message) [!LIBC]: Fall back on strerror if
5673         __strerror_r fails.
5674
5675         * path-concat.c (mempcpy): Don't define if a system header defines it.
5676         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5677         (longest_relative_suffix): New function.
5678         (path_concat): Use it.  Assume first argument is not NULL.
5679         Port to DOS.  Omit redundant separators.
5680         Report an error instead of returning NULL.
5681         Use mempcpy instead of memcpy.
5682         (xpath_concat): Remove: not declared or used.
5683
5684         * same.h: Include <stdbool.h>
5685         (same_name): Return bool, not int.
5686         * same.c (same_name): Likewise.
5687         (errno): Don't declare; we assume C89 or better now.
5688
5689         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5690         if not already defined.
5691
5692         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5693         * dup-safer.c (errno): Likewise.
5694
5695 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5696
5697         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5698         working.
5699
5700 2004-08-03  Simon Josefsson  <jas@extundo.com>
5701
5702         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5703         * progname.h: Don't include stdbool.h.
5704
5705 2004-08-02  Simon Josefsson  <jas@extundo.com>
5706
5707         * getsubopt.h: New file, with comments from Bruno Haible.
5708         * getsubopt.c: New file, from glibc, but slightly modified based on
5709         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5710
5711 2004-08-01  Simon Josefsson  <jas@extundo.com>
5712
5713         * xgetdomainname.c: Include stdlib.h, for free().
5714
5715 2004-07-16  Simon Josefsson  <jas@extundo.com>
5716
5717         * dummy.c: New file.
5718
5719 2004-07-16  Bruno Haible  <bruno@clisp.org>
5720
5721         * backupfile.h: Add extern "C" for C++.
5722         * closeout.h: Likewise.
5723         * copy-file.h: Likewise.
5724         * findprog.h: Likewise.
5725         * full-write.h: Likewise.
5726         * pathname.h: Likewise.
5727         * progname.h: Likewise.
5728         * stpcpy.h: Likewise.
5729         * stpncpy.h: Likewise.
5730         * strcase.h: Likewise.
5731         * strstr.h: Likewise.
5732         * xalloc.h: Likewise.
5733
5734         * mbswidth.h: Add extern "C" for C++.
5735         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5736
5737 2004-07-09  Simon Josefsson  <jas@extundo.com>
5738
5739         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5740         failed without this.)
5741
5742 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5743
5744         * fchown-stub.c: New file.
5745
5746 2004-06-24  Jim Meyering  <jim@meyering.net>
5747
5748         * obstack.h (obstack_base): Cast to (void *), per documentation.
5749
5750 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5751
5752         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5753
5754 2004-06-01  Jim Meyering  <jim@meyering.net>
5755
5756         * calloc.c: New file.
5757
5758 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5759
5760         * getdate.y (yylex): Allow space between sign and number.
5761         Problem reported by Dan Jacobson.
5762
5763 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5764         and  Jim Meyering  <jim@meyering.net>
5765
5766         Merge from coreutils CVS.
5767
5768         * stat-macros.h: New file, with contents from file-type.h
5769         and coreutils' system.h.
5770         * file-type.c: Include "stat-macros.h".
5771         * file-type.h (file_type): Move all macro definitions to new file,
5772         stat-macros.h.
5773
5774         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5775         Wrap old code with this conditional.
5776         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5777         function that does not dereference symlinks.
5778         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5779
5780         * xreadlink.c: Include xreadlink.h first, to catch .h file
5781         dependency problems.
5782         (xreadlink): Accept new arg SIZE, for efficiency.
5783         All decls and uses changed.
5784         * xreadlink.h: Include <stddef.h>, for size_t.
5785
5786         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5787         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5788
5789         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5790
5791 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5792
5793         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5794         macros to be defined.
5795         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5796         the allocator returns NULL because the requested size is zero.
5797
5798 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5799
5800         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5801         var.  Add comment explaining why libc still defines it.  This
5802         merges the following patch from glibc:
5803         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5804
5805 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5806
5807         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5808         present in glibc since revision 1.1 of this file.
5809         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5810         obstack_alignment_mask, obstack_alloc, obstack_base,
5811         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5812         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5813         obstack_grow0, obstack_init, obstack_int_grow,
5814         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5815         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5816         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5817         nonexistent functions.
5818
5819 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5820             Paul Eggert  <eggert@cs.ucla.edu>
5821
5822         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5823
5824 2004-05-14  Bruno Haible  <bruno@clisp.org>
5825
5826         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5827         that consists of a '.' followed by an empty digit string.
5828         Patch by Tor Lillqvist <tml@iki.fi>.
5829
5830 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5831
5832         Port obstack to the AS/400, where pointers are 16 bytes wide and
5833         you cannot cast an integer to a valid pointer.  This patch is
5834         currently waiting to be integrated into glibc; see
5835         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5836
5837         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5838         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5839         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5840         (struct obstack): temp member is now a union of a pointer and
5841         an integer, instead of an integer.  All integer uses changed.
5842         This does not affect the physical layout of struct obstack,
5843         except on hosts (like the AS/400) where the size or alignment of
5844         void * is greater than that of ptrdiff_t.
5845         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5846         __STDC__)]: Store temporary in pointer member of union, not
5847         integer member.
5848         * obstack.c: Include <stddef.h>, for offsetof.
5849         (struct fooalign): Remove; it doesn't need a name.
5850         (union fooround): Change double to long double, and add void *.
5851         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5852         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5853         not a macro.  Hence the values are always int; so remove all
5854         casts-to-int in uses.
5855
5856 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5857             Derek Price  <derek@ximbiot.com>
5858
5859         * alloca.c: Include <alloca.h>, to get our interface.
5860         * alloca_.h: Use __alloca on AIX, so that we don't have to
5861         include <alloca.h> first.  Use C89 prototype for alloca; this
5862         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5863         Use #elif for simplicity, since we can assume C89 now.
5864         Don't try to source the system alloca.h since it will not be found
5865         and to prevent recursively including its replacement.
5866         * fnmatch.c: Include <alloca.h> instead of opencoding.
5867         * regex.c: Likewise.
5868
5869 2004-05-16  Derek Price  <derek@ximbiot.com>
5870             Paul Eggert  <eggert@cs.ucla.edu>
5871
5872         getline cleanup.  This changes the getndelim2 API: both order of
5873         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5874         no delimiter).
5875
5876         * getline.c: Don't include stddef.h or stdio.h, since our
5877         interface does that.
5878         (getline): Always use getdelim, so that we don't have two
5879         copies of this code.
5880         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5881         if available.
5882         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5883         (GETNDELIM2_MAXIMUM): New macro.
5884         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5885         instead of the old practice of delim2==0.  All callers changed.
5886         Return -1 on overflow, instead of returning junk.
5887         Do not set *linesize unless allocation succeeds.
5888         * getndelim2.h: Do not include stddef.h; no longer needed, now
5889         that we include sys/types.h.
5890         * getnline.h: Likewise.
5891         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5892         (getndelim2): Reorder arguments.
5893         * getnline.c (getnline, getndelim):
5894         Don't discard the NMAX argument.
5895         (getnline): Invoke getndelim, to avoid code duplication.
5896         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5897         of (size_t) -1 by callers of the getnline family.
5898
5899 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5900
5901         * nanosleep.c (suspended): Change its type from int to
5902         sig_atomic_t volatile.
5903         (first_call): Make it private to rpl_nanosleep, and have it
5904         be zero initially as that's a bit faster.
5905         (my_usleep): Round up fractional times instead of truncating them,
5906         as this is the usual meaning for 'sleep'.
5907
5908         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5909         doesn't work.
5910         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5911         (ENOSYS): Define if not defined.
5912         (settime): Fall back on stime if it exists and settimeofday fails.
5913         But don't bother with fallbacks if a method fails with errno == EPERM.
5914
5915 2004-05-11  Jim Meyering  <jim@meyering.net>
5916
5917         Prior to this change, the save_cwd caller required read access to the
5918         current directory on most systems (ones with the fchdir function).
5919
5920         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5921         fails, try write-only, and finally, resort to using xgetcwd.
5922
5923 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5924
5925         * obstack.c, obstack.h: Import changes from libc.
5926
5927 2004-04-28  Bruno Haible  <bruno@clisp.org>
5928
5929         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5930         implicitly appends .exe to executables.
5931         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5932         accepts Windows pathnames.
5933         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5934         Cygwin like Windows, since it now accepts Windows pathnames.
5935         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5936         Cygwin like Windows, since it now accepts Windows pathnames.
5937         Reported by Derek Robert Price <derek@ximbiot.com>.
5938
5939 2004-04-20  Jim Meyering  <jim@meyering.net>
5940
5941         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5942
5943 2004-04-20  Jim Meyering  <jim@meyering.net>
5944             Bruno Haible  <bruno@clisp.org>
5945
5946         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5947         memory when realloc fails.
5948
5949 2004-04-18  Jim Meyering  <jim@meyering.net>
5950
5951         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5952         don't leak memory and do call END_UTMP_ENT.
5953
5954 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5955
5956         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5957         (CHAR_BIT): Remove, since we assume C89.
5958         Include <stdint.h> if available, as per current Autoconf CVS advice.
5959
5960 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5961
5962         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5963         not bool, to be more consistent with Unix conventions.
5964         Suggested by Bruno Haible.
5965
5966         Merge from coreutils.
5967
5968         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5969         New files.
5970
5971         * getdate.h: Include stdbool.h, and timespec.h instead of
5972         the usual <time.h> dance.
5973         (get_date): Change signature to support fractional time stamps.
5974         All callers changed.
5975         * getdate.y: Include "getdate.h" first, as we can now
5976         assume C89 and don't need to worry about 'const'.
5977         Similarly, include "unlocked-io.h" near start, not in middle.
5978         Include <limits.h>.
5979         (textint.value): Use long int rather than int.
5980         (textint.digits): Use size_t rather than int.
5981         (BILLION, LOG10_BILLION): New constants.
5982         (parser_control): New member rel_ns.  Members day_ordinal,
5983         time_zone, month, day, hour, minutes, rel_year, rel_month,
5984         rel_day, rel_hour, rel_minutes, rel_seconds
5985         are now long int, not int.  Member seconds is now struct timespec,
5986         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5987         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5988         not int.
5989         (%union.intval): Now long int, not int.
5990         New member timespec.
5991         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5992         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5993         (spec): Now is a timespec or an item list.
5994         (timespec, items): New nonterminals.
5995         (time, rel, relunit, number, get_date):
5996         Add support for fractional seconds.
5997         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5998         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5999         (to_hour): First arg is now long int, not int.
6000         (to_year): Returns long int, not int.
6001         Don't treat year -70 like 70.
6002         (tm_diff): Returns long int, not int.
6003         (lookup_word): Use bool instead of int when appropriate.
6004         (yylex): Use size_t for count, not int.
6005         Detect overflow when parsing large integer constants.
6006         Add support for fractions.
6007         (get_date): Make pointers 'const' if possible.
6008         Use more-portable code to detect integer overflow.
6009         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
6010         Don't use ctime; it's not reliable if the year has >4 digits.
6011
6012         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
6013         This is for compatibility with BSD.
6014
6015         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
6016         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6017         From coreutils' system.h.
6018
6019         * userspec.c: Don't include "posixver.h".
6020         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
6021         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
6022         compatible extension.  Simplify code by removing a boolean int
6023         that was always nonzero if a string was nonnull.
6024
6025 2004-03-30  Jim Meyering  <jim@meyering.net>
6026
6027         Merge from coreutils.
6028
6029         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
6030
6031         * readtokens.c (readtoken): Don't leak 64 bytes when reading
6032         an empty input stream.
6033
6034         * readtokens.c: Include <stdbool.h>.
6035         (readtoken): Use `size_t' rather than int/long.
6036         All callers adjusted.
6037         Use `bool' rather than `int' where appropriate.
6038         Use memset rather than an explicit loop.
6039         Use x2nrealloc rather than xrealloc.
6040         Allow the use of `\0' as a delimiter.
6041         (readtokens): Likewise.
6042         * readtokens.h (readtoken, readtokens): Update prototypes.
6043
6044 2004-03-30  Bruno Haible  <bruno@clisp.org>
6045
6046         * getloadavg.c (getloadavg): Don't assume setlocale returns
6047         nonnull.
6048
6049 2004-03-29  Paul Eggert  <eggert@twinsun.com>
6050
6051         Merge changes to getloadavg.c from coreutils and Emacs.
6052
6053         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
6054         Define to an expression, not to the empty string.
6055         Include cloexec.h and xalloc.h.
6056         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
6057         Use set_cloexec_flag rather than rolling our own.
6058         * cloexec.c, cloexec.h: New files.
6059
6060 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6061
6062         * getopt.h: Sync with libc CVS.
6063
6064 2004-03-18  Paul Eggert  <eggert@twinsun.com>
6065             Bruno Haible  <bruno@clisp.org>
6066
6067         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
6068         not on all platforms that have <wchar.h>.
6069         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
6070
6071 2004-03-09  Paul Eggert  <eggert@twinsun.com>
6072
6073         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
6074         Sync with libc CVS.
6075         * getopt_int.h: New file, also synced from libc.
6076
6077 2004-03-07  Paul Eggert  <eggert@twinsun.com>
6078
6079         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
6080         '#if' expressions.  Unlike the code it replaces, it does not
6081         depend on (defined _SC_PAGESIZE).  However, it does depend on
6082         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
6083         first reported by Jason Andrade in
6084         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
6085
6086 2004-01-18  Simon Josefsson  <jas@extundo.com>
6087
6088         * strdup.h: New file.
6089         * strdup.c: Include it.
6090         * path-concat.c: Include strdup.h. Drop strdup declaration.
6091         * userspec.c: Include strdup.h. Drop strdup declaration.
6092
6093 2004-02-06  Karl Berry  <karl@gnu.org>
6094
6095         * config.charset: update from gettext 0.14.1.
6096
6097 2004-02-05  Paul Eggert  <eggert@twinsun.com>
6098
6099         Add comments and code, prompted by suggestions from Bruno Haible
6100         for sh-quote.
6101         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
6102         describing the enum quoting_style values.
6103         * quotearg.c (quotearg_alloc): New function.
6104         (quotearg_buffer_restyled): Treat lone { and } as special.
6105         Treat = as special.  Work around bug with older shells
6106         that "see" a '\' that is really the 2nd byte of a multibyte char.
6107         Quote empty string with shell_quoting_style.
6108
6109 2004-02-03  Bruno Haible  <bruno@clisp.org>
6110
6111         * pipe.h: New file, from GNU gettext.
6112         * pipe.c: New file, from GNU gettext.
6113
6114 2004-01-27  Bruno Haible  <bruno@clisp.org>
6115
6116         * execute.h: New file, from GNU gettext.
6117         * execute.c: New file, from GNU gettext.
6118         * w32spawn.h: New file, from GNU gettext.
6119
6120 2004-01-23  Paul Eggert  <eggert@twinsun.com>
6121
6122         Exit-status fix from coreutils.
6123
6124         Use exit_failure consistently in place of EXIT_FAILURE,
6125         so that program exit statuses are consistent on failure.
6126
6127         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6128         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6129         * argmatch.h: Comment fix to match the above.
6130         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6131         Now a macro referring to exit_failure, instead of a separate
6132         variable.  Include "exitfail.h" to get it.
6133         * xstrtol.h: Include "exitfail.h".
6134         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6135
6136         * long-options.c (parse_long_options): Use prototype
6137         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
6138         for clarity.
6139
6140 2004-01-21  Jim Meyering  <jim@meyering.net>
6141
6142         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6143         so as not to conflict with a different-sized __mktime_internal
6144         function in GNU libc.
6145         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6146         Problem building statically-linked `ls' reported by Michael Brunnbauer.
6147
6148 2004-01-18  Paul Eggert  <eggert@twinsun.com>
6149
6150         Merge from diffutils.
6151
6152         * file-type.c (file_type): Add typed memory objects.
6153         * file-type.h (S_TYPEISTMO): New macro.
6154
6155         * c-stack.h (c_stack_action): Remove argv argument.
6156         * c-stack.c (c_stack_action): Likewise.  All uses changed.
6157         (die): Don't calculate message unless segv_action returns.
6158         (get_stack_location, min_address_from_argv, max_address_from_argv,
6159         volatile stack_base, volatile_stack_size): Remove.
6160         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6161         that every segmentation violation is a stack overflow.  (Ouch!)
6162         See Debian bug 136249 (still outstanding) for more info about why
6163         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6164
6165 2003-11-30  Bruno Haible  <bruno@clisp.org>
6166
6167         Safer stack allocation.
6168         * setenv.c: Include allocsa.h.
6169         (alloca): Remove fallback definition.
6170         (freea): Remove macro.
6171         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6172         instead of freea.
6173
6174 2003-10-17  Bruno Haible  <bruno@clisp.org>
6175
6176         * binary-io.h: Avoid warnings on Cygwin.
6177
6178 2003-12-28  Bruno Haible  <bruno@clisp.org>
6179
6180         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6181         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6182
6183 2003-11-28  Bruno Haible  <bruno@clisp.org>
6184
6185         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6186
6187 2003-11-27  Bruno Haible  <bruno@clisp.org>
6188
6189         * wait-process.c: On Windows, include windows.h. Needed on mingw.
6190
6191 2003-11-17  Bruno Haible  <bruno@clisp.org>
6192
6193         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6194
6195 2003-11-24  Bruno Haible  <bruno@clisp.org>
6196
6197         * xallocsa.h: New file, from GNU gettext.
6198         * xallocsa.c: New file, from GNU gettext.
6199
6200 2003-11-24  Bruno Haible  <bruno@clisp.org>
6201
6202         * allocsa.h: New file, from GNU gettext.
6203         * allocsa.c: New file, from GNU gettext.
6204
6205 2003-11-24  Bruno Haible  <bruno@clisp.org>
6206
6207         * eealloc.h: New file.
6208
6209 2004-01-15  Jim Meyering  <jim@meyering.net>
6210
6211         Merge from coreutils.
6212
6213         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
6214         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
6215         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6216
6217         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6218         optional configure-time default.
6219
6220         * version-etc.c (version_etc_copyright): Update copyright date.
6221
6222         * xreadlink.c (xreadlink): Correct outdated comment.
6223
6224 2004-01-15  Paul Eggert  <eggert@twinsun.com>
6225
6226         Merge from coreutils.
6227
6228         * posixver.c: Include posixver.h.
6229
6230         * same.c: Include <stdbool.h>, <limits.h>.
6231         (_POSIX_NAME_MAX): Define if not defined.
6232         (MIN): New macro.
6233         (same_name): If file names are silently truncated, report
6234         that the file names are the same if they are the same after
6235         the silent truncation.
6236
6237         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6238         conversion function.
6239         * xstrtod.c (xstrtod): Likewise.  All callers changed to
6240         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
6241         longer needed.
6242
6243 2004-01-14  Paul Eggert  <eggert@twinsun.com>
6244
6245         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6246         with like-named macro in fnmatch.c.
6247         (EXT): Use an internal constant instead.
6248
6249         Merge fnmatch patches from glibc.
6250         * fnmatch.c (mbsinit): Remove define.
6251         Add libc_hidden_ver (__fnmatch, fnmatch).
6252         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6253         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6254
6255 2003-12-14  Karl Berry  <karl@gnu.org>
6256
6257         * config.charset: update from gettext-runtime.
6258
6259 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6260
6261         * getgroups.c (getgroups): xmalloc takes one argument, not two.
6262         Bug reported by Alfred M. Szmidt.
6263
6264 2003-11-29  Karl Berry  <karl@gnu.org>
6265
6266         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6267
6268 2003-11-23  Paul Eggert  <eggert@twinsun.com>
6269             Bruno Haible  <bruno@clisp.org>
6270
6271         * printf-parse.h: Don't include sys/types.h.
6272         (ARG_NONE): New macro.
6273         (char_directive): Change type of *arg_index fields to size_t.
6274         * printf-parse.c: Don't include sys/types.h.
6275         (SSIZE_MAX): Remove macro.
6276         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6277         Remove unnecessary overflow check.
6278         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6279         fields.
6280
6281 2003-11-24  Paul Eggert  <eggert@twinsun.com>
6282
6283         * alloca.c: Remove dependency on xalloc module.
6284         (xalloc_die): Remove.
6285         (memory_full) [!defined emacs]: New macro.
6286         [!defined emacs]: Don't include xalloc.h.
6287         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6288         address arithmetic overflows.  Change datatypes a bit to avoid
6289         unnecessary casts.
6290
6291 2003-11-22  Jim Meyering  <jim@meyering.net>
6292
6293         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6294
6295 2003-11-17  Bruno Haible  <bruno@clisp.org>
6296
6297         * vasnprintf.c (alloca): Remove fallback definition.
6298         (freea): Remove definition.
6299         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6300         Reported by Paul Eggert.
6301
6302 2003-11-17  Jim Meyering  <jim@meyering.net>
6303
6304         On systems without utime and without a utimes function capable of
6305         dealing with a NULL struct utimbuf* argument, this utime replacement
6306         could -- in unusual circumstances -- leak a file descriptor.
6307         * utime.c: Include <unistd.h> and <errno.h>.
6308         (utime_null): Be sure to close `fd' and to preserve errno.
6309         Reported by Geoff Collyer via Arnold Robbins.
6310
6311 2003-11-16  Paul Eggert  <eggert@twinsun.com>
6312             Bruno Haible  <bruno@clisp.org>
6313
6314         Protect against address arithmetic overflow.
6315         * printf-args.h: Include stddef.h.
6316         (arguments): Change type of field 'count' to size_t.
6317         * printf-args.c (printf_fetchargs): Use size_t instead of
6318         'unsigned int' where appropriate.
6319         * printf-parse.h: Include sys/types.h.
6320         (char_directive): Change type of *arg_index fields to ssize_t.
6321         (char_directives): Change type of fields 'count', max_*_length to
6322         size_t.
6323         * printf-parse.c: Include sys/types.h and xsize.h.
6324         (SSIZE_MAX): Define fallback value.
6325         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6326         instead of 'int' where appropriate. Check a_allocated, d_allocated
6327         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6328         * vasnprintf.c: Include xsize.h.
6329         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6330         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6331         overflow. Avoid wraparound when converting a width or precision from
6332         decimal to binary.
6333
6334 2003-11-16  Bruno Haible  <bruno@clisp.org>
6335
6336         Update from GNU gettext.
6337         * printf-parse.c: Generalize to it can be compiled for wide strings.
6338         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6339         * vasnprintf.c: Generalize to it can be compiled for wide strings.
6340         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6341         SNPRINTF): New macros.
6342         Don't include <alloca.h> if the file is used inside libintl.
6343         (local_wcslen): New function, for Solaris 2.5.1.
6344         (VASNPRINTF): Use it instead of wcslen.
6345
6346 2003-11-16  Bruno Haible  <bruno@clisp.org>
6347
6348         * xsize.h (xmax): New function.
6349         (xsum, xsum3, xsum4): Declare as "pure" functions.
6350
6351 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6352
6353         * xalloc.h: Do not include <limits.h> or <stdint.h>.
6354         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6355         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
6356         heuristic is just as accurate as far as we know, and it removes a
6357         dependency on size_max.m4 and ptrdiff_max.m4.
6358
6359 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6360
6361         * xstrtol.c (__xstrtol): Remove "break" immediately after
6362         "return", to pacify some unknown compiler.  Problem reported
6363         by Joerg Schilling.
6364
6365 2003-11-11  Bruno Haible  <bruno@clisp.org>
6366
6367         * xsize.h (SIZE_MAX): Remove fallback definition.
6368         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6369         defined.
6370
6371 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6372
6373         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6374         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6375         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6376         From Bruno Haible.
6377         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6378         not (size_t) -1, since it's defined here.
6379
6380 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6381
6382         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6383         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6384         Reject sizes of exactly SIZE_MAX bytes.
6385         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6386         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6387
6388 2003-11-05  Bruno Haible  <bruno@clisp.org>
6389
6390         * xsize.h: Include limits.h, to avoid a possible collision with
6391         SIZE_MAX defined in <limits.h> on Solaris.
6392
6393 2003-11-04  Bruno Haible  <bruno@clisp.org>
6394
6395         * xsize.h: New file.
6396         * linebreak.c: Include xsize.h.
6397         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6398         argument for overflow.
6399         Suggested by Paul Eggert.
6400
6401 2003-10-31  Bruno Haible  <bruno@clisp.org>
6402
6403         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6404         to avoid (extremely rare) race condition.
6405         Suggested by Paul Eggert.
6406
6407 2003-11-03  Jim Meyering  <jim@meyering.net>
6408
6409         * userspec.c: Include "userspec.h".
6410         * userspec.h: New file.
6411
6412 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6413
6414         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6415         * mountlist.c (SIZE_MAX): Define if not defined already.
6416         (read_filesystem_list): Set and use me_type_malloced.
6417         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6418         whatever the type happens to be), for brevity and consistency.
6419         Check for size calculation overflow on Alphas running OSF/1.
6420
6421 2003-10-31  Jim Meyering  <jim@meyering.net>
6422
6423         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6424
6425         * linebuffer.c: Include <string.h> for declaration of memset.
6426
6427 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6428             Bruno Haible  <bruno@clisp.org>
6429
6430         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6431         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6432
6433 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6434
6435         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6436         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6437         no longer needed.
6438         * quotearg.c (quotearg_n_options): Use it.
6439         * group-member.c: Include <stdbool.h>.
6440         (free_group_info): Arg is now const *; don't free arg.
6441         (get_group_info): Now returns bool and accepts struct group_info *,
6442         rather than returning a malloc'ed struct group_info *.
6443         All uses changed.  Check for overflow in internal size calculation.
6444
6445         * getusershell.c (readname): Simplify the code by using x2nrealloc
6446         rather than xmalloc/xrealloc.
6447         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6448         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6449         conformance bug: the old code used a pointer after freeing the
6450         storage that it addressed.
6451         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6452         rather than doing it by hand.
6453         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6454         the buffer preserved.  Use free and xmalloc instead.
6455         * quotearg.c (quotearg_n_options): Likewise.
6456         Use a simpler test for size overflow.  Don't use xalloc_oversized
6457         because unsigned int might be wider than size_t (!); this suggests
6458         that we should switch from unsigned int to size_t for slot numbers.
6459
6460 2003-10-27  Bruno Haible  <bruno@clisp.org>
6461
6462         * stdbool_.h: Better support for BeOS.
6463
6464 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6465
6466         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6467         to allocate the returned structure.  Do not allocate a subarray,
6468         as x2nrealloc will do that.
6469         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6470         instead of xnrealloc.
6471         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6472
6473 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6474
6475         * xalloc.h (xalloc_oversized): New static inline function, for
6476         callers that want to do their own size-overflow checking.  Include
6477         <stdbool.h>, since xalloc_oversized returns bool.
6478         * xalloc.c (array_size_overflow): Remove.  All callers changed
6479         to use xalloc_oversized.
6480
6481         Add two functions x2realloc, x2nrealloc, for programs that grow
6482         arrays dynamically by doubling their sizes.
6483         * xalloc.h (x2realloc, x2nrealloc): New decls.
6484         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6485         New functions.
6486
6487         Port to C99 semantics for 'inline' of external functions.
6488         Bug reported by Bruno Haible.
6489         * xmalloc.c (xnmalloc_inline): New static inline function,
6490         with the old contents of xnmalloc.
6491         (xnmalloc, xmalloc): Use it.
6492         (xnrealloc_inline): New static inline function,
6493         with the old contents of xnrealloc.
6494         (xnrealloc, xrealloc): Use it.
6495
6496         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6497
6498 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6499
6500         Fix several address-calculation bugs in the hash modules,
6501         plus some minor code cleanup.
6502
6503         * hash.h: Include <stdbool.h>, for bool.
6504         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6505         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6506         hash_get_n_entries, hash_get_max_bucket_length,
6507         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6508         hash_rehash): Use size_t rather than unsigned.
6509         * hash.c (struct hash_table, hash_get_n_buckets,
6510         hash_get_n_buckets_used, hash_get_n_entries,
6511         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6512         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6513         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6514         Likewise.
6515         (SIZE_MAX): Define if not defined.
6516         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6517         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6518         hash_print):
6519         Use const * when possible.
6520         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6521         (check_tuning): Fix bug: if tuning parameters were very close to
6522         0 or 1, rounding errors could have caused subscript violations.
6523         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6524         (hash_initialize): Add 'fail:' label
6525         to free table and return NULL, and use it to simplify code.
6526         Use calloc rather than clearing the storage ourself.
6527         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6528         buffer size calculations.
6529         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6530         Include <stddef.h>, for size_t.
6531         * hash-pjw.c (hash_pjw): Likewise.
6532         Switch to method described by Bruno Haible.
6533         Include <limits.h>, for CHAR_BIT.
6534         (SIZE_BITS): New macro.
6535
6536 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6537
6538         * getndelim2.c (getndelim2): When size calculation overflows,
6539         ceiling the allocation at NMAX bytes rather than silently
6540         discarding input bytes before NMAX is reached.  This makes
6541         a difference only if NMAX exceeds SIZE_MAX / 2.
6542
6543         * obstack.c: Merge from glibc.
6544         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6545         Add libc_hidden_def (_obstack_newchunk).
6546         (_obstack_free) [! defined _LIBC]: Remove.
6547         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6548         a clone of the function body.
6549         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6550         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6551
6552         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6553         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6554         arg to memcpy.
6555
6556         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6557         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6558         Don't use lvalue casts, as GCC plans to remove support for them
6559         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6560         was also present in the non-GCC version, indicating that this
6561         code had always been buggy and had never been widely used.
6562         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6563         Use the fast variant of each macro, rather than copying the
6564         definiens of the fast variant; that way, we'll be more likely to
6565         catch future bugs in the fast variants.
6566
6567 2003-10-20  Bruno Haible  <bruno@clisp.org>
6568
6569         * wait-process.h: New file, from GNU gettext.
6570         * wait-process.c: New file, from GNU gettext.
6571
6572 2003-10-19  Jim Meyering  <jim@meyering.net>
6573
6574         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6575
6576 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6577
6578         * getgroups.c: Include <errno.h>, <stdlib.h>.
6579         (getgroups): First arg is int, not size_t.
6580         Don't let 'free' mangle errno.
6581
6582 2003-10-16  Jim Meyering  <jim@meyering.net>
6583
6584         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6585
6586 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6587
6588         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6589         (SIZE_MAX): Remove.
6590         (new_exclude, add_exclude_file): Initial size no longer needs to
6591         be a power of 2.
6592         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6593         our own address arithmetic overflow checking.
6594
6595         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6596         (fnmatch): Do not alloca more than 2000 wide characters;
6597         instead, use malloc for large buffers.
6598         Check for address arithmetic overflow, and return -1
6599         with errno set to ENOMEM in that case.
6600         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6601         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6602         instead, return -1.  Check for address arithmetic overflow.
6603
6604 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6605
6606         Handle invalid suffixes and overflow independently, so that
6607         callers can treat them independently as needed.  Fix some bugs in
6608         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6609         suffix for a human-readable blocksize.  The major caller-visible
6610         change is the addition of a new
6611         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6612         that both overflow and suffix chars were found.
6613
6614         * human.c (humblock): Don't check separately for invalid suffix
6615         char; that is xstrtoumax's job (now that its bug is fixed).
6616         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6617         INTMAX_MAX]: New macros.
6618         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6619         TYPE_MAXIMUM): New macros.
6620         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6621         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6622         if overflow occurs, as it's what __strtol does and it's more useful
6623         in practice.
6624         (__xstrtol): If __strtol reports some error other than ERANGE,
6625         reflect it to the caller as LONGINT_INVALID.  If it reports
6626         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6627         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6628         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6629         value.
6630         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6631         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6632         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6633         [defined UINTMAX_MAX]: New macros.
6634
6635 2003-10-14  Bruno Haible  <bruno@clisp.org>
6636
6637         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6638         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6639         Also use volatile where needed.
6640
6641 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6642
6643         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6644         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6645         and define in terms of the other primitives.
6646         * xmalloc.c: Include stdbool.h; do not include exit.h.
6647         (SIZE_MAX): Define if not already defined.
6648         (array_size_overflow): New function.
6649         (xalloc_die): Abort instead of exiting if 'error' returns.
6650         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6651         (xmalloc, xrealloc): Use them.
6652         (xcalloc): Check for address arithmetic overflow.
6653         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6654         a bit faster than strcpy.
6655
6656 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6657
6658         Merge getpass from libc, plus a few fixes.
6659
6660         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6661         Include <stdbool.h>.
6662         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6663         __fsetlocking to empty.
6664         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6665         do include <bits/libc-lock.h>.
6666         Do not include <fcntl.h>; not needed.
6667         [_LIBC]: Include <wchar.h>.
6668         (NOTCANCEL_MODE): New macro.
6669         (flockfile, funlockfile) [_LIBC]: New macros.
6670         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6671         [!_LIBC]: New macros.
6672         (call_fclose): New function.
6673         (getpass): Use it.  Save tty stream separately; this simplifies the
6674         code and makes it more reliable if stdin happens to equal stdout.
6675         Invoke __fsetlocking on tty.
6676         Handle thread cancellation if needed.
6677         Namespace cleanup (use __tcgetattr, __getline).
6678         Use bool for Booleans.
6679         [USE_IN_LIBIO]: Handle wide streams.
6680         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6681         stream might go where.
6682
6683         * unlocked-io.h: Include <stdio.h>, so that the caller
6684         doesn't have to include <stdio.h> before us.
6685         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6686         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6687         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6688         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6689         if not declared, so that we can use getpass.c code from libc without
6690         rewriting it.
6691         (flockfile, ftrylockfile, funlockfile): New macros.
6692
6693 2003-10-06  Bruno Haible  <bruno@clisp.org>
6694
6695         * version-etc-2.h: Remove file.
6696         * version-etc-2.c: Remove file.
6697
6698 2003-09-25  Jim Meyering  <jim@meyering.net>
6699             Bruno Haible  <bruno@clisp.org>
6700
6701         This lets translators provide better translations for the
6702         "Written by ..." part of --version output.
6703         * version-etc.h: Include stdarg.h.
6704         (version_etc_copyright): Declare as readonly.
6705         (version_etc): Make this function variadic with a NULL-terminated list
6706         of author name strings.
6707         (version_etc_va): New declaration.
6708         * version-etc.c: Include stdarg.h, stdlib.h.
6709         (version_etc_copyright): Declare as readonly.
6710         (version_etc_va): New function. Provide a different translatable string
6711         for each possible number of authors < 10. Abbreviate when there are 10
6712         authors or more.
6713         (version_etc): Make this function variadic. Call version_etc_va.
6714         Suggestion from Gary V. Vaughan.
6715
6716         * long-options.h (parse_long_options): Change prototype: the authors
6717         string is moved to the end and becomes variadic.
6718         * long-options.c: Include stdarg.h.
6719         (parse_long_options): Make this function variadic, too.
6720         Call version_etc_va, not version_etc.
6721
6722 2003-10-06  Bruno Haible  <bruno@clisp.org>
6723
6724         * fatal-signal.h: New file, from GNU gettext.
6725         * fatal-signal.c: New file, from GNU gettext.
6726
6727 2003-10-04  Karl Berry  <karl@gnu.org>
6728
6729         * argp*: update from libc.
6730
6731 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6732
6733         * getpass.c (getpass): Use a no-op fseek when switching from input to
6734         output mode on the same stream.
6735
6736 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6737
6738         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6739         Fix arg typo in previous patch.
6740
6741 2003-09-28  Jim Meyering  <jim@meyering.net>
6742
6743         * error.c: Correct cpp indentation.
6744
6745 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6746
6747         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6748         Omit the special code that used __typeof__, since we worry that
6749         it could be more trouble than it's worth.  See:
6750         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6751         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6752
6753         * free.c: New file.
6754
6755 2003-09-26  Jim Meyering  <jim@meyering.net>
6756
6757         * error.c (error_tail): Move some declarations
6758         into inner scope where the local variables are used.
6759
6760 2003-09-26  Bruno Haible  <bruno@clisp.org>
6761
6762         * stpncpy.h (gnu_stpncpy): New declaration.
6763         (stpncpy): Define as alias for gnu_stpncpy.
6764         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6765
6766 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6767
6768         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6769         (error_tail): Do not loop, reallocating temporary buffer, since
6770         the output cannot contain more wide characters than the input
6771         contains bytes, the size must be big enough already.  This avoids
6772         one potential size overflow calculation.  Check for size overflow
6773         when calculating temporary buffer size.  Free temporary buffer
6774         when done, if it was allocated with malloc; this plugs a memory
6775         leak.  Remove casts from void * to pointers, that are no longer
6776         needed now that we're assuming C89 or better.
6777
6778         Merge error changes from glibc.
6779
6780         * error.c, error.h: Update copyright notice header to match glibc.
6781         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6782         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6783         Disable cancellation while printing error.
6784         * error.h: Prepend __ to parameter names.
6785
6786 2003-09-25  Karl Berry  <karl@gnu.org>
6787
6788         * argp-fmtstream.c, argp-help.c: update from libc.
6789
6790 2003-09-25  Bruno Haible  <bruno@clisp.org>
6791
6792         * version-etc-2.h: New file, from version-etc.h with modifications.
6793         * version-etc-2.c: New file, from version-etc.c with modifications.
6794
6795 2003-09-25  Simon Josefsson  <jas@extundo.com>
6796
6797         * xgetdomainname.h: New file.
6798         * xgetdomainname.c: New file.
6799
6800 2003-09-25  Simon Josefsson  <jas@extundo.com>
6801             Bruno Haible  <bruno@clisp.org>
6802
6803         * getdomainname.h: New file.
6804         * getdomainname.c: New file.
6805
6806 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6807
6808         * linebuffer.c (freebuffer): Don't free the argument, just
6809         the buffer associated with the argument.  Bug reported by
6810         Simon Josefsson.
6811
6812 2003-09-19  Karl Berry  <karl@gnu.org>
6813
6814         * argp.h: update from libc.
6815
6816 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6817
6818         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6819         input error, instead of returning NULL the next time we are called
6820         (and therefore losing track of errno).
6821
6822 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6823
6824         * getndelim2.c (getndelim2): Don't trash errno when a read
6825         fails, so that the caller gets the proper errno.
6826
6827         * readutmp.c (read_utmp): Likewise.
6828         Check for fstat error.  Close stream and free storage
6829         when failing.
6830
6831 2003-09-14  Bruno Haible  <bruno@clisp.org>
6832
6833         * fwriteerror.h: New file.
6834         * fwriteerror.c: New file.
6835
6836 2003-09-14  Jim Meyering  <jim@meyering.net>
6837
6838         * getloadavg.c: Correct cpp indentation.
6839         * strdup.c: Likewise.
6840         * vasnprintf.c: Likewise.
6841
6842 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6843
6844         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6845         * obstack.c [!defined _LIBC]: Likewise.
6846         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6847         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6848         * exitfail.c: Don't include stdlib.h; no longer needed.
6849
6850         More changes to assume C89 or better.
6851
6852         * error.c (error_tail): Assume vprintf.
6853
6854         * argmatch.c (getenv): Remove decl.
6855         * progreloc.c (get_full_program_name): Define via prototype.
6856         * setenv.c (clearenv): Likewise.
6857         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6858         needed.
6859         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6860         (malloc, memcpy): Remove decls.
6861         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6862         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6863         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6864         (memcpy): Remove macro.
6865         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6866         (__P): Remove.  All uses removed.
6867         (PTR): Remove.  All uses changed to void *.
6868         (CHAR_BIT, NULL): Remove.
6869         (spaces, zeros, memset_space, memset_zero)
6870         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6871         Remove.
6872         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6873         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6874         Define with prototype.
6875         Remove now-unnecessary prototype decl.
6876         (extra_args_spec): Assume ANSI C.  All uses changed.
6877         (extra_args_spec_iso): Remove.
6878         (my_strftime, emacs_strftimeu): Define via prototype.
6879         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6880         unconditionally.
6881         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6882         * strtoimax.c: Include <stdlib.h> unconditionally.
6883         (strtoul, strtol): Remove decls.
6884         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6885         LONG_MAX): Remove.
6886         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6887         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6888         (LOCALE_PARAM_PROTO): New macro.
6889         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6890         (INTERNAL (strtol), strtol): Define with a prototype.
6891         (PARAMS): Remove.  All uses removed.
6892         * tempname.c: Include <string.h> unconditionally.
6893         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6894         * xgethostname.c (main): Define with a prototype.
6895         * xmalloc.c: Include "xalloc.h" first, to check interface.
6896         Include <stdlib.h> unconditionally.
6897         (calloc, malloc, realloc, free): Remove decls.
6898         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6899         Include <stdlib.h> unconditionally.  Sort include file names.
6900         (strtod): Remove.
6901         (xstrtod): Define with a prototype.
6902         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6903         (strtol, strtoul): Remove decls.
6904
6905 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6906
6907         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6908         Include <stdlib.h>, <string.h> unconditionally.
6909         Remove now-unnecessary cast to char *.
6910         * strnlen.c: Include <string.h> unconditionally.
6911         * yesno.c (yesno): Define with a prototype.
6912
6913 2003-09-10  Bruno Haible  <bruno@clisp.org>
6914
6915         * strcspn.c: Include <string.h> unconditionally.
6916         * strpbrk.c: Include <string.h> unconditionally.
6917         * strstr.c: Include <string.h> unconditionally.
6918         * unicodeio.c: Include <string.h> unconditionally.
6919         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6920         * unsetenv.c: Likewise.
6921         * xreadlink.c: Include <stdlib.h> unconditionally.
6922         * yesno.c: Include <stdlib.h> unconditionally.
6923         (rpmatch): Add prototype.
6924
6925 2003-09-10  Jim Meyering  <jim@meyering.net>
6926
6927         * error.c: Correct indentation of cpp directives.
6928
6929 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6930
6931         More K&R removal.
6932
6933         * acosl.c (main): Use a prototype.
6934         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6935         tanl.c: Likewise.
6936
6937         * getloadavg.c (getloadavg, main): Define via prototypes.
6938
6939         * getopt.h (struct option.name): Assume C89, and use 'const'.
6940         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6941         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6942         with a prototype.
6943         * getopt.c (const): Remove macro.
6944         Include <string.h> unconditionally.
6945         (my_index): Remove; all uses changed to strchr.
6946         (strlen): Remove decl.
6947         (exchange): Remove forward decl; no longer needed.
6948         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6949         Define with prototype.
6950         * getopt1.c (const): Remove macro.
6951         (getopt_long, getopt_long_only, main): Define with prototype.
6952
6953         * getugroups.c: Include <string.h> unconditionally.
6954
6955         * getusershell.c: Include <stdlib.h> unconditionally.
6956         (getusershell, setusershell, endusershell, readname, main):
6957         Define with prototypes.
6958
6959         * group-member.c: Include group-member.h first.
6960         Include <stdlib.h> unconditionally.
6961
6962         * hard-locale.c: Include hard-locale.h first.
6963         Include <stdlib.h>, <string.h> unconditionally.
6964
6965         * hash.c (free, malloc): Remove decls.
6966         Include <stdlib.h> unconditionally.
6967
6968         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6969         (getenv): Do not declare.
6970
6971         * idcache.c: Include <string.h> unconditionally.
6972
6973         * long-options.c: Include long-options.h first, to test interface.
6974         Include <stdlib.h> unconditionally.
6975
6976         * makepath.c: Include makepath.h first, to test interface.
6977         Include <stdlib.h> and <string.h> unconditionally.
6978
6979         * linebuffer.c: Include <stdlib.h>.
6980         (free): Remove decl.
6981
6982         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6983         rpl_malloc returns void *, not char *.
6984         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6985
6986         * md5.h: Include <limits.h> unconditionally.
6987         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6988         (__P): Remove; all uses removed.
6989         * md5.c: Include "md5.h" first.
6990         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6991         md5_buffer, md5_process_bytes, md5_process_block):
6992         Define with prototypes.
6993         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6994         * sha.c: Include "sha.h" first.
6995         Include <stdlib.h>, <string.h> unconditionally.
6996
6997         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6998         * memcmp.c (__ptr_t): Likewise.
6999         * memrchr.c (__ptr_t): Likewise.
7000         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
7001         Include <string.h> unconditionally.
7002         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
7003         * memchr.c: Include <stdlib.h> unconditionally.
7004         * memchr.c (LONG_MAX): Remove.
7005         * memrchr.c (LONG_MAX): Likewise.
7006         * memchr.c (__memchr): Define via a prototype.
7007         * memrchr.c (__memrchr): Likewise.
7008         * memcmp.c (__P): Remove, and remove all uses.
7009         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
7010         Remove forward decls; no longer needed.
7011         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
7012         Use types required by C89 in prototype.
7013
7014         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
7015         * savedir.c: Likewise.
7016         * mkdir.c (free): Remove decl.
7017         * rmdir.c (rmdir): Define with a prototype.
7018         * savedir.c: Include savedir.h first, to test interface.
7019
7020         * mktime.c (STDC_HEADERS): Remove.
7021         Include <stdlib.h>, <string.h> unconditionally.
7022
7023         * modechange.c: Include <stdlib.h> unconditionally.
7024         (malloc): Remove decl.
7025
7026         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
7027         (free): Remove decl.
7028
7029         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
7030         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
7031         (This type really should be intptr_t, but that's a C99ism.)
7032         (_obstack_memcpy): Remove: all uses changed to memcpy.
7033         Include <string.h> unconditionally.
7034         (struct obstack): Assume __STDC__ for types of members
7035         chunkfun, freefun, extra_arg.
7036         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
7037         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
7038         obstack_begin, obstack_specify_allocation,
7039         obstack_specify_allocation_with_arg, obstack_chunkfun,
7040         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
7041         Remove unprototyped decls and the macros that use them.
7042         * obstack.c (POINTER): Remove.  All uses changed to void *.
7043         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
7044         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
7045         (defined __STDC__ && __STDC__)]:
7046         Remove nonprototyped code.
7047         Include <stdlib.h> unconditionally.
7048         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
7049         _obstack_allocated_p, _obstack_free, obstack_free,
7050         _obstack_memory_used, print_and_abort):
7051         Define using prototypes.
7052         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
7053         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
7054         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
7055         obstack_next_free, obstack_object_size, obstack_room) [0]:
7056         Remove unused, unprototyped code.
7057
7058         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
7059
7060         * physmem.c (physmem_total, physmem_available, main): Define
7061         with prototypes.
7062
7063         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
7064         (main): Define with a prototype.
7065
7066         * posixver.c (getenv): Remove decl.
7067
7068         * putenv.c (malloc): Returns void *, not char *.
7069         Include <string.h> unconditionally.
7070         (strchr, memcpy, NULL): Do not define.
7071
7072         * readtokens.c: Include readtokens.h first, to test interface.
7073         Include <stdlib.h>, <string.h> unconditionally.
7074         (init_tokenbuffer): Define with a prototype.
7075
7076         * regex.c (PARAMS): Remove.  All uses removed.
7077         All uses of _RE_ARGS removed, too.
7078         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
7079         unconditionally.
7080         (bzero): Assume memset exists.
7081         (memcmp, memcpy, NULL): Remove.
7082         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
7083         char, or assignments to local vars of type signed char.
7084         (init_syntax_once, PREFIX(extract_number_and_incr),
7085         PREFIX(print_partial_compiled_pattern),
7086         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
7087         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
7088         PREFIX(regex_grow_registers), PREFIX(regex_compile),
7089         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
7090         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
7091         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
7092         wcs_compile_range, byte_compile_range, truncate_wchar,
7093         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
7094         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
7095         count_mbs_length, wcs_re_match_2_internal,
7096         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
7097         PREFIX(alt_match_null_string_p),
7098         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
7099         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
7100         regfree, PREFIX(extract_number)): Define with prototype.  Remove
7101         now-unnecessary declaration, if any.
7102         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
7103         regcomp, regexec):
7104         Remove now-unnecessary casts among pointer types.
7105         * regex.h (_RE_ARGS): Remove.  All uses removed.
7106
7107         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7108         (free): Remove decl.
7109
7110         * rpmatch.c: Include <stdlib.h> unconditionally.
7111
7112         * same.c: Include <stdlib.h>, <string.h> unconditionally.
7113         (free): Remove decl.
7114
7115         * save-cwd.c: Include <stdlib.h> unconditionally.
7116         * xgetcwd.c: Likewise.
7117
7118         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7119         (free): Remove decl.
7120
7121         * strchrnul.c (strchrnul): Define with a prototype.
7122         Fix bug: c_in was not converted to char before searching.
7123
7124         The following changes are not K&R related:
7125
7126         * group-member.h: Include <sys/types.h>, so that this file is
7127         self-contained.
7128         * makepath.h: Likewise.
7129
7130         * getusershell.c (readname, default_index, line_size, readname):
7131         Use size_t, not int, for sizes.
7132         (readname): If the size overflows, report an error instead of
7133         looping forever.
7134
7135 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
7136
7137         * getndelim2.c: Assume stdlib.h per the C89 spec.
7138
7139 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7140
7141         Assume C89 or better; remove K&R cruft.
7142         A few of these changes were first proposed by Derek Robert Price
7143         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7144
7145         * addext.c: Include <string.h> unconditionally.
7146         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7147         Don't declare getenv or malloc.
7148
7149         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7150         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7151         (NULL): Remove.
7152         (find_stack_direction, alloca): Use prototypes.
7153
7154         * atexit.c (atexit): Define using a prototype.
7155
7156         * basename.c, dirname.c, stripslash.c:
7157         Include <string.h> unconditionally.
7158
7159         * bcopy.c: Include <stddef.h>.
7160         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7161
7162         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7163
7164         * error.h (error, error_at_line, error_print_progname)
7165         [! (defined (__STDC__) && __STDC__)]: Remove decls.
7166         * error.c: Include error.h first, to check interface.
7167         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7168         (VA_START): Remove; all uses changeed to va_start.
7169         (exit, strerror): Remove decls.
7170         (error_print_progname): Prototype uncondionally.
7171         Don't include <errno.h>; no longer needed.
7172         (private_strerror): Remove.
7173         (error_tail): Always define.
7174         (error, error_at_line): Assume C89 or better; always use prototypes.
7175         * fatal.c: Include "fatal.h" first, to test interface.
7176         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7177         (VA_START): Remove; all uses changed to va_start.
7178         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7179         this case.
7180         (exit): Remove decl.
7181         (fatal): Prototype unconditionally.  Assume va_start works.
7182         Abort at end, to pacify gcc.
7183
7184         * euidaccess.c (main): Define with a prototype.
7185
7186         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7187
7188         * exitfail.c: Include <stdlib.h> unconditionally.
7189
7190         * fnmatch_.h (__P): Remove.  All uses changed to assume
7191         prototypes.
7192         * fnmatch.c: Include fnmatch.h first, to test interface.
7193         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7194         (getenv): Remove decl.
7195         (fnmatch): Define using a prototype.
7196         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7197         (FCT): Define using a prototype.
7198
7199         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7200
7201         * gethostname.c: Include <stddef.h>.
7202         (gethostname): Define with prototype.  Length is size_t, not int.
7203
7204 2003-09-08  Paul Eggert  <eggert@twinsun.com>
7205
7206         * getversion.c: Remove; was migrated to backupfile.c in 1997.
7207         getversion.c should have been removed then, but was accidentally
7208         preserved.
7209
7210         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7211         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7212
7213 2003-09-07  Paul Eggert  <eggert@twinsun.com>
7214
7215         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7216         copy_tm_result.  Bug reported by Simon Josefsson in
7217         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7218
7219 2003-09-06  Paul Eggert  <eggert@twinsun.com>
7220
7221         * time_r.c, time_r.h: New files.
7222
7223         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7224         __localtime_r.
7225         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
7226         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7227
7228         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7229         __gmtime_r.
7230         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7231         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7232         Include <time_r.h>.
7233
7234         * timegm.c: Switch to glibc implementation, with the following changes:
7235         [defined HAVE_CONFIG_H]: Include <config.h>.
7236         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7237         (__mktime_internal) [!defined _LIBC]: New decl.
7238         (__gmtime_r) [!defined _LIBC]: New macro and function.
7239         (timegm): Use a prototype, since gnulib assumes C89.
7240         Do not bother declaring tmp to be const, as it's not really usefu.
7241         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7242         (timegm): Declare only if HAVE_DECL_TIMEGM.
7243
7244 2003-09-03  Paul Eggert  <eggert@twinsun.com>
7245
7246         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7247         Bug reported by Lute Kamstra in
7248         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7249
7250         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7251         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
7252         course with correspondingly smaller numbers for tomorrow and
7253         yesterday.  From Tadayoshi Funaba.  Originally installed into
7254         sh-utils on 1999-08-07, but the patch got lost (I guess during the
7255         coreutils merge?).
7256
7257 2003-08-31  Simon Josefsson  <jas@extundo.com>
7258
7259         * timegm.h: New file.
7260         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
7261
7262 2003-08-31  Karl Berry  <karl@gnu.org>
7263
7264         * argp.h: update from libc.
7265
7266 2003-08-28  Bruno Haible  <bruno@clisp.org>
7267
7268         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7269         warning on QNX, which defines O_BINARY to 000000.
7270
7271 2003-08-24  Bruno Haible  <bruno@clisp.org>
7272
7273         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7274         MSVC7 <stdio.h> is included later.
7275
7276 2003-08-20  Bruno Haible  <bruno@clisp.org>
7277
7278         * progname.h: New file, from GNU gettext.
7279         * progname.c: New file, from GNU gettext.
7280         * progreloc.c: New file, from GNU gettext.
7281
7282 2003-08-19  Bruno Haible  <bruno@clisp.org>
7283
7284         * xstrdup.c: Assume <string.h> exists.
7285
7286 2003-08-18  Jim Meyering  <jim@meyering.net>
7287
7288         * setenv.h: Indent nested cpp directive.
7289         * vasnprintf.c: Remove trailing blanks.
7290
7291 2003-08-17  Simon Josefsson  <jas@extundo.com>
7292             Bruno Haible  <bruno@clisp.org>
7293
7294         * xstrndup.h: New file.
7295         * xstrndup.c: New file.
7296
7297 2003-08-17  Bruno Haible  <bruno@clisp.org>
7298
7299         * strndup.h: New file.
7300
7301 2003-08-16  Paul Eggert  <eggert@twinsun.com>
7302
7303         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7304         space, undoing this 2003-08-12 change:
7305         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7306
7307 2003-08-16  Jim Meyering  <jim@meyering.net>
7308
7309         Merge from coreutils.
7310         * xstrtoimax.c: #else #if -> #elif.
7311         * xstrtoumax.c: Likewise.
7312
7313 2003-08-15  Paul Eggert  <eggert@twinsun.com>
7314
7315         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7316         rather than tab, after '#' in shell-script copyright notices.
7317         Suggested by Bruno Haible.
7318
7319 2003-08-15  Jim Meyering  <jim@meyering.net>
7320         and Paul Eggert  <eggert@twinsun.com>
7321
7322         Merge from coreutils.
7323         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7324         member but strut utmpx does not.  Needed for AIX 4.3.3.
7325         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7326
7327 2003-08-15  Jim Meyering  <jim@meyering.net>
7328
7329         Merge from coreutils.
7330         * xgethostname.c: Include <stdlib.h>.
7331         (xghostname): Don't exit for anything other than memory-related
7332         failure; just return NULL.
7333         * userspec.c: Include "posixver.h".
7334         (parse_user_spec): Accept `.' as a separator only
7335         in pre-POSIX-200112 mode.
7336         * strtoimax.c: Use #elif rather than #else #if.
7337         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7338         Remove function, now that we can rely on a working tzset function.
7339         [!_LIBC]: Ensure that the required autoconf test has been run.
7340         [!defined _NL_CURRENT && HAVE_STRFTIME]:
7341         Use underlying_strftime for %r.
7342         * sha.c: Merge in some clean-up and optimization changes from glibc.
7343         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7344         Ensure that it is a multiple of 64.
7345         Rearrange loop exit tests so as to avoid performing an
7346         additional fread after encountering an error or EOF.
7347         * realloc.c: Update copyright date.
7348
7349 2003-08-14  Jim Meyering  <jim@meyering.net>
7350
7351         Merge from coreutils.
7352         * obstack.h: Whitespace changes.
7353         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7354         and xcalloc return values.
7355         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7356         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
7357         hang on OSF/1 5.1 for DIR on both local and remote file systems.
7358         Reported by (and fix confirmed by) Nelson H. F. Beebe.
7359         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7360         error from mntctl.
7361         Use mntctl's return value to drive the entry-processing loop, since
7362         we can't rely on the value of the vmt_length member in the last
7363         entry.  On some systems doing so could result in exhausting
7364         virtual memory.  Based in part on a patch from Mike Jetzer.
7365
7366 2003-08-14  Jim Meyering  <jim@meyering.net>
7367         and Paul Eggert  <eggert@twinsun.com>
7368
7369         Merges from coreutils, plus other fixes.
7370         * physmem.c: Merge in portability changes from gcc/libiberty
7371         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7372         for credits and details.  Thanks to Kaveh Ghazi for helping
7373         to keep these files in sync.
7374         (ARRAY_SIZE): Define it.
7375         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7376         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7377         (memcasecmp): Don't assume size_t fits in unsigned int.
7378         Remove casts and duplicate code.
7379         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7380         (memcpy): Remove definition.
7381         Merge in some clean-up and optimization changes from glibc.
7382         [BLOCKSIZE]: Move definition to top of file.
7383         Ensure that it is a multiple of 64.
7384         Rearrange loop exit tests so as to avoid performing an
7385         additional fread after encountering an error or EOF.
7386         * md5.h (md5_uintptr): Define.
7387         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7388         return to the initial working directory.  Preserve errno
7389         for caller.
7390         * idcache.c: Include "xalloc.h".
7391         (xmalloc, xrealloc): Remove decls.
7392         (getuser): Remove casts no longer required in C89.
7393         * human.c: Include stdio.h, for sprintf.
7394         * group-member.c: Include "xalloc.h".
7395         (xmalloc, xrealloc): Remove decls.
7396         (get_group_info): Remove casts no longer required in C89.
7397         * getusershell.c (readname): Remove casts no longer required in C89.
7398         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7399         * getline.c: Whitespace fix, from coreutils.
7400
7401 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7402
7403         * exclude.c: Include <ctype.h>
7404         (IN_CTYPE_DOMAIN): New macro.
7405         (is_space): New fn.
7406         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7407         and empty lines.
7408
7409         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7410         Undo previous (whitespace-only) change.
7411
7412 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7413
7414         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7415         Normalize leading white space and remove trailing white space.
7416         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7417         notice, as per ../config/srclist-update.
7418
7419         Merge from coreutils.
7420         * euidaccess.h: New file.
7421         * euidaccess.c: Include it.
7422         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7423         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7424         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7425
7426 2003-08-11  Bruno Haible  <bruno@clisp.org>
7427
7428         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7429         (vasnprintf): Use it instead of wcslen.
7430
7431 2003-08-11  Bruno Haible  <bruno@clisp.org>
7432
7433         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7434         value to ensure that _Bool promotes to int. Use #define for _Bool when
7435         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7436
7437 2003-08-10  Karl Berry  <karl@gnu.org>
7438
7439         * regex.h: update from libc (whitespace fix).
7440
7441 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7442
7443         Merge some files from coreutils.  These changes were
7444         originally made by Jim Meyering.
7445         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7446         many older Unixes require this.
7447         * alloca.c (alloca): Remove cast to argument of free;
7448         no longer needed in C89.
7449         * alloca_.h, regex.h: Fix white space to match
7450         what GNU indent does.
7451
7452 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7453
7454         * bumpalloc.h: Remove.
7455
7456 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7457
7458         * getloadavg.c: Change copyright notice and spacing to conform to
7459         GNU coding style.
7460
7461         Merge from coreutils.
7462         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7463         From glibc.
7464         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7465         from Karl Berry, implemented by Jim Meyering.
7466         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7467         from Dmitry V. Levin.
7468         Remove anachronistic cast of xrealloc.
7469         * fnmatch_.h (__const): Remove.  Use 'const'.
7470         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7471         type. Otherwise, it wouldn't compile with at least /bin/cc on
7472         ymp-cray-unicos9.0.2.X.
7473         Combine two mostly-identical uses of alloca into one.
7474         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7475
7476 2003-08-04  Dave Love <d.love@dl.ac.uk>
7477
7478         [From Emacs.]
7479
7480         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7481         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7482         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7483         obsolete NLIST_NAME_UNION.
7484         [__GNU__]: Undef BSD and FSCALE.
7485         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7486
7487 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7488
7489         * stdbool_.h (_Bool): Make it signed char, instead of
7490         an enum type, so that it's guaranteed to promote to int.  See:
7491         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7492
7493 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7494
7495         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7496         (strerror): Don't assume that a printable int fits in 14 bytes.
7497
7498 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7499             Bruno Haible  <bruno@clisp.org>
7500
7501         * getline.h (getline, getdelim): Change return type to ssize_t.
7502         * getline.c (getline, getdelim): Likewise.
7503         Remove _GNU_SOURCE define; now it's defined in config.h through
7504         m4/getline.m4.
7505
7506 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7507
7508         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7509         over-parenthesization in macros.
7510
7511         Sync with coreutils.
7512
7513         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7514         required by C99.
7515
7516         Use `exit_failure' for xalloc and xmemcoll instead of their own
7517         private exit-failure variables.
7518         * xalloc.h (xalloc_exit_failure): Remove.
7519         * xmalloc.c: Likewise.  Include exitfail.h.
7520         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7521         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7522         * xmemcoll.c: Likewise.  Include exitfail.h.
7523         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7524
7525 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7526
7527         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7528         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7529         to test that it can stand by itself.  Include "exitfail.h".
7530         Clients should set exit_failure instead.
7531         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7532
7533 2003-07-18  Andreas Schwab  <schwab@suse.de>
7534
7535         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7536
7537 2003-07-18  Bruno Haible  <bruno@clisp.org>
7538
7539         * getndelim2.h: New file.
7540         * getndelim2.c: Make into a module of its own. Include config.h,
7541         getndelim2.h.
7542         (getndelim2): Make non-static. Change return type to ssize_t.
7543         * getline.h: Change argument names.
7544         * getline.c: Include getndelim2.h instead of getndelim2.c.
7545         * getnline.c: Include getndelim2.h.
7546
7547 2003-07-17  Bruno Haible  <bruno@clisp.org>
7548
7549         * Makefile.am: Remove file.
7550         * Makefile.in: Remove file.
7551
7552 2003-07-17  Bruno Haible  <bruno@clisp.org>
7553
7554         * getnline.h: New file.
7555         * getnline.c: New file.
7556         * getndelim2.c: New file, extracted from getline.c.
7557         (getndelim2): Renamed from getdelim2, with added nmax argument.
7558         * getline.c: Include getndelim2.c.
7559         (getdelim2): Moved out to getndelim2.c.
7560         (getline, getdelim): Update.
7561
7562 2003-07-15    <karl@gnu.org>
7563
7564         * vasnprintf.c: update from gettext.
7565
7566 2003-07-15  Jim Meyering  <jim@meyering.net>
7567
7568         * makepath.c (make_path): Enclose diagnostic in _(...).
7569
7570 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7571
7572         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7573         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7574         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7575         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7576         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7577         updated automatically by ../config/srclist-update.  This changes
7578         their license from LPGL to GPL.
7579
7580 2003-07-14  Jim Meyering  <jim@meyering.net>
7581
7582         Don't emit diagnostics.  Let callers do that.
7583         * save-cwd.c: Don't include "error.h".
7584         (save_cwd): Don't call error.  Ensure that errno is valid
7585         when returning nonzero.
7586
7587         * save-cwd.h (restore_cwd): Update prototype.
7588         * save-cwd.c (restore_cwd): Remove two parameters.
7589         Simplify.  Don't call error upon failure.  Let callers do that.
7590         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7591         when auditing is enabled.  But don't bother updating the #if.
7592
7593 2003-07-14  Simon Josefsson  <jas@extundo.com>
7594
7595         * mempcpy.h: New file.
7596         * mempcpy.c: New file.
7597
7598 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7599
7600         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7601         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7602         unicodeio.c, unicodeio.h, unlocked-io.h:
7603         Switch from LGPL to GPL.
7604
7605 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7606
7607         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7608         it breaks C++ compilation.
7609         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7610
7611 2003-07-10  Jim Meyering  <jim@meyering.net>
7612
7613         * vasnprintf.c: Remove trailing blanks.
7614         Make cpp indentation consistent.
7615
7616 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7617
7618         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7619         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7620         Switch from LGPL to GPL.
7621
7622 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7623
7624         * mktime.c: Fix some boundary cases and remove need for floating point.
7625
7626         Issue a compile-time diagnostic if time_t is floating point, or if
7627         two's complement arithmetic is not in effect, or if arithmetic
7628         right shift does not propagate the sign.  These assumptions were
7629         all in the original code but they weren't checked.
7630
7631         (TIME_T_MIDPOINT, verify): New macros.
7632         (__isleap): Remove; it has integer overflow problems.
7633         (leapyear): New function, without those problems.
7634         (ydhms_tm_diff): Remove; splitting into two parts.
7635         (ydhms_diff): New function, containing the arithmetic part of
7636         the old ydhms_tm_diff function.  Issue a compile-time
7637         diagnostic if we are not using C99 integer division.
7638         Avoid casts when possible.
7639         (guess_time_tm): New function, containing the checking part of
7640         the old ydhms_tm_diff function.  Return the new value, rather than
7641         the difference between it and the old.  Accept a new argument T
7642         so that *T specifies the old value.  Check for overflow in the result.
7643
7644         (__mktime_internal): Use a time_t offset, not a long int offset.
7645         This undoes the 2003-06-04 change, which is no longer needed now
7646         that we have better overflow checking.
7647         (localtime_offset): Likewise.
7648
7649         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7650         and long are 64-bit but int is only 32-bit.
7651         (ydhms_diff): Use long int to store year1 and yday1.
7652         Issue a compile-time diagnostic if long int is not wide enough.
7653
7654         (__mktime_internal): Use long int to store adjusted year and yday.
7655         Use plain C rather than preprocessor commands, if that doesn't
7656         affect efficiency.
7657         Check for overflow (and try to repair) after each probe
7658         rather than checking only at the very end.  This avoids some bugs
7659         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7660         does not equal GMT offset at maximum time).
7661         Use integer to check for overflow rather than floating point; this
7662         is more portable to non-IEEE hosts, and is a tad faster.
7663         When we detect that we are oscillating between two values,
7664         don't check whether tm_isdst has the requested value, since
7665         we already know the answer.  When tm_isdst has the wrong value,
7666         use a different heuristic to find the right one, based on the
7667         extreme values actually observed in practice in tz2003a,
7668         rather than the (overly optimistic) "previous 3 calendar quarters".
7669
7670         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7671         "T const" to accommodate glibc style.
7672         (check_result): Use less-confusing report format.  "long" -> "long int.
7673         (main): Likewise.
7674         Don't loop if the iteration overflows time_t.
7675         Allow a negative step in the iteration.
7676
7677 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7678
7679         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7680         having it depend on HAVE_SYS_TYPES_H.
7681
7682 2003-06-25  Bruno Haible  <bruno@clisp.org>
7683
7684         * readlink.c: New file.
7685
7686 2003-06-20  Bruno Haible  <bruno@clisp.org>
7687
7688         Assume C89, so PARAMS isn't needed.
7689         * unicodeio.h (PARAMS): Remove.
7690         * unicodeio.c: Don't use PARAMS.
7691
7692 2003-06-18  Jim Meyering  <jim@meyering.net>
7693
7694         Merge changes from coreutils.
7695         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7696         Remove explicit declarations of xmalloc and realloc.
7697         Include xalloc.h.
7698         (read_utmp): Remove anachronistic cast of xmalloc.
7699
7700 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7701
7702         Assume C89, so PARAMS isn't needed.
7703         * backupfile.h (PARAMS): Remove.  All uses removed.
7704         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7705         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7706         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7707         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7708         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7709         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7710         xstrtol.h: Likewise.
7711         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7712         same.h, strverscmp.h: Do not include config.h; no longer needed.
7713         Anyway, config.h should always be included before any other file.
7714
7715 2003-06-11  Simon Josefsson  <jas@extundo.com>
7716
7717         * sysexit_.h: New file.
7718
7719 2003-05-20  Derek Price  <derek@ximbiot.com>
7720
7721         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7722
7723 2003-06-10  Simon Josefsson  <jas@extundo.com>
7724
7725         * strchrnul.h: New file.
7726         * strchrnul.c: New file.
7727
7728 2003-06-10  Simon Josefsson <jas@extundo.com>
7729
7730         * argp.h: New file, from glibc.
7731         * argp-ba.c: New file, from glibc.
7732         * argp-eexst.c: New file, from glibc.
7733         * argp-fmtstream.c: New file, from glibc.
7734         * argp-fmtstream.h: New file, from glibc.
7735         * argp-fs-xinl.c: New file, from glibc.
7736         * argp-help.c: New file, from glibc.
7737         * argp-namefrob.h: New file, from glibc.
7738         * argp-parse.c: New file, from glibc.
7739         * argp-pv.c: New file, from glibc.
7740         * argp-pvh.c: New file, from glibc.
7741         * argp-xinl.c: New file, from glibc.
7742
7743 2003-06-07  Jim Meyering  <jim@meyering.net>
7744
7745         * readtokens.h: Put `Free Software Foundation, Inc.'
7746         in place of my name in the copyright comment.
7747         Remove definition and uses of __P.
7748
7749         From coreutils.
7750         * stat.c: Don't declare xmalloc explicitly.
7751         Instead, include "xalloc.h".
7752         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7753         xrealloc, and xcalloc return values.
7754         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7755         Improve comment.
7756         * xgetcwd.h: Remove definition/uses of PARAMS.
7757
7758 2003-06-06  Jim Meyering  <jim@meyering.net>
7759
7760         * stdbool_.h: Renamed from stdbool.h.in.
7761
7762 2003-06-06  Jim Meyering  <jim@meyering.net>
7763
7764         Merge from coreutils.
7765         * same.c: (same_name): Declare *_basename locals to be `const'.
7766         Consolidate declarations and initializations of *_base* locals.
7767
7768         Merge from coreutils.
7769         This avoids a core dump on systems without GNU putenv,
7770         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7771         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7772         (unsetenv): New static function, from GNU libc.
7773         (rpl_putenv): Use it.
7774
7775         * modechange.c: Remove trailing blanks.
7776
7777         Merge from coreutils.
7778         * fsusage.c: Remove declaration of statfs.
7779         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7780
7781         * posixtm.c: Include <stdbool.h> unconditionally.
7782
7783 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7784
7785         * mktime.c (__mktime_internal): When resolving a tm_isdst
7786         mismatch, look in future quarters as well as past.  This fixes a
7787         bug when processing fall-backwards gaps immediately after a long
7788         period of daylight-saving time.
7789
7790         * mktime.c: Assume freestanding C89 or better.
7791         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7792         (__P): Remove; not used.
7793         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7794         (mktime, not_equal_tm, print_tm, check_result,
7795         main): Use prototypes.  Use const * where appropriate.
7796         (main): Fix typo in testing code that uncovered by above changes.
7797         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7798
7799 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7800
7801         * mktime.c: Fix Debian bug 177940
7802         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7803         (localtime_offset): Now long int, not time_t, because we want it
7804         to be guaranteed to be signed.  All uses changed.
7805         (__mktime_internal): If overflow would occur when adding offset,
7806         don't add it.
7807
7808         Merge 'human' changes from coreutils.  Rewrite to support
7809         locale-specific notations like thousands separators.
7810         * human.c: Simplify authorship notice.
7811         Include human.h immediately after config.h.
7812         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7813         <limits.h>: Do not include, since human.h does.
7814         (SIZE_MAX, UINTMAX_MAX): New macros.
7815         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7816         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7817         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7818         (power_letter): Renamed from suffixes.
7819         (generate_suffix_backwards): Remove.
7820         (adjust_value): Now takes int style (because of human.h changes)
7821         and long double value (for greater precision on some platforms).
7822         (group_number): New function.
7823         (human_readable): Use it.  Use integer options, not enum.
7824         Put the options before the sizes in the arg list.
7825         Support all the new options.
7826         The old human_readable function has been removed;
7827         use inttostr.h instead.
7828         (human_readable, default_block_size, humblock):
7829         Use uintmax_t, not int, for block sizes.
7830         (human_readable_inexact, block_size_types): Remove.
7831         (block_size_opts): New constant.
7832         (human_options): Renamed from human_block_size, with new signature
7833         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7834         * human.h: Add copyright and authorship notice.
7835         Include <limits.h> and <stdbool.h> unconditionally.
7836         (PARAMS): Remove.  All uses removed.
7837         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7838         (enum human_inexact_style): Remove tag; now a nameless enum.
7839         (human_floor, human_ceiling, human_round_to_even): Now have
7840         values 2, 0, 1 rather than -1, 1, 0.
7841         (human_group_digits, human_suppress_point_zero, human_autoscale,
7842         human_base_1024, human_SI, human_B): New constants.
7843         (human_readable_inexact, human_block_size): Remove.
7844         (human_readable): Size args are now uintmax_t, not int.
7845         (human_options): New decl.
7846
7847         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7848         unnecessary now that we assume C89 or better.  This change
7849         imported from coreutils.
7850
7851         * mktime.c (__mktime_internal): Do not reject negative timestamps
7852         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7853         in the 2003-05-30 sync from glibc.
7854
7855         .h files should stand alone, but we shouldn't include <sys/types.h>
7856         if we can get away with just <stddef.h>.
7857
7858         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7859         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7860         rather than <sys/types.h>, as we merely need size_t.
7861         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7862         to get size_t.
7863         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7864         Include <stdio.h>, to get FILE.
7865         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7866         memcasecmp.h has included <stddef.h> and all we need is size_t.
7867         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7868         our interface, instead of including <sys/types.h>
7869
7870 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7871
7872         [from coreutils]
7873         Fix some minor time-related bugs with POSIX time arguments.
7874         Some valid time stamps were being rejected (notably -1, and
7875         time stamps before 1900 on 64-bit hosts).  And some invalid
7876         time stamps were being accepted, e.g. September 31.
7877
7878         * posixtm.h (posixtime): Return bool instead of time_t, so
7879         that we can return (time_t) -1 successfully.
7880         * posixtm.c: Likewise.
7881         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7882         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7883         (t): Remove static var.
7884         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7885         of static var.  All uses changed.
7886         (year): Do not reject years before 1900; they can occur with
7887         64-bit time_t.
7888         (posix_time_parse): Do not check for out-of-range components;
7889         that is now the caller's responsibility, since our checks were
7890         only approximations.
7891         (posixtime): Use mktime to check for out-of-range components,
7892         since it knows them exactly.
7893         If mktime returns (time_t) -1, check whether an error actually occurred
7894         by invoking localtime on -1.
7895         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7896         posixtime failures better.
7897         Improve the test data (in comments only).
7898
7899 2003-05-30    <karl@gnu.org>
7900
7901         * mktime.c: update from libc.
7902
7903 2003-05-30  Bruno Haible  <bruno@clisp.org>
7904
7905         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7906         * localcharset.h: Likewise.
7907         * localcharset.c: Likewise.
7908
7909 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7910
7911         Assume the headers required for C89 freestanding compilers.
7912         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7913         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7914         without checking for HAVE_LIMITS_H.
7915         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7916         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7917         to do that.
7918         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7919         * exclude.c: Include <stdbool.h> unconditionally.
7920         * tempname.c: Include <stddef.h> unconditionally.
7921         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7922         * modechange.c, rpmatch.c (NULL): Don't define, since
7923         <stddef.h> does that.
7924         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7925         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7926         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7927         * xstrtol.c: Likewise.
7928         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7929         * savedir.c: Include <stddef.h> instead of defining NULL.
7930
7931         * addext.c (addext): Use assignment rather than cast, to avoid
7932         warnings on some platforms.
7933
7934         * mktime.c (__mktime_internal): Do not reject negative timestamps
7935         arbitrarily.
7936
7937 2003-05-10  Bruno Haible  <bruno@clisp.org>
7938
7939         * linebreak.c (iconv_string_length): Don't return -1 just because the
7940         string is longer than 4 KB.
7941
7942 2003-05-12  Jim Meyering  <jim@meyering.net>
7943
7944         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7945         the space-padded-by-default conversion specifiers, %e, %k, %l.
7946
7947 2003-05-03  Bruno Haible  <bruno@clisp.org>
7948
7949         Upgrade to Unicode-4.0.
7950         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7951         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7952         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7953         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7954         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7955         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7956         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7957         Change width of U+E0100..U+E01EF from 1 to 0.
7958
7959 2003-04-25  Bruno Haible  <bruno@clisp.org>
7960
7961         * copy-file.c: Include <stddef.h>, for size_t.
7962
7963 2003-04-25  Jim Meyering  <jim@meyering.net>
7964
7965         * copy-file.c (copy_file_preserving): Declare buf_size to be
7966         of type size_t, not int.
7967
7968 2003-04-11  Jim Meyering  <jim@meyering.net>
7969
7970         Merge changes from Coreutils.
7971
7972         2003-03-22  Jim Meyering  <jim@meyering.net>
7973
7974         * strftime.c (widen): Cast alloca return value to proper type.
7975
7976         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7977
7978         From GNU libc.
7979         * strftime.c (my_strftime): Handle very large width
7980         specifications for numeric values correctly.  Improve checks for
7981         overflow.
7982
7983         2003-01-19  Jim Meyering  <jim@meyering.net>
7984
7985         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7986         (nl_get_alt_digit) [! defined my_strftime]: Define.
7987         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7988         _nl_get_alt_digit and _nl_get_walt_digit.
7989
7990         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7991         These changes have no effect outside of _LIBC.
7992
7993 2003-04-10  Bruno Haible  <bruno@clisp.org>
7994
7995         * findprog.h: New file, from GNU gettext.
7996         * findprog.c: New file, from GNU gettext.
7997
7998 2003-04-05  Jim Meyering  <jim@meyering.net>
7999
8000         Merge changes from Coreutils.
8001
8002         * exclude.h (PARAMS): Remove definition and uses.
8003         * exclude.c: Remove uses of `PARAMS'.
8004
8005         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
8006         Add test-cases for DOS filenames. Declare program_name.
8007         (main): Set up program_name.  Patch by Rich Dawe.
8008
8009         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
8010         error from mntctl.
8011         Use mntctl's return value to drive the entry-processing loop, since
8012         we can't rely on the value of the vmt_length member in the last
8013         entry.  On some systems doing so could result in exhausting
8014         virtual memory.  Based in part on a patch from Mike Jetzer.
8015
8016 2003-04-04  Bruno Haible  <bruno@clisp.org>
8017
8018         * linebreak.h: New file, from GNU gettext.
8019         * linebreak.c: New file, from GNU gettext with slight modifications.
8020         * lbrkprop.h: New file, from GNU gettext.
8021
8022 2003-04-03  Bruno Haible  <bruno@clisp.org>
8023
8024         * utf8-ucs4.h: New file, from GNU gettext.
8025         * utf16-ucs4.h: New file, from GNU gettext.
8026         * ucs4-utf8.h: New file, from GNU gettext.
8027         * ucs4-utf16.h: New file, from GNU gettext.
8028
8029 2003-04-02  Bruno Haible  <bruno@clisp.org>
8030
8031         * binary-io.h: New file, from GNU gettext.
8032
8033 2003-04-01  Bruno Haible  <bruno@clisp.org>
8034
8035         * pathname.h: New file, from GNU gettext.
8036         * concatpath.c: New file, from GNU gettext.
8037
8038 2003-03-30  Bruno Haible  <bruno@clisp.org>
8039
8040         * copy-file.c (copy_file_preserving): Don't set owner if the function
8041         chown() doesn't exist.
8042
8043 2003-03-28  Bruno Haible  <bruno@clisp.org>
8044
8045         * copy-file.h: New file, from GNU gettext.
8046         * copy-file.c: New file, from GNU gettext.
8047
8048 2003-03-18  Jim Meyering  <jim@meyering.net>
8049
8050         * quote.c (quote_n): Fix typo in comment.
8051
8052 2003-03-14  Jim Meyering  <jim@meyering.net>
8053
8054         Merge changes from Coreutils.
8055         * obstack.h (obstack_object_size): Declare temporary, __o,
8056         to be const, in order to avoid warnings.
8057         (obstack_room): Likewise.
8058         (obstack_empty_p): Likewise.
8059
8060 2003-03-13  Paul Eggert  <eggert@twinsun.com>
8061
8062         Merge changes from Bison.
8063         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
8064         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8065         when compiling Bison 1.875's `bitset bset = obstack_alloc
8066         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
8067         * hash.c: Include <stdbool.h> unconditionally.
8068
8069 2003-03-09  Paul Eggert  <eggert@twinsun.com>
8070
8071         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
8072         Reported by Bruce Becker; see:
8073         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
8074
8075 2003-03-03  Paul Eggert  <eggert@twinsun.com>
8076             Bruno Haible  <bruno@clisp.org>
8077
8078         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
8079         Reported by John Hughes, see
8080         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
8081
8082 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
8083
8084         * poll_.h: New file.
8085         * poll.c: New file.
8086
8087 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
8088
8089         * mathl.h: New file.
8090         * acosl.c: New file.
8091         * asinl.c: New file.
8092         * atanl.c: New file.
8093         * ceill.c: New file.
8094         * cosl.c: New file.
8095         * expl.c: New file.
8096         * floorl.c: New file.
8097         * frexpl.c: New file.
8098         * ldexpl.c: New file.
8099         * logl.c: New file.
8100         * sincosl.c: New file.
8101         * sinl.c: New file.
8102         * sqrtl.c: New file.
8103         * tanl.c: New file.
8104         * trigl.c: New file.
8105         * trigl.h: New file.
8106
8107 2003-02-17  Bruno Haible  <bruno@clisp.org>
8108
8109         * mkdtemp.h: New file, from GNU gettext.
8110         * mkdtemp.c: New file, from GNU gettext.
8111
8112 2003-01-31  Bruno Haible  <bruno@clisp.org>
8113
8114         * rename.c: #undef rename before defining rpl_rename.
8115         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8116
8117 2003-01-30  Bruno Haible  <bruno@clisp.org>
8118
8119         * printf-args.h: New file, from GNU gettext.
8120         * printf-args.c: New file, from GNU gettext.
8121         * printf-parse.h: New file, from GNU gettext.
8122         * printf-parse.c: New file, from GNU gettext.
8123         * vasnprintf.h: New file, from GNU gettext.
8124         * vasnprintf.c: New file, from GNU gettext.
8125         * asnprintf.c: New file, from GNU gettext.
8126         * vasprintf.h: New file, from GNU gettext with modifications.
8127         * vasprintf.c: New file, from GNU gettext.
8128         * asprintf.c: New file, from GNU gettext.
8129
8130 2003-01-29  Bruno Haible  <bruno@clisp.org>
8131
8132         * stpncpy.h: New file, from GNU gettext with modifications.
8133         * stpncpy.c: New file, from GNU gettext with modifications.
8134
8135 2003-01-28  Bruno Haible  <bruno@clisp.org>
8136
8137         * c-ctype.h: New file, from GNU gettext, with changes suggested by
8138         Paul Eggert.
8139         * c-ctype.c: New file, from GNU gettext, with changes suggested by
8140         Paul Eggert.
8141
8142 2003-01-27  Bruno Haible  <bruno@clisp.org>
8143
8144         * xsetenv.h: New file, from GNU gettext.
8145         * xsetenv.c: New file, from GNU gettext.
8146
8147 2003-01-23  Bruno Haible  <bruno@clisp.org>
8148
8149         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8150
8151 2003-01-22  Bruno Haible  <bruno@clisp.org>
8152
8153         * exit.h: New file, from GNU gettext.
8154
8155 2003-01-11  Bruno Haible  <bruno@clisp.org>
8156
8157         * stpcpy.h (stpcpy): Use ANSI C function declarations.
8158         * strcase.h (strcasecmp, strncasecmp): Likewise.
8159
8160 2003-01-14  Jim Meyering  <jim@meyering.net>
8161
8162         * same.c (same_name): Tweak a comment.
8163
8164 2003-01-11  Bruno Haible  <bruno@clisp.org>
8165
8166         * same.c (same_name): Reorder tests so as to avoid calling stat()
8167         when a string comparison is sufficient.
8168
8169 2003-01-11  Bruno Haible  <bruno@clisp.org>
8170
8171         * readtokens.c (readtoken): Cast character to 'unsigned char', not
8172         'unsigned int'.
8173
8174 2003-01-11  Bruno Haible  <bruno@clisp.org>
8175
8176         * hash-pjw.c: Add comment about low quality of this function.
8177
8178 2003-01-12  Paul Eggert  <eggert@twinsun.com>
8179
8180         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8181         to avoid collisions with libcurses and libreadline.
8182
8183         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8184         * getstr.h, getstr.c: Remove.
8185         * getline.c: Include "getline.h", to check interface.
8186         Move body of old getstr.c here: this defines MIN_CHUNK and
8187         declares getdelim2, which is renamed from getstr.
8188         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8189
8190         * linebuffer.c (readlinebuffer): Renamed from readline.
8191         All uses changed.
8192         * linebuffer.h: Likewise.
8193         (readline): Remove backward-compatibility macro.
8194
8195 2003-01-12  Jim Meyering  <jim@meyering.net>
8196
8197         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
8198
8199 2003-01-10  Bruno Haible  <bruno@clisp.org>
8200
8201         * alloca_.h: New file.
8202         * getdate.y: Unconditionally include alloca.h.
8203         * makepath.c: Likewise.
8204         * setenv.c: Likewise.
8205         * userspec.c: Likewise.
8206
8207 2003-01-09  Bruno Haible  <bruno@clisp.org>
8208
8209         * stdbool.h.in: New file.
8210
8211 2003-01-08  Bruno Haible  <bruno@clisp.org>
8212
8213         * safe-read.c: Include specification header first, to ensure its
8214         selfcontainedness.
8215         * full-write.c: Likewise.
8216
8217 2003-01-08  Jim Meyering  <jim@meyering.net>
8218
8219         * full-write.c: Undefine and define-away `const' after inclusion
8220         of errno.h, not before.  Suggestion from Bruno Haible.
8221
8222 2003-01-07  Jim Meyering  <jim@meyering.net>
8223
8224         * full-write.c: Rework so that it may serve to define full_read, too.
8225         * full-read.c: Simply #define FULL_READ and include full-write.c.
8226
8227 2003-01-06  Jim Meyering  <jim@meyering.net>
8228
8229         * version-etc.c: Update year in translatable copyright string.
8230
8231 2002-12-25  Bruno Haible  <bruno@clisp.org>
8232
8233         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8234         * xstrtol.h: Likewise.
8235         * xstrtoimax.c: Likewise.
8236         * xstrtoumax.c: Likewise.
8237         * human.h: Likewise.
8238
8239         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8240         on systems that have <inttypes.h> but not <stdint.h>.
8241
8242 2002-12-31  Paul Eggert  <eggert@twinsun.com>
8243
8244         * memcoll.c (memcoll): Fall back on a simple algorithm using
8245         memcmp if strcoll doesn't work.
8246
8247 2002-12-23  Bruno Haible  <bruno@clisp.org>
8248
8249         * localcharset.h: New file.
8250         * localcharset.c: Include it.
8251         * unicodeio.c: Likewise.
8252
8253 2002-12-22  Bruno Haible  <bruno@clisp.org>
8254
8255         * utime.c (utime_null): No need to call ftruncate if the file was
8256         nonempty.
8257
8258 2002-12-23  Bruno Haible  <bruno@clisp.org>
8259
8260         * memcoll.c (STRCOLL): New macro.
8261         (memcoll): Use it.
8262
8263 2002-12-22  Bruno Haible  <bruno@clisp.org>
8264
8265         * getstr.h (getstr): Define, to avoid clash with libcurses.
8266         * linebuffer.h (readline): Define, to avoid clash with libreadline.
8267
8268 2002-12-22  Bruno Haible  <bruno@clisp.org>
8269
8270         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8271
8272 2002-12-23  Bruno Haible  <bruno@clisp.org>
8273
8274         * getline.h: Include <stddef.h>, for size_t.
8275
8276         * unicodeio.h: Include <stddef.h>, for size_t.
8277         * unicodeio.c: Don't include <stddef.h>.
8278
8279 2002-12-17  Bruno Haible  <bruno@clisp.org>
8280
8281         * canon-host.c (strdup): Remove unused declaration.
8282
8283         * fsusage.c: Include full_read.h.
8284         (get_fs_usage): Use full_read instead of safe_read.
8285
8286         * utime.c (utime_null): Use SAFE_READ_ERROR.
8287
8288 2002-12-11  Bruno Haible  <bruno@clisp.org>
8289
8290         * setenv.h: Rewritten to cope with systems that have setenv() but not
8291         unsetenv().
8292         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8293         modifications:
8294
8295         2002-12-11  Bruno Haible  <bruno@clisp.org>
8296
8297                 * setenv.c (alloca): Fall back to malloc.
8298                 (freea): New macro.
8299                 (setenv): Use freea() to free memory allocated with alloca().
8300
8301         2002-11-13  Bruno Haible  <bruno@clisp.org>
8302
8303                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8304                 function declarations.
8305                 * unsetenv.c (unsetenv): Likewise.
8306
8307         2002-03-04  Bruno Haible  <bruno@clisp.org>
8308
8309                 Portability to AIX 4.3.3.
8310                 * unsetenv.c: New file, extracted from setenv.c.
8311                 * setenv.c: Move the unsetenv() function to unsetenv.c.
8312
8313         2001-12-20  Bruno Haible  <bruno@clisp.org>
8314
8315                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8316                 use malloc instead. For SunOS 4.
8317
8318         2001-12-11  Bruno Haible  <bruno@clisp.org>
8319
8320                 * setenv.c: Declare alloca.
8321                 (compar_fn_t): New typedef.
8322                 (KNOWN_VALUE, STORE_VALUE): Use it.
8323
8324         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8325         setenv.h.
8326
8327 2002-12-10  Paul Eggert  <eggert@twinsun.com>
8328
8329         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8330         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8331         Choose values that are less likely to collide with system fnmatch
8332         options.
8333         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8334         defined (e.g., a pure POSIX system).
8335         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8336         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8337
8338 2002-12-06  Jim Meyering  <jim@meyering.net>
8339
8340         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8341
8342         Merge in changes from libc's misc/error.c, in preparation
8343         for the merge of gnulib's changes back into libc.
8344
8345         * error.c (_): Define only if not already defined.
8346         Move definition to follow all #include directives.
8347         Include unlocked-io.h only if !_LIBC.
8348         [_LIBC]: Include <libio/libioP.h>.
8349         [USE_IN_LIBIO]: Include <libio/iolibio.h>
8350         (fflush): Tweak definition to use INTUSE.
8351         (putc): Define.
8352
8353 2002-12-05  Paul Eggert  <eggert@twinsun.com>
8354
8355         * alloca.c [defined emacs]: Include "lisp.h".
8356         (xalloc_die) [defined emacs]: New macro.
8357         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8358         [! defined emacs]: Include <xalloc.h>.
8359         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8360         (pointer): Typedef to POINTER_TYPE *.
8361         (malloc): Remove decl; we now always use xmalloc.
8362         (alloca): Use old-style definition, since Emacs needs this.
8363         Check for arithmetic overflow when computing combined size.
8364
8365 2002-12-04  Paul Eggert  <eggert@twinsun.com>
8366
8367         Do not generate unlocked-io.h automatically, since it's easier to
8368         maintain it by hand.
8369
8370         * unlocked-io.h: New file, from GNU diffutils,
8371         but with proper copyright notice and attribution.
8372         * gen-uio: Remove.
8373         * Makefile.am: Add copyright notice.
8374         (libfetish_a_SOURCES): Add unlocked-io.h.
8375         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8376         (DISTCLEANFILES, io_functions): Remove macros.
8377         (EXTRA_DIST): Remove gen_uio.
8378         (unlocked-io.h): Remove rule.
8379
8380 2002-12-04  Jim Meyering  <jim@meyering.net>
8381
8382         Reflect the fact that stat.c and lstat.c are no longer generated.
8383         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8384         (DISTCLEANFILES): Likewise.
8385         (EXTRA_DIST): Likewise.
8386         (all_local): Don't depend on stat.c or lstat.c.
8387         (stat.c, lstat.c): Remove rules.
8388         (EXTRA_DIST): Remove xstat.in.
8389
8390         * xstat.in: Remove file.  Contents moved into stat.c.
8391         * stat.c: New file.  Contents mostly from xstat.in.
8392         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8393         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8394
8395         * safe-read.c: Rework so that it may serve to define safe_write, too.
8396         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8397
8398 2002-12-03  Jim Meyering  <jim@meyering.net>
8399
8400         * safe-read.c, safe-write.c: Change variable names and comments, but
8401         not semantics, to minimize the differences between these two files.
8402         (safe_read): Change comment to mention SAFE_READ_ERROR.
8403
8404         * safe-read.c (IS_EINTR): Define.
8405         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8406
8407 2002-12-02  Bruno Haible  <bruno@clisp.org>
8408
8409         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8410         Define, taken from safe-read.c.
8411         (INT_MAX): Provide fallback.
8412         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8413         * safe-write.h (SAFE_WRITE_ERROR): Define.
8414
8415         * safe-read.c (EINTR): Remove definition.
8416         (safe_read): Don't use EINTR if it is absent.
8417
8418 2002-12-02  Jim Meyering  <jim@meyering.net>
8419
8420         * safe-read.c (EINTR): Define.
8421         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8422         (INT_MAX): Provide fallback.
8423         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8424
8425         * safe-read.h (SAFE_READ_ERROR): Define.
8426
8427 2002-12-01  Jim Meyering  <jim@meyering.net>
8428
8429         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8430         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8431
8432 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8433
8434         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8435         hash_rehash): Replace `if (limit <= value) abort ();' with
8436         `if (! (value < limit)) abort ();', for readability.
8437
8438 2002-11-26    <karl@gnu.org>
8439
8440         * strdup.c: copy from libc again, with jim's ok.
8441         * .cppi-disable: re-add strdup.c
8442
8443 2002-11-25    <karl@gnu.org>
8444
8445         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8446         instead of "strtol.c".
8447
8448 2002-11-25  Jim Meyering  <jim@meyering.net>
8449
8450         * mktime.c: Sync from libc, now that it has the latest fix.
8451
8452 2002-11-24    <karl@gnu.org>
8453
8454         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8455         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8456
8457 2002-11-24  Jim Meyering  <jim@meyering.net>
8458
8459         Update from coreutils:
8460
8461         * mktime.c: Merge in changes from libc.
8462
8463         Avoid a link-time failure on some Linux systems.
8464         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8465         (__mon_yday): Declare with the STATIC attribute.
8466         (__mktime_internal): Likewise.
8467         Based on a report from Greg Schafer.
8468
8469 2002-11-23  Jim Meyering  <jim@meyering.net>
8470
8471         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8472         Use `unsigned', not `int', as type of index.
8473
8474         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8475
8476         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8477
8478 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8479
8480         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8481         hint that one should use `if (! x) abort ();' rather than `assert
8482         (x);', and anyway it's one less thing to worry about configuring.
8483         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8484         hash_rehash, hash_insert): Use abort rather than assert.
8485
8486 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8487
8488         * quotearg.h: Allow multiple inclusion by surrounding with
8489         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8490         so that we can be included first.
8491         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8492         * quotearg.c: Include quotearg.h immediately after config.h.
8493         No need to include stddef.h or sys/types.h any more.
8494         Surround local include files with "", not "<>".
8495         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8496         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8497         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8498         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8499         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8500         (ISPRINT): Remove; no longer needed now that we assume C89.
8501
8502         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8503         Preserve errno.
8504
8505         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8506         quotearg_char): Use SIZE_MAX rather than
8507         (size_t) -1 when we are talking about "infinity".
8508
8509         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8510
8511 2002-11-22  Bruno Haible  <bruno@clisp.org>
8512
8513         * safe-read.h: Assume C89. Add comments.
8514         (safe_read): Change return type to size_t.
8515         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8516         counts > SSIZE_MAX correctly.
8517         * safe-write.h: New file.
8518         * safe-write.c: New file.
8519         * full-read.h: New file.
8520         * full-read.c: New file.
8521         * full-write.h: Assume C89. Add comments.
8522         * full-write.c: Include safe-write.h.
8523         (full_write): Rewritten to use safe_write.
8524         Suggested by Jim Meyering and Paul Eggert.
8525
8526 2002-11-21  Bruno Haible  <bruno@clisp.org>
8527
8528         Remove case insensitive option matching.
8529         * argmatch.h (argcasematch): Remove declaration.
8530         (ARGCASEMATCH): Remove macro.
8531         (__xargmatch_internal): Remove case_sensitive argument.
8532         (XARGMATCH): Update.
8533         (XARGCASEMATCH): Remove macro.
8534         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8535         case_sensitive argument.
8536         (argcasematch): Remove function.
8537         (__xargmatch_internal): Remove case_sensitive argument.
8538         (main): Use XARGMATCH instead of XARGCASEMATCH.
8539
8540         * xmalloc.c: Change compile-time error message. Add comment about
8541         required autoconf version.
8542
8543 2002-11-21  Jim Meyering  <jim@meyering.net>
8544
8545         * strdup.c (strdup): Tweak comment and initial #if/#include.
8546
8547         Merge in changes from the coreutils.
8548
8549         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8550         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8551         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8552         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8553         int.  Work more efficiently if X is the same width as uintmax_t.
8554         Do not compare X to -1, to avoid bogus compiler warning.
8555         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8556         Don't assume that f_frsize and f_bsize are the same type.
8557
8558         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8559         on FreeBSD.
8560
8561         * makepath.c (make_path): Restore umask *before* creating the final
8562         component.
8563         (make_path): Minor reformatting.
8564
8565         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8566         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8567
8568         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8569         ones.  At least on GNU/Linux systems, `auto' means something else.
8570         From Michael Stone.
8571
8572 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8573
8574         Merge argmatch cleanups from Bison.  Assume C89.
8575
8576         * argmatch.c: Include config.h here, not in argmatch.h.
8577         Include stdlib.h, for EXIT_FAILURE.
8578         Always include <string.h>, since we assume C89.
8579         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8580         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8581         Include <stddef.h> instead, since it's all we need for size_t.
8582         (PARAMS): Remove.  All uses removed.
8583         (ARRAY_CARDINALITY): Do not bother to #undef.
8584         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8585         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8586         Remove unnecessary parentheses.
8587         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8588         Insert necessary parentheses.
8589         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8590         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8591
8592 2002-11-19  Bruno Haible  <bruno@clisp.org>
8593
8594         * mbswidth.c: Include mbswidth.h right at the beginning.
8595         * mbswidth.h: Include <stddef.h>, for size_t.
8596
8597         * mbswidth.h (PARAMS): Remove macro.
8598         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8599         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8600
8601         * gcd.h (PARAMS): Remove macro.
8602         (gcd): Use ANSI C function declarations.
8603         * gcd.c (gcd): Likewise.
8604
8605 2002-11-15  Bruno Haible  <bruno@clisp.org>
8606
8607         * strcspn.c: Include <stddef.h>.
8608         (strcspn): Use ANSI C function declaration. Change return type to
8609         size_t. Use NULL.
8610         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8611         (strpbrk): Use NULL.
8612         * strpbrk.h (PARAMS): Remove macro.
8613         (strpbrk): Use ANSI C function declaration.
8614         * strstr.c: Don't include <sys/types.h>.
8615         * strstr.h (PARAMS): Remove macro.
8616         (strstr): Use ANSI C function declarations.
8617
8618 2002-11-06  Bruno Haible  <bruno@clisp.org>
8619
8620         * gcd.h (gcd): Change argument type to 'unsigned long'.
8621         * gcd.c (gcd): Likewise.
8622
8623 2002-11-05  Bruno Haible  <bruno@clisp.org>
8624
8625         * gcd.h: New file, from gettext-0.11.5.
8626         * gcd.c: New file, from gettext-0.11.5.
8627
8628 2002-11-05  Bruno Haible  <bruno@clisp.org>
8629
8630         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8631         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8632         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8633         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8634
8635         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8636         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8637
8638         * closeout.c: Include gettext.h instead of <libintl.h>.
8639         * human.c: Include gettext.h instead of <libintl.h>.
8640         * quotearg.c: Include gettext.h instead of <libintl.h>.
8641         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8642         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8643         * userspec.c: Include gettext.h instead of <libintl.h>.
8644         * version-etc.c: Include gettext.h instead of <libintl.h>.
8645         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8646         (textdomain): Remove definition.
8647         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8648
8649         * long-options.c: Remove include of <libintl.h> and definition of _.
8650         * same.c: Remove include of <libintl.h> and definition of _.
8651
8652 2002-11-04  Bruno Haible  <bruno@clisp.org>
8653
8654         * stpcpy.h: New file, from GNU gettext-0.11.5.
8655         * strcase.h: New file, from GNU gettext-0.11.5.
8656         * strpbrk.h: New file, from GNU gettext-0.11.5.
8657         * strstr.h: New file, from GNU gettext-0.11.5.
8658         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8659
8660 2002-05-09  Bruno Haible  <bruno@clisp.org>
8661
8662         * config.charset: Update for newest glibc. Add canonical names
8663         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8664
8665 2002-05-09  Bruno Haible  <bruno@clisp.org>
8666
8667         * localcharset.c (get_charset_aliases): Add more Windows specific
8668         aliases.
8669
8670 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8671
8672         * config.charset: A few additions for Solaris.
8673
8674 2001-12-05  Bruno Haible  <bruno@clisp.org>
8675
8676         * localcharset.c (locale_charset): Don't return an empty string.
8677
8678 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8679
8680         * config.charset: msdos in uk_UA uses CP1125.
8681
8682 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8683
8684         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8685         * localcharset.c (locale_charset): Declare as extern "C".
8686
8687 2002-02-15  Bruno Haible  <bruno@clisp.org>
8688
8689         * config.charset [msdosdjgpp]: For Russian, use CP866.
8690
8691 2002-02-11  Bruno Haible  <bruno@clisp.org>
8692
8693         * config.charset: Add support for NetBSD.
8694
8695 2002-09-25    <karl@gnu.org>
8696
8697         * strdup.c: copy from libc/string (via ../config/srclist*).
8698         * getopt*: copy from libc/posix.
8699         * gettext.h: copy from gettext.
8700         * .cppi-disable: add strdup.c, gettext.h.
8701
8702 2002-07-01  Jim Meyering  <meyering@lucent.com>
8703
8704         * c-stack.c: Include sys/time.h.
8705         From Volker Borchert.
8706
8707 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8708
8709         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8710         New macro.  Use it uniformly instead of
8711         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8712         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8713         reported by Vin Shelton.
8714
8715 2002-06-22  Jim Meyering  <meyering@lucent.com>
8716
8717         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8718         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8719
8720 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8721
8722         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8723         Do not assume SA_SIGINFO behavior.
8724         Bug reported by Jim Meyering on NetBSD 1.5.2.
8725
8726 2002-06-22  Jim Meyering  <meyering@lucent.com>
8727
8728         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8729
8730         * exitfail.c, exitfail.h: Likewise.
8731         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8732
8733         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8734         of fnmatch.h.
8735         (EXTRA_DIST): Add fnmatch_loop.c.
8736         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8737
8738         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8739         * fnmatch.c: Update from diffutils-2.8.2.
8740         * fnmatch_.h: New file.  From diffutils-2.8.2.
8741         * fnmatch.h: Remove file.
8742
8743 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8744
8745         * file-type.h: Report an error if neither S_ISREG nor
8746         S_IFREG is defined, instead of using a test specific to glibc
8747         2.2.  This should be safe, since POSIX requires S_ISREG and
8748         Unix Version 7 had S_IFREG.  We don't need to check for
8749         <sys/types.h> since we don't use any symbols that it defines.
8750
8751 2002-06-15  Jim Meyering  <meyering@lucent.com>
8752
8753         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8754         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8755         have been included before this file.
8756
8757 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8758
8759         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8760         so that each temporary file name is unique and valid in the first
8761         8 characters, for operation under DOS.
8762
8763 2002-06-15  Jim Meyering  <meyering@lucent.com>
8764
8765         Work even with DJGPP 2.03, which lacks support for symlinks.
8766         From Richard Dawe.
8767         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8768         is defined.
8769         * lchown.c (S_ISLNK): Likewise.
8770
8771 2002-06-14  Jim Meyering  <meyering@lucent.com>
8772
8773         * file-type.h: Use the version from diffutils-2.8.2.
8774         * file-type.c: Likewise.
8775
8776 2002-05-27  Jim Meyering  <meyering@lucent.com>
8777
8778         Fix a problem seen only on nonconforming systems whereby ls.c's
8779         use of localtime, and then of gettimeofday would cause trouble:
8780         the localtime call used to initialize rpl_gettimeofday's save
8781         mechanism would clobber ls's current local time information so
8782         that in any long listing the first file would always be listed
8783         with date 1970-01-01.  Analysis by Volker Borchert.
8784
8785         * gettimeofday.c (localtime): Undefine.
8786         (rpl_localtime): New function.
8787
8788 2002-05-22  Jim Meyering  <meyering@lucent.com>
8789
8790         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8791         * file-type.h: New file.
8792         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8793
8794 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8795
8796         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8797
8798 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8799
8800         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8801         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8802         of 127, since 64 is the largest conceivable number for ancient
8803         nonstandard hosts.
8804         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8805
8806 2002-04-28  Jim Meyering  <meyering@lucent.com>
8807
8808         * sig2str.c (WTERMSIG): Remove definition (unused).
8809
8810 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8811
8812         * sig2str.h, sig2str.c: New files.
8813         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8814
8815 2002-04-24  Jim Meyering  <meyering@lucent.com>
8816
8817         * gettext.h: New file, from Gettext.
8818         * Makefile.am (INCLUDES): Remove -I../intl.
8819         (libfetish_a_SOURCES): Add gettext.h.
8820
8821 2002-04-16  Jim Meyering  <meyering@lucent.com>
8822
8823         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8824         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8825         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8826
8827 2002-04-12  Jim Meyering  <meyering@lucent.com>
8828
8829         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8830
8831 2002-03-10  Jim Meyering  <meyering@lucent.com>
8832
8833         * makepath.c (make_path): Remove a comma from a diagnostic.
8834         Suggestion from Santiago Vila.
8835
8836 2002-03-08  Jim Meyering  <meyering@lucent.com>
8837
8838         * rename.c: Mention that this wrapper is needed also on
8839         mips-dec-ultrix4.4 systems.
8840
8841 2002-03-02  Jim Meyering  <meyering@lucent.com>
8842
8843         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8844         not HAVE_CLOCK_SETTIME.
8845
8846 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8847
8848         * nanosleep.h: Rename to....
8849         * timespec.h: New name for nanosleep.h.  All uses changed.
8850
8851         * gettime.c: New file.
8852         * settime.c: New file.
8853         * stime.c: Remove.
8854
8855         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8856         timespec.h.  Remove nanosleep.h.
8857
8858 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8859
8860         * acl.c, acl.h: New files.
8861         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8862
8863 2002-02-24  Jim Meyering  <meyering@lucent.com>
8864
8865         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8866         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8867         cause trouble.  Reported by Nelson Beebe.
8868
8869 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8870
8871         * path-concat.c (xpath_concat): Reorder code to pacify
8872         compilers that don't know that xalloc_die never returns.
8873
8874 2002-02-20  Jim Meyering  <meyering@lucent.com>
8875
8876         * getdate.c: Regenerate using bison-1.33.
8877
8878 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8879
8880         * posixver.c, posixver.h: New files.
8881         * Makefile.am (libfetish_a_SOURCES): Add them.
8882
8883 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8884             Bruno Haible  <bruno@clisp.org>
8885
8886         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8887         (fwrite_success_callback): New declaration.
8888         * unicodeio.c (unicode_to_mb): New function, extracted from
8889         print_unicode_char. Call failure callback instead of error.
8890         (fwrite_success_callback): New function.
8891         (exit_failure_callback): New function.
8892         (fallback_failure_callback): New function.
8893         (print_unicode_char): Call unicode_to_mb.
8894
8895 2002-01-26  Jim Meyering  <meyering@lucent.com>
8896
8897         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8898
8899 2002-01-22  Jim Meyering  <meyering@lucent.com>
8900
8901         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8902         Otherwise, some versions of automake would omit the rule that makes
8903         Makefile from Makefile.in.
8904
8905 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8906
8907         * xmemcoll.h, xmemcoll.c: New files.
8908         * Makefile.am (libfetish_a_SOURCES): Add them.
8909         * memcoll.c: Include errno.h, and declare errno if not defined.
8910         (memcoll): Set errno to zero if there is no error.
8911
8912         * quotearg.c (quotearg_buffer_restyled):
8913         Fix bug with quoting buffers containing NUL when backslashing escapes.
8914         This bug was exposed by the other changes in this patch.
8915         (quotearg_n_options): New arg ARGSIZE.
8916         All callers changed.
8917         (quoting_options_from_style): New function.
8918         (quotearg_n_style): Use it.
8919         (quotearg_n_style_mem): New function.
8920
8921         * quotearg.h (quotearg_n_style_mem): New function.
8922
8923 2002-01-16  Jim Meyering  <meyering@lucent.com>
8924
8925         * getdate.y: Add three semicolons, each just before a closing brace.
8926         Bison (as of version 1.31) no longer papers over that mistake.
8927
8928 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8929
8930         * backupfile.c (ISDIGIT): Comment fix.
8931         * getdate.y (ISDIGIT): Likewise.
8932         * posixtm.c (ISDIGIT, year): Likewise.
8933         * strverscmp.c (ISDIGIT): Likewise.
8934         * userspec.c (ISDIGIT): Likewise.
8935
8936 2002-01-05  Jim Meyering  <meyering@lucent.com>
8937
8938         * version-etc.c (version_etc_copyright): Update copyright year.
8939
8940 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8941
8942         * closeout.c (close_stdout_status): If ferror (stdout), do
8943         not silently exit merely because the output buffer happens to
8944         have nothing pending.
8945
8946 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8947
8948         See the big note in ../ChangeLog.
8949         * human.c (suffixes): Prefer K to k for 1024.
8950         (generate_suffix_backwards): New function.
8951         (human_readable_inexact): Use it.
8952         * xstrtol.c (__xstrtol): If there is no number but there
8953         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8954         Accept 'K' as well as 'k'.
8955
8956 2001-12-15  Jim Meyering  <meyering@lucent.com>
8957
8958         * regex.h (__restrict_arr): Update from libc.
8959
8960         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8961         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8962         (STREQ): Define.
8963
8964 2001-12-10  Jim Meyering  <meyering@lucent.com>
8965
8966         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8967         Instead, include "xalloc.h".
8968         (initbuffer): Don't cast xmalloc return value to char*.
8969         (readline): Reword comment.
8970         Don't cast xrealloc return value to char*
8971         Return NULL, not 0.
8972
8973 2001-12-09  Jim Meyering  <meyering@lucent.com>
8974
8975         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8976         `signed and unsigned type in conditional expression'.
8977         * posixtm.c (posix_time_parse): Likewise.
8978
8979         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8980
8981         * readtokens.c (readtoken): Declare an index to be of type unsigned
8982         to avoid a pedantic warning.
8983
8984         * getstr.c: Don't include assert.h.
8985         (getstr): Remove warning-evoking assertions.
8986         Return -1 if offset parameter is out of bounds.
8987         Change the type of a local from int to size_t.
8988
8989         * strftime.c (my_strftime_localtime_r): Include this function
8990         definition in the `#if ! HAVE_TM_GMTOFF' block.
8991
8992         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8993         Include xalloc.h instead.
8994
8995 2001-12-02  Jim Meyering  <meyering@lucent.com>
8996
8997         * tempname.c: Don't declare getenv, thus reverting the change of
8998         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8999         included.
9000
9001         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
9002         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
9003
9004 2001-11-30  Akim Demaille  <akim@epita.fr>
9005
9006         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
9007         before being defined.
9008
9009 2001-11-27  Paul Eggert  <eggert@twinsun.com>
9010
9011         * quotearg.h (quotearg_n, quotearg_n_style):
9012         First arg is int, not unsigned.
9013         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
9014         (SIZE_MAX, UINT_MAX): New macros.
9015         (quotearg_n_options): Abort if N is negative.
9016         Avoid overflow check on hosts where size_t is 64 bits and int
9017         is 32 bits, as overflow is impossible there.
9018         Fix off-by-one typo that caused unnecessary reallocation.
9019
9020 2001-11-27  Jim Meyering  <meyering@lucent.com>
9021
9022         * tempname.c: Merge with version from libc.
9023         * regex.c: Likewise.
9024
9025         * tempname.c: Include stdlib.h unconditionally.  On some old systems
9026         for which STDC_HEADERS is 0, it was not included, resulting in a
9027         warning about an integer-to-pointer conversion problem with getenv.
9028         Reported by Volker Borchert.
9029
9030 2001-11-26  Jim Meyering  <meyering@lucent.com>
9031
9032         * gtod.h: Remove file.
9033         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
9034         * gettimeofday.c: Don't include gtod.h.
9035         (GTOD_init): Remove function.
9036         (rpl_gettimeofday): Do its job here instead, rather than aborting.
9037         Suggestion from Volker Borchert.
9038
9039 2001-11-23  Jim Meyering  <meyering@lucent.com>
9040
9041         * hash.h (struct hash_table): Don't define here.  Merely declare it.
9042         * hash.c (struct hash_table): Define it here instead.
9043
9044 2001-11-22  Jim Meyering  <meyering@lucent.com>
9045
9046         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
9047
9048 2001-11-18  Paul Eggert  <eggert@twinsun.com>
9049
9050         * tempname.c (TMP_MAX): Remove; no longer needed.
9051         (TEMPORARIES): New macro.
9052         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
9053         removes an artificial limitation (e.g. HP-UX 10.20, where
9054         TMP_MAX is 17576).
9055
9056 2001-11-18  Jim Meyering  <meyering@lucent.com>
9057
9058         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
9059         on SunOS 4.
9060
9061         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
9062         files will be created before anything else.
9063
9064 2001-11-17  Jim Meyering  <meyering@lucent.com>
9065
9066         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
9067         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
9068         rather than group writable.  Patch by Juan F. Codagnone.
9069
9070         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
9071         Instead, include "xalloc.h".
9072
9073         * mountlist.c: Include unlocked-io.h after all system headers.
9074         Remove explicit declarations of xmalloc, xrealloc,
9075         and xstrdup.  Instead, include "xalloc.h".
9076
9077         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
9078         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
9079         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
9080
9081         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
9082         Reported by Padraig Brady.
9083
9084         * mkstemp.c: #undef mkstemp.
9085         Include config.h.
9086         (rpl_mkstemp): Rename from mkstemp.
9087         Protoize.
9088
9089 2001-11-16  Jim Meyering  <meyering@lucent.com>
9090
9091         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
9092         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
9093         determine the amount of total physical memory, use pstat_getstatic.
9094         HPUX-11 doesn't define _SC_PHYS_PAGES.
9095         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
9096         If sysconf couldn't be used to determine the amount of available
9097         physical memory, use both pstat_getstatic and pstat_getdynamic.
9098         Based on a patch from Bob Proulx.
9099
9100 2001-11-05  Jim Meyering  <meyering@lucent.com>
9101
9102         * xstat.in (slash_aware_lstat): Correct a misleading comment.
9103
9104 2001-11-03  Jim Meyering  <meyering@lucent.com>
9105
9106         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9107         in argmatch_to_argument call.
9108
9109         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9110         argument.
9111
9112         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9113         e.g., a fault due to an attempt to free a NULL pointer.
9114
9115 2001-11-01  Jim Meyering  <meyering@lucent.com>
9116
9117         * dirfd.c, dirfd.h: New files.
9118         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9119
9120         * hash.c (hash_print) [TESTING]: Clean up.
9121
9122 2001-10-22  Paul Eggert  <eggert@twinsun.com>
9123
9124         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9125         to avoid a warning if -Wall.
9126
9127 2001-10-21  Paul Eggert  <eggert@twinsun.com>
9128
9129         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9130
9131 2001-10-21  Jim Meyering  <meyering@lucent.com>
9132
9133         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
9134         this code would end up calling gettext even in packages built
9135         with --disable-nls.
9136         * getopt.c (_): Likewise.
9137         * regex.c (_): Likewise.
9138
9139 2001-10-20  Paul Eggert  <eggert@twinsun.com>
9140
9141         * error.c (strerror_r): Do not declare unless !_LIBC.
9142         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9143         Use strerror_r that is only a macro, even if it is not a function.
9144         (strerror): Check for HAVE_DECL_STRERROR before declaring.
9145         (private_strerror): Use prototypes, not old-style function definition.
9146         (print_errno_message): New function.
9147         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9148         char*-flavored one.
9149         (error_tail, error, error_at_line): Use it.
9150
9151 2001-10-11  Jim Meyering  <meyering@lucent.com>
9152
9153         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9154         and quote_n (1, ... to avoid clobbering a buffer.
9155
9156 2001-10-05  Jim Meyering  <meyering@lucent.com>
9157
9158         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9159         * hash-pjw.c: New file (factored out of fileutils' remove.c).
9160         * hash-pjw.h: New file.
9161
9162 2001-09-30  Jim Meyering  <meyering@lucent.com>
9163
9164         * mountlist.c [MOUNTED_GETFSSTAT]:
9165         Include <sys/ucred.h>, for Apple Darwin.
9166         Include sys/mount.h and sys/fs_types.h only if available.
9167         (FS_TYPE): Define.
9168         (read_filesystem_list): Use FS_TYPE.
9169
9170 2001-09-29  Paul Eggert  <eggert@twinsun.com>
9171
9172         * exclude.c (excluded_filename): 0 -> false, since it's
9173         a boolean context.
9174
9175 2001-09-28  Paul Eggert  <eggert@twinsun.com>
9176
9177         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9178         #defines strtoimax.  Also treat the other strto* functions
9179         like strtoimax.
9180
9181         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9182         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9183         (strtoimax, strtoumax): Do not declare if already defined as a macro.
9184
9185 2001-09-26  Jim Meyering  <meyering@lucent.com>
9186
9187         Most macros in unlocked-io.h had the wrong number of arguments.
9188         * gen-uio: New script.
9189         (USE_UNLOCKED_IO): Define to 1 if not already defined.
9190         * unlocked-io.hin: Remove file.
9191         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9192         rather than trying to embed it here.
9193         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
9194         Reported by Padraig Brady.
9195
9196 2001-09-25  Volker Borchert  <bt@teknon.de>
9197
9198         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9199
9200 2001-09-23  Jim Meyering  <meyering@lucent.com>
9201
9202         * mountlist.c: Remove useless parentheses in #if directives.
9203         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9204         the deprecated MOUNTED symbol is no longer defined in mntent.h.
9205
9206 2001-09-22  Jim Meyering  <meyering@lucent.com>
9207
9208         * localcharset.c: Update from latest gettext.
9209         * config.charset: Likewise.
9210
9211 2001-09-20  Jim Meyering  <meyering@lucent.com>
9212
9213         * xstrtol.c (strtoimax): Guard declaration with
9214         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9215         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9216         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9217         (strtoumax): Likewise, for completeness (it wasn't necessary).
9218
9219 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9220
9221         * strtoimax.c (HAVE_LONG_LONG):
9222         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9223         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9224         to work around bug in IBM C compiler.
9225
9226 2001-09-16  Jim Meyering  <meyering@lucent.com>
9227
9228         * mkdir.c: New file.
9229
9230 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9231
9232         * xgetcwd.c: Revert some of the previous change; intead,
9233         fix the HAVE_GETCWD_NULL code to behave more like the
9234         !HAVE_GETCWD_NULL code used to.
9235
9236         Include "xalloc.h".
9237         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9238         invoke xalloc_die.
9239
9240 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9241
9242         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
9243         Use ssize_t, not int, to store result of readlink.
9244         Check for ssize_t overflow as well as size_t overflow,
9245         as POSIX says the result of readlink is implementation-defined
9246         when ssize_t overflows.
9247         Remove unnecessary cast to char*.
9248         Use free+malloc instead of realloc, as the storage doesn't need
9249         to be preserved and it's clearer and can be more efficient that way.
9250         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9251         * xreadlink.h (xreadlink): Update prototype.
9252
9253 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9254
9255         * exclude.c (fnmatch_no_wildcards): Fix confusion between
9256         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
9257         spotted by Jim Meyering.
9258
9259 2001-09-03  Jim Meyering  <meyering@lucent.com>
9260
9261         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9262
9263 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9264
9265         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9266         like the HAVE_GETCWD_NULL code.
9267         Include pathmax.h if not HAVE_GETCWD.
9268         Do not include xalloc.h.
9269         (INITIAL_BUFFER_SIZE): New symbol.
9270         Do not use xmalloc / xrealloc, since the caller is responsible for
9271         handling errors.  Preserve errno around `free' during failure.
9272         Do not overrun buffer when using getwd.
9273
9274 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9275
9276         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9277         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9278
9279 2001-09-02  Jim Meyering  <meyering@lucent.com>
9280
9281         * error.c: Update from GNU libc.
9282
9283 2001-09-01  Jim Meyering  <meyering@lucent.com>
9284
9285         * xreadlink.c: New file.
9286         * xreadlink.h: New file.
9287         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9288
9289         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9290         doesn't conflict with sparc Solaris 7's definition in
9291         /usr/include/sys/int_types.h.
9292
9293         * exclude.c: Use `""', not `<>' to #include non-system header files.
9294         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9295         and strncasecmp as r-values.  Unixware didn't have declarations.
9296
9297 2001-08-31  Jim Meyering  <meyering@lucent.com>
9298
9299         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9300         Use an initial, malloc'd, buffer of length 128 rather than
9301         a statically allocated one of length 1024.
9302
9303 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9304
9305         * xgetcwd.c: Don't include pathmax.h.
9306         Include stdlib.h and unistd.h if available.
9307         Include xalloc.h.
9308         (xmalloc, xstrdup, free): Remove decls.
9309         (xgetcwd): Don't assume sizes fit in unsigned.
9310         Check for overflow when computing sizes.
9311         Simplify reallocation code.
9312
9313 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9314
9315         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9316
9317         * strtoimax.c: Renamed from strtoxmax.c, removing the
9318         old strtoimax.c.
9319
9320         Also, make the following further changes to make this file's
9321         configuration more similar to that of strtol.c:
9322         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
9323         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9324         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9325         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9326         changed to signed values.
9327
9328         And make the following changes as well:
9329         Fix copyright notice, as 1999 was missing.
9330         (verify): New macro.
9331         (strtoimax): Check sizes at compile-time, not run-time.
9332         Prefer strtol to strtoll if both work.
9333         (main): Remove; it was not that useful and was a pain to maintain.
9334
9335         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9336
9337 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9338
9339         * savedir.c (savedir): Remove size parameter, as POSIX says that
9340         a directory's st_size can have an arbitrary value, so the old
9341         usage could waste an arbitrary amount of memory.  All uses
9342         changed.
9343         * savedir.h: Update prototype.
9344
9345 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9346
9347         * xstrtol.c (strtoimax): New decl.
9348
9349 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9350
9351         * xstrtol.h: Add copyright notice.
9352         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9353         LONGINT_INVALID_SUFFIX_CHAR.
9354
9355 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9356
9357         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9358         tm to be declared.
9359
9360 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9361
9362         * hash.c: Remove '2001' from copyright notice.
9363
9364 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9365
9366         * full-write.h: New file.
9367         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9368         * full-write.c: Correct credits, as cccp.c no longer
9369         exists and anyway it was so heavily changed from the old cccp
9370         code as to be unrecognizable.  Include full-write.h.
9371         (full_write) Return size_t, with short writes meaning failure.
9372         All callers changed.  This fixes a bug with large buffers
9373         on 64-bit hosts.
9374         * utime.c: Include full-write.h.
9375
9376 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9377
9378         Merge 'exclude' changes from tar 1.13.22.
9379         This fixes one or two unlikely storage allocation overflow bugs,
9380         but doesn't change user-visible behavior otherwise.
9381
9382 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9383
9384         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9385         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9386         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9387         Include if available.
9388         (<xalloc.h>): Include
9389         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9390         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9391         collide with FNM macros.
9392         (struct patopts): New struct.
9393         (struct exclude): Use it, as exclude patterns now come with options.
9394         (new_exclude): Support above changes.
9395         (new_exclude, add_exclude_file):
9396         Initial size must now be a power of two to simplify overflow checking.
9397         (free_exclude, fnmatch_no_wildcards): New function.
9398         (excluded_filename): No longer requires options arg, as the options
9399         are determined by add_exclude.  Now returns bool, not int.
9400         (excluded_filename, add_exclude):
9401         Add support for the fancy new exclusion options.
9402         (add_exclude, add_exclude_file): Now takes int options arg.
9403         Check for arithmetic overflow when computing sizes.
9404         (add_exclude_file): xrealloc might modify errno, so don't
9405         realloc until after errno might be used.
9406
9407         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9408         New macros.
9409         (free_exclude): New decl.
9410         (add_exclude, add_exclude_file): Now takes int options arg.
9411         (excluded_filename): No longer requires options arg, as the options
9412         are determined by add_exclude.  Now returns bool, not int.
9413
9414 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9415
9416         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9417
9418 2001-08-27  Jim Meyering  <meyering@lucent.com>
9419
9420         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9421
9422         * version-etc.c (N_): Remove definition.
9423         Revert most of last change.
9424         Instead, simply don't mark the `Copyright...' string for translation.
9425         Based on advice from Paul Eggert.
9426
9427         * strtoxmax.c: Tweak comment.
9428
9429 2001-08-26  Jim Meyering  <meyering@lucent.com>
9430
9431         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9432         of copyright with `%s' so translators don't get an untranslated
9433         message in 2002.
9434         (COPYRIGHT_YEAR): Define.
9435         (version_etc): Use fprintf rather than fputs.
9436         Suggestion from Ulrich Drepper.
9437
9438         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9439
9440         * strtoll.c: New file, from GNU libc.
9441         * xstrtoimax.c: New file.
9442
9443         * xstrtol.h: Add xstrtoimax.
9444         * strtoumax.c: New file.  Simply include "strtoumax.c".
9445         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9446
9447         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9448         * strtoxmax.c: ... then renamed to this.
9449
9450 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9451
9452         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9453         Port to Solaris 8, where 'sed' requires a space after the 'r'
9454         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9455         Redirect output to $tmp just once.
9456
9457 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9458
9459         * addext.c (<errno.h>): Include.
9460         (errno): Declare if not defined.
9461         (addext): Work correctly when pathconf returns -1 and leaves
9462         errno alone because there is no limit.  Also, work even if
9463         pathconf returns a value greater than SIZE_MAX.
9464
9465 2001-08-12  Jim Meyering  <meyering@lucent.com>
9466
9467         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9468         Simply `return getcwd (NULL, 0);'.
9469         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9470         Use 1300 as initial value for length, not PATH_MAX.
9471
9472         * pathmax.h: Clean up cpp syntax.
9473
9474 2001-08-12  Jim Meyering  <meyering@lucent.com>
9475
9476         * gettimeofday.c: New file.
9477         * gtod.h: New file.
9478         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9479
9480 2001-08-04  Jim Meyering  <meyering@lucent.com>
9481
9482         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9483         to get in sync with glibc.
9484
9485 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9486
9487         The following changes are from gettext 0.10.39 as maintained by
9488         Bruno Haible.
9489
9490         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9491         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9492         with inverted sense.  All uses changed.
9493
9494         * mbswidth.c: Don't include <limits.h>.
9495         Include <stdlib.h> and <string.h> unconditionally.
9496         (iswcntrl, mbsinit, ISCNTRL): New macros.
9497         (mbsnwidth): Use K&R style function declarations.
9498         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9499         can optimize it when MB_CUR_MAX == 1.
9500         The width of control characters is zero, not 1.
9501
9502 2001-07-15  Jim Meyering  <meyering@lucent.com>
9503
9504         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9505         (BUILT_SOURCES): Add unlocked-io.h.
9506         (io_functions): Define.
9507         (unlocked-io.h): New rule.
9508         (DISTCLEANFILES): Add unlocked-io.h.
9509         (all-local): Depend on unlocked-io.h, to ensure it is created.
9510
9511         * unlocked-io.hin: New file
9512
9513         * regex.c: Update from glibc.
9514
9515 2001-07-05  Jim Meyering  <meyering@lucent.com>
9516
9517         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9518         recommendation.
9519         (libfetish_a_SOURCES): Put all .h files here instead.
9520         Remove a thus-exposed (better checks in automake) duplicate and
9521         two unnecessary .h files.
9522
9523 2001-06-11  Jim Meyering  <meyering@lucent.com>
9524
9525         * regex.c: Update from GNU libc.
9526
9527 2001-05-27  Jim Meyering  <meyering@lucent.com>
9528
9529         * readutmp.h (UT_TYPE): Define.
9530
9531 2001-05-24  Jim Meyering  <meyering@lucent.com>
9532
9533         * argmatch.c: Include "quote.h".
9534         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9535         quote function.  Reported by Göran Uddeborg.
9536
9537 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9538
9539         * dirname.c (dir_name): Compute append_dot using path, not newpath
9540         which is not yet declared.
9541
9542 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9543
9544         * Makefile.am (libfetish_a_SOURCES):
9545         Add strftime.c, since we now compile it on all hosts.
9546
9547         * strftime.c (my_strftime):
9548         Define to nstrftime if emacs, but only if my_strftime is not defined.
9549         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9550         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9551         Add one more extra argument: a nanoseconds value.
9552         All uses changed.
9553         (ns): New macro.
9554         (my_strftime function): Add %N format.
9555         (emacs_strftimeu): Renamed from emacs_strftime,
9556         with extra ut argument.
9557
9558 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9559
9560         dirname code cleanup.  base_name now behaves more compatibly
9561         with POSIX basename when given file names that have trailing
9562         slashes, and similarly for dir_name.  Add new primitives
9563         base_len and dir_len.  Put the directory-name-related decls
9564         into dirname.h.
9565
9566         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9567         * backupfile.c (base_name): Likewise.
9568         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9569         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9570         * makepath.c (strip_trailing_slashes): Likewise.
9571         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9572         Likewise.
9573         * rename.c (strip_trailing_slashes): Likewise.
9574         * same.c (base_name): Likewise.
9575         * stripslash.c (ISSLASH): Likewise.
9576
9577         * addext.c: Include <dirname.h> after size_t is defined.
9578         * backupfile.c: Likewise.
9579
9580         * addext.c (addext): Use base_len to trim redundant
9581         trailing slashes instead of doing it ourselves.
9582         But do not trim the last slash if it is not redundant.
9583
9584         * backupfile.c (find_backup_file_name,
9585         max_backup_version): Use base_len instead of rolling it ourselves.
9586         Handle the case of "" and (on DOS) "C:" correctly.
9587
9588         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9589         Include <string.h>, <dirname.h>.
9590         (base_name): Allow file names ending in slashes, other than names
9591         that are all slashes.  In this case, return the basename followed
9592         by the slashes.  This is more general, and can be used in places
9593         where the original base_name purposely had an assertion failure.
9594         (base_len): New function.
9595
9596         * dirname.c: Include <string.h> instead of <stdlib.h>.
9597         Do not include <assert.h>; no longer needed.
9598         Include xalloc.h.
9599         (memrchr): Remove decl.
9600         (dir_name_r): Remove.
9601         (dir_len): Renamed from dirlen.  All callers changed.
9602         Rewrite in terms of base_name, for simplicity and consistency.
9603         (dir_name): Never return NULL.  All callers changed.
9604         Do not include <stdlib.h> in test program; no longer needed.
9605         return 0; is fine for test program.
9606
9607         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9608         New macros.
9609         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9610
9611         * path-concat.c (path_concat): Use base_len to compute
9612         base length, not strlen; this means we cannot rely on memcpy
9613         to null-terminate.
9614
9615         * same.c (STREQ): Remove.
9616         (same_name): Handle the case where the basename ends in trailing '/'.
9617
9618         * stripslash.c (strip_trailing_slashes): Return nonzero if
9619         a slash was stripped.  Do not strip the last slash after a
9620         file system prefix.
9621
9622 2001-04-08  Jim Meyering  <meyering@lucent.com>
9623
9624         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9625         recomputed; that's necessary when the offset spans a DST transition.
9626         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9627
9628 2001-04-02  Jim Meyering  <meyering@lucent.com>
9629
9630         * regex.h, regex.c: Update from GNU libc.
9631
9632 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9633
9634         * version-etc.c (version_etc_copyright): Update to 2001.
9635
9636 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9637
9638         * tempname.c (uint64_t): Define to uintmax_t if
9639         not defined, and if UINT64_MAX is not defined.
9640         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9641         Reported by John David Anglin.
9642
9643 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9644
9645         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9646         alias if codeset is empty.
9647         * config.charset (BeOS): Use wildcard syntax.
9648
9649 2001-03-13  Jim Meyering  <meyering@lucent.com>
9650
9651         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9652         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9653         From Bruno Haible.
9654
9655 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9656
9657         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9658         Don't return NULL.
9659         * unicodeio.c (print_unicode_char): Simplify accordingly.
9660
9661 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9662
9663         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9664         support for DOS/DJGPP.
9665
9666 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9667
9668         * Makefile.am (libfetish_a_SOURCES):
9669         Add dup-safer.c, fopen-safer.c.
9670         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9671
9672         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9673
9674 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9675
9676         The mkstemp replacement is taken from glibc 2.2.2, with some
9677         portability fixes for use outside glibc, as follows:
9678
9679         * tempname.c (struct_stat64): New macro.
9680         (direxists, __gen_tempname): Use it.
9681         This avoids a portability problem with Solaris 8.
9682
9683         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9684         (<stddef.h>, <stdint.h>, <string.h>):
9685         Include only if STDC_HEADERS || _LIBC.
9686         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9687         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9688         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9689         (__set_errno): Define this macro if <errno.h> doesn't.
9690         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9691         Define these macros if <stdio.h> doesn't.
9692         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9693         Define these macros if <sys/stat.h>
9694         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9695         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9696         __xstat64): Define if not _LIBC.
9697         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9698         (__gen_tempname): Invoke gettimeofday only if
9699         HAVE_GETTIMEOFDAY || _LIBC;
9700         otherwise, fall back on plain "time".
9701         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9702
9703         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9704
9705         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9706
9707 2001-02-17  Jim Meyering  <meyering@lucent.com>
9708
9709         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9710         around included file name.
9711
9712         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9713
9714         * strftime.c: Update from GNU libc (the only changes were to comments).
9715
9716 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9717
9718         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9719
9720 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9721
9722         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9723         Remove workaround macros for hosts that have mbrtowc but not
9724         mbstate_t, as we now insist on proper declarations for both
9725         before using mbrtowc.
9726
9727 2001-02-17  Jim Meyering  <meyering@lucent.com>
9728
9729         * regex.c: Update from libc.
9730
9731 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9732
9733         * alloca.c (malloc): Undef before defining, since stdlib.h
9734         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9735         Reported by Mark Hounschell via Paul Eggert.
9736
9737 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9738
9739         * config.charset: Update for FreeBSD 4.2.
9740
9741 2001-01-26  Jim Meyering  <meyering@lucent.com>
9742
9743         * quotearg.c: Include stddef.h.
9744         * quote.c: Include stddef.h.
9745         Reported by Axel Kittenberger.
9746
9747         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9748         line in double quotes so that it evokes a better diagnostic.
9749         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9750         Reported by Axel Kittenberger.
9751
9752 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9753
9754         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9755         to avoid a warning.  Add back 'const' to inptr.
9756
9757 2001-01-16  Jim Meyering  <meyering@lucent.com>
9758
9759         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9760         From Bruno Haible.
9761
9762 2001-01-14  Jim Meyering  <meyering@lucent.com>
9763
9764         * rename.c: New file.  From Volker Borchert.
9765         Include stdlib.h, string.h or strings.h, and xalloc.h.
9766         Use strip_trailing_slashes rather than open-coding it.
9767
9768 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9769
9770         * strftime.c: Sync with glibc time/strftime.c 1.81.
9771
9772 2001-01-03  Jim Meyering  <meyering@lucent.com>
9773
9774         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9775         local `inptr' to avoid warning with some system declarations of iconv.
9776
9777 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9778
9779         * modechange.c: Do not assume that mode_t uses the
9780         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9781         the other-execute bit of FOO even if S_IXOTH != 1.
9782
9783         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9784         WOTH, XOTH, ALLM): New macros.
9785         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9786          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9787         Use them.
9788         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9789         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9790         (mode_compile):
9791         No need to use uintmax_t; unsigned long is long enough.
9792         Don't bother to get suffix since we don't use it.
9793
9794 2000-12-24  Jim Meyering  <meyering@lucent.com>
9795
9796         * hash.c (is_prime): Return explicit boolean values.
9797         (hash_get_first): Return NULL to appease Irix5.6's 89.
9798         Reported by Nelson Beebe.
9799
9800 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9801
9802         * localcharset.c (locale_charset): Add support for Win32.
9803
9804 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9805
9806         * physmem.h, physmem.c: New files.
9807
9808         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9809         (noinst_HEADERS): Add physmem.h.
9810
9811         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9812         't' for compatibility with Solaris 8 sort.
9813
9814 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9815
9816         * config.charset: Add support for BeOS.
9817
9818 2000-12-16  Jim Meyering  <meyering@lucent.com>
9819
9820         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9821         SHELLS_FILE to a file name that's useful on djgpp systems.
9822         Include stdlib.h.
9823         (ADDITIONAL_DEFAULT_SHELLS): Define.
9824         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9825         Based mostly on a patch from Prashant TR.
9826
9827 2000-12-16  Jim Meyering  <meyering@lucent.com>
9828
9829         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9830         N and M) would have treated it like `chown N:N FILE'.
9831
9832         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9833
9834 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9835
9836         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9837         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9838         to the list of canonical encodings. Rename EUC-CN to GB2312.
9839
9840 2000-12-08  Andreas Schwab  <schwab@suse.de>
9841
9842         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9843         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9844
9845 2000-12-07  Jim Meyering  <meyering@lucent.com>
9846
9847         * stripslash.c (ISSLASH): Define.
9848         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9849         From Prashant TR.
9850
9851         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9852         (dir_name_r): Declare this function as static.
9853         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9854         manifest itself on a name containing a mix of slashes and
9855         backslashes.
9856         Make this function work with names starting with a DOS-style
9857         drive letter and colon prefix.
9858         (dir_name): Append `.' if necessary.
9859         Based mostly on patches from Prashant TR and Eli Zaretskii.
9860
9861         * dirname.h (dir_name_r): Remove prototype.
9862
9863 2000-12-05  Jim Meyering  <meyering@lucent.com>
9864
9865         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9866
9867 2000-12-04  Jim Meyering  <meyering@lucent.com>
9868
9869         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9870         Also include memory.h, stdlib.h, unistd.h if appropriate.
9871         Reported by Andreas Jaeger (conflicting declaration of malloc).
9872
9873 2000-12-02  Jim Meyering  <meyering@lucent.com>
9874
9875         * closeout.h: Make idempotent, to avoid some obscure warnings.
9876
9877 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9878
9879         * memrchr.c: Include <config.h> before any system include file.
9880
9881 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9882
9883         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9884
9885 2000-11-26  Jim Meyering  <meyering@lucent.com>
9886
9887         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9888
9889 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9890
9891         * strftime.c (my_strftime): Do not invoke mbrlen with a
9892         size of (size_t) -1; it's not portable.
9893
9894 2000-11-17  Akim Demaille  <akim@epita.fr>
9895
9896         * obstack.h: Formatting changes.
9897         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9898         prevent type checking.
9899         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9900         cast the value to (void *): assigning a `foo *' to a `void *'
9901         variable is valid.
9902         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9903
9904 2000-11-17  Jim Meyering  <meyering@lucent.com>
9905
9906         * strstr.c: Update from GNU libc.
9907
9908 2000-11-16  Jim Meyering  <meyering@lucent.com>
9909
9910         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9911
9912 2000-11-11  Jim Meyering  <meyering@lucent.com>
9913
9914         * error.c: Add a couple #includes, merging from GNU libc version.
9915
9916 2000-11-10  Jim Meyering  <meyering@lucent.com>
9917
9918         * obstack.h: Update from GNU libc.
9919         * obstack.c: Likewise.
9920
9921 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9922
9923         * getusershell.c (setusershell): Use rewind rather than
9924         fseek/fseeko, to avoid configuration hassles with fseeko.
9925         Don't bother opening SHELLS_FILE if shellstream is NULL;
9926         it's not necessary.
9927
9928 2000-11-05  Jim Meyering  <meyering@lucent.com>
9929
9930         * makepath.h (make_dir): Declare.
9931         * makepath.c (make_dir): Remove `static' attribute.
9932         Tweak a comment.
9933
9934 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9935
9936         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9937         last one in a bucket, advance to the next bucket.
9938
9939 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9940
9941         * fnmatch.c: Do not comment out all the code if we are using
9942         the GNU C library, because in some cases we are replacing buggy
9943         code in the GNU C library itself.
9944
9945 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9946
9947         * error.h, getline.h, modechange.h:
9948         Remove "2000" from Copyright line, as the file hasn't been
9949         changed this year other than in the copyright notice.
9950
9951         * xalloc.h: Add "2000" to Copyright line, as this file
9952         was changed this year.
9953
9954 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9955
9956         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9957         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9958         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9959
9960 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9961
9962         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9963         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9964         doesn't define __restrict_arr.
9965
9966 2000-10-29  Jim Meyering  <meyering@lucent.com>
9967
9968         * xstat.in: Fix grammar in comment.
9969
9970 2000-10-28  Jim Meyering  <meyering@lucent.com>
9971
9972         * memchr.c: Update from libc.
9973         Adjust for portability:
9974         [HAVE_STDLIB_H]: Include stdlib.h.
9975         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9976         Undef __memchr, too.
9977         [!weak_alias]: Define __memchr to memchr.
9978
9979         * regex.c: Update from libc.
9980         * regex.h: Likewise.
9981         * getopt1.c: Likewise.
9982         * memcmp.c: Likewise.
9983
9984         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9985         Avoid using fseek, when possible -- it's broken by design.
9986         Patch by Ulrich Drepper.
9987
9988 2000-10-26  Jim Meyering  <meyering@lucent.com>
9989
9990         * strftime.c: Update from libc.
9991
9992 2000-10-25  Jim Meyering  <meyering@lucent.com>
9993
9994         * obstack.c: Update from libc.
9995
9996 2000-10-23  Jim Meyering  <meyering@lucent.com>
9997
9998         * hard-locale.c (hard_locale): Revert last change -- it was simply
9999         wrong.  That set_locale call must not have any side effects.
10000         From Paul Eggert.
10001
10002 2000-10-22  Jim Meyering  <meyering@lucent.com>
10003
10004         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
10005         [CYCLIC]: Remove now-unused definition.
10006
10007         * save-cwd.c (O_DIRECTORY): Define, if needed.
10008         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
10009         Suggestion from Ulrich Drepper.
10010
10011 2000-10-21  Jim Meyering  <meyering@lucent.com>
10012
10013         * dirname.c (dir_name_r): New function, factored out of dir_name.
10014         (dir_name): Use dir_name_r.
10015         * dirname.h (dir_name_r): Declare it.
10016
10017 2000-10-21  Jim Meyering  <meyering@lucent.com>
10018
10019         * dirname.c (memrchr): Declare if necessary.
10020         (dir_name): Remove the restriction that there be no
10021         trailing slashes.  Now, this code skips past them, effectively
10022         ignoring them.
10023         [TEST_DIRNAME] (main): New unit tests.
10024
10025         * memrchr.c: New file from GNU libc.
10026         Undef __memrchr, too.
10027         [!weak_alias]: Define __memrchr to memrchr.
10028         Guard weak_alias use with `#ifdef weak_alias'.
10029
10030 2000-10-17  Jim Meyering  <meyering@lucent.com>
10031
10032         * quote.h (PARAMS): Define and use.
10033         Reported by Akim Demaille.
10034
10035         * getopt.c: Update from libc.
10036
10037 2000-10-16  Jim Meyering  <meyering@lucent.com>
10038
10039         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
10040         From Jan Fedak.
10041
10042 2000-09-25  Jim Meyering  <meyering@lucent.com>
10043
10044         * md5.h (rol): Define (from GnuPG).
10045
10046         * sha.c: Give credit (GnuPG) where due.
10047         (M): Use rol rather than open-coding it.
10048         Add a FIXME comment.
10049
10050 2000-09-21  Jim Meyering  <meyering@lucent.com>
10051
10052         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
10053         Reported by Michael Stone.
10054
10055 2000-09-20  Jim Meyering  <meyering@lucent.com>
10056
10057         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
10058         (noinst_HEADERS): Add sha.h.
10059         Based on code from Scott G. Miller and from GnuPG.
10060
10061 2000-09-15  Jim Meyering  <meyering@lucent.com>
10062
10063         * regex.c: Update from libc.
10064
10065 2000-09-10  Jim Meyering  <meyering@lucent.com>
10066
10067         * getopt.c (_getopt_internal): Update from glibc.
10068
10069 2000-09-09  Jim Meyering  <meyering@lucent.com>
10070
10071         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
10072         think it should be used as a general replacement for isascii.
10073         * fnmatch.c: Likewise.
10074         * mbswidth.c: Likewise
10075         * regex.c: Likewise.
10076
10077         Don't use atoi.
10078         * userspec.c: Include sys/param.h and limits.h.
10079         Include xstrtol.h.
10080         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
10081         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
10082         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
10083         UID, GID.  Check range.
10084
10085 2000-09-06  Jim Meyering  <meyering@lucent.com>
10086
10087         * getopt.c (_getopt_internal): Update from glibc.
10088
10089 2000-08-30  Jim Meyering  <meyering@lucent.com>
10090
10091         * strftime.c: Merge in changes from GNU libc.
10092
10093 2000-08-26  Jim Meyering  <meyering@lucent.com>
10094
10095         * closeout.c: Include "__fpending.h".
10096         (close_stdout_status): Return right away if there's nothing to flush.
10097
10098         * Makefile.am (noinst_HEADERS): Add __fpending.h.
10099         * __fpending.c: New file.
10100         * __fpending.h: New file.
10101
10102 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10103
10104         Standardize on "memory exhausted" instead of "Memory exhausted"
10105         or "virtual memory exhausted".
10106         * obstack.c (print_and_abort): Use "memory exhausted", not
10107         "virtual memory exhausted".
10108         * same.c (same_name): Invoke xalloc_die instead of printing
10109         our own message.
10110         * userspec.c (parse_user_spec): Likewise.
10111         * bumpalloc.h: comment fix
10112         * same.c, userspec.c: Include xalloc.h.
10113
10114         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10115         not char *const and pointing to a constant array.
10116         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10117         (xrealloc): Comment fix.
10118
10119         * userspec.c (parse_user_spec):
10120         Don't translate a message until just before returning,
10121         to avoid unnecessary translation.
10122
10123 2000-08-07  Jim Meyering  <meyering@lucent.com>
10124
10125         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10126         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10127         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10128         getgroups.c, gethostname.c, getopt.h, group-member.c,
10129         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10130         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10131         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10132         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10133         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10134         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10135         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10136         yesno.c: Back out Copyright date changes for each file with no change
10137         this year.  This eases coordination with other programs using the same
10138         source code modules.  From Paul Eggert.
10139
10140 2000-08-03  Greg McGary  <greg@mcgary.org>
10141
10142         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10143         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10144         (EXTEND_BUFFER): Use them.
10145
10146 2000-08-01  Jim Meyering  <meyering@lucent.com>
10147
10148         * dirname.c (ISSLASH): Define.
10149         (BACKSLASH_IS_PATH_SEPARATOR): Define.
10150         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10151         both `\' and `/' may be use as path separators.
10152         Based on a patch from Prashant TR.
10153
10154 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10155
10156         * quotearg.c (quotearg_n_options): Don't make the initial
10157         slot vector a constant, since it might get modified.
10158
10159 2000-07-31  Jim Meyering  <meyering@lucent.com>
10160
10161         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10162         * obstack.c (print_and_abort): Likewise.
10163
10164 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10165
10166         * quotearg.c (quotearg_n_options): Preallocate a slot 0
10167         buffer, so that the caller can always quote one small
10168         component of a "memory exhausted" message in slot 0.
10169         From a suggestion by Jim Meyering.
10170
10171 2000-07-30  Jim Meyering  <meyering@lucent.com>
10172
10173         * makepath.c (make_path): Quote the other instance, too.
10174
10175         * quotearg.c (N_STATIC_SLOTVECS): Define.
10176         (STATIC_BUF_SIZE): Define.
10177         (quotearg_n_options): Use only statically allocated storage when
10178         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10179         than STATIC_BUF_SIZE.
10180
10181 2000-07-29  Jim Meyering  <meyering@lucent.com>
10182
10183         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10184         * dirname.c (dir_name): Likewise.
10185
10186         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10187
10188         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10189         (dir_name): Assert that there are no trailing slashes.
10190
10191 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
10192
10193         * mbswidth.h (mbswidth): Add a flags argument.
10194         (mbswidth): New declaration.
10195         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10196         * mbswidth.c (mbswidth): Add a flags argument.
10197         (mbsnwidth): New function.
10198
10199 2000-07-24  Jim Meyering  <meyering@lucent.com>
10200
10201         * mbswidth.c: Remove useless #else.  From Bruno Haible.
10202
10203 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10204
10205         * mbswidth.c (_XOPEN_SOURCE):
10206         Don't define; this causes problems on Solaris 7.
10207         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10208
10209 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10210
10211         * quotearg.c:
10212         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10213         so that mbstate_t is always defined.
10214
10215         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10216         be 1 in at least one GCC installation, and this configuration
10217         error is likely to be common.  Ignoring MB_LEN_MAX hurts
10218         performance on hosts that have mbrtowc but have only unibyte
10219         locales, but I assume these hosts are rare.
10220
10221 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10222
10223         * quotearg.c: Streamline by invoking multibyte code only if needed.
10224         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10225         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10226         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10227         invoke multibyte primitives.
10228
10229 2000-07-23  Jim Meyering  <meyering@lucent.com>
10230
10231         * basename.c (base_name): Add an assertion.
10232
10233 2000-07-15  Bruno Haible  <clisp.cons.org>
10234
10235         * quotearg.c: When the system forces us to redefine mbstate_t,
10236         shadow its mbsinit function.
10237
10238 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
10239
10240         * mbswidth.h: New file.
10241         * mbswidth.c: New file.
10242         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10243         (noinst_HEADERS): Add mbswidth.h.
10244
10245 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
10246
10247         * config.charset: Add support for FreeBSD. Improve support for HP-UX
10248         and IRIX 6.
10249
10250 2000-07-15  Jim Meyering  <meyering@lucent.com>
10251
10252         * makepath.c: Include quote.h.
10253         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10254         corresponding argument in a `quote (...)' call.
10255         Give better diagnostics.
10256
10257         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10258         (noinst_HEADERS): Add quote.h.
10259
10260         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
10261         from tar's src/misc.c.
10262         * quote.h: New file.  Prototypes for same.
10263
10264 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10265
10266         From a suggestion by Bruno Haible.
10267         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10268         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10269         to decide whether to define the BeOS workaround macro;
10270         this adjusts to the change to AC_MBSTATE_T.
10271
10272 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10273
10274         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10275
10276         * quotearg.c (quoting_style_args, quoting_style_vals,
10277         quotearg_buffer_restyled): Add support for
10278         clocale_quoting_style.  Undo previous change to
10279         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10280         and "{RIGHT QUOTATION MARK}" msgids.
10281
10282 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10283
10284         The old behavior of quoting `like this' doesn't look good with
10285         newer, ISO-style fonts.  See:
10286         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10287
10288         Instead, quote "like this" by default.  Let the translator
10289         tailor the locale-specific quoting behavior by providing
10290         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10291
10292         * quotearg.c (N_): New macro.
10293         (gettext_default): New function.
10294         (quotearg_buffer_restyled): Use
10295         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10296         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10297
10298 2000-07-09  Jim Meyering  <meyering@lucent.com>
10299
10300         * Most files: Update copyright dates to include 2000.
10301
10302 2000-07-08  Jim Meyering  <meyering@lucent.com>
10303
10304         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10305         if not defined.
10306         (xgethostname): Remove now-unnecessary #ifdef.
10307         Move declaration of `err' into loop where it's used.
10308
10309 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10310
10311         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10312         by allocating a larger buffer. Test the gethostname return value for
10313         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
10314         returns an error and ENAMETOOLONG isn't defined.
10315
10316 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10317         and Bruno Haible  <haible@clisp.cons.org>
10318
10319         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10320
10321 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
10322
10323         * quotearg.c (struct quoting_options): Simplify quote_these_too
10324         dimension.
10325
10326 2000-07-03  Jim Meyering  <meyering@lucent.com>
10327
10328         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10329         Reported by Bruno Haible.
10330
10331 2000-07-04  Jim Meyering  <meyering@lucent.com>
10332
10333         * quotearg.c: Make inclusion of <wchar.h> independent of whether
10334         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
10335         lacks mbrtowc.
10336
10337 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10338         and Bruno Haible  <haible@clisp.cons.org>
10339
10340         * quotearg.c (mbrtowc):
10341         Assign to *pwc, and return 1 only if result is nonzero.
10342         (iswprint): Use ISPRINT when substituting our own mbrtowc.
10343
10344 2000-07-03  Jim Meyering  <meyering@lucent.com>
10345
10346         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10347         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10348         From Bob Proulx.
10349
10350 2000-07-02  Jim Meyering  <meyering@lucent.com>
10351
10352         * quotearg.c (mbstate_t): Don't define here.
10353
10354 2000-07-02  Jim Meyering  <meyering@lucent.com>
10355
10356         * nanosleep.c (SIGCONT): Define if not already defined.
10357
10358 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10359
10360         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10361         per change in ../m4/ls-mntd-fs.m4.
10362         (read_filesystem_list): Ignore symbolic links.
10363
10364 2000-06-29  Jim Meyering  <meyering@lucent.com>
10365
10366         * same.c: Include <string.h> or <strings.h>, as appropriate,
10367         for declaration of strcmp.
10368
10369         * long-options.c: Include <stdlib.h>, for declaration of exit.
10370
10371         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10372         Avoid warning by casting result to `char *' to remove `const'.
10373
10374 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10375
10376         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10377
10378 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10379
10380         savedir now sets errno on failure and invokes xmalloc to get memory.
10381         Fix a couple of other minor bugs while we're at it.
10382
10383         * savedir.c (<unistd.h>): Do not include; there's no need.
10384         (NAMLEN): Remove macro.
10385         (malloc, realloc): Remove decls.
10386         (stpcpy): Likewise.
10387         ("xalloc.h"): Include.
10388         (NAME_SIZE_DEFAULT): New macro.
10389         (savedir): Use xmalloc / xrealloc to allocate memory.
10390         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10391         Skip "" directory entries.
10392         Use strlen to calculate directory entry length, since the old method
10393         is rarely used these days and isn't worth supporting.
10394         Don't use a pointer after freeing it.
10395         Check for integer overflow when calculating allocation size.
10396         Use memcpy to copy entries, instead of stpcpy.
10397         Set errno properly when returning NULL.
10398         Check for readdir error.
10399
10400 2000-06-26  Jim Meyering  <meyering@lucent.com>
10401
10402         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10403
10404 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10405
10406         * getusershell.c (xmalloc, xrealloc): Remove functions.
10407         Include xalloc.h.
10408         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10409
10410 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10411
10412         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10413
10414 2000-06-24  Jim Meyering  <meyering@lucent.com>
10415
10416         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10417
10418 2000-06-21  Jim Meyering  <meyering@lucent.com>
10419
10420         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10421
10422 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10423
10424         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10425         (mbrtowc, mbstate_t): Define substitutes if
10426         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10427         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10428         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10429
10430 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10431
10432         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10433         than 1024, return a memory chunk of least possible size, instead
10434         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10435         Use free/xmalloc instead of xrealloc to avoid copying for very long
10436         paths.
10437
10438 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10439
10440         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10441         address, not strdup.  Include <stdlib.h> and don't declare free().
10442
10443 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10444
10445         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10446         the empty string.
10447
10448 2000-06-21  Jim Meyering  <meyering@lucent.com>
10449
10450         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10451         (noinst_HEADERS): Add getstr.h.
10452
10453         * getline.c (getstr): Move into a separate file.
10454         * getstr.c (getstr): New file, extracted from getline.c, with
10455         the following changes: new parameter, delim2; both delim[12]
10456         parameters have type `int', not `char'.  The latter would lose
10457         with 8-bit delimiters.
10458         * getstr.h: New file.
10459
10460 2000-06-19  Jim Meyering  <meyering@lucent.com>
10461
10462         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10463
10464 2000-06-18  Jim Meyering  <meyering@lucent.com>
10465
10466         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10467         Besides, these days every porting target provides a mkdir function.
10468
10469         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10470         (this snippet comes from src/system.h).
10471
10472 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10473
10474         * human.c (adjust_value): New function.
10475         (human_readable_inexact): Apply rounding style even when
10476         printing approximate values.
10477
10478 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10479
10480         * human.c (human_readable_inexact): Allow an input block
10481         size that is not a multiple of the output block size, and vice versa.
10482         Reported by Piergiorgio Sartor.
10483
10484 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10485
10486         * getdate.y (get_date): Apply relative times after time
10487         zone indicator, not before.  Reported by Todd A. Jacobs.
10488
10489 2000-06-13  Jim Meyering  <meyering@lucent.com>
10490
10491         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10492
10493         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10494
10495 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10496
10497         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10498
10499 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10500
10501         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10502
10503 2000-06-04  Jim Meyering  <meyering@lucent.com>
10504
10505         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10506         SunOS 4.1.4 for which gid_t is an unsigned type.
10507
10508 2000-06-03  Jim Meyering  <meyering@lucent.com>
10509
10510         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10511
10512 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10513
10514         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10515         newer, don't install charset.alias.
10516         * config.charset: Change the Linux/glibc rules so they become empty
10517         on glibc-2.1 or newer.
10518
10519 2000-06-02  Jim Meyering  <meyering@lucent.com>
10520
10521         * mountlist.c: Back out last change.  Instead, do this...
10522         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10523         member using the same `ignore'-testing code.
10524         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10525         fs_type strings.
10526         From Mark D. Roth.
10527
10528 2000-05-29  Jim Meyering  <meyering@lucent.com>
10529
10530         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10531         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10532
10533 2000-05-22  Jim Meyering  <meyering@lucent.com>
10534
10535         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10536
10537 2000-05-18  Jim Meyering  <meyering@lucent.com>
10538
10539         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10540         back, too, since it may have been modified by allocate_entry.
10541         (hash_delete): Rewrite to use neither the assignment operator
10542         nor the comma operator in an if-expression.
10543
10544 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10545
10546         * closeout.c:
10547         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10548         Remove; no longer needed.
10549         "quotearg.h": Add include.
10550         (file_name): Do not bother to explicitly initialize to NULL; it's less
10551         efficient on some hosts.
10552         (close_stdout_status): Remove test as to whether stdout was already
10553         closed; it breaks for the case "echo x | sort >&-".
10554         Quote file name colons.
10555         Do not assume that _("write error") lacks format strings.
10556
10557 2000-05-15  Jim Meyering  <meyering@lucent.com>
10558
10559         * version-etc.c (version_etc_copyright): Update the copyright string
10560         used in all --version output.
10561
10562 2000-05-14  Jim Meyering  <meyering@lucent.com>
10563
10564         * closeout.c (close_stdout_set_file_name): New function.
10565         (close_stdout_status): Use new file-scoped global.
10566         Return right away if fstat says the stdout file descriptor is invalid.
10567         * closeout.h (close_stdout_set_file_name): Declare.
10568
10569 2000-05-10  Jim Meyering  <meyering@lucent.com>
10570
10571         * closeout.c [default_exit_status]: New file-scoped variable.
10572         (close_stdout_set_status): New function.
10573         * closeout.h (close_stdout_set_status): Declare.
10574
10575 2000-05-08  Jim Meyering  <meyering@lucent.com>
10576
10577         * long-options.c: Don't include closeout.h.
10578         (parse_long_options): Don't call close_stdout for --version.
10579
10580 2000-05-06  Jim Meyering  <meyering@lucent.com>
10581
10582         * strnlen.c: Undefine __strnlen and strnlen.
10583         [!weak_alias]: Define __strnlen to strnlen.
10584
10585         * atexit.c: New file, from libiberty.
10586
10587 2000-05-06  Jim Meyering  <meyering@lucent.com>
10588
10589         * closeout.c (close_stdout_status): Also check for errors on the
10590         stderr stream.
10591
10592 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10593
10594         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10595         instead of xmalloc, xrealloc, path_concat.
10596         (locale_charset): Treat empty environment variables as absent.
10597         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10598
10599 2000-05-04  Jim Meyering  <meyering@lucent.com>
10600
10601         * getopt.c: Update from glibc.
10602         * obstack.c: Likewise.
10603         * obstack.h: Likewise.
10604         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10605
10606         * regex.h: Likewise.
10607         * strndup.c: Likewise.
10608         * strnlen.c: New file, from glibc.
10609
10610 2000-05-01  Jim Meyering  <meyering@lucent.com>
10611
10612         * full-write.c (full_write): Remove `FIXME' part of comment.
10613
10614 2000-04-29  Jim Meyering  <meyering@lucent.com>
10615
10616         * path-concat.c: Declare strdup only if it's not defined.
10617         * canon-host.c: Likewise.
10618
10619 2000-04-28  Jim Meyering  <meyering@lucent.com>
10620
10621         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10622         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10623         included first, then limits.h is included by locale.h by libintl.h.
10624         From John David Anglin.
10625
10626 2000-04-25  Jim Meyering  <meyering@lucent.com>
10627
10628         * makepath.c (S_IRWXUGO): Define.
10629         (make_path): Always perform explicit chmod if MODE specifies any
10630         of the `special' permission bits.  Prompted by a bug report against
10631         install from Mate Wierdl and Joost van Baal.
10632
10633 2000-04-18  Jim Meyering  <meyering@lucent.com>
10634
10635         * README: New file.
10636
10637         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10638         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10639
10640 2000-04-17  Jim Meyering  <meyering@lucent.com>
10641
10642         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10643         the definition of it to rpl_strftime also defined-away the system's
10644         declaration.
10645
10646 2000-04-15  Jim Meyering  <meyering@lucent.com>
10647
10648         Use `C' to denote so-called `contiguous' files, the same way
10649         that tar does.
10650         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10651         (ftypelet): Use S_ISCTG.
10652         From Michael Deutschmann.
10653
10654 2000-04-14  Jim Meyering  <meyering@lucent.com>
10655
10656         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10657
10658 2000-04-08  Jim Meyering  <meyering@lucent.com>
10659
10660         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10661         names don't conflict.  Reported by Eli Zaretskii.
10662
10663 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10664
10665         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10666         bug.  Deal with the different error behavior of Irix iconv.
10667
10668 2000-04-07  Jim Meyering  <meyering@lucent.com>
10669
10670         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10671         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10672
10673 2000-04-05  Jim Meyering  <meyering@lucent.com>
10674
10675         Portability tweaks required for ultrix4.3.
10676         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10677         * readutmp.c: Include sys/types.h before sys/stat.h.
10678         * canon-host.c: Declare strdup.
10679         * path-concat.c: Likewise.
10680         From John David Anglin.
10681
10682 2000-04-04  Jim Meyering  <meyering@lucent.com>
10683
10684         Be more DOS 8.3-friendly.
10685         * ref-add.sin: Renamed from ref-add.sed.in.
10686         * ref-del.sin: Renamed from ref-del.sed.in.
10687         * Makefile.am: Reflect renaming.
10688         Reported by Eli Zaretskii.
10689
10690         Use a temporary file name that won't clash with `charset.alias'
10691         in the DOS 8.3 name space.
10692         * Makefile.am (charset_tmp): Define.
10693         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10694         (uninstall-local): Likewise.
10695         Reported by Eli Zaretskii.
10696
10697 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10698
10699         * time/strftime.c (my_strftime): Make sure we call the system
10700         strftime, not ourselves, when invoking the underlying strftime.
10701
10702 2000-03-24  Jim Meyering  <meyering@lucent.com>
10703
10704         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10705         (charset_alias): Define.
10706         (install-exec-local): Factor out common code.
10707         (uninstall-local): Split lines longer than 80.
10708         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10709         (SUFFIXES): Define.
10710         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10711         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10712
10713 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10714
10715         * config.charset: Output a line containing "Packages using this file".
10716         * ref-add.sed.in, ref-del.sed.in: New files.
10717         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10718         ref-del.sed): New rules.
10719
10720 2000-03-17  Jim Meyering  <meyering@lucent.com>
10721
10722         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10723         Otherwise, include <strings.h>
10724
10725 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10726
10727         * unicodeio.c (utf8_wctomb): New function.
10728         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10729         format instead of in UCS-4 with platform dependent endianness.
10730
10731 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10732
10733         * savedir.c (savedir): Work even if directory size is
10734         negative; this can happen with some screwy NFS configurations.
10735
10736 2000-03-06  Jim Meyering  <meyering@lucent.com>
10737
10738         * localcharset.c (get_charset_aliases): Don't try to free file_name
10739         if it's NULL (because we ran out of memory).  From Bruno Haible.
10740
10741 2000-03-05  Jim Meyering  <meyering@lucent.com>
10742
10743         * localcharset.c ("path-concat.h"): Include.
10744         (get_charset_aliases): Use path_concat instead of ANSI string
10745         concatenation.
10746
10747         * unicodeio.h (PARAMS): Define.
10748         Use it to guard prototype.
10749
10750 2000-03-04  Jim Meyering  <meyering@lucent.com>
10751
10752         * Makefile.am (install-exec-local): Create $(libdir) before installing
10753         into it.
10754         (uninstall-local): Uncomment this rule so `make distcheck' works
10755         once again.
10756
10757         * unicodeio.c (<errno.h>): Include it.
10758         (errno): Declare if not defined.
10759
10760         * localcharset.c: Add Bruno's comment justifying use of volatile.
10761
10762         * config.charset: New version, incorporating remarks from a linux
10763         i18n mailing list.  From Bruno Haible.
10764
10765 2000-03-02  Jim Meyering  <meyering@lucent.com>
10766
10767         * Makefile.am (EXTRA_DIST): Add config.charset.
10768
10769 2000-03-01  Jim Meyering  <meyering@lucent.com>
10770
10771         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10772         * unicodeio.c: Likewise.
10773
10774 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10775
10776         * config.charset: New file.
10777         * localcharset.c: New file.
10778         * unicodeio.h, unicodeio.c: New files.
10779         * Makefile.am (DEFS): Add -DLIBDIR=...
10780         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10781         (noinst_HEADERS): Add unicodeio.h.
10782         (all-local, install-exec-local, charset.alias): New targets.
10783
10784 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10785
10786         * quotearg.c (ALERT_CHAR): New macro.
10787         (quotearg_buffer_restyled): Use it.
10788
10789 2000-02-27  Jim Meyering  <meyering@lucent.com>
10790
10791         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10792         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10793
10794         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10795         not `#if STDC_HEADERS'.
10796         Declare malloc if needed.
10797
10798         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10799         now that autoconf always defines the HAVE_DECL_ symbols.
10800         * human.c: Likewise.
10801         * same.c: Likewise.
10802         * strtoumax.c: Likewise.
10803
10804         * backupfile.c: Arrange for cpp to fail if the configure-time
10805         declaration check was not run.
10806         * hash.c: Likewise.
10807         * human.c: Likewise.
10808         * same.c: Likewise.
10809         * strtoumax.c: Likewise.
10810
10811         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10812         then first look up the entire `.'-containing string as a login name.
10813
10814 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10815
10816         * getdate.y: Handle two-digit years with leading zeros correctly.
10817         (textint): New typedef.
10818         (parser_control): Member year changed from int to textint.
10819         All uses changed.
10820         (YYSTYPE): Removed; replaced by %union with int and textint members.
10821         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10822         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10823         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10824         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10825         (date, number, to_year): Use width of number in digits, not its value,
10826         to determine whether it's a 2-digit year, or a 2-digit time.
10827         (yylex): Store number of digits of numeric tokens.
10828         Reported by John Kendall.
10829
10830         (parser_control): Changed from struct parser_control to typedef (for
10831         consistency).  All uses changed.
10832
10833         (tID): Removed; not used.
10834         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10835
10836 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10837
10838         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10839         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10840
10841 2000-02-12  Jim Meyering  <meyering@lucent.com>
10842
10843         * userspec.c (ISDIGIT): Define it.
10844         (isdigit): Remove definition.
10845         (is_number): Use ISDIGIT, not isdigit.
10846         <libintl.h>: Include.
10847         (_ and N_): Define.
10848         (parse_user_spec): Mark translatable strings.
10849
10850 2000-02-10  Jim Meyering  <meyering@lucent.com>
10851
10852         With these changes, nanosleep.[ch] are finally enough like the other
10853         lib/* replacement files to compile on a few more losing systems.
10854
10855         * nanosleep.h: Don't include config.h.
10856         Remove prototype from declaration of nanosleep.
10857         (PARAMS): Remove now-unneeded definition.
10858         * nanosleep.c: #undef nanosleep.
10859         (rpl_nanosleep): Rename from nanosleep.
10860
10861 2000-02-03  Jim Meyering  <meyering@lucent.com>
10862
10863         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10864         rather than with `#if HAVE_UTMPNAME'.
10865
10866 2000-02-01  Jim Meyering  <meyering@lucent.com>
10867
10868         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10869
10870 2000-01-31  Jim Meyering  <meyering@lucent.com>
10871
10872         * nanosleep.h (nanosleep): Guard declaration with
10873         `#if ! HAVE_DECL_NANOSLEEP'.
10874         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10875         the declaration in that vendor's sys/timers.h.
10876         Reported by Christian Krackowizer.
10877
10878         * quotearg.c (ISASCII): Add #undef and move definition to follow
10879         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10880         (ISPRINT): Likewise.
10881         Reported by Tom Tromey.
10882
10883 2000-01-30  Jim Meyering  <meyering@lucent.com>
10884
10885         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10886         uses of ->ut_name.  The latter doesn't work with new Linux header files
10887         where only utmpx.ut_user is declared.
10888
10889         * readutmp.h (UT_USER): Define.
10890
10891 2000-01-23  Jim Meyering  <meyering@lucent.com>
10892
10893         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10894         obstack.c.
10895
10896 2000-01-22  Jim Meyering  <meyering@lucent.com>
10897
10898         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10899         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10900         Required for some AIX systems.  Reported by Christian Krackowizer.
10901         [TESTING] (main): New function.
10902
10903         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10904         * dirname.c (dir_name): Support for DOS-style file names with drive
10905         letters.
10906
10907         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10908
10909         * strverscmp.c (ISDIGIT): Define.
10910         (strverscmp): Use ISDIGIT, not isdigit.
10911
10912 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10913
10914         * nanosleep.c (nanosleep):
10915         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10916         POSIX.1 doesn't require SA_INTERRUPT and some systems
10917         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10918         it's been part of POSIX.1 since day 1 (in 1988).
10919
10920 2000-01-17  Jim Meyering  <meyering@lucent.com>
10921
10922         * interlock: Remove unused file.  Reported by François Pinard.
10923
10924 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10925
10926         * quotearg.c (quotearg_buffer_restyled): Do not quote
10927         alert, backslash, formfeed, and vertical tab unnecessarily in
10928         shell quoting style.
10929
10930
10931 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10932 Free Software Foundation, Inc.
10933 Copying and distribution of this file, with or without modification,
10934 are permitted provided the copyright notice and this notice are preserved.