* glob.c: Say "invalid" rather than "illegal" in comments.
[pspp] / lib / ChangeLog
1 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * glob.c: Say "invalid" rather than "illegal" in comments.
4
5 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
6
7         * lib/mkdtemp.c, lib/setenv.c, lib/unsetenv.c: Normalize
8         inclusion of `config.h'.
9
10 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
11
12         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
13         AT_FDCWD exceeds INT_MAX.
14         * openat.h (AT_FDCWD): Likewise.
15
16 2006-02-14  Jim Meyering  <jim@meyering.net>
17
18         Sync from coreutils.
19
20         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
21         failure on deficient systems, and simplify gnulib lgpl dependencies.
22         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
23         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
24
25         * xalloc-die.c: Remove unused definition of N_.
26
27 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
28
29         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
30
31 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
32
33         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
34         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
35
36 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
37
38         * argp-namefrob.h: Restore changes accidentally lost during the
39         "autoupdate" on 2005-12-12.
40
41 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
42
43         * fnmatch.c (L_): Renamed from L, to work around a bug in
44         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
45         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
46         All uses changed.
47
48 2006-01-26  Simon Josefsson  <jas@extundo.com>
49
50         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
51         prototype is visible on mingw32.
52
53         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
54         for mingw32.
55
56         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
57         mingw32).
58
59 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
60
61         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
62         attempt to open for write; this always fails, at least on POSIX
63         hosts.  This reinstates the 2006-01-09 change, which was
64         inadvertently removed.
65
66 2006-01-26  Bruno Haible  <bruno@clisp.org>
67             Paul Eggert  <eggert@cs.ucla.edu>
68
69         * stdbool_.h (_Bool)
70         [(! (defined __cplusplus || defined __BEOS__)
71           && !defined __GNUC__
72           && !(defined __HP_cc || defined __xlc__
73                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
74                || defined __sgi))]:
75         #define to signed char in these cases too; this simplifies
76         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
77         etc., separately) and makes it more conservative.
78
79 2006-01-21  Jim Meyering  <jim@meyering.net>
80
81         Sync from the stable (b5) branch of coreutils:
82
83         * fts.c (fts_children): Don't let close() clobber errno from
84         failed fchdir().
85
86         * fts.c (fts_stat): When following a symlink-to-directory,
87         don't necessarily interpret stat-fails+lstat-succeeds as indicating
88         a dangling symlink.  That can also happen at least for ELOOP.
89         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
90         FYI, this bug predates the inclusion of fts.c in coreutils.
91
92         * fts.c (fts_open): Put new maxarglen declaration and uses
93         in their own block, so pre-c99 compilers don't object.
94
95         Avoid the double-free (first in fts_read, second in fts_close) that
96         would occur when an `active' directory is made inaccessible (e.g.,
97         via chmod a-x) during a traversal.
98         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
99         before returning.  Reproduce this failure by
100         mkdir -p a/b; cd a; chmod a-x . b
101         Reported by Stavros Passas.
102
103 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
104
105         * argp-namefrob.h: Bugfix. Remove stray #
106
107 2006-01-25  Bruno Haible  <bruno@clisp.org>
108
109         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
110         warnings.
111         Reported by Paul Eggert.
112
113 2006-01-25  Jim Meyering  <jim@meyering.net>
114
115         * fileblocks.c: Remove more useless parentheses.
116         * readutmp.h: Likewise.
117
118 2006-01-24  Bruno Haible  <bruno@clisp.org>
119
120         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
121         has it.
122         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
123         2005-11-26.
124
125         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
126         to avoid problems with the built-in _Bool type.
127         Reported by Paul Eggert on 2005-11-26.
128
129 2006-01-24  Jim Meyering  <jim@meyering.net>
130
131         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
132
133 2006-01-24  Simon Josefsson  <jas@extundo.com>
134
135         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
136         Bruno.
137
138 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
139
140         Work around porting bugs reported by Dieter in
141         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
142         * getopt.c (_NOPROTO): Remove; no longer needed.
143         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
144         Include "getopt.h" first, to check interface.
145         (getenv): Declare only if defined HAVE_DECL_GETENV &&
146         !HAVE_DECL_GETENV.
147         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
148         (__strndup): Revert to K&R-style function dfns, the glibc style.
149         * strnlen.c: Don't claim it's taken from glibc; it's not.
150         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
151         Include strnlen.h first, to get prototype properly.
152         (strnlen): Renamed from __strnlen.
153         Remove weak alias.
154
155 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
156
157         These changes imported from libc.
158         * getopt.c: Use __fxprintf instead of inline stream orientation
159         test and two separate function calls.
160         * strndup.c (__strndup): Add libc_hidden_def.
161
162 2006-01-22  Bruno Haible  <bruno@clisp.org>
163
164         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
165         temporary buffer for sprintf, take into account the precision also
166         for 'd', 'i', 'u', 'o', 'x', 'X'.
167
168 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
169
170         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
171         to pacify gcc -Wswitch-default.
172
173 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
174
175         * argp-help.c (usage_long_opt): Do not print DOC options.
176         (__argp_base_name): Removed
177         * argp-namefrob.h (__argp_basename): Removed definition. Was a
178         typo.
179         (__argp_base_name): Provide macro definition or extern declaration
180         depending on the configuration
181
182 2006-01-20  Simon Josefsson  <jas@extundo.com>
183
184         * inet_ntop.h: Unconditionally include sys/socket.h.
185
186 2006-01-19  Simon Josefsson  <jas@extundo.com>
187
188         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
189
190 2006-01-12  Simon Josefsson  <jas@extundo.com>
191
192         * base64.c: Fix warning, reported by Bruno Haible
193         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
194
195 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
196
197         Sync from coreutils.
198         * md5.c: Fix commentary typos.
199         (alignof, UNALIGNED_P): No need for a GCC-specific version.
200         * md5.h (__attribute__): Remove; unused.
201         * sha1.c: Fix commentary to match md5 better.
202         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
203         so that we don't need to worry about alignment.  All uses changed.
204         This merges the 2005-10-28 md5 change into sha1.
205
206 2006-01-11  Jim Meyering  <jim@meyering.net>
207
208         Sync from coreutils.
209         * md5.c (OP): Fix spacing.
210
211 2006-01-11  Simon Josefsson  <jas@extundo.com>
212
213         * stdint_.h (SIZE_MAX): Add missing (.
214
215 2006-01-10  Bruno Haible  <bruno@clisp.org>
216
217         * argp.h (__const): Remove macro. Use const instead.
218         * argp-fmtstream.h (__const): Likewise.
219         * glob_.h (__const): Remove macro.
220         * glob-libc.h: Use const instead of __const.
221
222 2006-01-10  Jim Meyering  <jim@meyering.net>
223
224         Avoid the double-free (first in fts_read, second in fts_close) that
225         would occur when an `active' directory is made inaccessible (e.g.,
226         via chmod a-x) during a traversal.
227         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
228         before returning.  Reproduce this failure by
229         mkdir -p a/b; cd a; chmod a-x . b
230         Reported by Stavros Passas.
231
232         Sync from coreutils.
233         * sha1.c: Tweak grammar in a comment.
234
235 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
236
237         * regex_internal.h (BITSET_WORD_BITS):
238         Work around a bug in 64-bit PGC (before version 6.1-2), where the
239         preprocessor mishandles large unsigned values as if they were signed.
240         Problem reported by Claudio Fontana in
241         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
242
243 2006-01-10  Simon Josefsson  <jas@extundo.com>
244
245         * socket_.h: New file.
246
247 2006-01-10  Bruno Haible  <bruno@clisp.org>
248
249         * localcharset.c: Update from GNU gettext.
250
251 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
252
253         Sync from coreutils.
254         * chdir-long.c (cdb_free): Don't bother trying to open directory
255         for write access: POSIX says that must fail.
256         * fts.c (diropen): Likewise.
257         * save-cwd.c (save_cwd): Likewise.
258         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
259         well, for minor improvements on hosts that lack O_DIRECTORY.
260         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
261         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
262         Fall back on chown if open failed with EACCES.
263
264         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
265         Report an error at compile-time if only a 1-second nominal clock
266         resolution is found.
267
268         * lchmod.h: New file.
269         * mkdir-p.c: Include lchmod.h, lchown.h.
270         (make_dir_parents): Use lchown rather than chown, and
271         lchmod rather than chmod.
272
273         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
274         too.  Problem with "none" reported by Bob Proulx.  Problem with
275         "proc" reported by n0dalus.
276
277         * mountlist.c: Include <limits.h>.
278         (dev_from_mount_options)
279         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
280         New function.  It no longer assumes "dev=" has the System V meaning
281         on Linux (since it doesn't).  It also parses "dev=" more carefully.
282         (read_file_system_list)
283         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
284         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
285         dev= in that case.
286
287         * posixtm.h (PDS_PRE_2000): New macro.
288         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
289         All usages changed.  Reject dates outside the range 1969-1999 if
290         PDS_PRE_2000 is used.
291
292 2006-01-09  Jim Meyering  <jim@meyering.net>
293
294         Sync from coreutils.
295
296         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
297
298         * chdir-safer.h, chdir-safer.c: New files.
299
300         * modechange.c (mode_compile): Reject an invalid mode string
301         that starts with an octal digit.  From Andreas Gruenbacher.
302
303         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
304         and dup to open_safer and dup_safer, respectively.
305         (openat_permissive): Fix typo in comment.
306
307         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
308         "gettext.h"; either no longer needed or are guaranteed by openat.h.
309         (_): Remove; no longer needed.
310         (openat): Renamed from rpl_openat; no need for rpl_openat
311         since openat.h renames openat for us.
312         Replace most of the body with a call to openat_permissive,
313         to avoid duplicate code.
314         Port to (probably hypothetical) environments were mode_t is
315         wider than int.
316         (openat_permissive): Require mode arg, so that we can check
317         types better.  Put it just after flags.  Change cwd failure
318         indicator from pointer-to-bool to pointer-to-errno-value.
319         All callers changed.
320         Invoke openat_save_fail and/or openat_restore_fail if
321         cwd_errno is null, so that openat can call us.
322         (openat_permissive, fdopendir, fstatat, unlinkat):
323         Simplify errno handling to avoid some duplicate code,
324         as it's OK to set errno on success.
325         * openat.h: Revamp code so that function macros depend on
326         __OPENAT_PREFIX only, not also on AT_FDCWD.
327         (openat_ro): Remove.  Caller changed to use openat_permissive.
328         (openat_permissive): Now a macro, if not a function.
329         (openat_restore_fail, openat_save_fail): Now always functions,
330         since mkdirat needs them even if __OPENAT_PREFIX is defined.
331
332         * openat-priv.h: New file, defining macros used by mkdirat.c
333         and openat.c.
334         * mkdirat.c: Include openat-priv.h.
335         Remove definitions of macros defined therein.
336         * openat.c: Likewise.
337
338         * mkdirat.c (mkdirat): New file and function.
339         * openat.h (mkdirat): Declare.
340
341         * openat.c (fdopendir): Don't change errno when returning non-NULL.
342
343         * openat.h (openat_permissive): Declare.
344         (openat_ro): Define.
345
346         * openat.c (EXPECTED_ERRNO): New macro.
347         (openat_permissive): New function -- used in remove.c rewrite.
348         (all functions): Set errno just before returning, only if there
349         was an actual failure.
350         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
351
352         Emulate openat-family functions using Linux's procfs, if possible.
353         Idea and some code based on Ulrich Drepper's glibc changes.
354
355         * openat.c: (BUILD_PROC_NAME): New macro.
356         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
357         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
358         before falling back on save_cwd and restore_cwd.
359         (fdopendir, fstatat, unlinkat): Likewise.
360
361         * openat.c (fstatat, unlinkat): Perform the syscall directly,
362         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
363
364         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
365         as second argument to va_arg.  Otherwise, some versions of gcc
366         warn that `if this code is reached, the program will abort'.
367
368 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
369
370         Sync from coreutils.
371
372         Add POSIX ACL support
373         * acl.h (copy_acl, set_acl): Add declarations.
374         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
375         systems other than Linux.
376         (chmod_or_fchmod): New function: use fchmod when possible,
377         and chmod otherwise.
378         (file_has_acl): Add a POSIX ACL implementation, with a
379         Linux-specific subcase.
380         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
381         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
382         acls are unsupported.
383         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
384         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
385         are unsupported.
386
387 2006-01-09  Bruno Haible  <bruno@clisp.org>
388
389         * sysexit_.h (EX_OK): New macro.
390         Suggested by Martin Lambers <marlam@marlam.de>.
391
392 2006-01-09  Bruno Haible  <bruno@clisp.org>
393
394         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
395         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
396         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
397         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
398
399 2006-01-09  Bruno Haible  <bruno@clisp.org>
400
401         * stdint_.h (SIZE_MAX): Write the value without involving negative
402         numbers.
403
404 2005-10-16  Bruno Haible  <bruno@clisp.org>
405
406         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
407         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
408
409 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
410
411         * strftime.c (tzname): Don't declare if it is already #defined.
412         Problem reported for Mingw by Mark Junker.
413
414 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
415
416         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
417         long int, not int, for nanosecond counts, so that people who are
418         used to POSIX struct timespec won't be surprised.  Reported by Jim
419         Meyering.
420
421 2005-12-16  Jim Meyering  <jim@meyering.net>
422
423         * fprintftime.c, fprintftime.h: New files.
424
425 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
426
427         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
428         * argp-help.c (fill_in_uparams): Check if the constructed
429         struct uparams is valid. Fall back to the default values if it is
430         not.
431
432 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
433
434         * argp-help.c (__argp_base_name): New function
435         (__argp_short_program_name): Rewrite using __argp_base_name
436         * argp-namefrob.h: Define program_invocation_name and
437         program_invocation_short_name if requested
438         (__argp_base_name): Add prototype
439         * argp-parse.c (argp_def): Use gettext wrappers
440         (argp_default_parser): Use __argp_base_name
441         * argp-pin.c: New file. Defines program_invocation_name and
442         program_invocation_short_name on systems that lack them.
443
444 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
445
446         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
447         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
448         porting problem reported by Georg Schwarz in
449         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
450
451 2005-07-09  Bruno Haible  <bruno@clisp.org>
452
453         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
454         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
455         Reported by Mark Junker <mjscod@gmx.de>.
456
457 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
458
459         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
460         (uintmax_t) [defined uintmax_t]: Do not declare.
461         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
462         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
463         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
464         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
465         sake of portability to weird hosts that C allows (though we don't
466         know of any practical examples).
467
468         * savedir.h (fdsavedir): New decl.
469         * savedir.c (fdsavedir, savedirstream): New functions; the latter
470         contains most of the former guts of savedir.
471         (savedir): Use savedirstream.
472         Include "openat.h".
473
474 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
475
476         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
477         coreutils no longer futzes with rounding modes.
478
479 2005-11-14  Jim Meyering  <jim@meyering.net>
480
481         * mkstemp-safer.c: Include <config.h>, required for possible
482         replacement of mkstemp.
483
484 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
485
486         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
487         business.
488         (gethrxtime) [! (HAVE_NANOUPTIME
489         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
490         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
491         our own approximation.
492
493 2005-11-10  Simon Josefsson  <jas@extundo.com>
494
495         * readline.c: Remove EOL.
496
497 2005-11-08  Eric Blake  <ebb9@byu.net>
498
499         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
500
501 2005-11-08  Eric Blake  <ebb9@byu.net>
502
503         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
504
505 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
506
507         Fix porting problem reported by Theodoros V. Kalamatianos.
508         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
509         Don't assume that futimes failing means we must fail.
510
511 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
512
513         * getcwd.c (__getcwd): Don't assume that system calls after readdir
514         leave errno alone.  Problem reported by Dmitry V. Levin.
515
516 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
517
518         * savedir.c (savedir): Don't assume that xrealloc etc. leave
519         errno alone.  Problem reported by Frederic Jolliton.
520
521 2005-10-28  Simon Josefsson  <jas@extundo.com>
522
523         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
524         "restrict" keywords, as per POSIX.  Protect the function
525         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
526         Don't use K&R prototypes.  Check the sprintf return values.
527         Re-define EAFNOSUPPORT if not present.  Indent.
528
529         * md5.h, md5.c: Simplify buffer handling visavi alignment,
530         suggested by Bruno Haible <bruno@clisp.org>.
531
532         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
533
534         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
535
536         * gc-libgcrypt.c: Add MD2 (which is not available through
537         libgcrypt).
538
539         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
540
541         * md2.h, md2.c: New files.
542
543 2005-10-24  Simon Josefsson  <jas@extundo.com>
544
545         * md4.h: Shrink buffer size, now that we changed the type.
546
547 2005-10-22  Simon Josefsson  <jas@extundo.com>
548
549         * arcfour.h, arcfour.c: Use fixed size indices in the
550         arcfour_context struct (simplify test vector testing in GNU
551         Shishi).
552
553 2005-10-22  Simon Josefsson  <jas@extundo.com>
554
555         * md4.h, md4.c: Simplify buffer handling visavi alignment,
556         suggested by Bruno Haible <bruno@clisp.org>.
557
558 2005-10-22  Simon Josefsson  <jas@extundo.com>
559
560         * crc.h: Include stddef.h, for size_t.
561
562 2005-10-21  Simon Josefsson  <jas@extundo.com>
563
564         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
565         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
566
567 2005-10-21  Simon Josefsson  <jas@extundo.com>
568
569         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
570         block.
571
572 2005-10-21  Simon Josefsson  <jas@extundo.com>
573
574         * gc-gnulib.c: Support ARCTWO in CBC mode.
575
576 2005-10-21  Simon Josefsson  <jas@extundo.com>
577
578         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
579         <bruno@clisp.org>.
580
581         * hmac-sha1.c (hmac_sha1): Likewise.
582
583         * crc.c (crc32_update): Actually use crc parameter, suggested by
584         Bruno Haible <bruno@clisp.org>.
585
586         * crc.h: Include stdint.h directly, suggested by Bruno Haible
587         <bruno@clisp.org>.
588
589 2005-10-21  Simon Josefsson  <jas@extundo.com>
590
591         * des.h, des.c: New files.
592
593         * gc-gnulib.c: Support DES.c
594
595 2005-10-21  Simon Josefsson  <jas@extundo.com>
596
597         * arctwo.h, arctwo.c: New files.
598
599         * gc-gnulib.c: Support ARCTWO.
600
601 2005-10-21  Simon Josefsson  <jas@extundo.com>
602
603         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
604
605 2005-10-19  Simon Josefsson  <jas@extundo.com>
606
607         * gc-gnulib.c: Support ARCFOUR.
608
609 2005-10-19  Simon Josefsson  <jas@extundo.com>
610
611         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
612         support.
613
614         * gc.h: Add ECB enum type.
615
616         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
617
618 2005-10-19  Simon Josefsson  <jas@extundo.com>
619
620         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
621
622 2005-10-18  Simon Josefsson  <jas@extundo.com>
623
624         * md4.h, md4.c: New files, based on md5.?.
625
626 2005-10-17  Simon Josefsson  <jas@extundo.com>
627
628         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
629
630         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
631
632 2005-10-17  Simon Josefsson  <jas@extundo.com>
633
634         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
635
636 2005-10-17  Simon Josefsson  <jas@extundo.com>
637
638         * gc.h, gc-libgcrypt.c: Add ciphers.
639
640 2005-10-17  Simon Josefsson  <jas@extundo.com>
641
642         * sha1.c: Use uint32_t instead of md5_uint32.t
643
644         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
645         md5.h.
646
647         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
648
649         * md5.h: Use stdint.h and uint32_t.  Doc fix.
650
651 2005-10-15  Simon Josefsson  <jas@extundo.com>
652
653         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
654
655         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
656
657 2005-10-14  Simon Josefsson  <jas@extundo.com>
658
659         * arcfour.h, arcfour.c: New files.
660
661 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
662
663         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
664         include <wchar.h>; no longer needed.
665
666 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
667         and  Ulrich Drepper  <drepper@redhat.com>
668
669         Import from libc.
670         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
671         instead of inline stream orientation test and two separate
672         function calls.  Pay no attention to USE_IN_LIBIO.
673
674 2005-10-14  Roland McGrath  <roland@redhat.com>
675
676         Import from libc.  [BZ #1331]
677         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
678         macro argument.
679         Reported by Matej Vela <vela@debian.org>.
680
681 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
682
683         * mkdir-p.c (make_dir_parents): Don't report an error if an
684         intermediate directory is in a read-only file system.  Problem
685         reported by Eric Blake.
686
687 2005-10-13  Simon Josefsson  <jas@extundo.com>
688
689         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
690         Move memory allocation outside of loop.
691
692 2005-10-12  Simon Josefsson  <jas@extundo.com>
693
694         * gc-pbkdf2-sha1.c: New file.
695
696         * gc.h: Add gc_pbkdf2_sha1 prototype.
697
698 2005-10-12  Simon Josefsson  <jas@extundo.com>
699
700         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
701         suggested by Bruno Haible <bruno@clisp.org>.
702
703 2005-10-12  Simon Josefsson  <jas@extundo.com>
704
705         * gc-libgcrypt.c (gc_hmac_sha1): New function.
706
707         * gc-gnulib.c (gc_hmac_sha1): New function.
708
709 2005-10-12  Simon Josefsson  <jas@extundo.com>
710
711         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
712
713 2005-10-12  Simon Josefsson  <jas@extundo.com>
714
715         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
716         GC_USE_HMAC_MD5, respectively.
717
718         * gc-libgcrypt.c (gc_md5): Fix assert call.
719         (gc_md5): Fix typo.
720
721         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
722
723         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
724
725         * gc-gnulib.c (gc_hash_buffer): Ditto.
726
727 2005-10-11  Bruno Haible  <bruno@clisp.org>
728
729         * c-strcasestr.h: New file, from GNU gettext.
730         * c-strcasestr.c: New file, from GNU gettext.
731
732 2005-10-11  Bruno Haible  <bruno@clisp.org>
733
734         * c-strcase.h: New file, from GNU gettext.
735         * c-strcasecmp.c: New file, from GNU gettext.
736         * c-strncasecmp.c: New file, from GNU gettext.
737
738 2005-10-11  Simon Josefsson  <jas@extundo.com>
739
740         * crc.h, crc.c: New files.
741
742         * gc.h (gc_hash_buffer): Add doc.
743
744 2005-10-08  Simon Josefsson  <jas@extundo.com>
745
746         * gc.h: Add gc_hash and gc_hash_buffer.
747
748         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
749
750         * gc-libgcrypt.c (gc_hash_buffer): Add.
751
752 2005-10-11  Bruno Haible  <bruno@clisp.org>
753
754         * strcasecmp.c: Include limits.h.
755         (strcasecmp): Avoid integer overflow on exotic platforms.
756         * strncasecmp.c: Include limits.h.
757         (strncasecmp): Avoid integer overflow on exotic platforms.
758         Reported by Paul Eggert.
759
760 2005-10-06  Simon Josefsson  <jas@extundo.com>
761
762         * hmac-md5.c: New file.
763
764         * hmac.h: New file.
765
766 2005-10-06  Simon Josefsson  <jas@extundo.com>
767
768         * memxor.c (memxor): Avoid casts and warnings.
769
770 2005-10-05  Derek Price  <derek@ximbiot.com>
771
772         * getdelim.c (SIZE_MAX): New macro, if not already defined.
773
774 2005-10-05  Simon Josefsson  <jas@extundo.com>
775
776         * memxor.c (memxor): Fix compiler error.
777
778         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
779         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
780
781         * memxor.h, memxor.c: New files.
782
783         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
784         we assume all systems have it, suggested by Jim Meyering
785         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
786         any systems lack sys/socket.h; mingw32 is known to lack it, but we
787         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
788         same reasons.
789
790 2005-10-04  Bruno Haible  <bruno@clisp.org>
791
792         * verify.h (verify_true): Provide alternative definition for C++.
793
794 2005-10-04  Simon Josefsson  <jas@extundo.com>
795
796         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
797         D. Baushke" <mdb@gnu.org>.
798
799 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
800
801         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
802         (SSIZE_MAX): New macro, if not already defined.
803         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
804         than 2 GiB.
805
806 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
807
808         * exclude.c: Include verify.h.
809         (verify): Remove.  All callers changed to use verify.h's version.
810         * strtoimax.c: Likewise.
811         * utimecmp.c: Likewis.e
812
813         Sync from coreutils.
814         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
815         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
816         * .cvsignore: Add fts.h, search.h, t-fpending.
817         * settime.c (settime): Fix { typo in previous patch.  Also, don't
818         bother returning ENOSYS if settimeofday or stime fails; just let
819         them return whatever errno they want to return.
820         * utimens.c: Include unistd.h, for dup2.
821         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
822         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
823
824 2005-10-02  Jim Meyering  <jim@meyering.net>
825
826         Sync from coreutils.
827         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
828         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
829         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
830         Remove AT_FDCWD test.
831         Do not consume the fd unless successful.
832         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
833         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
834         block, so that we don't even try to compile it if settimeofday is
835         available.  This works around a compilation failure on OSF1 V5.1,
836         due to stime requiring a `long int*' while tv_sec is `int'.
837
838 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
839
840         * getdelim.c (getdelim): Remove unused variables.
841
842 2005-10-01  Simon Josefsson  <jas@extundo.com>
843
844         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
845         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
846         AI_* and EAI_* definitions.  Protect function declarations.
847
848 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
849
850         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
851         so that the code works even with ancient cpp.  Portability problem
852         with GCC 2.7.2.1 reported by Thomas M.Ott.
853
854 2005-09-27  Jim Meyering  <jim@meyering.net>
855
856         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
857
858         * intprops.h (signed_type_or_expr__): Define.
859         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
860         for unsigned types.
861
862 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
863
864         * verify.h (verify_expr): Remove, replacing with:
865         (verify_true): New macro that returns true instead of void.
866         (verify_type__): Remove.
867         (verify): Use verify_true rather than verify_type__.
868
869 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
870
871         * utimens.c (ENOSYS): Define if not already defined.
872         (futimens): Support having a null PATH if the file descriptor
873         is nonnegative.
874
875         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
876         Remove.
877         (__attribute): Define to empty unless GCC 3.1 or later.
878         This works around a core dump on OpenBSD 3.4, which has GCC
879         2.95.3, which dumps core when given __attribute__(()).  It also
880         simplifies other tests, since we really don't want to bother with
881         worrying about which ancient version of GCC supported what.
882         Original problem reported by Yoann Vandoorselaere, with part of
883         the fix suggested by Derek Price.
884
885 2005-09-24  Jim Meyering  <jim@meyering.net>
886
887         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
888         so we can once again use a positive bitfield width of 1 -- now we
889         don't have to explain why we were using a bitfield width of 2.
890
891 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
892
893         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
894         Problem reported by Eric Blake.
895         (getaddrinfo): Initialize se so that it's not garbage.
896         Redo internal storage allocation so that it doesn't make unportable
897         assumptions about alignment.
898         Fix a memory leak.
899
900         * utimens.c (futimens): Use futimesat if available.
901         Prefer it to futimes since it doesn't have the futimes bug.
902
903         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
904         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
905         Instead, declare a function that returns a pointer to an array,
906         and use verify_type__ to declare the size of the array.
907         Problem and germ of a solution reported by Bruno Haible.
908         (verify_type__): Use 2, not 1, for bitfield size, to avoid
909         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
910
911 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
912
913         Sync from coreutils.
914
915         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
916         stat-time.h.
917         * argmatch.h: Include verify.h
918         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
919         (ARGMATCH_ASSERT): Remove; unused.
920         * canonicalize.c: Assume STDC_HEADERS.
921         * exclude.c: Include "strcase.h".
922         * regex_internal.h [!defined _LIBC]: Likewise.
923         * getusershell.c: Include stdio--.h rather than stdio.h
924         and stdio-safer.h.
925         (getusershell): Call fopen, not fopen_safer.
926         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
927         Do not include unistd-safer.h.
928         (save_cwd): Don't call fd_safer; no longer needed
929         now that we include fcntl--.h.
930
931         * getdate.y (relative_time): New type.
932         (RELATIVE_TIME_0): New constant.
933         (parser_control): Use relative_time instead of doing it ourselves.
934         (%union): Add new relative_time rel member.
935         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
936         Now typeless.
937         (relunit, relunit_snumber): Now of type rel.
938         (zone, rel, relunit, get_date): Adjust to above changes.
939
940         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
941         Do not include unistd-safer.h.
942         (getloadavg): Don't call fd_safer; no longer needed
943         now that we include fcntl--.h.
944
945         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
946         (make_dir_parents): Treat ENOSYS like EEXIST.
947
948         Improve quality of diagnostics on restore_cwd failure.
949         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
950         (make_dir_parents): Last arg is now int * (for errno), not bool *.
951         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
952         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
953         each time through the loop.  Do not diagnose restore_cwd failure;
954         that is the caller's job (and perhaps the caller does not care).
955
956         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
957         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
958         If the file already exists but is not a directory, don't bother
959         to try to make its parents.
960         Close potential file descriptor leak if we can't chdir("/") (!).
961         Don't always return true if chdir($PWD) fails; return true only
962         if the requested action was done successfully (except for the
963         chdir($PWD)).
964         Don't log final directory unless we actually made it.
965         Refactor to avoid duplicate code to fix up permissions.
966         Don't attempt to fix up parent permissions if chdir($PWD) fails.
967
968         * strftime.c (my_strftime): Rewrite the previous change slightly,
969         to make it a bit faster and (I hope) clearer.
970         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
971         Fix bug in formats like %2N.
972
973         * verify.h: New file.
974
975 2005-09-22  Jim Meyering  <jim@meyering.net>
976
977         Sync from coreutils.
978
979         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
980
981         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
982         the .tm_year member, since otherwise gcc-4.0 would now warn about
983         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
984
985         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
986         order to avoid an unsuppressible warning from gcc on 64-bit systems.
987
988         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
989         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
990         when run in a time zone for which daylight savings time is in effect
991         for the starting date.
992
993         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
994         stop us from restricting permissions of just-created absolute-named
995         directories.
996         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
997         to restore initial working directory.
998         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
999         to tell caller if/when we change the working directory and are
1000         unable to return to the initial one.
1001         * mkdir-p.h (make_dir_parents): Update prototype.
1002         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
1003         `return false'.  This fixes a bug introduced on 2004-07-30.
1004
1005         * openat.c (fdopendir): Be sure to close the supplied
1006         file descriptor before returning.  This makes our replacement
1007         implementation a little closer to Solaris's, where fdopendir
1008         ties the file descriptor to the returned DIR* pointer.
1009         * openat.c (unlinkat): New function.
1010         * openat.h (unlinkat): Add prototype.
1011         * openat-die.c (openat_save_fail): Rename from openat_save_die.
1012         (openat_restore_fail): Rename from openat_restore_die.
1013         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
1014
1015         Provide an alternative to exiting immediately upon save_cwd or
1016         restore_cwd failure.  Now, an application can arrange e.g.,
1017         to perform a longjump in that case.
1018         * openat.c: Include dirname.h.
1019         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
1020         (rpl_openat, fdopendir, fstatat): Call openat_save_die
1021         and openat_restore_die rather than calling error directly.
1022         Don't include "error.h" or "exitfail.h"; they're no longer needed.
1023
1024         * openat-die.c (openat_save_die, openat_restore_die): New file.
1025         * openat.h (openat_save_die, openat_restore_die): Declare and define.
1026
1027         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
1028         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
1029                             int utc, int nanoseconds);
1030         Background:
1031         date should not have to allocate a megabyte of virtual memory to
1032         handle a format argument like +%1048575T.  When implemented with
1033         strftime, it must allocate such a buffer, use strftime to fill it
1034         in, print it, then free it.
1035         With fprintftime, it simply prints everything and exits.
1036         With no need for memory allocation, that's one fewer way to fail.
1037         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
1038         optional field width, not before, so we accept %9:z, not %:9z.
1039         (my_strftime): Be sure to use L_('x') for literals.
1040
1041         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
1042         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
1043         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
1044         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
1045         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
1046         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
1047         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
1048         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
1049         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
1050
1051         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1052         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
1053         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1054         and don't include <sys/file.h>).
1055
1056 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
1057
1058         Sync from coreutils.
1059
1060         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
1061         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
1062         [!LDAV_DONE]: Avoid unused variable warning.
1063
1064 2005-09-21  Bruno Haible  <bruno@clisp.org>
1065
1066         * unicodeio.h (unicode_to_mb): New declaration.
1067
1068 2005-09-20  Derek Price  <derek@ximbiot.com>
1069
1070         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
1071
1072 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1073
1074         Use a consistent style for including <config.h>.
1075         * __fpending.c, acl.c, argmatch.c,
1076         argp-help.c, argp-parse.c,
1077         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
1078         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
1079         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
1080         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
1081         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
1082         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
1083         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
1084         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
1085         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
1086         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
1087         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
1088         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
1089         modechange.c, mountlist.c, open-safer.c, physmem.c,
1090         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
1091         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
1092         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
1093         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
1094         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
1095         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
1096         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
1097         userspec.c, utimecmp.c, version-etc-fsf.c,
1098         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
1099         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
1100         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
1101         Standardize inclusion of config.h.
1102         * __fpending.h, dirfd.h, getdate.h, human.h,
1103         inttostr.h:  Removed inclusion of config.h from header files.
1104         * inttostr.c:  Adjusted in-tree users.
1105         * timespec.h: Remove superfluous warning to include config.h.
1106         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
1107         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
1108         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
1109         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
1110
1111 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
1112
1113         * stat-time.h: New file.
1114         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
1115         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
1116         in a different way.
1117         (timespec_cmp): New function.
1118         * utimecmp.c: Include stat-time.h.
1119         (SYSCALL_RESOLUTION): Depend on whether various struct stat
1120         members exist, not on the obsolescent ST_MTIM_NSEC.
1121         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
1122
1123 2005-09-15  Derek Price  <derek@ximbiot.com>
1124             Paul Eggert  <eggert@cs.ucla.edu>
1125
1126         * regcomp.c, regexec.c, regex_internal.c: Back out previous
1127         changes, consolidating in...
1128         * regex_internal.h: ...this file.
1129
1130 2005-09-15  Derek Price  <derek@ximbiot.com>
1131
1132         * regex_internal.h: Blank `pure' for GNUC < 3.
1133         * regex_internal.c: Ditto, using this...
1134         (__GNUC_PREREQ): ...new macro.
1135         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
1136         (__GNUC_PREREQ): ...this new macro.
1137
1138         * strstr.h: Include string.h. Define strstr as a macro here.
1139
1140 2005-09-13  Derek Price  <derek@ximbiot.com>
1141
1142         * canon-host.c (canon_host_r): Set *cherror on memory allocation
1143         failure.
1144         Reported by Jim Meyering  <jim@meyering.net>.
1145
1146 2005-09-13  Jim Meyering  <jim@meyering.net>
1147
1148         * canon-host.c: Filter through gnu indent and reword comments slightly.
1149         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
1150
1151 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
1152
1153         * lib/base64.c: Typo.
1154         (base64_encode): Put b64str in initialized data section.
1155
1156 2005-09-12  Derek Price  <derek@ximbiot.com>
1157
1158         Return usable errors from canon-host.
1159         * canon-host.h: New file.
1160         * canon-host.c (canon_host): Wrap...
1161         (canon_host_r): ...this new function, which now relies exclusively on
1162         getaddrinfo.
1163         (ch_strerror): New function.
1164         (last_cherror): New global.
1165         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
1166         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
1167         void *.
1168         (freeaddrinfo): Free ai->ai_canonname when set.
1169
1170 2005-09-12  Derek Price  <derek@ximbiot.com>
1171             Paul Eggert  <eggert@cs.ucla.edu>
1172
1173         * glob-libc.h: Renamed from glob_.h.  The new version is
1174         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
1175         protecting things that should be done only in gnulib contexts.
1176         * glob_.h: New file, containing only the glob things needed for
1177         gnulib.
1178         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
1179         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
1180         (glob, globfree, glob_pattern_p): Now defined simply in terms of
1181         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
1182         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
1183         and to respect the namespace rules better.
1184
1185 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
1186
1187         Merge glibc and coreutils changes into gnulib, plus a few
1188         extra fixes.
1189         * md5.c: Use #error rather than a string.
1190         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
1191         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
1192         (__attribute__): Define to empty for non recent-GCC.
1193         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
1194         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
1195         Renamed from their non-__ counterparts, with new macros replacing
1196         them if not _LIBC.  Add __THROW attribute.
1197         (rol): Remove.
1198         (struct md5_ctx): Align buffer if using GCC.
1199         * sha1.h (struct sha1_ctx): Likewise.
1200         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
1201         The old name was backwards.
1202         (NOTSWAP): Remove; not used.
1203         (rol): New macro, moved here from md5.h.
1204         (sha1_process_block): Remove a FIXME that doesn't make sense.
1205
1206 2005-09-12  Derek Price  <derek@ximbiot.com>
1207
1208         * gai_strerror.c: Include config.h when available.  Include
1209         getaddrinfo.h before other headers to test interface.
1210         Reported by Larry Jones <lawrence.jones@ugs.com>.
1211
1212 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
1213
1214         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
1215         definitions, since that's the preferred style in glibc.
1216         Fix a minor spacing issue, and update copyright notice to match glibc's.
1217
1218 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1219
1220         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
1221
1222 2005-09-06  Simon Josefsson  <jas@extundo.com>
1223
1224         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
1225         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
1226
1227 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
1228
1229         Change bitset word type from unsigned int to unsigned long int,
1230         as this has better performance on typical 64-bit hosts.
1231         Port bitset code to hosts with unusual word sizes.
1232         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
1233         (build_collating_symbol):
1234         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
1235         argument is a bitset.  This is merely a style issue, but it makes
1236         it clearer that an entire array is expected.
1237         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
1238         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
1239         Port to the case where bitset_word is not the same as unsigned int.
1240         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
1241         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
1242         Likewise.
1243         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1244         (build_trtable, group_nodes_into_DFAstates):
1245         Likewise.
1246         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
1247         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
1248         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
1249         * regexec.c (group_nodes_into_DFAstates): Likewise.
1250         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
1251         * regcomp.c (optimize_subexps, lower_subexp):
1252         Work even if bitset_word has holes in its bitwise representation.
1253         * regex_internal.h (BITSET_WORD_BITS): Likewise.
1254         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1255         Likewise.
1256         * regex_internal.c (re_string_reconstruct):
1257         Don't assume UCHAR_MAX == 255.
1258         * regex_internal.h (bitset_set_all): Likewise.
1259         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
1260         All uses changed.
1261         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
1262         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
1263         All uses changed.
1264         (BITSET_WORD_MAX): New macro.
1265         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
1266         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
1267         (bitset_empty, bitset_copy):
1268         Prefer sizeof (bitset) to multiplying it out ourselves.
1269         (bitset_not_merge): Remove; unused.
1270         (bitset_contain): Return bool, not unsigned int with one bit on.
1271         All callers changed.
1272         * regexec.c (build_trtable): Don't assume bitset has no stricter
1273         alignment than re_node_set; do this by defining a new internal
1274         type struct dests_alloc and using it to allocate memory.
1275
1276 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
1277
1278         Check for arithmetic overflow when calculating sizes, to prevent
1279         some buffer-overflow issues.  These patches are conservative, in the
1280         sense that when I couldn't determine whether an overflow was possible,
1281         I inserted a run-time check.
1282         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
1283         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
1284         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
1285         (re_xnrealloc, re_x2nrealloc): New inline functions.
1286         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
1287         (build_equiv_class, build_charclass): Check for arithmetic overflow
1288         in size expression calculations.
1289         * lib/regex_internal.c (re_string_realloc_buffers):
1290         (build_wcs_upper_buffer, re_node_set_add_intersect):
1291         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
1292         (re_dfa_add_node, register_state): Likewise.
1293         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
1294         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
1295         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
1296         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
1297
1298 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
1299
1300         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
1301         to avoid a collision with bits/local_lim.h in glibc.
1302         All uses changed.  Problem reported by Dmitry V. Levin in
1303         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
1304
1305         * regex_internal.c (build_wcs_upper_buffer): Fix portability
1306         bugs in int versus size_t comparisons.
1307         (re_string_context_at): Fix bug where the code assumed that
1308         Idx is signed.
1309
1310         Use bool where appropriate.
1311         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
1312         All callers changed.
1313         (calc_eclosure_iter): Likewise, for ROOT arg.
1314         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
1315         (build_charclass_op): Likewise, for NON_MATCH arg.
1316         * regex_internal.c (re_string_allocate, re_string_construct):
1317         (re_string_construct_common): Likewise, for ICASE arg.
1318         * regexec.c (re_search_2_stub, re_search_stub):
1319         Likewise, for RET_LEN arg.
1320         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
1321         (set_regs): Likewise, for FL_BACKTRACK arg.
1322         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
1323         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
1324         (calc_eclosure_iter, parse_bracket_exp):
1325         Use bool for internal variables that are booleans.
1326         * regexec.c (re_search_internal, check_matching, proceed_next_node):
1327         (set_regs, build_sifted_states, sift_states_bkref):
1328         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
1329         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1330         (find_collation_sequence_value):
1331         Likewise.
1332         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
1333         (re_node_set_compare):
1334         Return bool, not int. All callers changed.
1335         * regexec.c (check_halt_node_context, check_dst_limits):
1336         (build_trtable, check_node_accept): Likewise.
1337         * regex_internal.h: Include stdbool.h.
1338
1339         Fix bugs uncovered when converting to bool.
1340         * regcomp.c (calc_eclosure_iter): Check for storage allocation
1341         failure instead of charging ahead blindly.
1342         * regex_internal.c (register_state): Likewise.
1343         * regexec.c (re_search_2_stub): Use simpler method than boolean
1344         for freeing internal storage.
1345         (group_nodes_into_DFA_states): Use unsigned int, not int, for
1346         bitset pieces used as boolean, to avoid undefined behavior
1347         on hosts that do int overflow checking.
1348
1349 2005-08-31  Derek Price  <derek@ximbiot.com>
1350
1351         * getdelim.c (getdelim): Return EOF on EOF.
1352         Reported by Larry Jones <lawrence.jones@ugs.com>.
1353
1354 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
1355
1356         * regex_internal.c (re_string_reconstruct): Don't assume buffer
1357         lengths fit in regoff_t; this isn't true if regoff_t is the same
1358         width as size_t.
1359         * regex.c (re_search_internal): 5th arg is LAST_START
1360         (= START + RANGE) instead of RANGE.  This avoids overflow
1361         problems when regoff_t is the same width as size_t.
1362         All callers changed.
1363         (re_search_2_stub): Check for overflow when adding the
1364         sizes of the two strings.
1365         (re_search_stub): Check for overflow when adding START
1366         to RANGE; if it occurs, substitute the extreme value.
1367
1368 2005-08-31  Jim Meyering  <jim@meyering.net>
1369
1370         * regcomp.c (search_duplicated_node): Make first pointer arg
1371         a pointer-to-const.
1372         * regex_internal.c (create_ci_newstate, create_cd_newstate):
1373         (register_state): Likewise.
1374         * regexec.c (search_cur_bkref_entry, check_dst_limits):
1375         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
1376         (group_nodes_into_DFAstates): Likewise.
1377
1378 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
1379
1380         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
1381         old glibc regex code mishandles strings longer than 2**31 bytes.
1382         This patch fixes this when the regex code is used in gnulib
1383         (i.e., outside glibc).
1384
1385         This patch should not affect the use of the regex code inside
1386         glibc.  No doubt this problem also needs to be handled for glibc
1387         as well, but the result will be an incompatible change to the
1388         glibc ABI, and the old ABI will have to be supported too.  That
1389         can be the the subject for another patch.
1390
1391         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
1392         governing whether the rest of this patch is active.  By default,
1393         the macro is disabled and the patch has no effect.
1394         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
1395         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
1396         (struct re_pattern_buffer, re_search, re_search_2, re_match):
1397         (re_match_2, re_set_registers): Use the new types.
1398         * regex_internal.h (Idx, re_hashval_t): New types.
1399         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
1400         New macros.
1401         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
1402         (re_string_context_at, bin_tree_t, re_dfastate_t):
1403         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
1404         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
1405         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
1406         (re_string_char_size_at, re_string_wchar_at):
1407         (re_string_elem_size_at):
1408         Use the new types and macros to port to 64-bit hosts.
1409         Use unsigned types for internal values, so that the code
1410         mostly works even for arrays larger than SSIZE_MAX.
1411         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
1412         (search_duplicated_node, calc_eclosure_iter, fetch_number):
1413         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
1414         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
1415         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
1416         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
1417         (calc_inveclosure, parse_dup_op, build_range_exp):
1418         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
1419         (fetch_number, create_token_tree, mark_opt_subexp):
1420         Likewise.
1421         * regex_internal.c (re_string_construct_common, create_ci_newstate):
1422         (create_cd_newstate, re_string_allocate, re_string_construct):
1423         (re_string_realloc_buffers, build_wcs_upper_buffer):
1424         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1425         (re_string_reconstruct, re_string_peek_byte_case):
1426         (re_string_fetch_byte_case, re_string_context_at):
1427         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1428         (re_node_set_init_copy, re_node_set_add_intersect):
1429         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1430         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1431         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1432         (re_acquire_state, re_acquire_state_context, register_state):
1433         Likewise.
1434         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
1435         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
1436         (re_search_internal, re_search_2_stub, re_search_stub)
1437         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
1438         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
1439         (update_cur_sifted_state, check_dst_limits):
1440         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
1441         (check_subexp_limits, sift_states_bkref, merge_state_array):
1442         (check_subexp_matching_top, get_subexp, get_subexp_sub):
1443         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
1444         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1445         (expand_bkref_cache, check_node_accept_bytes):
1446         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
1447         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
1448         (acquire_init_state_context, check_halt_node_context):
1449         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
1450         (sift_states_backward, clean_state_log_if_needed):
1451         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
1452         (find_recover_state, transit_state_sb, transit_state_mb):
1453         (transit_state_bkref, build_trtable, match_ctx_clean):
1454         Likewise.
1455         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
1456         to work around an assumption that REG_MISSING is negative.
1457
1458         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
1459         (seek_collating_symbol_entry) [defined _LIBC]:
1460         (lookup_collation_sequence_value) [defined _LIBC]:
1461         (build_range_exp, build_collating_symbol) [defined _LIBC]:
1462         Use prototypes rather than old-style function definitions.
1463         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
1464         (transit_state_sb) [0]:
1465         (find_collation_sequence_value) [defined _LIBC]: Likewise.
1466
1467         * regexec.c (re_search_internal): Simplify update of rm_so and
1468         rm_eo.
1469
1470         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
1471         (optimize_subexps, lower_subexp):
1472         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
1473         since the signed shift might overflow.  Use 1u<<31 instead.
1474         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
1475         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1476         Likewise.
1477
1478         * regcomp.c (optimize_subexps, lower_subexp):
1479         Use CHAR_BIT rather than 8, for clarity.
1480         * regexec.c (check_dst_limits_calc_pos_1):
1481         (check_subexp_matching_top): Likewise.
1482         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
1483         have to worry about portability issues when shifting it left.
1484         Remove no-longer-needed test for table_size > 0.
1485         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
1486         in a word, as the resulting behavior is undefined.
1487         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
1488         in one case, a <= should have been an <, and in another case the
1489         whole test was missing.
1490         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
1491         the standard name CHAR_BIT.
1492         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
1493         this is not true on one's complement and signed-magnitude hosts.
1494
1495         * regex_internal.h (re_sub_match_top_t): Remove unused member
1496         next_last_offset.
1497         (struct re_dfa_t): Remove unused member states_alloc.
1498         * regcomp.c (init_dfa): Don't initialize unused members.
1499
1500 2005-08-31  Bruno Haible  <bruno@clisp.org>
1501
1502         * strstr.c: Include <stddef.h>, for NULL.
1503         * strcasestr.c: Likewise.
1504         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
1505
1506 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
1507
1508         * iconvme.h: Add prototype for iconv_alloc.
1509
1510 2005-08-29  Simon Josefsson  <jas@extundo.com>
1511
1512         * iconvme.c: Fix errno.
1513
1514 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
1515
1516         * iconvme.c: Split iconv_string into iconv_alloc.
1517
1518 2005-08-27  Jim Meyering  <jim@meyering.net>
1519
1520         * fopen-safer.c: Merge minor changes from coreutils.
1521         * dup-safer.c: Likewise.
1522         * fd-safer.c: Likewise.
1523
1524         Merge from coreutils.
1525         * stdio--.h: New file.
1526         * stdlib--.h: New file.
1527         * mkstemp-safer.c: New file.
1528
1529         GNU tar needs these.
1530         * pipe-safer.c: New file.
1531         * creat-safer.c: New file.
1532         * fcntl--.h (creat): Define to creat_safer.
1533         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
1534         * unistd--.h (pipe): Define to pipe_safer.
1535         * unistd-safer.h: Declare pipe_safer.
1536
1537 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
1538
1539         * regex_internal.h: Remove all references to
1540         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
1541         or better.
1542         (bitset_not, bitset_merge, bitset_not_merge):
1543         (bitset_mask, re_string_allocate, re_string_construct):
1544         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
1545         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
1546         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
1547         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
1548         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1549         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1550         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
1551         (re_acquire_state_context):
1552         Remove unnecessary forward decls.
1553         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
1554         Put __attribute at function definition,
1555         now that the function decl has been removed.
1556         * lib/regex_internal.c (re_string_peek_byte_case):
1557         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
1558         Likewise.
1559
1560 2005-08-26  Simon Josefsson  <jas@extundo.com>
1561
1562         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
1563         Haible <bruno@clisp.org>.
1564
1565 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
1566
1567         * regexec.c (set_regs): Don't alloca with an unbounded size.
1568
1569         alloca modernization/simplification for regex.
1570         * regex.c: Remove portability cruft for alloca.  This no longer
1571         needs to be at the start of the file, and can be moved into
1572         regex_internal.h and simplified.
1573         * regex_internal.h: Include <alloca.h>.
1574         (__libc_use_alloca) [!defined _LIBC]: New macro.
1575         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
1576         now works outside glibc.
1577
1578 2005-08-24  Simon Josefsson  <jas@extundo.com>
1579
1580         * getpass.c: Add WIN32 implementation.  Conditionalize use of
1581         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
1582         GLIBC specific code.
1583
1584 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
1585
1586         Make regex safe for g++.  This fixes one real bug (an "err"
1587         that should have been "*err").  g++ problem reported by
1588         Sam Steingold.
1589         * regex_internal.h (re_calloc): New macro, consistent with
1590         re_malloc etc.  All callers of calloc changed to use re_calloc.
1591         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
1592         not int.  All callers changed.
1593         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
1594         just use an array of size MB_LEN_MAX.
1595         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
1596         (find_recover_state): Change "err" to "*err"; this fixes what
1597         appears to be a real bug.
1598         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
1599         versus int.
1600
1601 2005-08-25  Jim Meyering  <jim@meyering.net>
1602
1603         * open-safer.c: Include <config.h>.
1604         Otherwise, we'd lose LARGEFILE support in any file using
1605         e.g. "fcntl--.h"
1606
1607 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
1608
1609         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
1610         * regex.h (regerror): Likewise.
1611
1612         * regex.c: Do not include <sys/types.h>, as POSIX no longer
1613         requires this.  (The code never needed it.)
1614
1615         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
1616         All uses of recently-renamed identifiers changed to use the new,
1617         POSIX-compliant names.  The code will build and run just fine
1618         without these changes, but it's better to eat our own dog food
1619         and use the standard-conforming names.
1620
1621         * regex.h: Fix a multitude of POSIX name space violations.
1622         These changes have an effect only for programs that define
1623         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
1624         do not change anything for programs compiled in the normal way.
1625         Also, there is no effect on the ABI.
1626
1627         (_REGEX_SOURCE): New macro.
1628         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
1629         defined and _GNU_SOURCE is not; this fixes a name space violation.
1630
1631         Rename the following macros to obey POSIX requirements.
1632         The old names are still visible as macros if _REGEX_SOURCE is defined.
1633         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
1634         RE_BACKSLASH_ESCAPE_IN_LISTS.
1635         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
1636         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
1637         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
1638         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
1639         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
1640         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
1641         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
1642         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
1643         (REG_INTERVALS): renamed from RE_INTERVALS.
1644         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
1645         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
1646         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
1647         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
1648         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
1649         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
1650         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
1651         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
1652         RE_UNMATCHED_RIGHT_PAREN_ORD.
1653         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
1654         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
1655         (REG_DEBUG): renamed from RE_DEBUG.
1656         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
1657         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
1658         unusual, since we can't clash with the POSIX REG_ICASE.
1659         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
1660         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
1661         (REG_NO_SUB): renamed from RE_NO_SUB.
1662         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
1663         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
1664         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
1665         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
1666         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
1667         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
1668         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
1669         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
1670         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
1671         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
1672         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
1673         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
1674         RE_SYNTAX_POSIX_MINIMAL_BASIC.
1675         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
1676         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
1677         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
1678         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
1679         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
1680         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
1681         (REG_FIXED): Renamed from REGS_FIXED.
1682         (REG_NREGS): Renamed from RE_NREGS.
1683
1684         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
1685         of other REG_* macros, since POSIX says the user is allowed to
1686         #undef these macros selectively.
1687
1688         (reg_errcode_t): Update comment stating what other tables need
1689         to be consistent.
1690
1691         Rename the following enum values to obey POSIX requirements.
1692         The old names are still visible as macros.
1693         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
1694         is not defined, since GNU is supposed to be a superset of POSIX as
1695         much as possible, and since we want reg_errcode_t to be a signed
1696         type for implementation consistency.
1697         (_REG_NOERROR): Renamed from REG_NOERROR.
1698         (_REG_NOMATCH): Renamed from REG_NOMATCH.
1699         (_REG_BADPAT): Renamed from REG_BADPAT.
1700         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
1701         (_REG_ECTYPE): Renamed from REG_ECTYPE.
1702         (_REG_EESCAPE): Renamed from REG_EESCAPE.
1703         (_REG_ESUBREG): Renamed from REG_ESUBREG.
1704         (_REG_EBRACK): Renamed from REG_EBRACK.
1705         (_REG_EPAREN): Renamed from REG_EPAREN.
1706         (_REG_EBRACE): Renamed from REG_EBRACE.
1707         (_REG_BADBR): Renamed from REG_BADBR.
1708         (_REG_ERANGE): Renamed from REG_ERANGE.
1709         (_REG_ESPACE): Renamed from REG_ESPACE.
1710         (_REG_BADRPT): Renamed from REG_BADRPT.
1711         (_REG_EEND): Renamed from REG_EEND.
1712         (_REG_ESIZE): Renamed from REG_ESIZE.
1713         (_REG_ERPAREN): Renamed from REG_ERPAREN.
1714         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
1715         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
1716         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
1717         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
1718
1719         (_REG_RE_NAME, _REG_RM_NAME): New macros.
1720         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
1721         changed.  But support the old name if the new one is not defined
1722         and if _REGEX_SOURCE.
1723
1724         Change the following member names in struct re_pattern_buffer.
1725         The old names are still supported if !_REGEX_SOURCE.
1726         The new names are always supported, regardless of _REGEX_SOURCE.
1727         (re_buffer): Renamed from buffer.
1728         (re_allocated): Renamed from allocated.
1729         (re_used): Renamed from used.
1730         (re_syntax): Renamed from syntax.
1731         (re_fastmap): Renamed from fastmap.
1732         (re_translate): Renamed from translate.
1733         (re_can_be_null): Renamed from can_be_null.
1734         (re_regs_allocated): Renamed from regs_allocated.
1735         (re_fastmap_accurate): Renamed from fastmap_accurate.
1736         (re_no_sub): Renamed from no_sub.
1737         (re_not_bol): Renamed from not_bol.
1738         (re_not_eol): Renamed from not_eol.
1739         (re_newline_anchor): Renamed from newline_anchor.
1740
1741         Change the following member names in struct re_registers.
1742         The old names are still supported if !_REGEX_SOURCE.
1743         The new names are always supported, regardless of _REGEX_SOURCE.
1744         (rm_num_regs): Renamed from num_regs.
1745         (rm_start): Renamed from start.
1746         (rm_end): Renamed from end.
1747
1748         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
1749         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
1750         Prepend __ to parameter names.
1751
1752         Undo yesterday's changes.
1753
1754 2005-08-24  Jim Meyering  <jim@meyering.net>
1755
1756         Sync from coreutils.
1757         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
1758
1759 2005-08-21  Bruno Haible  <bruno@clisp.org>
1760
1761         * lock.h: Add multiple inclusion guard.
1762         * tls.h: Add multiple inclusion guard.
1763
1764 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
1765
1766         * regex.h (REG_NOSYS)
1767         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
1768         Define, since POSIX requires it as of 2001.
1769         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
1770         New private symbol, used to keep the enum signed in all cases.
1771         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
1772         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
1773
1774         * regex_internal.c (re_string_skip_chars, register_state):
1775         (calc_state_hash):
1776         Remove forward decls; no longer needed now that we use prototypes.
1777         * regexec.c (acquire_init_state_context, check_halt_node_context):
1778         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
1779         (clean_state_log_if_needed): Likewise.
1780
1781 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
1782
1783         Fix problems reported by Sam Steingold in
1784         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
1785         * regexec.c (sift_states_bkref): Fix portability bug: the code
1786         assumed that reg_errcode_t is a signed type, which is not
1787         necessarily true if _XOPEN_SOURCE is not defined.
1788         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
1789         some compilers warn about it otherwise.
1790
1791 2005-08-20  Jim Meyering  <jim@meyering.net>
1792
1793         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
1794         of unused local, dfa.
1795
1796 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
1797
1798         * regcomp.c (create_initial_state): Remove duplicate decl.
1799         (init_word_char, create_initial_state, duplicate_node_closure):
1800         (fetch_token, peek_token_bracket, build_range_exp):
1801         (build_collating_symbol): Remove forward decls; no longer needed
1802         now that we use prototypes.
1803
1804         * regcomp.c:
1805         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
1806         (re_compile_fastmap_iter, regcomp, regerror, regfree):
1807         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
1808         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
1809         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
1810         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
1811         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
1812         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
1813         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
1814         (build_range_exp, build_collating_symbol, parse_bracket_exp):
1815         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
1816         (build_charclass, build_charclass_op, fetch_number, create_tree):
1817         (create_token_tree, mark_opt_subexp, duplicate_tree):
1818         Use prototypes rather than old-style definitions.
1819
1820         * regex_internal.c:
1821         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
1822         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
1823         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1824         (re_string_reconstruct, re_string_peek_byte_case):
1825         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
1826         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1827         (re_node_set_init_copy, re_node_set_add_intersect):
1828         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1829         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1830         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1831         (re_acquire_state, re_acquire_state_context, register_state):
1832         (create_ci_newstate, create_cd_newstate, free_state):
1833         Likewise.
1834         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
1835         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
1836         (re_search_internal, prune_impossible_nodes):
1837         (acquire_init_state_context, check_matching, static):
1838         (check_halt_node_context, check_halt_state_context, proceed_next_node):
1839         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
1840         (update_regs, sift_states_backward, build_sifted_states):
1841         (clean_state_log_if_needed, merge_state_array):
1842         (update_cur_sifted_state, add_epsilon_src_nodes):
1843         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1844         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1845         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1846         (find_recover_state, check_subexp_matching_top, transit_state_mb):
1847         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1848         (check_arrival, check_arrival_add_next_nodes):
1849         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1850         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1851         (check_node_accept_bytes, check_node_accept, extend_buffers):
1852         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1853         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1854         (sift_ctx_init):
1855         Likewise.
1856
1857         * regex_internal.h:
1858         (re_string_allocate, re_string_construct, re_string_reconstruct):
1859         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1860         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1861         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1862         (re_string_context_at, re_string_peek_byte_case):
1863         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1864         is defined, since we now use prototypes always.
1865
1866         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
1867         C89 or better.  All uses removed.
1868
1869 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
1870
1871         * regex_internal.c (re_acquire_state, re_acquire_state_context)
1872         [defined lint]: Suppress bogus uninitialized-variable warnings.
1873
1874         * regcomp.c (duplicate_node): Return new index, not an error code,
1875         and let the caller return REG_ESPACE if out of space.  This
1876         removes an uninitialied-variable warning with GCC 4.0.1, and also
1877         avoids taking the address of a local variable.  All callers
1878         changed.
1879
1880 2005-08-19  Jim Meyering  <jim@meyering.net>
1881
1882         * regexec.c (proceed_next_node): Redo local variables to
1883         avoid GCC shadowing warnings.
1884
1885 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
1886
1887         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1888         (re_node_set_insert_last, re_dfa_add_node):
1889         Rename local variables to avoid GCC shadowing warnings.
1890
1891 2005-08-18  Bruno Haible  <bruno@clisp.org>
1892
1893         * strstr.c (strstr): Fix return value in multibyte case.
1894         * strcasestr.c (strcasestr): Likewise.
1895
1896 2005-08-17  Jim Meyering  <jim@meyering.net>
1897
1898         Make the %s format (seconds since the epoch) work for a negative
1899         number and when used with a zero-padded field width, e.g. %015s.
1900
1901         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1902         label so that it precedes the code to set `digits'.  Otherwise,
1903         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
1904         print `00-22'.  Now, it prints `-0022', as it should.
1905
1906 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
1907
1908         * regex.h: Remove useless space-before-tab.  From coreutils.
1909
1910 2005-08-17  Bruno Haible  <bruno@clisp.org>
1911
1912         * strcasestr.h: New file.
1913         * strcasestr.c: New file.
1914
1915 2005-08-17  Bruno Haible  <bruno@clisp.org>
1916
1917         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1918         * strstr.c: Completely rewritten, with multibyte locale support.
1919
1920 2005-08-17  Bruno Haible  <bruno@clisp.org>
1921
1922         * strcasecmp.c: Use mbuiter.h.
1923
1924 2005-08-17  Bruno Haible  <bruno@clisp.org>
1925
1926         * mbuiter.h: New file.
1927
1928 2005-08-16  Bruno Haible  <bruno@clisp.org>
1929
1930         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1931         (mbi_init): Update.
1932         (mbi_avail, mbi_advance): Let the iteration end before the terminating
1933         NUL byte, not after it.
1934
1935 2005-08-16  Bruno Haible  <bruno@clisp.org>
1936
1937         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
1938         the valid ones. Makes the comparison operations transitive:
1939         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
1940         * strcasecmp.c (strcasecmp): Use mb_casecmp.
1941
1942 2005-08-16  Bruno Haible  <bruno@clisp.org>
1943
1944         * strcase.h (strcasecmp): Add note in comments.
1945         * strncasecmp.c: Use code from strcasecmp.c.
1946         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
1947         (strcasecmp): Work correctly in multibyte locales.
1948
1949 2005-08-16  Bruno Haible  <bruno@clisp.org>
1950
1951         * strnlen1.h: New file.
1952         * strnlen1.c: New file.
1953
1954 2005-08-16  Bruno Haible  <bruno@clisp.org>
1955
1956         * mbfile.h: New file.
1957
1958 2005-08-16  Bruno Haible  <bruno@clisp.org>
1959
1960         * mbiter.h: New file.
1961
1962 2005-08-16  Bruno Haible  <bruno@clisp.org>
1963
1964         * mbchar.h: New file.
1965         * mbchar.c: New file.
1966
1967 2005-08-16  Bruno Haible  <bruno@clisp.org>
1968
1969         * tls.h: New file, from GNU gettext.
1970         * tls.c: New file, from GNU gettext.
1971
1972 2005-08-15  Bruno Haible  <bruno@clisp.org>
1973
1974         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1975         is defined.
1976
1977 2005-08-14  Jim Meyering  <jim@meyering.net>
1978
1979         Sync from coreutils.
1980
1981         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
1982         Use the hash-table-based cycle-detection code not just when
1983         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
1984         Reported by James Youngman in
1985         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
1986         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
1987         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
1988         This lets us compile with -DFTS_DEBUG, once again.
1989         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
1990         * fts.c (fd_safer): Remove decl.
1991         Include fcntl--.h rather than unistd-safer.h
1992         (fts_safe_changedir): Don't call fd_safer; no longer needed
1993         now that we include fcntl--.h.
1994
1995 2005-08-11  Simon Josefsson  <jas@extundo.com>
1996
1997         * readline.h, readline.c: New file.
1998
1999 2005-08-11  Bruno Haible  <bruno@clisp.org>
2000
2001         * strnlen.h (strnlen): Change parameter name to match comment.
2002
2003 2005-08-10  Simon Josefsson  <jas@extundo.com>
2004
2005         * strndup.c: Use strnlen.h.
2006
2007         * strnlen.h: New file.
2008
2009 2005-08-02  Simon Josefsson  <jas@extundo.com>
2010
2011         * getline.h, getline.c: Rewrite.
2012
2013         * getdelim.h, getdelim.c: New files, ported from glibc.
2014
2015 2005-07-31  Bruno Haible  <bruno@clisp.org>
2016
2017         * lock.h (gl_lock_initializer): New macro.
2018         (gl_lock_define_initialized): Use it.
2019         (gl_rwlock_initializer): New macro.
2020         (gl_rwlock_define_initialized): Use it.
2021         (gl_recursive_lock_initializer): New macro.
2022         (gl_recursive_lock_define_initialized): Use it.
2023
2024 2005-07-26  Bruno Haible  <bruno@clisp.org>
2025
2026         * lock.h: Update from GNU gettext.
2027         * lock.c: Update from GNU gettext.
2028
2029 2005-07-18  Bruno Haible  <bruno@clisp.org>
2030
2031         * lock.h (gl_once_t): New type.
2032         (gl_once_define, gl_once): New macros.
2033         * lock.c (fresh_once): New variable.
2034         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
2035         functions.
2036
2037 2005-07-18  Simon Josefsson  <jas@extundo.com>
2038
2039         * check-version.c (check_version): Accept identical versions too.
2040
2041 2005-07-18  Bruno Haible  <bruno@clisp.org>
2042
2043         * lock.h: New file, from GNU gettext.
2044         * lock.c: New file, from GNU gettext.
2045
2046 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
2047
2048         * quotearg.c: Add translator comment suggested by Bruno Haible,
2049         with a minor change.
2050
2051 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
2052
2053         * version-etc-fsf.c (version_etc_copyright): Parameterize the
2054         copyright symbol and the year.
2055         * version-etc.c (COPYRIGHT_YEAR): New constant.
2056         (version_etc_va): Use parameterized copyright notice.
2057         Reword to conform to the current GNU coding standards.
2058
2059 2005-07-11  Simon Josefsson  <jas@extundo.com>
2060
2061         * size_max.h: New file.
2062
2063 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2064
2065         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
2066         block of defines.
2067
2068 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
2069        and  Paul Eggert  <eggert@cs.ucla.edu>
2070
2071         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
2072         in wint_t, not wchar_t.  Remove now-unnecessary cast.
2073
2074 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
2075
2076         * regex.c, regex.h: Sync from libc.
2077         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
2078         New files, synced from libc, except that regex_internal.h
2079         currently has a small porting fix.
2080
2081 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
2082
2083         Remove the dependency of the strftime module on the tzset module.
2084         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
2085         Copy the input structure, to work around some of the bug with
2086         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
2087         Solaris releases, you should also use the tzset module, but we won't
2088         require it as a dependency any more since we don't want LGPLed code
2089         to depend on GPLed code.
2090
2091 2005-07-02  Jim Meyering  <jim@meyering.net>
2092
2093         * backupfile.c (backup_args): Change a `0' to NULL.
2094
2095 2005-07-01  Jim Meyering  <jim@meyering.net>
2096
2097         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2098         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
2099         * save-cwd.c, tempname.c:
2100         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2101         and don't include <sys/file.h>).
2102
2103 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
2104
2105         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
2106         declares only 'struct timespec;' (!).
2107
2108 2005-06-29  Jim Meyering  <jim@meyering.net>
2109
2110         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
2111         type name.  Use the variable name instead.
2112         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
2113
2114 2005-06-28  Simon Josefsson  <jas@extundo.com>
2115
2116         * check-version.h, check-version.c: New files.
2117
2118 2005-06-28  Simon Josefsson  <jas@extundo.com>
2119
2120         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
2121         collision with global variable.  Better indentation.  Don't
2122         increment buffer pointer beyond buffer end.  Based on comments
2123         from Paul Eggert <eggert@cs.ucla.edu>.
2124
2125         * base64.h: Indent.
2126
2127 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
2128
2129         * canon-host.c (canon-host): Append trailing "," to 0 in
2130         initializer of struct addrinfo, as an indication that we don't
2131         care how many members the structure has.
2132
2133 2005-06-24  Derek Price  <derek@ximbiot.com>
2134         and Bruno Haible  <bruno@clisp.org>
2135
2136         Remove stat module & update lstat.
2137         * stat.c: Remove this file...
2138         (slash_aware_lstat): ...moving this content and its support...
2139         * lstat.c (rpl_lstat): ...into here.
2140         * lstat.h: New file.
2141
2142 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
2143
2144         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
2145         (ranged_convert): Don't save conversion in a temporary struct.
2146         This causes a warning with GCC 4.0.0, and anyway in the typical
2147         case it's not worth the extra 100 bytes or so of code.
2148         (ranged_convert, __mktime_internal): When calling a function via a
2149         pointer P, use P () rather than (*P) (), as we now assume C89 or
2150         better.
2151
2152 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
2153
2154         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
2155         "who -r" failed to give output.  Problem reported by Tim Waugh.
2156
2157         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
2158         (xcalloc): Use it to avoid needless tests.
2159         Problem reported by Jim Meyering.
2160
2161 2005-06-16  Jim Meyering  <jim@meyering.net>
2162
2163         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
2164         when either N or S is zero.
2165
2166 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2167
2168         * argp.h (__option_is_short): Check upper limit of
2169         __key. Isprint() requires its argument to have the value
2170         of an unsigned char or EOF.
2171
2172 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
2173
2174         * fnmatch.c (fnmatch): If there is an encoding error in a
2175         multibyte string or pattern, fall back on unibyte matching.
2176         Problem reported by James Youngman.
2177
2178 2005-06-08  Bruno Haible  <bruno@clisp.org>
2179
2180         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
2181         warning on mingw.
2182
2183 2005-06-08  Bruno Haible  <bruno@clisp.org>
2184
2185         * csharpcomp.h: New file, from GNU gettext.
2186         * csharpcomp.c: New file, from GNU gettext.
2187         * csharpcomp.sh.in: New file, from GNU gettext.
2188
2189 2005-06-07  Derek Price  <derek@ximbiot.com>
2190
2191         Sync from CVS.
2192         * glob_.h: Indent nested #ifdef.
2193
2194 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
2195
2196         Sync from coreutils.
2197         Use "file name" when talking about file names, instead of "filename"
2198         or "path", as per the GNU coding standards.
2199         * mkdir-p.c: Renamed from makepath.c.
2200         (make_dir_parents): Renamed from make_path.  All callers changed.
2201         * mkdir-p.h: Likewise.  All includers changed.
2202         * filenamecat.c: Renamed from path-concat.c.
2203         (file_name_concat): Renamed from path_concat.  All callers changed.
2204         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
2205         * filenamecat.h: Likewise.  All includers changed.
2206         * acl.c: Don't use "path" or "filename" to mean "file name"
2207         in comments or local variable names.
2208         * basename.c: Likewise.
2209         * canonicalize.c, canonicalize.h: Likewise.
2210         * dirname.c, dirname.h: Likewise.
2211         * euidaccess.c: Likewise.
2212         * exclude.c: Likewise
2213         * fnmatch_.h, fnmatch_loop.c: Likewise.
2214         * fsusage.c, fsuage.h: Likewise.
2215         * fts.c, fts_.h: Likewise.
2216         * getcwd.c: Likewise.
2217         * getloadavg.c: Likewise.
2218         * mkstemp.c: Likewise.
2219         * mountlist.c, mountlist.h: Likewise.
2220         * openat.c, openat.h: Likewise.
2221         * readlink-stub.c: Likewise.
2222         * readutmp.c, readutmp.h: Likewise.
2223         * rename.c: Likewise.
2224         * rmdir.c: Likewise.
2225         * same.c: Likewise.
2226         * savedir.c: Likewise.
2227         * stripslash.c: Likewise.
2228         * tempname.c: Likewise.
2229         * xreadlink.c: Likewise.
2230         * exclude.c (excluded_file_name): Renamed from excluded_filename.
2231         All uses changed.
2232         * exclude.h: Likewise.
2233
2234         * euidaccess.c (getuid, getgid, getuid, getegid)
2235         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2236         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
2237         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2238         * pathmax.h: Include <limits.h> unconditionally, since other
2239         files have been getting away with it for years (MORE/BSD 4.3
2240         is extinct now).
2241         * userspec.c (getpwnam, getgrnam, getgrgid)
2242         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2243
2244         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
2245         Define to 256, not 255, as per modern POSIX.
2246
2247 2005-06-01  Bruno Haible  <bruno@clisp.org>
2248
2249         * csharpexec.h: New file, from GNU gettext.
2250         * csharpexec.c: New file, from GNU gettext.
2251         * csharpexec.sh.in: New file, from GNU gettext.
2252
2253 2005-05-31  Derek Price  <derek@ximbiot.com>
2254             Paul Eggert  <eggert@cs.ucla.edu>
2255
2256         Sync from cvs.
2257         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
2258
2259 2005-05-29  Derek Price  <derek@ximbiot.com>
2260             Paul Eggert  <eggert@cs.ucla.edu>
2261
2262         * glob_.h, glob.c: New files.
2263
2264 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
2265
2266         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
2267
2268         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
2269         the configuration hassle isn't worth it.
2270         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
2271         (LONGEST_MODIFIER, PRIuMAX): Remove.
2272
2273 2005-05-27  Bruno Haible  <bruno@clisp.org>
2274
2275         * getlogin_r.h: Remove second include of <stddef.h>.
2276
2277 2005-05-25  Bruno Haible  <bruno@clisp.org>
2278             Derek Price  <derek@ximbiot.com>
2279
2280         * getlogin_r.h: Simplify API documentation.
2281
2282 2005-05-25  Derek Price  <derek@ximbiot.com>
2283             Paul Eggert  <eggert@cs.ucla.edu>
2284
2285         * getlogin_r.c, getlogin_r.h: New files.
2286
2287 2005-05-22  Bruno Haible  <bruno@clisp.org>
2288
2289         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
2290         Also include <sys/param.h> if it defines MIN, MAX.
2291         Based on a patch by Derek Price <derek@ximbiot.com>.
2292
2293 2005-05-22  Bruno Haible  <bruno@clisp.org>
2294
2295         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
2296         (INT64_MIN): Fix definition.
2297         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2298
2299         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
2300         NEED_SIGNED_INT_TYPES.
2301
2302         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
2303         HAVE_SYSTEM_INTTYPES.
2304
2305 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
2306
2307         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
2308         so that unistd-safer.h (GPL'ed code) need not be included.
2309
2310 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
2311
2312         New fts module.
2313         * fts.c: Don't include "cycle-check.h" or "hash.h".
2314         (setup_dir, free_dir): New functions.
2315         (enter_dir, leave_dir): Define trivial
2316         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
2317         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
2318         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
2319         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
2320         Move to fts-cycle.c.
2321         (fts_open): Use setup_dir.
2322         (fts_close): Use free_dir.
2323         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
2324         This adds a label and some gotos, but the alternatives were messier.
2325         Check for memory allocation failure when entering a dir.
2326         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
2327         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
2328         (FTS): New member fts_cycle, that is a union that contains the
2329         old active_dir_ht and cycle_state.  All uses changed to mention
2330         fts_cycle.ht and fts_cycle.state.
2331         * fts-cycle.c: New file, containing GPL'ed code migrated out of
2332         fts.c, with the following changes:
2333         (setup_dir, free_dir): New functions.
2334         (enter_dir): Now returns bool.  Return true if successful, false
2335         if memory exhausted.  All callers changed.
2336         Do not bother partly cleaning up on
2337         memory allocation failure; that is free_dir's job.
2338         However, free ad if hash_insert fails, to avoid memory leak.
2339         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
2340         fts->fts_options to see which union member to use.
2341
2342 2005-05-20  Jim Meyering  <jim@meyering.net>
2343
2344         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
2345         Now a macro, to pacify GCC.
2346
2347 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
2348
2349         * chown.c (rpl_chown): Return -1 on failure.
2350
2351 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
2352
2353         * canonicalize.c: Include canonicalize.h first, to test interface.
2354         Include <stddef.h> unconditionally, since we assume C89 now.
2355         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
2356         * fts.c: Include fts_.h first, to check interface.
2357         Do not include intprops.h; no longer needed.
2358         Include cycle-check.h and hash.h, since fts_.h no longer does.
2359         Remove unnecessary casts of closedir to void.
2360         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
2361         decide whether to decrement nlinks.
2362         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
2363         (FTS): Use struct hash_table * instead of Hash_table, so that
2364         we no longer need to include hash.h here.
2365
2366 2005-05-17  Jim Meyering  <jim@meyering.net>
2367
2368         * fts.c, fts_.h: New files, from coreutils.
2369
2370 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
2371
2372         Sync from coreutils.
2373         * unlinkdir.c, unlinkdir.h: New files.
2374         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
2375         regex.h, unlocked-io.h, xtime.h:
2376         White space changes only.
2377         * makepath.c (make_path): Port to hosts where leading "//" is special.
2378         * yesno.c: Include getline.h, not ctype.h.
2379         (yesno): Don't remove leading white space; POSIX doesn't allow it.
2380         Use getline to remove arbitrary restriction on response length.
2381
2382 2005-05-13  Bruno Haible  <bruno@clisp.org>
2383
2384         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
2385         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
2386         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
2387         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
2388         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
2389         Add support for 64-bit integers in the MSVC compiler.
2390
2391 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
2392
2393         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
2394         Change the initial comment to refer to GPL, not LGPL.
2395         gnulib-tool will change it to LGPL as needed.
2396
2397         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
2398         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
2399         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
2400         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
2401         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
2402         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
2403         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
2404         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
2405         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
2406         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
2407         concatpath.c, config.charset, copy-file.c, copy-file.h,
2408         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
2409         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
2410         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
2411         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
2412         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
2413         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
2414         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
2415         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
2416         full-read.c, full-read.h, full-write.c, full-write.h,
2417         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
2418         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
2419         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
2420         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
2421         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
2422         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
2423         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
2424         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
2425         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
2426         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
2427         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
2428         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
2429         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
2430         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
2431         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
2432         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
2433         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
2434         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
2435         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
2436         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
2437         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
2438         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
2439         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
2440         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
2441         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
2442         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
2443         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
2444         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
2445         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
2446         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
2447         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
2448         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
2449         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
2450         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
2451         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
2452         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
2453         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
2454         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
2455         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
2456         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
2457         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
2458         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
2459         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
2460         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
2461         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
2462         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
2463         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
2464         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
2465         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
2466         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
2467         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
2468         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
2469         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
2470         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
2471         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
2472         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
2473         Update FSF postal mail address.
2474
2475 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2476
2477         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
2478         specified in ai_socktype. Fix invalid ai_protocol
2479         check. ai_protocol is usually set to 0 or depending on
2480         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
2481         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
2482         ai_socktype / ai_protocol in the returned addrinfo structure.
2483
2484 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2485             Bruno Haible  <bruno@clisp.org>
2486
2487         * inet_ntop.h: New file.
2488         * inet_ntop.c: New file, from glibc with modifications.
2489
2490 2005-05-08  Jim Meyering  <jim@meyering.net>
2491
2492         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
2493
2494 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
2495
2496         Merge from coreutils.  Among other things,
2497         add bulletproofing for cases where stdin, stdout, or stderr are closed.
2498         * fd-safer.c: New file.
2499         * fcntl-safer.h, open-safer.c: Remove.
2500         * chdir-long.c: Fix comment "fetish" -> "coreutils".
2501         * dup-safer.c: Include unistd-safer.h first.
2502         Don't include errno.h.
2503         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
2504         * file-type.h: Don't assume invoker included sys/stat.h first.
2505         * file-type.c: Rely on file-type.h change.
2506         * getloadavg.c: Include unistd-safer.h.
2507         (getloadavg): Use safer open.
2508         * getusershell.c: Include "stdio-safer.h".
2509         (getusershell): Use safer fopen.
2510         * long-options.c (long_options): Use NULL rather than 0.
2511         * modechange.h (mode_free): Remove; all callers changed to invoke
2512         'free'.
2513         * modechange.c: Likewise.
2514         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
2515         (MODE_DONE): New constant.
2516         (struct mode_change): Remove 'next' member.
2517         (make_node_op_equals): New function; like the old one of the
2518         same name, except it allocates an array.
2519         (mode_compile, mode_create_from_ref): Use it.
2520         (mode_compile): Allocate result as an array, not a linked list.
2521         Parse octal string ourself, so that we catch mistakes like "+0".
2522         (mode_adjust): Arg is an array, not a linked list.
2523         * modechange.c: Include stat-macros.h, xalloc.h.
2524         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
2525         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
2526         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
2527         Remove.  This is now stat-macros.h's job.
2528         (talloc): Remove.  All callers replaced by xalloc, so that
2529         our invokers don't have to worry about reporting memory failures.
2530         (make_node_op_equals): Remove.
2531         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2532         New constants.
2533         (struct mode_change): Moved here from modechange.h.
2534         (mode_append_entry): Remove.
2535         (mode_compile): Remove MASKED_OPS arg, since it encouraged
2536         apps to have incorrect behavior.  Use simpler algorithm for head
2537         and tail.  Don't futz with umask; that's now the job of mode_adjust.
2538         Detect more invalid usages rather than having somewhat-random behavior.
2539         Don't insert an "a=" action, as that leads to incorrect behavior.
2540         (mode_compile, mode_create_from_ref): Return NULL on error instead
2541         of an enum, since now there's only one way to have an error.  All
2542         callers changed.
2543         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
2544         at the correct time.  Simplify calculation of "+u" and its ilk.
2545         Don't mishandle "+X".
2546         (mode_free): Remove "register" and localize decls.
2547         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2548         (struct mode_change): Move to modechange.c; callers don't
2549         need to see this stuff.
2550         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
2551         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
2552         (mode_change, mode_adjust): Reflect the new signatures noted above.
2553         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
2554         that might redefine system include files.
2555         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
2556         (my_usleep): Use NULL rather than (void *) 0.
2557         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
2558         Use siginterrupt to specify that system calls should be interrupted.
2559         (rpl_nanosleep): Move initialization of suspended closer to call of
2560         my_usleep.
2561         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
2562         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
2563         (desirable_utmp_entry): New function.
2564         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
2565         using x2nrealloc, to simplify logic.
2566         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
2567         size calculation.  Do not assume utmp file is a regular file.
2568         * readutmp.h (UT_PID): Moved here from ../src/who.c.
2569         (READ_UTMP_CHECK_PIDS): New constant.
2570         * save-cwd.c: Include unistd-safer.h.
2571         (save_cwd): Use fd_safer.
2572         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
2573         [!_LIBC] Include "stat-macros.h" instead.
2574         * unistd-safer.h (fd_safer): New decl.
2575
2576 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
2577
2578         * byteswap_.h: New file.
2579
2580 2005-04-25  Albert Chin  <china@thewrittenword.com>
2581
2582         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
2583         Toolkit C bug.
2584
2585 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
2586
2587         * getdate.y (zone): Allow relunit_snumber after tZONE, so
2588         that "UTC +1 second" continues to work.  Problem reported
2589         by Dmitry V. Levin.
2590         (relunit_snumber): New rule.
2591         (relunit): Use it.
2592
2593 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
2594
2595         * getdate.y (universal_time_zone_table): New constant.
2596         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
2597         universal_time_zone_table.
2598         (lookup_zone): Prefer universal_time_zone_table to
2599         local_time_zone_table, so that "GMT" time stamps are allowed in
2600         London during the summer.  Problem reported by Ian Abbott.
2601
2602 2005-04-12  Jim Meyering  <jim@meyering.net>
2603
2604         * human.c (humblock): Set *options even when returning due to
2605         xstrtoumax conversion failure.  Thanks to a used-uninitialized
2606         warning from gcc-4.
2607
2608 2005-04-09  Jim Meyering  <jim@meyering.net>
2609
2610         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
2611         -Wuninitialized: initialize tm0.tm_year.
2612
2613 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
2614
2615         * getdate.y (parser_control): rels_seen is now a boolean, not a
2616         count, since there's no maximum.  All uses changed.
2617         Add member dsts_seen.
2618         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
2619         not being INT_MAX.
2620         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
2621         Use pc_rels_seen to decide whther a date is absolute.
2622
2623         * getdate.y (number): Don't overwrite year.
2624         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
2625         check.
2626
2627 2005-04-02  Simon Josefsson  <jas@extundo.com>
2628
2629         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
2630         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
2631
2632 2005-03-27  Jim Meyering  <jim@meyering.net>
2633
2634         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
2635
2636 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
2637
2638         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
2639         "one's complement" -> "ones' complement" in comment, as per Knuth.
2640         "value of type" -> "type or expression" in comment.
2641         * mktime.c, strftime.c: Propagate intprops.h comment nits.
2642
2643 2005-03-26  Jim Meyering  <jim@meyering.net>
2644
2645         Comment nits.
2646         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
2647         Correct typos: s/or/of/.
2648
2649 2005-03-23  Jim Meyering  <jim@meyering.net>
2650
2651         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
2652
2653 2005-03-21  Jim Meyering  <jim@meyering.net>
2654
2655         Changes imported from coreutils.
2656
2657         * cycle-check.c: Don't include xalloc.h.
2658
2659         * path-concat.c: Don't include assert.h.
2660         (path_concat): Remove assertion that would have triggered
2661         for ABASE starting with more than one slash.
2662         Reported by Andreas Schwab.
2663
2664         * path-concat.c (path_concat): Set *BASE_IN_RESULT
2665         properly when ABASE is an absolute file name.
2666         Correct the description of this function.
2667         Include <assert.h>.
2668         Add an assertion and a test driver.
2669         This fixes a bug introduced on 2004-07-02.
2670         Andreas Schwab reported the resulting failure of cp --parents:
2671         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
2672
2673 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
2674
2675         * strftime.c (my_strftime): If the underlying strftime returns 0
2676         (which shouldn't happen), generate nothing instead of returning 0
2677         immediately, so that nstrftime (NULL, ...) doesn't return 0.
2678
2679 2005-03-16  Bruno Haible  <bruno@clisp.org>
2680
2681         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
2682
2683 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
2684
2685         * strftime.c (my_strftime): Prepend space to format so that we can
2686         reliably distinguish strftime failure from empty output on POSIX
2687         hosts.
2688
2689 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
2690
2691         * iconvme.c (SIZE_MAX): New macro, if not already defined.
2692         (iconv_string): Don't guess a size-zero buffer, as that might cause
2693         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
2694         result would be 'too large', where 'too large' is (heuristically)
2695         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
2696         overflow concerns.  This will prevent some unwanted malloc failures
2697         when the inputs are very large.
2698
2699 2005-03-15  Bruno Haible  <bruno@clisp.org>
2700
2701         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
2702         'negate'.
2703
2704         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
2705         variable.
2706
2707         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
2708
2709 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
2710
2711         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
2712         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
2713         intprops.h.
2714         * strtol.c: Likewise.
2715
2716 2005-03-14  Simon Josefsson  <jas@extundo.com>
2717
2718         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
2719         <fx@gnu.org>.
2720
2721 2005-03-14  Jim Meyering  <jim@meyering.net>
2722
2723         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2724         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2725         to be nonzero so that we (and caller) can detect the difference
2726         between a valid zero-length expansion and an error return, even
2727         when the underlying strftime fails before writing anything into
2728         that location.
2729
2730 2005-03-10  Jim Meyering  <jim@meyering.net>
2731
2732         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2733         so that this module works on systems without fchdir.
2734
2735 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
2736
2737         Factor int-properties macros into a single file, except for
2738         glibc-related files.
2739         * intprops.h: New file.
2740         * getloadavg.c: Include it instead of limits.h.
2741         (INT_STRLEN_BOUND): Remove.
2742         * human.c: Include intprops.h.
2743         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2744         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2745         * inttostr.h: Include intprops.h instead of limits.h.
2746         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2747         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2748         for consistency with intprops.h.
2749         (time_t_is_integer, twos_complement_arithmetic): Use them.
2750         * sig2str.h: Include <signal.h>, intprops.h.
2751         (INT_STRLEN_BOUND): Remove.
2752         * strftime.c (TYPE_SIGNED): Remove.
2753         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2754         * strtol.c: Adjust comments to match intprops.h.
2755         * userspec.c: Include intprops.h.
2756         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2757         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2758         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2759         instead of rolling our own expressions.
2760         * xstrtol.c: Include xstrtol.h first, to test interface.
2761
2762         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
2763         instead of int.
2764         (my_strftime): Do not mishandle years close to INT_MAX, by doing
2765         the right thing even if adding 1900 would overflow.  Similarly
2766         for tm_mon + 1 and tm_yday + 1.
2767         Make %Y always equivalent to %C%y, and similarly for %G and %g.
2768         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2769         (DO_SIGNED_NUMBER): New macro.
2770         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2771
2772 2005-03-07  Bruno Haible  <bruno@clisp.org>
2773
2774         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
2775
2776 2005-03-03  Derek R. Price  <derek@ximbiot.com>
2777             Bruno Haible  <bruno@clisp.org>
2778
2779         * pagealign_alloc.h: New file.
2780         * pagealign_alloc.c: New file.
2781
2782 2005-01-28  Bruno Haible  <bruno@clisp.org>
2783
2784         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
2785         stpncpy.c uses it.
2786
2787 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
2788
2789         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2790         The workaround isn't strictly needed for POSIX conformance, and
2791         it's too much of a pain to configure and maintain.  We'll ask
2792         people to fix their kernels instead.
2793         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2794         (NANOSLEEP_BUG_WORKAROUND): Remove.
2795         (xnanosleep): Remove the workaround.
2796
2797 2005-02-12  Bruno Haible  <bruno@clisp.org>
2798
2799         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
2800
2801 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
2802
2803         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2804         * timespec.h (gettime): Return void, since it always
2805         succeeds now.  All uses changed.
2806         * gettime.c (gettime) Likewise.
2807         [HAVE_NANOTIME]: Prefer nanotime.
2808         Assume gettimeofday succeeds, as POSIX requires.
2809         Assime time () succeeds, since other code already does.
2810         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2811         (timespec_subtract): Remove.
2812         (NANOSLEEP_BUG_WORKAROUND): New constant.
2813         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2814         things considerably.  Use it only on GNU/Linux hosts, since the
2815         workaround shouldn't be needed elsewhere.
2816
2817 2005-02-24  Bruno Haible  <bruno@clisp.org>
2818
2819         * gettext.h: Update from GNU gettext 0.14.2.
2820
2821 2005-02-24  Bruno Haible  <bruno@clisp.org>
2822
2823         * localcharset.c: Update from GNU gettext 0.14.2.
2824         * config.charset: Update from GNU gettext 0.14.2.
2825
2826 2005-02-22  Simon Josefsson  <jas@extundo.com>
2827
2828         * iconvme.h, iconvme.c: New files, from libc.
2829
2830 2005-02-20  Neil Conway  <neilc@samurai.com>
2831
2832         * xgethostname.c (xgethostname): Check for ENOMEM, which is
2833         returned by OSX/Darwin if the specified buffer is not large
2834         enough for the hostname.
2835
2836 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
2837
2838         * memrchr.h: New file.
2839         * chdir-long.c: Include it.
2840         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2841         Don't bother including stddef.h.
2842
2843 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2844
2845         * argp-help.c (__argp_help): Create a fake struct argp_state and
2846         pass it to _help, otherwise the latter coredumps trying to
2847         dereference state.root_argp.
2848
2849 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
2850
2851         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2852         inclusion.
2853         Include <sys/types.h>, for dev_t.
2854         (ME_DUMMY, ME_REMOTE): Move from here....
2855         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2856         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
2857         Dmitry V. Levin.
2858         Include mountlist.h first, to test the interface.
2859
2860 2005-01-29  Bruno Haible  <bruno@clisp.org>
2861
2862         * progname.c (program_name): Initialize.
2863         Needed when linking statically on MacOS X.
2864
2865 2005-01-28  Bruno Haible  <bruno@clisp.org>
2866
2867         * javacomp.sh.in: New file, from GNU gettext.
2868         * javacomp.h: New file, from GNU gettext.
2869         * javacomp.c: New file, from GNU gettext.
2870
2871 2005-01-26  Bruno Haible  <bruno@clisp.org>
2872
2873         * javaexec.sh.in: New file, from GNU gettext.
2874         * javaexec.h: New file, from GNU gettext.
2875         * javaexec.c: New file, from GNU gettext.
2876
2877 2005-01-26  Simon Josefsson  <jas@extundo.com>
2878
2879         * gai_strerror.c: Use GPL in header.
2880
2881 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2882
2883         * argp-help.c (hol_entry_help): Avoid using non-constant
2884         initializers for struct pentry_state.
2885         (__argp_error): Check return value of __asprintf
2886         (__argp_failure): Translate error message
2887
2888         * argp-parse.c: Removed braces around the expansion of N_()
2889
2890 2005-01-21  Jim Meyering  <jim@meyering.net>
2891
2892         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2893         same value as for Solaris 9.
2894
2895         * chdir-long.c (chdir_long): Rewrite to remove limitation on
2896         component length.  This included changing the parameter to be
2897         of type `char *' rather than `char const *'.
2898         * chdir-long.h (chdir_long): Update prototype.
2899
2900         * openat.c (fdopendir, fstatat): New functions.
2901         * openat.h: Include headers required for use of DIR and struct stat.
2902         [AT_SYMLINK_NOFOLLOW]: Define.
2903         (fdopendir, fstatat): Add prototypes.
2904
2905 2005-01-21  Bruno Haible  <bruno@clisp.org>
2906
2907         * classpath.h: New file, from GNU gettext.
2908         * classpath.c: New file, from GNU gettext.
2909
2910 2005-01-20  Simon Josefsson  <jas@extundo.com>
2911
2912         * version-etc-fsf.c: New file, with version_etc_copyright.
2913         * version-etc.c: Remove version_etc_copyright.
2914         * version-etc.h (version_etc_copyright): Use [] instead of * in
2915         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2916
2917 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
2918
2919         * save-cwd.c (save_cwd): Remove code to support the case
2920         where fchdir is missing or flaky.
2921
2922 2005-01-20  Simon Josefsson  <jas@extundo.com>
2923
2924         * base64.h (isbase64): Add.
2925
2926         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2927         using a unsigned prototype, don't inline.
2928         (base64_decode): Use it.
2929
2930 2005-01-19  Bruno Haible  <bruno@clisp.org>
2931
2932         * sh-quote.h: New file, from GNU gettext.
2933         * sh-quote.c: New file, from GNU gettext.
2934
2935 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
2936
2937         Merge changes from coreutils, as described below in several
2938         changelogs dated today.
2939
2940         * save-cwd.c: Include "save-cwd.h" before other include files.
2941         (O_DIRECTORY): Remove; not needed here, since "." must be
2942         a directory.  All uses removed.
2943         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
2944         universal on Suns, and we also need to test for IRIX.
2945         Revamp code to use 'if' rather than '#if'.
2946         Avoid unnecessary comparison of cwd->desc to 0.
2947
2948         * utimens.c (futimens): Robustify the previous patch, by checking
2949         for known valid error numbers rather than observed invalid ones.
2950
2951 2005-01-18  Jim Meyering  <jim@meyering.net>
2952
2953         * version-etc.c (version_etc_copyright): Update copyright date.
2954
2955         * utimens.c (futimens): Account for the fact that futimes
2956         can also fail with errno == ENOSYS or errno == ENOENT.
2957         Patch from Dmitry V. Levin.
2958
2959         Change the name of the robust chdir function from chdir to chdir_long.
2960         * save-cwd.c: Include chdir-long.h rather than chdir.h.
2961         (restore_cwd): Use chdir_long, not chdir.
2962         * chdir-long.c: Renamed from chdir.c.
2963         * chdir-long.h: Renamed from chdir.h.
2964         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
2965         Hurd.
2966
2967 2005-01-18  Bob Proulx  <bob@proulx.com>
2968
2969         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2970         offsetof() macro construct to avoid compile failure with native HP-UX
2971         11.0 ANSI C compiler.
2972
2973 2005-01-06  Bruno Haible  <bruno@clisp.org>
2974
2975         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
2976         because stpncpy.m4 takes care of it.
2977
2978 2004-01-24  Bruno Haible  <bruno@clisp.org>
2979
2980         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
2981
2982 2003-10-09  Bruno Haible  <bruno@clisp.org>
2983
2984         * progreloc.c: Include xalloc.h instead of xmalloc.h.
2985
2986 2005-01-06  Bruno Haible  <bruno@clisp.org>
2987
2988         * fwriteerror.h (fwriteerror): Change specification to include fclose.
2989         * fwriteerror.c: Include <stdbool.h>.
2990         (fwriteerror): At the end, close the file stream. Record whether
2991         stdout was already closed.
2992
2993 2004-05-27  Bruno Haible  <bruno@clisp.org>
2994
2995         * execute.c (environ): Declare if needed.
2996         * pipe.c (environ): Likewise.
2997         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
2998
2999 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
3000
3001         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
3002         definitions to be after all include files, to avoid collisions.
3003         Problem reported by Bob Proulx.
3004
3005 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
3006
3007         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
3008         not needed.  This removes a dependency on the gettext module.
3009         [defined _LIBC]: Do not include <libintl.h>; not needed.
3010
3011 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
3012
3013         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
3014         HAVE_DECL_STRTOLD.
3015
3016 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
3017
3018         * argp-parse.c: Include <stddef.h>.
3019         (alignof, alignto): New macros.
3020         (parser_init): Don't assume that void * is aligned sufficiently
3021         for struct option.
3022
3023         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
3024         need to extend the stack.
3025         (YYINITDEPTH): New macro, so that the initial stack isn't overly
3026         large.
3027
3028 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3029
3030         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
3031
3032 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
3033
3034         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
3035         Remove now-obsolete comment about AIX.
3036         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
3037         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
3038         (YYMAXDEPTH): New macro.
3039
3040 2004-12-18  Bruno Haible  <bruno@clisp.org>
3041
3042         * fatal-signal.c (fatal_signals): Make non-const.
3043         (init_fatal_signals): New function.
3044         (uninstall_handlers, install_handlers): Ignore signals that were set to
3045         SIG_IGN.
3046         (at_fatal_signal): Call init_fatal_signals.
3047         (init_fatal_signal_set): Likewise. Ignore signals that were set to
3048         SIG_IGN.
3049         Reported by Paul Eggert.
3050
3051 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
3052
3053         * getdate.y (textint): New member "negative".
3054         (time_zone_hhmm): New function.
3055         Expect 14 shift-reduce conflicts, not 13.
3056         (o_colon_minutes): New rule.
3057         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
3058         (yylex): Set the "negative" member of signed numbers.
3059
3060 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
3061
3062         Changes imported from coreutils.
3063         * hard-locale.c: Assume <locale.h> exists.
3064         Include "strdup.h".
3065         (GLIBC_VERSION): New macro.
3066         (hard_locale): Assume setlocale exists.
3067         Rewrite to avoid #ifdef.
3068         Use strdup rather than malloc + strcpy.
3069         * human.c: Assume <locale.h> exists.
3070         (human_readable): Assume localeconv exists.
3071
3072 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3073
3074         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
3075         convert T2, not T.  (Imported from libc.)
3076
3077 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
3078
3079         * getcwd.c (is_ENAMETOOLONG): New macro.
3080         (__getcwd.c): Don't restore errno; glibc doesn't.
3081         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
3082         first, falling back to our code only if its results look suspicious.
3083         Ensure that the resulting buffer is only as large as necessary.
3084
3085         * readutmp.c: Include readutmp.h first.
3086         Include <errno.h>, since readutmp.h no longer does that.
3087         * readutmp.h: Don't include <errno.h>,
3088         <sys/param.h>, <time.h>; not needed to establish interface.
3089         (errno): Remove decl.
3090         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
3091         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
3092         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
3093
3094 2004-11-28  Simon Josefsson  <jas@extundo.com>
3095
3096         * base64.h, base64.c: New file.
3097
3098 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
3099
3100         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
3101
3102 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
3103
3104         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
3105         HP's ANSI C compiler.
3106         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
3107         Declaring int functions causes warnings on some modern systems and
3108         shouldn't be needed to compile on ancient ones.
3109         * same.c (MIN) [defined MIN]: Don't define, since it's already
3110         defined.
3111
3112         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
3113         with the following changes.
3114         (__set_errno): Parenthesize properly.
3115         Include <stdbool.h>.
3116         (MIN, MAX, MATCHING_INO): New macros.
3117         (__getcwd): Define with prototype, not K&R form.
3118         Use heuristics to allocate default buffer on stack if possible.
3119         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
3120         behavior, and to avoid the PATH_MAX limit when computing
3121         ../../../../...
3122         Use MATCHING_INO to compare inode number to file.
3123         Check for arithmetic overflow in size calculations.
3124         Fix bug in reallocation of dot array that caused getcwd to fail
3125         on directories nested deeper than 75.
3126         Be more careful about saving errno on error.
3127         Do not use realloc; use only free+malloc, as this is a bit
3128         more flexible and avoids a needless copy operation.
3129         Do not inspect st_dev and st_ino for symbolic links; POSIX
3130         doesn't specify the latter.
3131         Check for closedir errors.
3132         Avoid needless casts.
3133         Use "#ifdef weak_alias" around weak_alias, to be like other
3134         glibc code.
3135         The following changes to getcwd.c have effect only when used in
3136         gnulib; they have no effect inside glibc proper.
3137         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
3138         as alloca isn't used.
3139         (alloca, __alloca): Likewise.
3140         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
3141         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3142         unconditionally, as gnulib assumes C89 or better.
3143         Do not include <sys/param.h>.
3144         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
3145         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
3146         better.
3147         (NULL) [!defined NULL]: Remove; we assume C89 or better.
3148         Include <dirent.h> in a way that is compatible with modern Autoconf.
3149         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
3150         New macros, if not already defined.
3151         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
3152         Use "_LIBC", not "defined _LIBC", for consistency.
3153         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
3154         a mempcpy module.
3155         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
3156         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
3157         * xgetcwd.c: David MacKenzie's old code was removed, so give
3158         credit only to Jim Meyering and adjust the copyright dates.
3159         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
3160         <stdlib.h>, <unistd.h>, "pathmax.h".
3161         Instead, include "xgetcwd.h" (first) and "getcwd.h".
3162         (INITIAL_BUFFER_SIZE): Remove.
3163         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
3164
3165 2004-11-23  Jim Meyering  <jim@meyering.net>
3166
3167         * getopt_.h: Remove trailing blanks.
3168
3169 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
3170
3171         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
3172         (futimens): New function, which uses futimes if available.
3173         (futimens, utimens): Support timespec==NULL, with same semantics
3174         as utime and utimens.
3175         * utimens.h (futimens): New decl.
3176
3177 2004-11-23  Jim Meyering  <jim@meyering.net>
3178
3179         * __fpending.c: Add comment.
3180
3181 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3182
3183         * getopt_.h: Re-addition of __getopt_argv_const caused
3184         redefinition warnings. To avoid them, include the defines
3185         in `#if !defined __need_getopt ... #endif'. The only place
3186         where __getopt_argv_const is used is in definitions
3187         of getopt_long and getopt_long_only below, which are as well
3188         protected by `#ifndef __need_getopt'.
3189         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
3190         __need_getopt after including <stdio.h> and <unistd.h> These
3191         headers might have defined it.
3192
3193 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
3194
3195         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
3196         New macros.
3197         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
3198         optopt): Use them instead of invoking ## directly; otherwise, the
3199         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
3200
3201 2004-11-19  Bruno Haible  <bruno@clisp.org>
3202
3203         * strtok_r.c: Move comments from here...
3204         * strtok_r.h: ... to here.
3205
3206 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
3207
3208         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
3209         might fail.  Problem reported by Yoann Vandoorselaere.
3210         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
3211         that mishandle size_t overflow.
3212
3213 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
3214
3215         * canon-host.c: Include "strdup.h".
3216         (canon_host): Use getaddrinfo if available, so that IPv6 works.
3217         Use strdup instead of malloc/strcpy to duplicate strings.
3218
3219         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
3220         (human_space_before_unit): New constant.
3221         * human.c (human_readable): Support it.
3222
3223         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
3224         (xgetcwd): Set errno correctly when failing.
3225         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
3226         the failure is actually due to a PATH_MAX problem.
3227
3228         Further getopt changes to make it more likely that glibc will
3229         buy the changes back.
3230         * getopt.c (POSIXLY_CORRECT): New constant.
3231         (getopt): Use it, so to preserve glibc semantic
3232         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
3233         when compiling for libc.
3234         * getopt_.h (__getopt_argv_const): Bring it back.
3235         (getopt_long, getopt_long_only): Use it.
3236
3237         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
3238         New arg POSIXLY_CORRECT.  All callers changed.
3239         (getopt): Argv is now char * const *, as per standard.
3240         (_getopt_internal_r, _getopt_internal): Argv is now char **,
3241         not char *__getopt_argv_const *.
3242         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3243         _getopt_long_only_r): Likewise.
3244         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
3245         * getopt_int.h (_getopt_internal, _getopt_internal_r,
3246         _getopt_long_r, _getopt_long_only_r): Likewise.
3247         * getopt_.h (__getopt_argv_const): Remove.
3248         (getopt): Argv is now char * const *, as per standard.
3249
3250         * getdate.y (tORDINAL): New token.
3251         (day, relunit): Allow it for relative times.
3252         (relative_time_table): Use tORDINAL for ordinals.
3253
3254 2004-11-15  Jim Meyering  <jim@meyering.net>
3255
3256         * closeout.c: Include "__fpending.h" once again.
3257         Include <stdbool.h>.
3258         (close_stdout): Don't fail just because stdout was closed initially,
3259         since some programs don't write to stdout in the normal course of
3260         operation (other than --version and --help), and we don't want this
3261         function to make e.g. `touch file >&-' fail.
3262         But do fail if it was closed and someone has tried to write to it.
3263         E.g., `printf foo >&-' must fail.
3264
3265 2004-11-11  Simon Josefsson  <jas@extundo.com>
3266
3267         * strtok_r.h, strtok_r.c: New file.
3268
3269 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
3270
3271         * getopt_.h (__getopt_argv_const): New macro, to be used so that
3272         we can stop lying to compilers about the constness of argv when we
3273         are compiled outside glibc.
3274         (getopt, getopt_long, getopt_long_only): Use it.
3275         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
3276         getopt): Likewise.
3277         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3278         _getopt_long_only_r): Likewise.
3279         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
3280         _getopt_long_only_r): Likewise.
3281
3282         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
3283         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
3284         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
3285         the other external symbols.
3286         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
3287         declaration, since the above renaming now works around collisions.
3288
3289 2004-11-11  Jim Meyering  <jim@meyering.net>
3290
3291         * linebreak.c: Remove trailing blanks.
3292         * alloca_.h: Likewise.
3293         * acosl.c: Likewise.
3294         * euidaccess.c: Likewise.
3295         * allocsa.h: Likewise.
3296
3297 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
3298
3299         * mktime.c (SHR): New macro, which is a portable
3300         substitute for >> that should work even on Crays.
3301         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
3302         Problem reported by Mark D. Baushke in
3303         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
3304         * getdate.y (SHR): Likewise.
3305         (tm_diff): Use it.
3306         * strftime.c (SHR): Likewise.
3307         (tm_diff): Use it.
3308         * quotearg.c (struct quoting_options): Use unsigned int for
3309         quote_these_too, so that right shifts are well defined.  All uses
3310         changed.
3311
3312 2004-11-10  Simon Josefsson  <jas@extundo.com>
3313
3314         * getaddrinfo.h, getaddrinfo.c: New files.
3315
3316 2004-11-10  Jim Meyering  <jim@meyering.net>
3317
3318         Ensure that no close failure goes unreported.
3319         * closeout.c (close_stdout): Always close stdout.  I.e., don't
3320         return early when it seems there's nothing to flush.
3321         Don't include __fpending.h.
3322
3323 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
3324
3325         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
3326
3327 2004-11-05  Bruno Haible  <bruno@clisp.org>
3328
3329         * readlink.c: Include stddef.h, needed for size_t on Woe32.
3330         Reported by Mark D. Baushke <mdb@cvshome.org>.
3331
3332 2004-11-04  Bruno Haible  <bruno@clisp.org>
3333
3334         2004-09-11  Bruno Haible  <bruno@clisp.org>
3335                 * allocsa.valgrind: New file.
3336         2004-02-06  Bruno Haible  <bruno@clisp.org>
3337                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
3338                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
3339                 Reported by Christopher Seip <chris.seip@hp.com>.
3340
3341 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
3342
3343         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
3344         with errno == ERANGE if the buffer is too small.
3345         Problem reported by Mark D. Baushke.
3346
3347 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
3348
3349         * xreadlink.c (MAXSIZE): New macro.
3350         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
3351         size does not exceed MAXSIZE.  Avoid cast.
3352         As suggested by Mark D. Baushke in
3353         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
3354         if readlink fails with buffer size just under MAXSIZE, try again
3355         with MAXSIZE.
3356
3357 2004-11-02  Derek R. Price  <derek@ximbiot.com>
3358         and  Paul Eggert  <eggert@cs.ucla.edu>
3359
3360         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
3361         (get_date): Overparenthesize to avoid GCC warning.
3362
3363 2004-11-02  Bruno Haible  <bruno@clisp.org>
3364
3365         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
3366         function returns void.
3367
3368 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
3369
3370         * getpass.c (fflush_unlocked, flockfile, funlockfile)
3371         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
3372         already declared.
3373
3374 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
3375
3376         * getdate.y: Add support for TZ="foo" within a date string.
3377         Fix some bugs near time_t boundaries.  Reject dates with
3378         out-of-range components, e.g., "Sept 31".
3379         Include <stdlib.h>, "setenv.h", "xalloc.h".
3380         (ISDIGIT_LOCALE): Remove; unused.
3381         Note that the TZ and time functions used here are not reentrant.
3382         (mktime_ok, get_tz): New functions.
3383         (TZBUFSIZE): New constant.
3384         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
3385         This requires that we sometimes generate our own TZ="XXX..." setting.
3386
3387 2004-10-27  Derek R. Price  <derek@ximbiot.com>
3388
3389         * mktime.c (not_equal_tm): Remove redundant check.
3390
3391 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
3392
3393         * getdate.y: Use Bison 1.875 features, and some minor
3394         code cleanups.  This change does not affect semantics.
3395         Don't include <stdlib.h>; no longer needed.
3396         Don't include unlocked-io.h; only the "#if TEST" code uses
3397         stdio, and performance isn't crucial there.
3398         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
3399         Bison 1.875 features as described below.
3400         All uses of "PC." replaced by "pc->".
3401         (YYSTYPE): Add a forward declaration.
3402         (yylex, yyerror): Use full prototypes in forward decls.
3403         Use "%pure-parser" rather than obsolescent "%pure_parser".
3404         Use %parse-param and %lex-param instead of obsolescent
3405         YYPARSE_PARAM and YYLEX_PARAM.
3406         (meridian_table, month_and_day_table, time_units_table,
3407         relative_time_table, time_zone_table, military_table,
3408         lookup_zone, lookup_word, get_date):
3409         Use NULL instead of 0 where appropriate.
3410         (to_hour): Avoid abort (), to avoid a dependency on
3411         stdlib.h.
3412         (yyerror, yylex): Now accepts parser_control * arg.
3413         (main) [TEST]: Use '\0' rather than 0 for char.
3414
3415 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
3416
3417         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
3418         It's now the caller's responsibility to handle the case where
3419         !HAVE_GETPAGESIZE && !defined getpagesize.
3420
3421         * mktime.c (leapyear): Arg is long int, not int.
3422
3423 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
3424
3425         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
3426
3427 2004-10-12  Simon Josefsson  <jas@extundo.com>
3428
3429         * getpass.c (fflush_unlocked, flockfile, funlockfile)
3430         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
3431         to real functions.
3432
3433 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
3434
3435         * vsnprintf.h: New file.
3436         * vsnprintf.c: New file.
3437
3438 2004-10-07  Bruno Haible  <bruno@clisp.org>
3439
3440         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
3441         into the provided buffer.
3442
3443 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
3444
3445         * diacrit.c, diacrit.h: Add GPL notice.
3446
3447         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
3448         * atanl.c (atanl): Keep the code as similar to glibc as possible.
3449         * logl.c (logl): Keep the code as similar to glibc as possible.
3450         This avoids a potential constant-folding bug.
3451
3452 2004-10-05  Bruno Haible  <bruno@clisp.org>
3453
3454         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
3455
3456 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
3457
3458         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
3459         * xmalloc.c (xmemdup): Likewise.
3460         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
3461         XFREE): Remove these long-obsolescent macros.
3462         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
3463         * xstrdup.c: Remove.
3464
3465         * regex.c (re_comp): Cast gettext return value to char *,
3466         Problem reported by Martin Neitzel via Mark D. Baushke.
3467
3468 2004-10-04  Simon Josefsson  <jas@extundo.com>
3469
3470         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
3471         '#ifdef USE_UNLOCKED_IO'.
3472
3473 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
3474
3475         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
3476         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
3477         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
3478         regex.c, sha1.c, version-etc.c, yesno.c:
3479         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
3480         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
3481         the includer's responsibility.
3482
3483         Sync from coreutils.
3484
3485         * modechange.c (mode_compile): Don't decrement a pointer that
3486         points to the start of a string, as the C Standard says the
3487         resulting behavior is undefined.
3488
3489         * backupfile.h (enum backuptype): Rename none -> no_backups,
3490         simple -> simple_backups, numbered_existing ->
3491         numbered_existing_backups, numbered -> numbered_backups
3492         to avoid shadowing problems.  All uses changed.
3493         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
3494         * backupfile.c (check_extension, numbered_backup):
3495         Rename locals to avoid shadowing 'basename'.
3496         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
3497         once.
3498
3499         * .cppi-disable: Add getopt_.h, getopt_int.h.
3500         * .cvsignore: Add getopt.h.
3501
3502 2004-10-04  Simon Josefsson  <jas@extundo.com>
3503
3504         * memmem.h: New file.
3505         * memmem.c: New file, taken from glibc.
3506
3507 2004-10-02  Jim Meyering  <jim@meyering.net>
3508
3509         * dirfd.h, getpagesize.h: Add copyright notice.
3510
3511 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
3512
3513         * snprintf.c: Remove comments as to why each header is needed.
3514
3515 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
3516
3517         * strsep.h: New file.
3518         * strsep.c: New file.
3519
3520 2004-10-01  Simon Josefsson  <jas@extundo.com>
3521
3522         * snprintf.c (snprintf): Handle size==0.
3523
3524 2004-10-01  Simon Josefsson  <jas@extundo.com>
3525             Bruno Haible  <bruno@clisp.org>
3526
3527         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
3528         (snprintf): Declare 'args'.
3529
3530 2004-09-30  Simon Josefsson  <jas@extundo.com>
3531
3532         * snprintf.h, snprintf.c: New files.
3533
3534 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3535
3536         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
3537         (hol_entry_help): Never translate an empty string.
3538         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
3539         * argp.h (OPTION_NO_TRANS): New option.
3540
3541 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
3542
3543         * xvasprintf.c: Include xalloc.h.
3544         (xvasprintf): Use xalloc_die, not xmalloc_die.
3545
3546 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
3547
3548         * dummy.c: Change copyright notice to FSF, and license to GPL.
3549
3550 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
3551
3552         * argp-pvh.c (argp_program_version_hook): Provide initial value.
3553         Problem reported by Bruno Haible in:
3554         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
3555
3556 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
3557
3558         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
3559         in case some system header has #define'd it.  Problem reported by
3560         Soeren D. Schulze in
3561         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
3562
3563 2004-09-08  Bruno Haible  <bruno@clisp.org>
3564
3565         * stdint_.h: New file, taken from GNU clisp.
3566
3567 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
3568
3569         * xvasprintf.h: New file.
3570         * xvasprintf.c: New file.
3571         * xasprintf.c: New file.
3572
3573 2004-09-08  Bruno Haible  <bruno@clisp.org>
3574
3575         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
3576         is > INT_MAX.
3577         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
3578
3579 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3580
3581         Import from coreutils.
3582         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
3583         strings on unbounded length.  alloca's performance benefits aren't
3584         that important here.
3585         (V_STRDUP): Remove.
3586         (parse_with_separator): New function, with most of the internals
3587         of the old parse_user_spec.  Allow user to omit both user and group,
3588         for compatibility with FreeBSD.
3589         Clone only the user name, not the entire spec.
3590         Do not set *uid, *gid unless entirely successful.
3591         Avoid memory leak in some failing cases.
3592         Fix regression for USER.GROUP reported by Dmitry V. Levin in
3593         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3594         (parse_user_spec): Rewrite to use parse_with_separator.
3595
3596 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
3597
3598         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
3599         its complicated substitute.
3600         * argp-help.c: Include <errno.h>, for program_invocation_short_name
3601         and program_invocation_name.
3602         (__argp_basename) [!_LIBC]: Remove; the only use was
3603         replaced by its body.
3604         (__argp_short_program_name): Change condition from
3605         !defined __argp_short_program_name to
3606         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
3607         to match argp-namefrob.h.
3608         (__argp_failure): Don't assume strerror_r returns char *.
3609         * argp-parse.c (N_): Define unconditionally.
3610         (argp_default_options): Fill out initializers with 0 to avoid
3611         gcc warnings.
3612
3613 2004-08-12  Simon Josefsson  <jas@extundo.com>
3614
3615         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
3616         * getopt_.h: Renamed from getopt.h.
3617
3618 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
3619
3620         Merge from coreutils.
3621
3622         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
3623         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
3624         for Reliant Unix 5.43.
3625
3626         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
3627         (union fooround): Use uintmax_t, not long int.
3628         The rest is a merge from libc:
3629         [defined _LIBC]: Include <shlib-compat.h>.
3630         (_obstack) [defined _LIBC]: Remove after 2.3.4.
3631
3632         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
3633
3634         * strverscmp.c: Convert to UTF-8.
3635
3636 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
3637
3638         * obstack.h (obstack_empty_p):
3639         Don't assume that chunk->contents is suitably aligned.
3640         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
3641         Likewise. Problem reported by Benno in
3642         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
3643
3644         * chown.c (rpl_chown): Work even if the file is writeable but not
3645         readable.  This could be improved further but it'd take some work.
3646
3647 2004-08-08  Simon Josefsson  <jas@extundo.com>
3648
3649         * xgethostname.c: Don't include error.h (not used).
3650
3651         * getpass.h: Add.
3652         * getpass.c: Include getpass.h first.
3653
3654 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
3655
3656         * xalloc-die.c: New files.
3657         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
3658         All uses removed.
3659         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
3660         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
3661         (_, N_, xalloc_die): Move to xalloc-die.c.
3662         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
3663         so that we needn't mess with xalloc_msg_memory_exhausted.
3664
3665         * sha1.h: Renamed from sha.h.
3666         (SHA1_H): Renamed from _SHA_H.
3667         (sha1_ctx): Renamed from sha_ctx.
3668         (sha1_init_ctx): Renamed from sha_init_ctx.
3669         (sha1_process_block): Renamed from sha_process_block.
3670         (sha1_process_bytes): Renamed from sha_process_bytes.
3671         (sha1_finish_ctx): Renamed from sha_finish_ctx.
3672         (sha1_read_ctx): Renamed from sha_read_ctx.
3673         (sha1_stream): Renamed from sha_stream.
3674         (sha1_buffer): Renamed from sha_buffer.
3675         * sha1.c: Likewise; renamed from sha.c.
3676         Do not include <sys/types.h>.
3677         Include <stddef.h> rather than <stdlib.h>.
3678
3679 2004-08-08  Bruno Haible  <bruno@clisp.org>
3680
3681         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
3682         FILESYSTEM_PREFIX_LEN.
3683         * progreloc.c: Likewise.
3684         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
3685
3686 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
3687
3688         Merge from tar.
3689         * argp-help.c (make_hol, hol_append): Don't assume that
3690         SIZE_MAX is a valid preprocessor constant.
3691         (__argp_basename): Change from "#ifndef _LIBC"
3692         to "#ifndef __argp_short_program_name", so that
3693         we don't compile these functions for tar.
3694
3695         More merges from coreutils.
3696         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
3697         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
3698         yesno.h: New files.
3699         * addext.c: Remove; no longer needed.
3700         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
3701         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
3702         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
3703         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
3704         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
3705         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
3706         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
3707         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
3708         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
3709         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
3710         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
3711         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
3712         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
3713         Import changes from coreutils.
3714
3715 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
3716
3717         Merge from coreutils.
3718
3719         * .gdb-history: Remove; this doesn't belong here.
3720
3721         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
3722         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
3723         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
3724
3725         * dirname.h: Include <stdbool.h>.
3726         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
3727         for consistency with POSIX terminology.  All uses changed.
3728         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
3729         (strip_trailing_slashes): Use bool for booleans.
3730         * stripslash.c (strip_trailing_slashes): Likewise.
3731
3732         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3733         sometimes returns a positive errno value even when it succeeds.
3734         (print_errno_message) [!LIBC]: Fall back on strerror if
3735         __strerror_r fails.
3736
3737         * path-concat.c (mempcpy): Don't define if a system header defines it.
3738         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3739         (longest_relative_suffix): New function.
3740         (path_concat): Use it.  Assume first argument is not NULL.
3741         Port to DOS.  Omit redundant separators.
3742         Report an error instead of returning NULL.
3743         Use mempcpy instead of memcpy.
3744         (xpath_concat): Remove: not declared or used.
3745
3746         * same.h: Include <stdbool.h>
3747         (same_name): Return bool, not int.
3748         * same.c (same_name): Likewise.
3749         (errno): Don't declare; we assume C89 or better now.
3750
3751         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
3752         if not already defined.
3753
3754         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
3755         * dup-safer.c (errno): Likewise.
3756
3757 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
3758
3759         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
3760         working.
3761
3762 2004-08-03  Simon Josefsson  <jas@extundo.com>
3763
3764         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
3765         * progname.h: Don't include stdbool.h.
3766
3767 2004-08-02  Simon Josefsson  <jas@extundo.com>
3768
3769         * getsubopt.h: New file, with comments from Bruno Haible.
3770         * getsubopt.c: New file, from glibc, but slightly modified based on
3771         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
3772
3773 2004-08-01  Simon Josefsson  <jas@extundo.com>
3774
3775         * xgetdomainname.c: Include stdlib.h, for free().
3776
3777 2004-07-16  Simon Josefsson  <jas@extundo.com>
3778
3779         * dummy.c: New file.
3780
3781 2004-07-16  Bruno Haible  <bruno@clisp.org>
3782
3783         * backupfile.h: Add extern "C" for C++.
3784         * closeout.h: Likewise.
3785         * copy-file.h: Likewise.
3786         * findprog.h: Likewise.
3787         * full-write.h: Likewise.
3788         * pathname.h: Likewise.
3789         * progname.h: Likewise.
3790         * stpcpy.h: Likewise.
3791         * stpncpy.h: Likewise.
3792         * strcase.h: Likewise.
3793         * strstr.h: Likewise.
3794         * xalloc.h: Likewise.
3795
3796         * mbswidth.h: Add extern "C" for C++.
3797         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
3798
3799 2004-07-09  Simon Josefsson  <jas@extundo.com>
3800
3801         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
3802         failed without this.)
3803
3804 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
3805
3806         * fchown-stub.c: New file.
3807
3808 2004-06-24  Jim Meyering  <jim@meyering.net>
3809
3810         * obstack.h (obstack_base): Cast to (void *), per documentation.
3811
3812 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3813
3814         * argz.c, argz_.h: New files, which are autoupdated from libtool.
3815
3816 2004-06-01  Jim Meyering  <jim@meyering.net>
3817
3818         * calloc.c: New file.
3819
3820 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
3821
3822         * getdate.y (yylex): Allow space between sign and number.
3823         Problem reported by Dan Jacobson.
3824
3825 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
3826         and  Jim Meyering  <jim@meyering.net>
3827
3828         Merge from coreutils CVS.
3829
3830         * stat-macros.h: New file, with contents from file-type.h
3831         and coreutils' system.h.
3832         * file-type.c: Include "stat-macros.h".
3833         * file-type.h (file_type): Move all macro definitions to new file,
3834         stat-macros.h.
3835
3836         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
3837         Wrap old code with this conditional.
3838         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
3839         function that does not dereference symlinks.
3840         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3841
3842         * xreadlink.c: Include xreadlink.h first, to catch .h file
3843         dependency problems.
3844         (xreadlink): Accept new arg SIZE, for efficiency.
3845         All decls and uses changed.
3846         * xreadlink.h: Include <stddef.h>, for size_t.
3847
3848         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3849         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3850
3851         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3852
3853 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
3854
3855         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3856         macros to be defined.
3857         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3858         the allocator returns NULL because the requested size is zero.
3859
3860 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3861
3862         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3863         var.  Add comment explaining why libc still defines it.  This
3864         merges the following patch from glibc:
3865         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3866
3867 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
3868
3869         * obstack.c (_obstack): Remove unused variable.  It hasn't been
3870         present in glibc since revision 1.1 of this file.
3871         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3872         obstack_alignment_mask, obstack_alloc, obstack_base,
3873         obstack_blank, obstack_blank_fast, obstack_chunk_size,
3874         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3875         obstack_grow0, obstack_init, obstack_int_grow,
3876         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3877         obstack_next_free, obstack_object_size, obstack_ptr_grow,
3878         obstack_ptr_grow_fast, obstack_room): Remove declarations of
3879         nonexistent functions.
3880
3881 2004-05-17  Derek R. Price  <derek@ximbiot.com>
3882             Paul Eggert  <eggert@cs.ucla.edu>
3883
3884         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3885
3886 2004-05-14  Bruno Haible  <bruno@clisp.org>
3887
3888         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3889         that consists of a '.' followed by an empty digit string.
3890         Patch by Tor Lillqvist <tml@iki.fi>.
3891
3892 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
3893
3894         Port obstack to the AS/400, where pointers are 16 bytes wide and
3895         you cannot cast an integer to a valid pointer.  This patch is
3896         currently waiting to be integrated into glibc; see
3897         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3898
3899         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3900         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3901         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3902         (struct obstack): temp member is now a union of a pointer and
3903         an integer, instead of an integer.  All integer uses changed.
3904         This does not affect the physical layout of struct obstack,
3905         except on hosts (like the AS/400) where the size or alignment of
3906         void * is greater than that of ptrdiff_t.
3907         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3908         __STDC__)]: Store temporary in pointer member of union, not
3909         integer member.
3910         * obstack.c: Include <stddef.h>, for offsetof.
3911         (struct fooalign): Remove; it doesn't need a name.
3912         (union fooround): Change double to long double, and add void *.
3913         (DEFAULT_ALIGNMENT): Use offsetof to compute.
3914         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3915         not a macro.  Hence the values are always int; so remove all
3916         casts-to-int in uses.
3917
3918 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
3919             Derek Price  <derek@ximbiot.com>
3920
3921         * alloca.c: Include <alloca.h>, to get our interface.
3922         * alloca_.h: Use __alloca on AIX, so that we don't have to
3923         include <alloca.h> first.  Use C89 prototype for alloca; this
3924         requires including <stddef.h> for size_t.  Use extern "C" if C++.
3925         Use #elif for simplicity, since we can assume C89 now.
3926         Don't try to source the system alloca.h since it will not be found
3927         and to prevent recursively including its replacement.
3928         * fnmatch.c: Include <alloca.h> instead of opencoding.
3929         * regex.c: Likewise.
3930
3931 2004-05-16  Derek Price  <derek@ximbiot.com>
3932             Paul Eggert  <eggert@cs.ucla.edu>
3933
3934         getline cleanup.  This changes the getndelim2 API: both order of
3935         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
3936         no delimiter).
3937
3938         * getline.c: Don't include stddef.h or stdio.h, since our
3939         interface does that.
3940         (getline): Always use getdelim, so that we don't have two
3941         copies of this code.
3942         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
3943         if available.
3944         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
3945         (GETNDELIM2_MAXIMUM): New macro.
3946         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
3947         instead of the old practice of delim2==0.  All callers changed.
3948         Return -1 on overflow, instead of returning junk.
3949         Do not set *linesize unless allocation succeeds.
3950         * getndelim2.h: Do not include stddef.h; no longer needed, now
3951         that we include sys/types.h.
3952         * getnline.h: Likewise.
3953         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
3954         (getndelim2): Reorder arguments.
3955         * getnline.c (getnline, getndelim):
3956         Don't discard the NMAX argument.
3957         (getnline): Invoke getndelim, to avoid code duplication.
3958         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
3959         of (size_t) -1 by callers of the getnline family.
3960
3961 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3962
3963         * nanosleep.c (suspended): Change its type from int to
3964         sig_atomic_t volatile.
3965         (first_call): Make it private to rpl_nanosleep, and have it
3966         be zero initially as that's a bit faster.
3967         (my_usleep): Round up fractional times instead of truncating them,
3968         as this is the usual meaning for 'sleep'.
3969
3970         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3971         doesn't work.
3972         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3973         (ENOSYS): Define if not defined.
3974         (settime): Fall back on stime if it exists and settimeofday fails.
3975         But don't bother with fallbacks if a method fails with errno == EPERM.
3976
3977 2004-05-11  Jim Meyering  <jim@meyering.net>
3978
3979         Prior to this change, the save_cwd caller required read access to the
3980         current directory on most systems (ones with the fchdir function).
3981
3982         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
3983         fails, try write-only, and finally, resort to using xgetcwd.
3984
3985 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
3986
3987         * obstack.c, obstack.h: Import changes from libc.
3988
3989 2004-04-28  Bruno Haible  <bruno@clisp.org>
3990
3991         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
3992         implicitly appends .exe to executables.
3993         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
3994         accepts Windows pathnames.
3995         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3996         Cygwin like Windows, since it now accepts Windows pathnames.
3997         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3998         Cygwin like Windows, since it now accepts Windows pathnames.
3999         Reported by Derek Robert Price <derek@ximbiot.com>.
4000
4001 2004-04-20  Jim Meyering  <jim@meyering.net>
4002
4003         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
4004
4005 2004-04-20  Jim Meyering  <jim@meyering.net>
4006             Bruno Haible  <bruno@clisp.org>
4007
4008         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
4009         memory when realloc fails.
4010
4011 2004-04-18  Jim Meyering  <jim@meyering.net>
4012
4013         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
4014         don't leak memory and do call END_UTMP_ENT.
4015
4016 2004-04-11  Paul Eggert  <eggert@twinsun.com>
4017
4018         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
4019         (CHAR_BIT): Remove, since we assume C89.
4020         Include <stdint.h> if available, as per current Autoconf CVS advice.
4021
4022 2004-03-30  Paul Eggert  <eggert@twinsun.com>
4023
4024         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
4025         not bool, to be more consistent with Unix conventions.
4026         Suggested by Bruno Haible.
4027
4028         Merge from coreutils.
4029
4030         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
4031         New files.
4032
4033         * getdate.h: Include stdbool.h, and timespec.h instead of
4034         the usual <time.h> dance.
4035         (get_date): Change signature to support fractional time stamps.
4036         All callers changed.
4037         * getdate.y: Include "getdate.h" first, as we can now
4038         assume C89 and don't need to worry about 'const'.
4039         Similarly, include "unlocked-io.h" near start, not in middle.
4040         Include <limits.h>.
4041         (textint.value): Use long int rather than int.
4042         (textint.digits): Use size_t rather than int.
4043         (BILLION, LOG10_BILLION): New constants.
4044         (parser_control): New member rel_ns.  Members day_ordinal,
4045         time_zone, month, day, hour, minutes, rel_year, rel_month,
4046         rel_day, rel_hour, rel_minutes, rel_seconds
4047         are now long int, not int.  Member seconds is now struct timespec,
4048         not int.  New member timespec_seen.  Members dates_seen, days_seen,
4049         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
4050         not int.
4051         (%union.intval): Now long int, not int.
4052         New member timespec.
4053         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
4054         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
4055         (spec): Now is a timespec or an item list.
4056         (timespec, items): New nonterminals.
4057         (time, rel, relunit, number, get_date):
4058         Add support for fractional seconds.
4059         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
4060         (gmtime, localtime, mktime): Remove decls; not needed with C89.
4061         (to_hour): First arg is now long int, not int.
4062         (to_year): Returns long int, not int.
4063         Don't treat year -70 like 70.
4064         (tm_diff): Returns long int, not int.
4065         (lookup_word): Use bool instead of int when appropriate.
4066         (yylex): Use size_t for count, not int.
4067         Detect overflow when parsing large integer constants.
4068         Add support for fractions.
4069         (get_date): Make pointers 'const' if possible.
4070         Use more-portable code to detect integer overflow.
4071         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
4072         Don't use ctime; it's not reliable if the year has >4 digits.
4073
4074         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
4075         This is for compatibility with BSD.
4076
4077         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
4078         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
4079         From coreutils' system.h.
4080
4081         * userspec.c: Don't include "posixver.h".
4082         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
4083         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
4084         compatible extension.  Simplify code by removing a boolean int
4085         that was always nonzero if a string was nonnull.
4086
4087 2004-03-30  Jim Meyering  <jim@meyering.net>
4088
4089         Merge from coreutils.
4090
4091         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
4092
4093         * readtokens.c (readtoken): Don't leak 64 bytes when reading
4094         an empty input stream.
4095
4096         * readtokens.c: Include <stdbool.h>.
4097         (readtoken): Use `size_t' rather than int/long.
4098         All callers adjusted.
4099         Use `bool' rather than `int' where appropriate.
4100         Use memset rather than an explicit loop.
4101         Use x2nrealloc rather than xrealloc.
4102         Allow the use of `\0' as a delimiter.
4103         (readtokens): Likewise.
4104         * readtokens.h (readtoken, readtokens): Update prototypes.
4105
4106 2004-03-30  Bruno Haible  <bruno@clisp.org>
4107
4108         * getloadavg.c (getloadavg): Don't assume setlocale returns
4109         nonnull.
4110
4111 2004-03-29  Paul Eggert  <eggert@twinsun.com>
4112
4113         Merge changes to getloadavg.c from coreutils and Emacs.
4114
4115         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
4116         Define to an expression, not to the empty string.
4117         Include cloexec.h and xalloc.h.
4118         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
4119         Use set_cloexec_flag rather than rolling our own.
4120         * cloexec.c, cloexec.h: New files.
4121
4122 2004-03-18  Paul Eggert  <eggert@twinsun.com>
4123
4124         * getopt.h: Sync with libc CVS.
4125
4126 2004-03-18  Paul Eggert  <eggert@twinsun.com>
4127             Bruno Haible  <bruno@clisp.org>
4128
4129         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
4130         not on all platforms that have <wchar.h>.
4131         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
4132
4133 2004-03-09  Paul Eggert  <eggert@twinsun.com>
4134
4135         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
4136         Sync with libc CVS.
4137         * getopt_int.h: New file, also synced from libc.
4138
4139 2004-03-07  Paul Eggert  <eggert@twinsun.com>
4140
4141         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
4142         '#if' expressions.  Unlike the code it replaces, it does not
4143         depend on (defined _SC_PAGESIZE).  However, it does depend on
4144         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
4145         first reported by Jason Andrade in
4146         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
4147
4148 2004-01-18  Simon Josefsson  <jas@extundo.com>
4149
4150         * strdup.h: New file.
4151         * strdup.c: Include it.
4152         * path-concat.c: Include strdup.h. Drop strdup declaration.
4153         * userspec.c: Include strdup.h. Drop strdup declaration.
4154
4155 2004-02-06  Karl Berry  <karl@gnu.org>
4156
4157         * config.charset: update from gettext 0.14.1.
4158
4159 2004-02-05  Paul Eggert  <eggert@twinsun.com>
4160
4161         Add comments and code, prompted by suggestions from Bruno Haible
4162         for sh-quote.
4163         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
4164         describing the enum quoting_style values.
4165         * quotearg.c (quotearg_alloc): New function.
4166         (quotearg_buffer_restyled): Treat lone { and } as special.
4167         Treat = as special.  Work around bug with older shells
4168         that "see" a '\' that is really the 2nd byte of a multibyte char.
4169         Quote empty string with shell_quoting_style.
4170
4171 2004-02-03  Bruno Haible  <bruno@clisp.org>
4172
4173         * pipe.h: New file, from GNU gettext.
4174         * pipe.c: New file, from GNU gettext.
4175
4176 2004-01-27  Bruno Haible  <bruno@clisp.org>
4177
4178         * execute.h: New file, from GNU gettext.
4179         * execute.c: New file, from GNU gettext.
4180         * w32spawn.h: New file, from GNU gettext.
4181
4182 2004-01-23  Paul Eggert  <eggert@twinsun.com>
4183
4184         Exit-status fix from coreutils.
4185
4186         Use exit_failure consistently in place of EXIT_FAILURE,
4187         so that program exit statuses are consistent on failure.
4188
4189         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
4190         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
4191         * argmatch.h: Comment fix to match the above.
4192         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
4193         Now a macro referring to exit_failure, instead of a separate
4194         variable.  Include "exitfail.h" to get it.
4195         * xstrtol.h: Include "exitfail.h".
4196         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
4197
4198         * long-options.c (parse_long_options): Use prototype
4199         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
4200         for clarity.
4201
4202 2004-01-21  Jim Meyering  <jim@meyering.net>
4203
4204         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
4205         so as not to conflict with a different-sized __mktime_internal
4206         function in GNU libc.
4207         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
4208         Problem building statically-linked `ls' reported by Michael Brunnbauer.
4209
4210 2004-01-18  Paul Eggert  <eggert@twinsun.com>
4211
4212         Merge from diffutils.
4213
4214         * file-type.c (file_type): Add typed memory objects.
4215         * file-type.h (S_TYPEISTMO): New macro.
4216
4217         * c-stack.h (c_stack_action): Remove argv argument.
4218         * c-stack.c (c_stack_action): Likewise.  All uses changed.
4219         (die): Don't calculate message unless segv_action returns.
4220         (get_stack_location, min_address_from_argv, max_address_from_argv,
4221         volatile stack_base, volatile_stack_size): Remove.
4222         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
4223         that every segmentation violation is a stack overflow.  (Ouch!)
4224         See Debian bug 136249 (still outstanding) for more info about why
4225         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
4226
4227 2003-11-30  Bruno Haible  <bruno@clisp.org>
4228
4229         Safer stack allocation.
4230         * setenv.c: Include allocsa.h.
4231         (alloca): Remove fallback definition.
4232         (freea): Remove macro.
4233         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
4234         instead of freea.
4235
4236 2003-10-17  Bruno Haible  <bruno@clisp.org>
4237
4238         * binary-io.h: Avoid warnings on Cygwin.
4239
4240 2003-12-28  Bruno Haible  <bruno@clisp.org>
4241
4242         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
4243         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
4244
4245 2003-11-28  Bruno Haible  <bruno@clisp.org>
4246
4247         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
4248
4249 2003-11-27  Bruno Haible  <bruno@clisp.org>
4250
4251         * wait-process.c: On Windows, include windows.h. Needed on mingw.
4252
4253 2003-11-17  Bruno Haible  <bruno@clisp.org>
4254
4255         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
4256
4257 2003-11-24  Bruno Haible  <bruno@clisp.org>
4258
4259         * xallocsa.h: New file, from GNU gettext.
4260         * xallocsa.c: New file, from GNU gettext.
4261
4262 2003-11-24  Bruno Haible  <bruno@clisp.org>
4263
4264         * allocsa.h: New file, from GNU gettext.
4265         * allocsa.c: New file, from GNU gettext.
4266
4267 2003-11-24  Bruno Haible  <bruno@clisp.org>
4268
4269         * eealloc.h: New file.
4270
4271 2004-01-15  Jim Meyering  <jim@meyering.net>
4272
4273         Merge from coreutils.
4274
4275         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
4276         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
4277         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
4278
4279         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
4280         optional configure-time default.
4281
4282         * version-etc.c (version_etc_copyright): Update copyright date.
4283
4284         * xreadlink.c (xreadlink): Correct outdated comment.
4285
4286 2004-01-15  Paul Eggert  <eggert@twinsun.com>
4287
4288         Merge from coreutils.
4289
4290         * posixver.c: Include posixver.h.
4291
4292         * same.c: Include <stdbool.h>, <limits.h>.
4293         (_POSIX_NAME_MAX): Define if not defined.
4294         (MIN): New macro.
4295         (same_name): If file names are silently truncated, report
4296         that the file names are the same if they are the same after
4297         the silent truncation.
4298
4299         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
4300         conversion function.
4301         * xstrtod.c (xstrtod): Likewise.  All callers changed to
4302         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
4303         longer needed.
4304
4305 2004-01-14  Paul Eggert  <eggert@twinsun.com>
4306
4307         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
4308         with like-named macro in fnmatch.c.
4309         (EXT): Use an internal constant instead.
4310
4311         Merge fnmatch patches from glibc.
4312         * fnmatch.c (mbsinit): Remove define.
4313         Add libc_hidden_ver (__fnmatch, fnmatch).
4314         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
4315         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
4316
4317 2003-12-14  Karl Berry  <karl@gnu.org>
4318
4319         * config.charset: update from gettext-runtime.
4320
4321 2003-12-03  Paul Eggert  <eggert@twinsun.com>
4322
4323         * getgroups.c (getgroups): xmalloc takes one argument, not two.
4324         Bug reported by Alfred M. Szmidt.
4325
4326 2003-11-29  Karl Berry  <karl@gnu.org>
4327
4328         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
4329
4330 2003-11-23  Paul Eggert  <eggert@twinsun.com>
4331             Bruno Haible  <bruno@clisp.org>
4332
4333         * printf-parse.h: Don't include sys/types.h.
4334         (ARG_NONE): New macro.
4335         (char_directive): Change type of *arg_index fields to size_t.
4336         * printf-parse.c: Don't include sys/types.h.
4337         (SSIZE_MAX): Remove macro.
4338         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
4339         Remove unnecessary overflow check.
4340         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
4341         fields.
4342
4343 2003-11-24  Paul Eggert  <eggert@twinsun.com>
4344
4345         * alloca.c: Remove dependency on xalloc module.
4346         (xalloc_die): Remove.
4347         (memory_full) [!defined emacs]: New macro.
4348         [!defined emacs]: Don't include xalloc.h.
4349         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
4350         address arithmetic overflows.  Change datatypes a bit to avoid
4351         unnecessary casts.
4352
4353 2003-11-22  Jim Meyering  <jim@meyering.net>
4354
4355         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
4356
4357 2003-11-17  Bruno Haible  <bruno@clisp.org>
4358
4359         * vasnprintf.c (alloca): Remove fallback definition.
4360         (freea): Remove definition.
4361         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
4362         Reported by Paul Eggert.
4363
4364 2003-11-17  Jim Meyering  <jim@meyering.net>
4365
4366         On systems without utime and without a utimes function capable of
4367         dealing with a NULL struct utimbuf* argument, this utime replacement
4368         could -- in unusual circumstances -- leak a file descriptor.
4369         * utime.c: Include <unistd.h> and <errno.h>.
4370         (utime_null): Be sure to close `fd' and to preserve errno.
4371         Reported by Geoff Collyer via Arnold Robbins.
4372
4373 2003-11-16  Paul Eggert  <eggert@twinsun.com>
4374             Bruno Haible  <bruno@clisp.org>
4375
4376         Protect against address arithmetic overflow.
4377         * printf-args.h: Include stddef.h.
4378         (arguments): Change type of field 'count' to size_t.
4379         * printf-args.c (printf_fetchargs): Use size_t instead of
4380         'unsigned int' where appropriate.
4381         * printf-parse.h: Include sys/types.h.
4382         (char_directive): Change type of *arg_index fields to ssize_t.
4383         (char_directives): Change type of fields 'count', max_*_length to
4384         size_t.
4385         * printf-parse.c: Include sys/types.h and xsize.h.
4386         (SSIZE_MAX): Define fallback value.
4387         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
4388         instead of 'int' where appropriate. Check a_allocated, d_allocated
4389         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
4390         * vasnprintf.c: Include xsize.h.
4391         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
4392         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
4393         overflow. Avoid wraparound when converting a width or precision from
4394         decimal to binary.
4395
4396 2003-11-16  Bruno Haible  <bruno@clisp.org>
4397
4398         Update from GNU gettext.
4399         * printf-parse.c: Generalize to it can be compiled for wide strings.
4400         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
4401         * vasnprintf.c: Generalize to it can be compiled for wide strings.
4402         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
4403         SNPRINTF): New macros.
4404         Don't include <alloca.h> if the file is used inside libintl.
4405         (local_wcslen): New function, for Solaris 2.5.1.
4406         (VASNPRINTF): Use it instead of wcslen.
4407
4408 2003-11-16  Bruno Haible  <bruno@clisp.org>
4409
4410         * xsize.h (xmax): New function.
4411         (xsum, xsum3, xsum4): Declare as "pure" functions.
4412
4413 2003-11-12  Paul Eggert  <eggert@twinsun.com>
4414
4415         * xalloc.h: Do not include <limits.h> or <stdint.h>.
4416         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
4417         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
4418         heuristic is just as accurate as far as we know, and it removes a
4419         dependency on size_max.m4 and ptrdiff_max.m4.
4420
4421 2003-11-12  Paul Eggert  <eggert@twinsun.com>
4422
4423         * xstrtol.c (__xstrtol): Remove "break" immediately after
4424         "return", to pacify some unknown compiler.  Problem reported
4425         by Joerg Schilling.
4426
4427 2003-11-11  Bruno Haible  <bruno@clisp.org>
4428
4429         * xsize.h (SIZE_MAX): Remove fallback definition.
4430         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
4431         defined.
4432
4433 2003-11-10  Paul Eggert  <eggert@twinsun.com>
4434
4435         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
4436         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
4437         rejected some allocations of exactly SIZE_MAX - 2 bytes.
4438         From Bruno Haible.
4439         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
4440         not (size_t) -1, since it's defined here.
4441
4442 2003-11-06  Paul Eggert  <eggert@twinsun.com>
4443
4444         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
4445         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
4446         Reject sizes of exactly SIZE_MAX bytes.
4447         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
4448         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
4449
4450 2003-11-05  Bruno Haible  <bruno@clisp.org>
4451
4452         * xsize.h: Include limits.h, to avoid a possible collision with
4453         SIZE_MAX defined in <limits.h> on Solaris.
4454
4455 2003-11-04  Bruno Haible  <bruno@clisp.org>
4456
4457         * xsize.h: New file.
4458         * linebreak.c: Include xsize.h.
4459         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
4460         argument for overflow.
4461         Suggested by Paul Eggert.
4462
4463 2003-10-31  Bruno Haible  <bruno@clisp.org>
4464
4465         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
4466         to avoid (extremely rare) race condition.
4467         Suggested by Paul Eggert.
4468
4469 2003-11-03  Jim Meyering  <jim@meyering.net>
4470
4471         * userspec.c: Include "userspec.h".
4472         * userspec.h: New file.
4473
4474 2003-10-31  Paul Eggert  <eggert@twinsun.com>
4475
4476         * mountlist.h (struct mount_entry.me_type_malloced): New member.
4477         * mountlist.c (SIZE_MAX): Define if not defined already.
4478         (read_filesystem_list): Set and use me_type_malloced.
4479         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
4480         whatever the type happens to be), for brevity and consistency.
4481         Check for size calculation overflow on Alphas running OSF/1.
4482
4483 2003-10-31  Jim Meyering  <jim@meyering.net>
4484
4485         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
4486
4487         * linebuffer.c: Include <string.h> for declaration of memset.
4488
4489 2003-10-30  Paul Eggert  <eggert@twinsun.com>
4490             Bruno Haible  <bruno@clisp.org>
4491
4492         * vasprintf.c: Include <limits.h>, <stdlib.h>.
4493         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
4494
4495 2003-10-29  Paul Eggert  <eggert@twinsun.com>
4496
4497         * xalloc.h (xalloc_oversized): Now a macro, not a function,
4498         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
4499         no longer needed.
4500         * quotearg.c (quotearg_n_options): Use it.
4501         * group-member.c: Include <stdbool.h>.
4502         (free_group_info): Arg is now const *; don't free arg.
4503         (get_group_info): Now returns bool and accepts struct group_info *,
4504         rather than returning a malloc'ed struct group_info *.
4505         All uses changed.  Check for overflow in internal size calculation.
4506
4507         * getusershell.c (readname): Simplify the code by using x2nrealloc
4508         rather than xmalloc/xrealloc.
4509         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
4510         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
4511         conformance bug: the old code used a pointer after freeing the
4512         storage that it addressed.
4513         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
4514         rather than doing it by hand.
4515         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
4516         the buffer preserved.  Use free and xmalloc instead.
4517         * quotearg.c (quotearg_n_options): Likewise.
4518         Use a simpler test for size overflow.  Don't use xalloc_oversized
4519         because unsigned int might be wider than size_t (!); this suggests
4520         that we should switch from unsigned int to size_t for slot numbers.
4521
4522 2003-10-27  Bruno Haible  <bruno@clisp.org>
4523
4524         * stdbool_.h: Better support for BeOS.
4525
4526 2003-10-27  Paul Eggert  <eggert@twinsun.com>
4527
4528         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
4529         to allocate the returned structure.  Do not allocate a subarray,
4530         as x2nrealloc will do that.
4531         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
4532         instead of xnrealloc.
4533         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
4534
4535 2003-10-26  Paul Eggert  <eggert@twinsun.com>
4536
4537         * xalloc.h (xalloc_oversized): New static inline function, for
4538         callers that want to do their own size-overflow checking.  Include
4539         <stdbool.h>, since xalloc_oversized returns bool.
4540         * xalloc.c (array_size_overflow): Remove.  All callers changed
4541         to use xalloc_oversized.
4542
4543         Add two functions x2realloc, x2nrealloc, for programs that grow
4544         arrays dynamically by doubling their sizes.
4545         * xalloc.h (x2realloc, x2nrealloc): New decls.
4546         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
4547         New functions.
4548
4549         Port to C99 semantics for 'inline' of external functions.
4550         Bug reported by Bruno Haible.
4551         * xmalloc.c (xnmalloc_inline): New static inline function,
4552         with the old contents of xnmalloc.
4553         (xnmalloc, xmalloc): Use it.
4554         (xnrealloc_inline): New static inline function,
4555         with the old contents of xnrealloc.
4556         (xnrealloc, xrealloc): Use it.
4557
4558         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
4559
4560 2003-10-25  Paul Eggert  <eggert@twinsun.com>
4561
4562         Fix several address-calculation bugs in the hash modules,
4563         plus some minor code cleanup.
4564
4565         * hash.h: Include <stdbool.h>, for bool.
4566         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
4567         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
4568         hash_get_n_entries, hash_get_max_bucket_length,
4569         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
4570         hash_rehash): Use size_t rather than unsigned.
4571         * hash.c (struct hash_table, hash_get_n_buckets,
4572         hash_get_n_buckets_used, hash_get_n_entries,
4573         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
4574         hash_get_entries, hash_do_for_each, hash_string, is_prime,
4575         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
4576         Likewise.
4577         (SIZE_MAX): Define if not defined.
4578         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
4579         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
4580         hash_print):
4581         Use const * when possible.
4582         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
4583         (check_tuning): Fix bug: if tuning parameters were very close to
4584         0 or 1, rounding errors could have caused subscript violations.
4585         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
4586         (hash_initialize): Add 'fail:' label
4587         to free table and return NULL, and use it to simplify code.
4588         Use calloc rather than clearing the storage ourself.
4589         (hash_initialize, hash_rehash): Check for arithmetic overflow in
4590         buffer size calculations.
4591         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
4592         Include <stddef.h>, for size_t.
4593         * hash-pjw.c (hash_pjw): Likewise.
4594         Switch to method described by Bruno Haible.
4595         Include <limits.h>, for CHAR_BIT.
4596         (SIZE_BITS): New macro.
4597
4598 2003-10-21  Paul Eggert  <eggert@twinsun.com>
4599
4600         * getndelim2.c (getndelim2): When size calculation overflows,
4601         ceiling the allocation at NMAX bytes rather than silently
4602         discarding input bytes before NMAX is reached.  This makes
4603         a difference only if NMAX exceeds SIZE_MAX / 2.
4604
4605         * obstack.c: Merge from glibc.
4606         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
4607         Add libc_hidden_def (_obstack_newchunk).
4608         (_obstack_free) [! defined _LIBC]: Remove.
4609         [defined _LIBC]: Make a strong alias from obstack_free, rather than
4610         a clone of the function body.
4611         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
4612         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
4613
4614         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
4615         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
4616         arg to memcpy.
4617
4618         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
4619         (obstack_ptr_grow_fast, obstack_int_grow_fast):
4620         Don't use lvalue casts, as GCC plans to remove support for them
4621         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
4622         was also present in the non-GCC version, indicating that this
4623         code had always been buggy and had never been widely used.
4624         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
4625         Use the fast variant of each macro, rather than copying the
4626         definiens of the fast variant; that way, we'll be more likely to
4627         catch future bugs in the fast variants.
4628
4629 2003-10-20  Bruno Haible  <bruno@clisp.org>
4630
4631         * wait-process.h: New file, from GNU gettext.
4632         * wait-process.c: New file, from GNU gettext.
4633
4634 2003-10-19  Jim Meyering  <jim@meyering.net>
4635
4636         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
4637
4638 2003-10-16  Paul Eggert  <eggert@twinsun.com>
4639
4640         * getgroups.c: Include <errno.h>, <stdlib.h>.
4641         (getgroups): First arg is int, not size_t.
4642         Don't let 'free' mangle errno.
4643
4644 2003-10-16  Jim Meyering  <jim@meyering.net>
4645
4646         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
4647
4648 2003-10-15  Paul Eggert  <eggert@twinsun.com>
4649
4650         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
4651         (SIZE_MAX): Remove.
4652         (new_exclude, add_exclude_file): Initial size no longer needs to
4653         be a power of 2.
4654         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
4655         our own address arithmetic overflow checking.
4656
4657         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
4658         (fnmatch): Do not alloca more than 2000 wide characters;
4659         instead, use malloc for large buffers.
4660         Check for address arithmetic overflow, and return -1
4661         with errno set to ENOMEM in that case.
4662         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
4663         (NEW_PATTERN): Do not alloca more than 8000 bytes;
4664         instead, return -1.  Check for address arithmetic overflow.
4665
4666 2003-10-14  Paul Eggert  <eggert@twinsun.com>
4667
4668         Handle invalid suffixes and overflow independently, so that
4669         callers can treat them independently as needed.  Fix some bugs in
4670         suffix handling, e.g., "100k@" was not diagnosed as an invalid
4671         suffix for a human-readable blocksize.  The major caller-visible
4672         change is the addition of a new
4673         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
4674         that both overflow and suffix chars were found.
4675
4676         * human.c (humblock): Don't check separately for invalid suffix
4677         char; that is xstrtoumax's job (now that its bug is fixed).
4678         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
4679         INTMAX_MAX]: New macros.
4680         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
4681         TYPE_MAXIMUM): New macros.
4682         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
4683         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
4684         if overflow occurs, as it's what __strtol does and it's more useful
4685         in practice.
4686         (__xstrtol): If __strtol reports some error other than ERANGE,
4687         reflect it to the caller as LONGINT_INVALID.  If it reports
4688         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
4689         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
4690         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
4691         value.
4692         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
4693         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
4694         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
4695         [defined UINTMAX_MAX]: New macros.
4696
4697 2003-10-14  Bruno Haible  <bruno@clisp.org>
4698
4699         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
4700         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
4701         Also use volatile where needed.
4702
4703 2003-10-12  Paul Eggert  <eggert@twinsun.com>
4704
4705         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
4706         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
4707         and define in terms of the other primitives.
4708         * xmalloc.c: Include stdbool.h; do not include exit.h.
4709         (SIZE_MAX): Define if not already defined.
4710         (array_size_overflow): New function.
4711         (xalloc_die): Abort instead of exiting if 'error' returns.
4712         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
4713         (xmalloc, xrealloc): Use them.
4714         (xcalloc): Check for address arithmetic overflow.
4715         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
4716         a bit faster than strcpy.
4717
4718 2003-10-08  Paul Eggert  <eggert@twinsun.com>
4719
4720         Merge getpass from libc, plus a few fixes.
4721
4722         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
4723         Include <stdbool.h>.
4724         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
4725         __fsetlocking to empty.
4726         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
4727         do include <bits/libc-lock.h>.
4728         Do not include <fcntl.h>; not needed.
4729         [_LIBC]: Include <wchar.h>.
4730         (NOTCANCEL_MODE): New macro.
4731         (flockfile, funlockfile) [_LIBC]: New macros.
4732         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
4733         [!_LIBC]: New macros.
4734         (call_fclose): New function.
4735         (getpass): Use it.  Save tty stream separately; this simplifies the
4736         code and makes it more reliable if stdin happens to equal stdout.
4737         Invoke __fsetlocking on tty.
4738         Handle thread cancellation if needed.
4739         Namespace cleanup (use __tcgetattr, __getline).
4740         Use bool for Booleans.
4741         [USE_IN_LIBIO]: Handle wide streams.
4742         [!_LIBC]: Unconditionally do the fseek, since we don't know what
4743         stream might go where.
4744
4745         * unlocked-io.h: Include <stdio.h>, so that the caller
4746         doesn't have to include <stdio.h> before us.
4747         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4748         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4749         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4750         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4751         if not declared, so that we can use getpass.c code from libc without
4752         rewriting it.
4753         (flockfile, ftrylockfile, funlockfile): New macros.
4754
4755 2003-10-06  Bruno Haible  <bruno@clisp.org>
4756
4757         * version-etc-2.h: Remove file.
4758         * version-etc-2.c: Remove file.
4759
4760 2003-09-25  Jim Meyering  <jim@meyering.net>
4761             Bruno Haible  <bruno@clisp.org>
4762
4763         This lets translators provide better translations for the
4764         "Written by ..." part of --version output.
4765         * version-etc.h: Include stdarg.h.
4766         (version_etc_copyright): Declare as readonly.
4767         (version_etc): Make this function variadic with a NULL-terminated list
4768         of author name strings.
4769         (version_etc_va): New declaration.
4770         * version-etc.c: Include stdarg.h, stdlib.h.
4771         (version_etc_copyright): Declare as readonly.
4772         (version_etc_va): New function. Provide a different translatable string
4773         for each possible number of authors < 10. Abbreviate when there are 10
4774         authors or more.
4775         (version_etc): Make this function variadic. Call version_etc_va.
4776         Suggestion from Gary V. Vaughan.
4777
4778         * long-options.h (parse_long_options): Change prototype: the authors
4779         string is moved to the end and becomes variadic.
4780         * long-options.c: Include stdarg.h.
4781         (parse_long_options): Make this function variadic, too.
4782         Call version_etc_va, not version_etc.
4783
4784 2003-10-06  Bruno Haible  <bruno@clisp.org>
4785
4786         * fatal-signal.h: New file, from GNU gettext.
4787         * fatal-signal.c: New file, from GNU gettext.
4788
4789 2003-10-04  Karl Berry  <karl@gnu.org>
4790
4791         * argp*: update from libc.
4792
4793 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
4794
4795         * getpass.c (getpass): Use a no-op fseek when switching from input to
4796         output mode on the same stream.
4797
4798 2003-09-29  Paul Eggert  <eggert@twinsun.com>
4799
4800         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4801         Fix arg typo in previous patch.
4802
4803 2003-09-28  Jim Meyering  <jim@meyering.net>
4804
4805         * error.c: Correct cpp indentation.
4806
4807 2003-09-27  Paul Eggert  <eggert@twinsun.com>
4808
4809         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
4810         Omit the special code that used __typeof__, since we worry that
4811         it could be more trouble than it's worth.  See:
4812         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
4813         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
4814
4815         * free.c: New file.
4816
4817 2003-09-26  Jim Meyering  <jim@meyering.net>
4818
4819         * error.c (error_tail): Move some declarations
4820         into inner scope where the local variables are used.
4821
4822 2003-09-26  Bruno Haible  <bruno@clisp.org>
4823
4824         * stpncpy.h (gnu_stpncpy): New declaration.
4825         (stpncpy): Define as alias for gnu_stpncpy.
4826         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
4827
4828 2003-09-26  Paul Eggert  <eggert@twinsun.com>
4829
4830         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
4831         (error_tail): Do not loop, reallocating temporary buffer, since
4832         the output cannot contain more wide characters than the input
4833         contains bytes, the size must be big enough already.  This avoids
4834         one potential size overflow calculation.  Check for size overflow
4835         when calculating temporary buffer size.  Free temporary buffer
4836         when done, if it was allocated with malloc; this plugs a memory
4837         leak.  Remove casts from void * to pointers, that are no longer
4838         needed now that we're assuming C89 or better.
4839
4840         Merge error changes from glibc.
4841
4842         * error.c, error.h: Update copyright notice header to match glibc.
4843         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4844         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4845         Disable cancellation while printing error.
4846         * error.h: Prepend __ to parameter names.
4847
4848 2003-09-25  Karl Berry  <karl@gnu.org>
4849
4850         * argp-fmtstream.c, argp-help.c: update from libc.
4851
4852 2003-09-25  Bruno Haible  <bruno@clisp.org>
4853
4854         * version-etc-2.h: New file, from version-etc.h with modifications.
4855         * version-etc-2.c: New file, from version-etc.c with modifications.
4856
4857 2003-09-25  Simon Josefsson  <jas@extundo.com>
4858
4859         * xgetdomainname.h: New file.
4860         * xgetdomainname.c: New file.
4861
4862 2003-09-25  Simon Josefsson  <jas@extundo.com>
4863             Bruno Haible  <bruno@clisp.org>
4864
4865         * getdomainname.h: New file.
4866         * getdomainname.c: New file.
4867
4868 2003-09-24  Paul Eggert  <eggert@twinsun.com>
4869
4870         * linebuffer.c (freebuffer): Don't free the argument, just
4871         the buffer associated with the argument.  Bug reported by
4872         Simon Josefsson.
4873
4874 2003-09-19  Karl Berry  <karl@gnu.org>
4875
4876         * argp.h: update from libc.
4877
4878 2003-09-16  Paul Eggert  <eggert@twinsun.com>
4879
4880         * linebuffer.c (readlinebuffer): Return NULL immediately upon
4881         input error, instead of returning NULL the next time we are called
4882         (and therefore losing track of errno).
4883
4884 2003-09-15  Paul Eggert  <eggert@twinsun.com>
4885
4886         * getndelim2.c (getndelim2): Don't trash errno when a read
4887         fails, so that the caller gets the proper errno.
4888
4889         * readutmp.c (read_utmp): Likewise.
4890         Check for fstat error.  Close stream and free storage
4891         when failing.
4892
4893 2003-09-14  Bruno Haible  <bruno@clisp.org>
4894
4895         * fwriteerror.h: New file.
4896         * fwriteerror.c: New file.
4897
4898 2003-09-14  Jim Meyering  <jim@meyering.net>
4899
4900         * getloadavg.c: Correct cpp indentation.
4901         * strdup.c: Likewise.
4902         * vasnprintf.c: Likewise.
4903
4904 2003-09-12  Paul Eggert  <eggert@twinsun.com>
4905
4906         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4907         * obstack.c [!defined _LIBC]: Likewise.
4908         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4909         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4910         * exitfail.c: Don't include stdlib.h; no longer needed.
4911
4912         More changes to assume C89 or better.
4913
4914         * error.c (error_tail): Assume vprintf.
4915
4916         * argmatch.c (getenv): Remove decl.
4917         * progreloc.c (get_full_program_name): Define via prototype.
4918         * setenv.c (clearenv): Likewise.
4919         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4920         needed.
4921         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4922         (malloc, memcpy): Remove decls.
4923         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4924         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4925         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4926         (memcpy): Remove macro.
4927         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4928         (__P): Remove.  All uses removed.
4929         (PTR): Remove.  All uses changed to void *.
4930         (CHAR_BIT, NULL): Remove.
4931         (spaces, zeros, memset_space, memset_zero)
4932         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4933         Remove.
4934         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4935         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4936         Define with prototype.
4937         Remove now-unnecessary prototype decl.
4938         (extra_args_spec): Assume ANSI C.  All uses changed.
4939         (extra_args_spec_iso): Remove.
4940         (my_strftime, emacs_strftimeu): Define via prototype.
4941         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
4942         unconditionally.
4943         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
4944         * strtoimax.c: Include <stdlib.h> unconditionally.
4945         (strtoul, strtol): Remove decls.
4946         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
4947         LONG_MAX): Remove.
4948         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4949         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
4950         (LOCALE_PARAM_PROTO): New macro.
4951         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
4952         (INTERNAL (strtol), strtol): Define with a prototype.
4953         (PARAMS): Remove.  All uses removed.
4954         * tempname.c: Include <string.h> unconditionally.
4955         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
4956         * xgethostname.c (main): Define with a prototype.
4957         * xmalloc.c: Include "xalloc.h" first, to check interface.
4958         Include <stdlib.h> unconditionally.
4959         (calloc, malloc, realloc, free): Remove decls.
4960         * xstrtod.c: Include "xstrtod.h" first, to check interface.
4961         Include <stdlib.h> unconditionally.  Sort include file names.
4962         (strtod): Remove.
4963         (xstrtod): Define with a prototype.
4964         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
4965         (strtol, strtoul): Remove decls.
4966
4967 2003-09-11  Paul Eggert  <eggert@twinsun.com>
4968
4969         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
4970         Include <stdlib.h>, <string.h> unconditionally.
4971         Remove now-unnecessary cast to char *.
4972         * strnlen.c: Include <string.h> unconditionally.
4973         * yesno.c (yesno): Define with a prototype.
4974
4975 2003-09-10  Bruno Haible  <bruno@clisp.org>
4976
4977         * strcspn.c: Include <string.h> unconditionally.
4978         * strpbrk.c: Include <string.h> unconditionally.
4979         * strstr.c: Include <string.h> unconditionally.
4980         * unicodeio.c: Include <string.h> unconditionally.
4981         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
4982         * unsetenv.c: Likewise.
4983         * xreadlink.c: Include <stdlib.h> unconditionally.
4984         * yesno.c: Include <stdlib.h> unconditionally.
4985         (rpmatch): Add prototype.
4986
4987 2003-09-10  Jim Meyering  <jim@meyering.net>
4988
4989         * error.c: Correct indentation of cpp directives.
4990
4991 2003-09-09  Paul Eggert  <eggert@twinsun.com>
4992
4993         More K&R removal.
4994
4995         * acosl.c (main): Use a prototype.
4996         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
4997         tanl.c: Likewise.
4998
4999         * getloadavg.c (getloadavg, main): Define via prototypes.
5000
5001         * getopt.h (struct option.name): Assume C89, and use 'const'.
5002         (getopt, etopt_long, getopt_long_only, _getopt_internal)
5003         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
5004         with a prototype.
5005         * getopt.c (const): Remove macro.
5006         Include <string.h> unconditionally.
5007         (my_index): Remove; all uses changed to strchr.
5008         (strlen): Remove decl.
5009         (exchange): Remove forward decl; no longer needed.
5010         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
5011         Define with prototype.
5012         * getopt1.c (const): Remove macro.
5013         (getopt_long, getopt_long_only, main): Define with prototype.
5014
5015         * getugroups.c: Include <string.h> unconditionally.
5016
5017         * getusershell.c: Include <stdlib.h> unconditionally.
5018         (getusershell, setusershell, endusershell, readname, main):
5019         Define with prototypes.
5020
5021         * group-member.c: Include group-member.h first.
5022         Include <stdlib.h> unconditionally.
5023
5024         * hard-locale.c: Include hard-locale.h first.
5025         Include <stdlib.h>, <string.h> unconditionally.
5026
5027         * hash.c (free, malloc): Remove decls.
5028         Include <stdlib.h> unconditionally.
5029
5030         * human.c: Include <stdlib.h>, <string.h> unconditionally.
5031         (getenv): Do not declare.
5032
5033         * idcache.c: Include <string.h> unconditionally.
5034
5035         * long-options.c: Include long-options.h first, to test interface.
5036         Include <stdlib.h> unconditionally.
5037
5038         * makepath.c: Include makepath.h first, to test interface.
5039         Include <stdlib.h> and <string.h> unconditionally.
5040
5041         * linebuffer.c: Include <stdlib.h>.
5042         (free): Remove decl.
5043
5044         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
5045         rpl_malloc returns void *, not char *.
5046         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
5047
5048         * md5.h: Include <limits.h> unconditionally.
5049         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
5050         (__P): Remove; all uses removed.
5051         * md5.c: Include "md5.h" first.
5052         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
5053         md5_buffer, md5_process_bytes, md5_process_block):
5054         Define with prototypes.
5055         * sha.h (__P): Remove all uses.  (It wasn't defined??)
5056         * sha.c: Include "sha.h" first.
5057         Include <stdlib.h>, <string.h> unconditionally.
5058
5059         * memchr.c (__ptr_t): Remove; all uses changed to void *.
5060         * memcmp.c (__ptr_t): Likewise.
5061         * memrchr.c (__ptr_t): Likewise.
5062         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
5063         Include <string.h> unconditionally.
5064         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
5065         * memchr.c: Include <stdlib.h> unconditionally.
5066         * memchr.c (LONG_MAX): Remove.
5067         * memrchr.c (LONG_MAX): Likewise.
5068         * memchr.c (__memchr): Define via a prototype.
5069         * memrchr.c (__memrchr): Likewise.
5070         * memcmp.c (__P): Remove, and remove all uses.
5071         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
5072         Remove forward decls; no longer needed.
5073         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
5074         Use types required by C89 in prototype.
5075
5076         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
5077         * savedir.c: Likewise.
5078         * mkdir.c (free): Remove decl.
5079         * rmdir.c (rmdir): Define with a prototype.
5080         * savedir.c: Include savedir.h first, to test interface.
5081
5082         * mktime.c (STDC_HEADERS): Remove.
5083         Include <stdlib.h>, <string.h> unconditionally.
5084
5085         * modechange.c: Include <stdlib.h> unconditionally.
5086         (malloc): Remove decl.
5087
5088         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
5089         (free): Remove decl.
5090
5091         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
5092         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
5093         (This type really should be intptr_t, but that's a C99ism.)
5094         (_obstack_memcpy): Remove: all uses changed to memcpy.
5095         Include <string.h> unconditionally.
5096         (struct obstack): Assume __STDC__ for types of members
5097         chunkfun, freefun, extra_arg.
5098         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
5099         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
5100         obstack_begin, obstack_specify_allocation,
5101         obstack_specify_allocation_with_arg, obstack_chunkfun,
5102         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
5103         Remove unprototyped decls and the macros that use them.
5104         * obstack.c (POINTER): Remove.  All uses changed to void *.
5105         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
5106         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
5107         (defined __STDC__ && __STDC__)]:
5108         Remove nonprototyped code.
5109         Include <stdlib.h> unconditionally.
5110         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
5111         _obstack_allocated_p, _obstack_free, obstack_free,
5112         _obstack_memory_used, print_and_abort):
5113         Define using prototypes.
5114         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
5115         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
5116         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
5117         obstack_next_free, obstack_object_size, obstack_room) [0]:
5118         Remove unused, unprototyped code.
5119
5120         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
5121
5122         * physmem.c (physmem_total, physmem_available, main): Define
5123         with prototypes.
5124
5125         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
5126         (main): Define with a prototype.
5127
5128         * posixver.c (getenv): Remove decl.
5129
5130         * putenv.c (malloc): Returns void *, not char *.
5131         Include <string.h> unconditionally.
5132         (strchr, memcpy, NULL): Do not define.
5133
5134         * readtokens.c: Include readtokens.h first, to test interface.
5135         Include <stdlib.h>, <string.h> unconditionally.
5136         (init_tokenbuffer): Define with a prototype.
5137
5138         * regex.c (PARAMS): Remove.  All uses removed.
5139         All uses of _RE_ARGS removed, too.
5140         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5141         unconditionally.
5142         (bzero): Assume memset exists.
5143         (memcmp, memcpy, NULL): Remove.
5144         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
5145         char, or assignments to local vars of type signed char.
5146         (init_syntax_once, PREFIX(extract_number_and_incr),
5147         PREFIX(print_partial_compiled_pattern),
5148         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
5149         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
5150         PREFIX(regex_grow_registers), PREFIX(regex_compile),
5151         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
5152         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
5153         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
5154         wcs_compile_range, byte_compile_range, truncate_wchar,
5155         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
5156         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
5157         count_mbs_length, wcs_re_match_2_internal,
5158         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
5159         PREFIX(alt_match_null_string_p),
5160         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
5161         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
5162         regfree, PREFIX(extract_number)): Define with prototype.  Remove
5163         now-unnecessary declaration, if any.
5164         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
5165         regcomp, regexec):
5166         Remove now-unnecessary casts among pointer types.
5167         * regex.h (_RE_ARGS): Remove.  All uses removed.
5168
5169         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
5170         (free): Remove decl.
5171
5172         * rpmatch.c: Include <stdlib.h> unconditionally.
5173
5174         * same.c: Include <stdlib.h>, <string.h> unconditionally.
5175         (free): Remove decl.
5176
5177         * save-cwd.c: Include <stdlib.h> unconditionally.
5178         * xgetcwd.c: Likewise.
5179
5180         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
5181         (free): Remove decl.
5182
5183         * strchrnul.c (strchrnul): Define with a prototype.
5184         Fix bug: c_in was not converted to char before searching.
5185
5186         The following changes are not K&R related:
5187
5188         * group-member.h: Include <sys/types.h>, so that this file is
5189         self-contained.
5190         * makepath.h: Likewise.
5191
5192         * getusershell.c (readname, default_index, line_size, readname):
5193         Use size_t, not int, for sizes.
5194         (readname): If the size overflows, report an error instead of
5195         looping forever.
5196
5197 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
5198
5199         * getndelim2.c: Assume stdlib.h per the C89 spec.
5200
5201 2003-09-08  Paul Eggert  <eggert@twinsun.com>
5202
5203         Assume C89 or better; remove K&R cruft.
5204         A few of these changes were first proposed by Derek Robert Price
5205         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
5206
5207         * addext.c: Include <string.h> unconditionally.
5208         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
5209         Don't declare getenv or malloc.
5210
5211         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
5212         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
5213         (NULL): Remove.
5214         (find_stack_direction, alloca): Use prototypes.
5215
5216         * atexit.c (atexit): Define using a prototype.
5217
5218         * basename.c, dirname.c, stripslash.c:
5219         Include <string.h> unconditionally.
5220
5221         * bcopy.c: Include <stddef.h>.
5222         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
5223
5224         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
5225
5226         * error.h (error, error_at_line, error_print_progname)
5227         [! (defined (__STDC__) && __STDC__)]: Remove decls.
5228         * error.c: Include error.h first, to check interface.
5229         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
5230         (VA_START): Remove; all uses changeed to va_start.
5231         (exit, strerror): Remove decls.
5232         (error_print_progname): Prototype uncondionally.
5233         Don't include <errno.h>; no longer needed.
5234         (private_strerror): Remove.
5235         (error_tail): Always define.
5236         (error, error_at_line): Assume C89 or better; always use prototypes.
5237         * fatal.c: Include "fatal.h" first, to test interface.
5238         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
5239         (VA_START): Remove; all uses changed to va_start.
5240         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
5241         this case.
5242         (exit): Remove decl.
5243         (fatal): Prototype unconditionally.  Assume va_start works.
5244         Abort at end, to pacify gcc.
5245
5246         * euidaccess.c (main): Define with a prototype.
5247
5248         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
5249
5250         * exitfail.c: Include <stdlib.h> unconditionally.
5251
5252         * fnmatch_.h (__P): Remove.  All uses changed to assume
5253         prototypes.
5254         * fnmatch.c: Include fnmatch.h first, to test interface.
5255         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
5256         (getenv): Remove decl.
5257         (fnmatch): Define using a prototype.
5258         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
5259         (FCT): Define using a prototype.
5260
5261         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
5262
5263         * gethostname.c: Include <stddef.h>.
5264         (gethostname): Define with prototype.  Length is size_t, not int.
5265
5266 2003-09-08  Paul Eggert  <eggert@twinsun.com>
5267
5268         * getversion.c: Remove; was migrated to backupfile.c in 1997.
5269         getversion.c should have been removed then, but was accidentally
5270         preserved.
5271
5272         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
5273         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
5274
5275 2003-09-07  Paul Eggert  <eggert@twinsun.com>
5276
5277         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
5278         copy_tm_result.  Bug reported by Simon Josefsson in
5279         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
5280
5281 2003-09-06  Paul Eggert  <eggert@twinsun.com>
5282
5283         * time_r.c, time_r.h: New files.
5284
5285         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
5286         __localtime_r.
5287         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
5288         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
5289
5290         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
5291         __gmtime_r.
5292         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
5293         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
5294         Include <time_r.h>.
5295
5296         * timegm.c: Switch to glibc implementation, with the following changes:
5297         [defined HAVE_CONFIG_H]: Include <config.h>.
5298         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
5299         (__mktime_internal) [!defined _LIBC]: New decl.
5300         (__gmtime_r) [!defined _LIBC]: New macro and function.
5301         (timegm): Use a prototype, since gnulib assumes C89.
5302         Do not bother declaring tmp to be const, as it's not really usefu.
5303         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
5304         (timegm): Declare only if HAVE_DECL_TIMEGM.
5305
5306 2003-09-03  Paul Eggert  <eggert@twinsun.com>
5307
5308         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
5309         Bug reported by Lute Kamstra in
5310         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
5311
5312         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
5313         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
5314         course with correspondingly smaller numbers for tomorrow and
5315         yesterday.  From Tadayoshi Funaba.  Originally installed into
5316         sh-utils on 1999-08-07, but the patch got lost (I guess during the
5317         coreutils merge?).
5318
5319 2003-08-31  Simon Josefsson  <jas@extundo.com>
5320
5321         * timegm.h: New file.
5322         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
5323
5324 2003-08-31  Karl Berry  <karl@gnu.org>
5325
5326         * argp.h: update from libc.
5327
5328 2003-08-28  Bruno Haible  <bruno@clisp.org>
5329
5330         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
5331         warning on QNX, which defines O_BINARY to 000000.
5332
5333 2003-08-24  Bruno Haible  <bruno@clisp.org>
5334
5335         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
5336         MSVC7 <stdio.h> is included later.
5337
5338 2003-08-20  Bruno Haible  <bruno@clisp.org>
5339
5340         * progname.h: New file, from GNU gettext.
5341         * progname.c: New file, from GNU gettext.
5342         * progreloc.c: New file, from GNU gettext.
5343
5344 2003-08-19  Bruno Haible  <bruno@clisp.org>
5345
5346         * xstrdup.c: Assume <string.h> exists.
5347
5348 2003-08-18  Jim Meyering  <jim@meyering.net>
5349
5350         * setenv.h: Indent nested cpp directive.
5351         * vasnprintf.c: Remove trailing blanks.
5352
5353 2003-08-17  Simon Josefsson  <jas@extundo.com>
5354             Bruno Haible  <bruno@clisp.org>
5355
5356         * xstrndup.h: New file.
5357         * xstrndup.c: New file.
5358
5359 2003-08-17  Bruno Haible  <bruno@clisp.org>
5360
5361         * strndup.h: New file.
5362
5363 2003-08-16  Paul Eggert  <eggert@twinsun.com>
5364
5365         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
5366         space, undoing this 2003-08-12 change:
5367         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
5368
5369 2003-08-16  Jim Meyering  <jim@meyering.net>
5370
5371         Merge from coreutils.
5372         * xstrtoimax.c: #else #if -> #elif.
5373         * xstrtoumax.c: Likewise.
5374
5375 2003-08-15  Paul Eggert  <eggert@twinsun.com>
5376
5377         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
5378         rather than tab, after '#' in shell-script copyright notices.
5379         Suggested by Bruno Haible.
5380
5381 2003-08-15  Jim Meyering  <jim@meyering.net>
5382         and Paul Eggert  <eggert@twinsun.com>
5383
5384         Merge from coreutils.
5385         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
5386         member but strut utmpx does not.  Needed for AIX 4.3.3.
5387         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
5388
5389 2003-08-15  Jim Meyering  <jim@meyering.net>
5390
5391         Merge from coreutils.
5392         * xgethostname.c: Include <stdlib.h>.
5393         (xghostname): Don't exit for anything other than memory-related
5394         failure; just return NULL.
5395         * userspec.c: Include "posixver.h".
5396         (parse_user_spec): Accept `.' as a separator only
5397         in pre-POSIX-200112 mode.
5398         * strtoimax.c: Use #elif rather than #else #if.
5399         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
5400         Remove function, now that we can rely on a working tzset function.
5401         [!_LIBC]: Ensure that the required autoconf test has been run.
5402         [!defined _NL_CURRENT && HAVE_STRFTIME]:
5403         Use underlying_strftime for %r.
5404         * sha.c: Merge in some clean-up and optimization changes from glibc.
5405         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
5406         Ensure that it is a multiple of 64.
5407         Rearrange loop exit tests so as to avoid performing an
5408         additional fread after encountering an error or EOF.
5409         * realloc.c: Update copyright date.
5410
5411 2003-08-14  Jim Meyering  <jim@meyering.net>
5412
5413         Merge from coreutils.
5414         * obstack.h: Whitespace changes.
5415         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
5416         and xcalloc return values.
5417         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
5418         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
5419         hang on OSF/1 5.1 for DIR on both local and remote file systems.
5420         Reported by (and fix confirmed by) Nelson H. F. Beebe.
5421         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5422         error from mntctl.
5423         Use mntctl's return value to drive the entry-processing loop, since
5424         we can't rely on the value of the vmt_length member in the last
5425         entry.  On some systems doing so could result in exhausting
5426         virtual memory.  Based in part on a patch from Mike Jetzer.
5427
5428 2003-08-14  Jim Meyering  <jim@meyering.net>
5429         and Paul Eggert  <eggert@twinsun.com>
5430
5431         Merges from coreutils, plus other fixes.
5432         * physmem.c: Merge in portability changes from gcc/libiberty
5433         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
5434         for credits and details.  Thanks to Kaveh Ghazi for helping
5435         to keep these files in sync.
5436         (ARRAY_SIZE): Define it.
5437         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
5438         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
5439         (memcasecmp): Don't assume size_t fits in unsigned int.
5440         Remove casts and duplicate code.
5441         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
5442         (memcpy): Remove definition.
5443         Merge in some clean-up and optimization changes from glibc.
5444         [BLOCKSIZE]: Move definition to top of file.
5445         Ensure that it is a multiple of 64.
5446         Rearrange loop exit tests so as to avoid performing an
5447         additional fread after encountering an error or EOF.
5448         * md5.h (md5_uintptr): Define.
5449         * makepath.c (CLEANUP_CWD): Report an error if we failed to
5450         return to the initial working directory.  Preserve errno
5451         for caller.
5452         * idcache.c: Include "xalloc.h".
5453         (xmalloc, xrealloc): Remove decls.
5454         (getuser): Remove casts no longer required in C89.
5455         * human.c: Include stdio.h, for sprintf.
5456         * group-member.c: Include "xalloc.h".
5457         (xmalloc, xrealloc): Remove decls.
5458         (get_group_info): Remove casts no longer required in C89.
5459         * getusershell.c (readname): Remove casts no longer required in C89.
5460         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
5461         * getline.c: Whitespace fix, from coreutils.
5462
5463 2003-08-13  Paul Eggert  <eggert@twinsun.com>
5464
5465         * exclude.c: Include <ctype.h>
5466         (IN_CTYPE_DOMAIN): New macro.
5467         (is_space): New fn.
5468         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
5469         and empty lines.
5470
5471         * argp-help.c, argp-parse.c, config.charset, getopt.h:
5472         Undo previous (whitespace-only) change.
5473
5474 2003-08-12  Paul Eggert  <eggert@twinsun.com>
5475
5476         * argp-help.c, argp-parse.c, config.charset, getopt.h:
5477         Normalize leading white space and remove trailing white space.
5478         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
5479         notice, as per ../config/srclist-update.
5480
5481         Merge from coreutils.
5482         * euidaccess.h: New file.
5483         * euidaccess.c: Include it.
5484         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
5485         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
5486         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
5487
5488 2003-08-11  Bruno Haible  <bruno@clisp.org>
5489
5490         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
5491         (vasnprintf): Use it instead of wcslen.
5492
5493 2003-08-11  Bruno Haible  <bruno@clisp.org>
5494
5495         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
5496         value to ensure that _Bool promotes to int. Use #define for _Bool when
5497         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
5498
5499 2003-08-10  Karl Berry  <karl@gnu.org>
5500
5501         * regex.h: update from libc (whitespace fix).
5502
5503 2003-08-09  Paul Eggert  <eggert@twinsun.com>
5504
5505         Merge some files from coreutils.  These changes were
5506         originally made by Jim Meyering.
5507         * acl.c: Include <sys/types.h> before <sys/stat.h>;
5508         many older Unixes require this.
5509         * alloca.c (alloca): Remove cast to argument of free;
5510         no longer needed in C89.
5511         * alloca_.h, regex.h: Fix white space to match
5512         what GNU indent does.
5513
5514 2003-08-05  Paul Eggert  <eggert@twinsun.com>
5515
5516         * bumpalloc.h: Remove.
5517
5518 2003-08-04  Paul Eggert  <eggert@twinsun.com>
5519
5520         * getloadavg.c: Change copyright notice and spacing to conform to
5521         GNU coding style.
5522
5523         Merge from coreutils.
5524         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
5525         From glibc.
5526         * getdate.y (date): Also accept dates like May-23-2003; suggestion
5527         from Karl Berry, implemented by Jim Meyering.
5528         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
5529         from Dmitry V. Levin.
5530         Remove anachronistic cast of xrealloc.
5531         * fnmatch_.h (__const): Remove.  Use 'const'.
5532         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
5533         type. Otherwise, it wouldn't compile with at least /bin/cc on
5534         ymp-cray-unicos9.0.2.X.
5535         Combine two mostly-identical uses of alloca into one.
5536         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
5537
5538 2003-08-04  Dave Love <d.love@dl.ac.uk>
5539
5540         [From Emacs.]
5541
5542         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
5543         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
5544         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
5545         obsolete NLIST_NAME_UNION.
5546         [__GNU__]: Undef BSD and FSCALE.
5547         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
5548
5549 2003-08-03  Paul Eggert  <eggert@twinsun.com>
5550
5551         * stdbool_.h (_Bool): Make it signed char, instead of
5552         an enum type, so that it's guaranteed to promote to int.  See:
5553         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
5554
5555 2003-07-31  Paul Eggert  <eggert@twinsun.com>
5556
5557         * strerror.c: Include config.h, limits.h.  Declare sprintf.
5558         (strerror): Don't assume that a printable int fits in 14 bytes.
5559
5560 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
5561             Bruno Haible  <bruno@clisp.org>
5562
5563         * getline.h (getline, getdelim): Change return type to ssize_t.
5564         * getline.c (getline, getdelim): Likewise.
5565         Remove _GNU_SOURCE define; now it's defined in config.h through
5566         m4/getline.m4.
5567
5568 2003-07-22  Paul Eggert  <eggert@twinsun.com>
5569
5570         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
5571         over-parenthesization in macros.
5572
5573         Sync with coreutils.
5574
5575         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
5576         required by C99.
5577
5578         Use `exit_failure' for xalloc and xmemcoll instead of their own
5579         private exit-failure variables.
5580         * xalloc.h (xalloc_exit_failure): Remove.
5581         * xmalloc.c: Likewise.  Include exitfail.h.
5582         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
5583         * xmemcoll.h (xmemcoll_exit_failure): Remove.
5584         * xmemcoll.c: Likewise.  Include exitfail.h.
5585         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
5586
5587 2003-07-18  Paul Eggert  <eggert@twinsun.com>
5588
5589         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
5590         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
5591         to test that it can stand by itself.  Include "exitfail.h".
5592         Clients should set exit_failure instead.
5593         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
5594
5595 2003-07-18  Andreas Schwab  <schwab@suse.de>
5596
5597         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5598
5599 2003-07-18  Bruno Haible  <bruno@clisp.org>
5600
5601         * getndelim2.h: New file.
5602         * getndelim2.c: Make into a module of its own. Include config.h,
5603         getndelim2.h.
5604         (getndelim2): Make non-static. Change return type to ssize_t.
5605         * getline.h: Change argument names.
5606         * getline.c: Include getndelim2.h instead of getndelim2.c.
5607         * getnline.c: Include getndelim2.h.
5608
5609 2003-07-17  Bruno Haible  <bruno@clisp.org>
5610
5611         * Makefile.am: Remove file.
5612         * Makefile.in: Remove file.
5613
5614 2003-07-17  Bruno Haible  <bruno@clisp.org>
5615
5616         * getnline.h: New file.
5617         * getnline.c: New file.
5618         * getndelim2.c: New file, extracted from getline.c.
5619         (getndelim2): Renamed from getdelim2, with added nmax argument.
5620         * getline.c: Include getndelim2.c.
5621         (getdelim2): Moved out to getndelim2.c.
5622         (getline, getdelim): Update.
5623
5624 2003-07-15    <karl@gnu.org>
5625
5626         * vasnprintf.c: update from gettext.
5627
5628 2003-07-15  Jim Meyering  <jim@meyering.net>
5629
5630         * makepath.c (make_path): Enclose diagnostic in _(...).
5631
5632 2003-07-14  Paul Eggert  <eggert@twinsun.com>
5633
5634         * asnprintf.c, asprintf.c, config.charset, gettext.h,
5635         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
5636         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
5637         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
5638         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
5639         updated automatically by ../config/srclist-update.  This changes
5640         their license from LPGL to GPL.
5641
5642 2003-07-14  Jim Meyering  <jim@meyering.net>
5643
5644         Don't emit diagnostics.  Let callers do that.
5645         * save-cwd.c: Don't include "error.h".
5646         (save_cwd): Don't call error.  Ensure that errno is valid
5647         when returning nonzero.
5648
5649         * save-cwd.h (restore_cwd): Update prototype.
5650         * save-cwd.c (restore_cwd): Remove two parameters.
5651         Simplify.  Don't call error upon failure.  Let callers do that.
5652         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
5653         when auditing is enabled.  But don't bother updating the #if.
5654
5655 2003-07-14  Simon Josefsson  <jas@extundo.com>
5656
5657         * mempcpy.h: New file.
5658         * mempcpy.c: New file.
5659
5660 2003-07-14  Paul Eggert  <eggert@twinsun.com>
5661
5662         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
5663         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
5664         unicodeio.c, unicodeio.h, unlocked-io.h:
5665         Switch from LGPL to GPL.
5666
5667 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
5668
5669         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
5670         it breaks C++ compilation.
5671         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
5672
5673 2003-07-10  Jim Meyering  <jim@meyering.net>
5674
5675         * vasnprintf.c: Remove trailing blanks.
5676         Make cpp indentation consistent.
5677
5678 2003-07-09  Paul Eggert  <eggert@twinsun.com>
5679
5680         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
5681         posixver.c, strftime.c, strnlen.c, strverscmp.c:
5682         Switch from LGPL to GPL.
5683
5684 2003-07-07  Paul Eggert  <eggert@twinsun.com>
5685
5686         * mktime.c: Fix some boundary cases and remove need for floating point.
5687
5688         Issue a compile-time diagnostic if time_t is floating point, or if
5689         two's complement arithmetic is not in effect, or if arithmetic
5690         right shift does not propagate the sign.  These assumptions were
5691         all in the original code but they weren't checked.
5692
5693         (TIME_T_MIDPOINT, verify): New macros.
5694         (__isleap): Remove; it has integer overflow problems.
5695         (leapyear): New function, without those problems.
5696         (ydhms_tm_diff): Remove; splitting into two parts.
5697         (ydhms_diff): New function, containing the arithmetic part of
5698         the old ydhms_tm_diff function.  Issue a compile-time
5699         diagnostic if we are not using C99 integer division.
5700         Avoid casts when possible.
5701         (guess_time_tm): New function, containing the checking part of
5702         the old ydhms_tm_diff function.  Return the new value, rather than
5703         the difference between it and the old.  Accept a new argument T
5704         so that *T specifies the old value.  Check for overflow in the result.
5705
5706         (__mktime_internal): Use a time_t offset, not a long int offset.
5707         This undoes the 2003-06-04 change, which is no longer needed now
5708         that we have better overflow checking.
5709         (localtime_offset): Likewise.
5710
5711         (__mktime_internal): Avoid harmful overflow on hosts where time_t
5712         and long are 64-bit but int is only 32-bit.
5713         (ydhms_diff): Use long int to store year1 and yday1.
5714         Issue a compile-time diagnostic if long int is not wide enough.
5715
5716         (__mktime_internal): Use long int to store adjusted year and yday.
5717         Use plain C rather than preprocessor commands, if that doesn't
5718         affect efficiency.
5719         Check for overflow (and try to repair) after each probe
5720         rather than checking only at the very end.  This avoids some bugs
5721         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
5722         does not equal GMT offset at maximum time).
5723         Use integer to check for overflow rather than floating point; this
5724         is more portable to non-IEEE hosts, and is a tad faster.
5725         When we detect that we are oscillating between two values,
5726         don't check whether tm_isdst has the requested value, since
5727         we already know the answer.  When tm_isdst has the wrong value,
5728         use a different heuristic to find the right one, based on the
5729         extreme values actually observed in practice in tz2003a,
5730         rather than the (overly optimistic) "previous 3 calendar quarters".
5731
5732         (not_equal_tm, print_tm, check_result): Use "const T" rather than
5733         "T const" to accommodate glibc style.
5734         (check_result): Use less-confusing report format.  "long" -> "long int.
5735         (main): Likewise.
5736         Don't loop if the iteration overflows time_t.
5737         Allow a negative step in the iteration.
5738
5739 2003-07-01  Paul Eggert  <eggert@twinsun.com>
5740
5741         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5742         having it depend on HAVE_SYS_TYPES_H.
5743
5744 2003-06-25  Bruno Haible  <bruno@clisp.org>
5745
5746         * readlink.c: New file.
5747
5748 2003-06-20  Bruno Haible  <bruno@clisp.org>
5749
5750         Assume C89, so PARAMS isn't needed.
5751         * unicodeio.h (PARAMS): Remove.
5752         * unicodeio.c: Don't use PARAMS.
5753
5754 2003-06-18  Jim Meyering  <jim@meyering.net>
5755
5756         Merge changes from coreutils.
5757         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5758         Remove explicit declarations of xmalloc and realloc.
5759         Include xalloc.h.
5760         (read_utmp): Remove anachronistic cast of xmalloc.
5761
5762 2003-06-17  Paul Eggert  <eggert@twinsun.com>
5763
5764         Assume C89, so PARAMS isn't needed.
5765         * backupfile.h (PARAMS): Remove.  All uses removed.
5766         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5767         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5768         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5769         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5770         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5771         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5772         xstrtol.h: Likewise.
5773         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
5774         same.h, strverscmp.h: Do not include config.h; no longer needed.
5775         Anyway, config.h should always be included before any other file.
5776
5777 2003-06-11  Simon Josefsson  <jas@extundo.com>
5778
5779         * sysexit_.h: New file.
5780
5781 2003-05-20  Derek Price  <derek@ximbiot.com>
5782
5783         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5784
5785 2003-06-10  Simon Josefsson  <jas@extundo.com>
5786
5787         * strchrnul.h: New file.
5788         * strchrnul.c: New file.
5789
5790 2003-06-10  Simon Josefsson <jas@extundo.com>
5791
5792         * argp.h: New file, from glibc.
5793         * argp-ba.c: New file, from glibc.
5794         * argp-eexst.c: New file, from glibc.
5795         * argp-fmtstream.c: New file, from glibc.
5796         * argp-fmtstream.h: New file, from glibc.
5797         * argp-fs-xinl.c: New file, from glibc.
5798         * argp-help.c: New file, from glibc.
5799         * argp-namefrob.h: New file, from glibc.
5800         * argp-parse.c: New file, from glibc.
5801         * argp-pv.c: New file, from glibc.
5802         * argp-pvh.c: New file, from glibc.
5803         * argp-xinl.c: New file, from glibc.
5804
5805 2003-06-07  Jim Meyering  <jim@meyering.net>
5806
5807         * readtokens.h: Put `Free Software Foundation, Inc.'
5808         in place of my name in the copyright comment.
5809         Remove definition and uses of __P.
5810
5811         From coreutils.
5812         * stat.c: Don't declare xmalloc explicitly.
5813         Instead, include "xalloc.h".
5814         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
5815         xrealloc, and xcalloc return values.
5816         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
5817         Improve comment.
5818         * xgetcwd.h: Remove definition/uses of PARAMS.
5819
5820 2003-06-06  Jim Meyering  <jim@meyering.net>
5821
5822         * stdbool_.h: Renamed from stdbool.h.in.
5823
5824 2003-06-06  Jim Meyering  <jim@meyering.net>
5825
5826         Merge from coreutils.
5827         * same.c: (same_name): Declare *_basename locals to be `const'.
5828         Consolidate declarations and initializations of *_base* locals.
5829
5830         Merge from coreutils.
5831         This avoids a core dump on systems without GNU putenv,
5832         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5833         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5834         (unsetenv): New static function, from GNU libc.
5835         (rpl_putenv): Use it.
5836
5837         * modechange.c: Remove trailing blanks.
5838
5839         Merge from coreutils.
5840         * fsusage.c: Remove declaration of statfs.
5841         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5842
5843         * posixtm.c: Include <stdbool.h> unconditionally.
5844
5845 2003-06-05  Paul Eggert  <eggert@twinsun.com>
5846
5847         * mktime.c (__mktime_internal): When resolving a tm_isdst
5848         mismatch, look in future quarters as well as past.  This fixes a
5849         bug when processing fall-backwards gaps immediately after a long
5850         period of daylight-saving time.
5851
5852         * mktime.c: Assume freestanding C89 or better.
5853         (HAVE_LIMITS_H): Remove.  Assume it's 1.
5854         (__P): Remove; not used.
5855         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5856         (mktime, not_equal_tm, print_tm, check_result,
5857         main): Use prototypes.  Use const * where appropriate.
5858         (main): Fix typo in testing code that uncovered by above changes.
5859         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5860
5861 2003-06-04  Paul Eggert  <eggert@twinsun.com>
5862
5863         * mktime.c: Fix Debian bug 177940
5864         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5865         (localtime_offset): Now long int, not time_t, because we want it
5866         to be guaranteed to be signed.  All uses changed.
5867         (__mktime_internal): If overflow would occur when adding offset,
5868         don't add it.
5869
5870         Merge 'human' changes from coreutils.  Rewrite to support
5871         locale-specific notations like thousands separators.
5872         * human.c: Simplify authorship notice.
5873         Include human.h immediately after config.h.
5874         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5875         <limits.h>: Do not include, since human.h does.
5876         (SIZE_MAX, UINTMAX_MAX): New macros.
5877         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5878         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5879         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5880         (power_letter): Renamed from suffixes.
5881         (generate_suffix_backwards): Remove.
5882         (adjust_value): Now takes int style (because of human.h changes)
5883         and long double value (for greater precision on some platforms).
5884         (group_number): New function.
5885         (human_readable): Use it.  Use integer options, not enum.
5886         Put the options before the sizes in the arg list.
5887         Support all the new options.
5888         The old human_readable function has been removed;
5889         use inttostr.h instead.
5890         (human_readable, default_block_size, humblock):
5891         Use uintmax_t, not int, for block sizes.
5892         (human_readable_inexact, block_size_types): Remove.
5893         (block_size_opts): New constant.
5894         (human_options): Renamed from human_block_size, with new signature
5895         that allows block sizes up to UINTMAX_MAX.  All callers changed.
5896         * human.h: Add copyright and authorship notice.
5897         Include <limits.h> and <stdbool.h> unconditionally.
5898         (PARAMS): Remove.  All uses removed.
5899         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5900         (enum human_inexact_style): Remove tag; now a nameless enum.
5901         (human_floor, human_ceiling, human_round_to_even): Now have
5902         values 2, 0, 1 rather than -1, 1, 0.
5903         (human_group_digits, human_suppress_point_zero, human_autoscale,
5904         human_base_1024, human_SI, human_B): New constants.
5905         (human_readable_inexact, human_block_size): Remove.
5906         (human_readable): Size args are now uintmax_t, not int.
5907         (human_options): New decl.
5908
5909         * exclude.c: (new_exclude, add_exclude): Remove casts that are
5910         unnecessary now that we assume C89 or better.  This change
5911         imported from coreutils.
5912
5913         * mktime.c (__mktime_internal): Do not reject negative timestamps
5914         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
5915         in the 2003-05-30 sync from glibc.
5916
5917         .h files should stand alone, but we shouldn't include <sys/types.h>
5918         if we can get away with just <stddef.h>.
5919
5920         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5921         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5922         rather than <sys/types.h>, as we merely need size_t.
5923         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5924         to get size_t.
5925         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5926         Include <stdio.h>, to get FILE.
5927         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5928         memcasecmp.h has included <stddef.h> and all we need is size_t.
5929         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5930         our interface, instead of including <sys/types.h>
5931
5932 2003-06-02  Paul Eggert  <eggert@twinsun.com>
5933
5934         [from coreutils]
5935         Fix some minor time-related bugs with POSIX time arguments.
5936         Some valid time stamps were being rejected (notably -1, and
5937         time stamps before 1900 on 64-bit hosts).  And some invalid
5938         time stamps were being accepted, e.g. September 31.
5939
5940         * posixtm.h (posixtime): Return bool instead of time_t, so
5941         that we can return (time_t) -1 successfully.
5942         * posixtm.c: Likewise.
5943         [HAVE_STDBOOL_H]: Include <stdbool.h>.
5944         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
5945         (t): Remove static var.
5946         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
5947         of static var.  All uses changed.
5948         (year): Do not reject years before 1900; they can occur with
5949         64-bit time_t.
5950         (posix_time_parse): Do not check for out-of-range components;
5951         that is now the caller's responsibility, since our checks were
5952         only approximations.
5953         (posixtime): Use mktime to check for out-of-range components,
5954         since it knows them exactly.
5955         If mktime returns (time_t) -1, check whether an error actually occurred
5956         by invoking localtime on -1.
5957         (main) [TEST_POSIXTIME]: Check for input data errors, and report
5958         posixtime failures better.
5959         Improve the test data (in comments only).
5960
5961 2003-05-30    <karl@gnu.org>
5962
5963         * mktime.c: update from libc.
5964
5965 2003-05-30  Bruno Haible  <bruno@clisp.org>
5966
5967         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
5968         * localcharset.h: Likewise.
5969         * localcharset.c: Likewise.
5970
5971 2003-05-28  Paul Eggert  <eggert@twinsun.com>
5972
5973         Assume the headers required for C89 freestanding compilers.
5974         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
5975         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
5976         without checking for HAVE_LIMITS_H.
5977         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
5978         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
5979         to do that.
5980         * fatal.c: Include <stdarg.h> without checking for __STDC__.
5981         * exclude.c: Include <stdbool.h> unconditionally.
5982         * tempname.c: Include <stddef.h> unconditionally.
5983         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
5984         * modechange.c, rpmatch.c (NULL): Don't define, since
5985         <stddef.h> does that.
5986         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
5987         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
5988         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
5989         * xstrtol.c: Likewise.
5990         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
5991         * savedir.c: Include <stddef.h> instead of defining NULL.
5992
5993         * addext.c (addext): Use assignment rather than cast, to avoid
5994         warnings on some platforms.
5995
5996         * mktime.c (__mktime_internal): Do not reject negative timestamps
5997         arbitrarily.
5998
5999 2003-05-10  Bruno Haible  <bruno@clisp.org>
6000
6001         * linebreak.c (iconv_string_length): Don't return -1 just because the
6002         string is longer than 4 KB.
6003
6004 2003-05-12  Jim Meyering  <jim@meyering.net>
6005
6006         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
6007         the space-padded-by-default conversion specifiers, %e, %k, %l.
6008
6009 2003-05-03  Bruno Haible  <bruno@clisp.org>
6010
6011         Upgrade to Unicode-4.0.
6012         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
6013         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
6014         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
6015         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
6016         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
6017         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
6018         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
6019         Change width of U+E0100..U+E01EF from 1 to 0.
6020
6021 2003-04-25  Bruno Haible  <bruno@clisp.org>
6022
6023         * copy-file.c: Include <stddef.h>, for size_t.
6024
6025 2003-04-25  Jim Meyering  <jim@meyering.net>
6026
6027         * copy-file.c (copy_file_preserving): Declare buf_size to be
6028         of type size_t, not int.
6029
6030 2003-04-11  Jim Meyering  <jim@meyering.net>
6031
6032         Merge changes from Coreutils.
6033
6034         2003-03-22  Jim Meyering  <jim@meyering.net>
6035
6036         * strftime.c (widen): Cast alloca return value to proper type.
6037
6038         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
6039
6040         From GNU libc.
6041         * strftime.c (my_strftime): Handle very large width
6042         specifications for numeric values correctly.  Improve checks for
6043         overflow.
6044
6045         2003-01-19  Jim Meyering  <jim@meyering.net>
6046
6047         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
6048         (nl_get_alt_digit) [! defined my_strftime]: Define.
6049         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
6050         _nl_get_alt_digit and _nl_get_walt_digit.
6051
6052         * strftime.c (my_strftime): Merge in locale-related changes from libc.
6053         These changes have no effect outside of _LIBC.
6054
6055 2003-04-10  Bruno Haible  <bruno@clisp.org>
6056
6057         * findprog.h: New file, from GNU gettext.
6058         * findprog.c: New file, from GNU gettext.
6059
6060 2003-04-05  Jim Meyering  <jim@meyering.net>
6061
6062         Merge changes from Coreutils.
6063
6064         * exclude.h (PARAMS): Remove definition and uses.
6065         * exclude.c: Remove uses of `PARAMS'.
6066
6067         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
6068         Add test-cases for DOS filenames. Declare program_name.
6069         (main): Set up program_name.  Patch by Rich Dawe.
6070
6071         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6072         error from mntctl.
6073         Use mntctl's return value to drive the entry-processing loop, since
6074         we can't rely on the value of the vmt_length member in the last
6075         entry.  On some systems doing so could result in exhausting
6076         virtual memory.  Based in part on a patch from Mike Jetzer.
6077
6078 2003-04-04  Bruno Haible  <bruno@clisp.org>
6079
6080         * linebreak.h: New file, from GNU gettext.
6081         * linebreak.c: New file, from GNU gettext with slight modifications.
6082         * lbrkprop.h: New file, from GNU gettext.
6083
6084 2003-04-03  Bruno Haible  <bruno@clisp.org>
6085
6086         * utf8-ucs4.h: New file, from GNU gettext.
6087         * utf16-ucs4.h: New file, from GNU gettext.
6088         * ucs4-utf8.h: New file, from GNU gettext.
6089         * ucs4-utf16.h: New file, from GNU gettext.
6090
6091 2003-04-02  Bruno Haible  <bruno@clisp.org>
6092
6093         * binary-io.h: New file, from GNU gettext.
6094
6095 2003-04-01  Bruno Haible  <bruno@clisp.org>
6096
6097         * pathname.h: New file, from GNU gettext.
6098         * concatpath.c: New file, from GNU gettext.
6099
6100 2003-03-30  Bruno Haible  <bruno@clisp.org>
6101
6102         * copy-file.c (copy_file_preserving): Don't set owner if the function
6103         chown() doesn't exist.
6104
6105 2003-03-28  Bruno Haible  <bruno@clisp.org>
6106
6107         * copy-file.h: New file, from GNU gettext.
6108         * copy-file.c: New file, from GNU gettext.
6109
6110 2003-03-18  Jim Meyering  <jim@meyering.net>
6111
6112         * quote.c (quote_n): Fix typo in comment.
6113
6114 2003-03-14  Jim Meyering  <jim@meyering.net>
6115
6116         Merge changes from Coreutils.
6117         * obstack.h (obstack_object_size): Declare temporary, __o,
6118         to be const, in order to avoid warnings.
6119         (obstack_room): Likewise.
6120         (obstack_empty_p): Likewise.
6121
6122 2003-03-13  Paul Eggert  <eggert@twinsun.com>
6123
6124         Merge changes from Bison.
6125         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
6126         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
6127         when compiling Bison 1.875's `bitset bset = obstack_alloc
6128         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
6129         * hash.c: Include <stdbool.h> unconditionally.
6130
6131 2003-03-09  Paul Eggert  <eggert@twinsun.com>
6132
6133         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
6134         Reported by Bruce Becker; see:
6135         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
6136
6137 2003-03-03  Paul Eggert  <eggert@twinsun.com>
6138             Bruno Haible  <bruno@clisp.org>
6139
6140         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
6141         Reported by John Hughes, see
6142         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
6143
6144 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
6145
6146         * poll_.h: New file.
6147         * poll.c: New file.
6148
6149 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
6150
6151         * mathl.h: New file.
6152         * acosl.c: New file.
6153         * asinl.c: New file.
6154         * atanl.c: New file.
6155         * ceill.c: New file.
6156         * cosl.c: New file.
6157         * expl.c: New file.
6158         * floorl.c: New file.
6159         * frexpl.c: New file.
6160         * ldexpl.c: New file.
6161         * logl.c: New file.
6162         * sincosl.c: New file.
6163         * sinl.c: New file.
6164         * sqrtl.c: New file.
6165         * tanl.c: New file.
6166         * trigl.c: New file.
6167         * trigl.h: New file.
6168
6169 2003-02-17  Bruno Haible  <bruno@clisp.org>
6170
6171         * mkdtemp.h: New file, from GNU gettext.
6172         * mkdtemp.c: New file, from GNU gettext.
6173
6174 2003-01-31  Bruno Haible  <bruno@clisp.org>
6175
6176         * rename.c: #undef rename before defining rpl_rename.
6177         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
6178
6179 2003-01-30  Bruno Haible  <bruno@clisp.org>
6180
6181         * printf-args.h: New file, from GNU gettext.
6182         * printf-args.c: New file, from GNU gettext.
6183         * printf-parse.h: New file, from GNU gettext.
6184         * printf-parse.c: New file, from GNU gettext.
6185         * vasnprintf.h: New file, from GNU gettext.
6186         * vasnprintf.c: New file, from GNU gettext.
6187         * asnprintf.c: New file, from GNU gettext.
6188         * vasprintf.h: New file, from GNU gettext with modifications.
6189         * vasprintf.c: New file, from GNU gettext.
6190         * asprintf.c: New file, from GNU gettext.
6191
6192 2003-01-29  Bruno Haible  <bruno@clisp.org>
6193
6194         * stpncpy.h: New file, from GNU gettext with modifications.
6195         * stpncpy.c: New file, from GNU gettext with modifications.
6196
6197 2003-01-28  Bruno Haible  <bruno@clisp.org>
6198
6199         * c-ctype.h: New file, from GNU gettext, with changes suggested by
6200         Paul Eggert.
6201         * c-ctype.c: New file, from GNU gettext, with changes suggested by
6202         Paul Eggert.
6203
6204 2003-01-27  Bruno Haible  <bruno@clisp.org>
6205
6206         * xsetenv.h: New file, from GNU gettext.
6207         * xsetenv.c: New file, from GNU gettext.
6208
6209 2003-01-23  Bruno Haible  <bruno@clisp.org>
6210
6211         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
6212
6213 2003-01-22  Bruno Haible  <bruno@clisp.org>
6214
6215         * exit.h: New file, from GNU gettext.
6216
6217 2003-01-11  Bruno Haible  <bruno@clisp.org>
6218
6219         * stpcpy.h (stpcpy): Use ANSI C function declarations.
6220         * strcase.h (strcasecmp, strncasecmp): Likewise.
6221
6222 2003-01-14  Jim Meyering  <jim@meyering.net>
6223
6224         * same.c (same_name): Tweak a comment.
6225
6226 2003-01-11  Bruno Haible  <bruno@clisp.org>
6227
6228         * same.c (same_name): Reorder tests so as to avoid calling stat()
6229         when a string comparison is sufficient.
6230
6231 2003-01-11  Bruno Haible  <bruno@clisp.org>
6232
6233         * readtokens.c (readtoken): Cast character to 'unsigned char', not
6234         'unsigned int'.
6235
6236 2003-01-11  Bruno Haible  <bruno@clisp.org>
6237
6238         * hash-pjw.c: Add comment about low quality of this function.
6239
6240 2003-01-12  Paul Eggert  <eggert@twinsun.com>
6241
6242         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
6243         to avoid collisions with libcurses and libreadline.
6244
6245         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
6246         * getstr.h, getstr.c: Remove.
6247         * getline.c: Include "getline.h", to check interface.
6248         Move body of old getstr.c here: this defines MIN_CHUNK and
6249         declares getdelim2, which is renamed from getstr.
6250         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
6251
6252         * linebuffer.c (readlinebuffer): Renamed from readline.
6253         All uses changed.
6254         * linebuffer.h: Likewise.
6255         (readline): Remove backward-compatibility macro.
6256
6257 2003-01-12  Jim Meyering  <jim@meyering.net>
6258
6259         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
6260
6261 2003-01-10  Bruno Haible  <bruno@clisp.org>
6262
6263         * alloca_.h: New file.
6264         * getdate.y: Unconditionally include alloca.h.
6265         * makepath.c: Likewise.
6266         * setenv.c: Likewise.
6267         * userspec.c: Likewise.
6268
6269 2003-01-09  Bruno Haible  <bruno@clisp.org>
6270
6271         * stdbool.h.in: New file.
6272
6273 2003-01-08  Bruno Haible  <bruno@clisp.org>
6274
6275         * safe-read.c: Include specification header first, to ensure its
6276         selfcontainedness.
6277         * full-write.c: Likewise.
6278
6279 2003-01-08  Jim Meyering  <jim@meyering.net>
6280
6281         * full-write.c: Undefine and define-away `const' after inclusion
6282         of errno.h, not before.  Suggestion from Bruno Haible.
6283
6284 2003-01-07  Jim Meyering  <jim@meyering.net>
6285
6286         * full-write.c: Rework so that it may serve to define full_read, too.
6287         * full-read.c: Simply #define FULL_READ and include full-write.c.
6288
6289 2003-01-06  Jim Meyering  <jim@meyering.net>
6290
6291         * version-etc.c: Update year in translatable copyright string.
6292
6293 2002-12-25  Bruno Haible  <bruno@clisp.org>
6294
6295         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
6296         * xstrtol.h: Likewise.
6297         * xstrtoimax.c: Likewise.
6298         * xstrtoumax.c: Likewise.
6299         * human.h: Likewise.
6300
6301         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
6302         on systems that have <inttypes.h> but not <stdint.h>.
6303
6304 2002-12-31  Paul Eggert  <eggert@twinsun.com>
6305
6306         * memcoll.c (memcoll): Fall back on a simple algorithm using
6307         memcmp if strcoll doesn't work.
6308
6309 2002-12-23  Bruno Haible  <bruno@clisp.org>
6310
6311         * localcharset.h: New file.
6312         * localcharset.c: Include it.
6313         * unicodeio.c: Likewise.
6314
6315 2002-12-22  Bruno Haible  <bruno@clisp.org>
6316
6317         * utime.c (utime_null): No need to call ftruncate if the file was
6318         nonempty.
6319
6320 2002-12-23  Bruno Haible  <bruno@clisp.org>
6321
6322         * memcoll.c (STRCOLL): New macro.
6323         (memcoll): Use it.
6324
6325 2002-12-22  Bruno Haible  <bruno@clisp.org>
6326
6327         * getstr.h (getstr): Define, to avoid clash with libcurses.
6328         * linebuffer.h (readline): Define, to avoid clash with libreadline.
6329
6330 2002-12-22  Bruno Haible  <bruno@clisp.org>
6331
6332         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
6333
6334 2002-12-23  Bruno Haible  <bruno@clisp.org>
6335
6336         * getline.h: Include <stddef.h>, for size_t.
6337
6338         * unicodeio.h: Include <stddef.h>, for size_t.
6339         * unicodeio.c: Don't include <stddef.h>.
6340
6341 2002-12-17  Bruno Haible  <bruno@clisp.org>
6342
6343         * canon-host.c (strdup): Remove unused declaration.
6344
6345         * fsusage.c: Include full_read.h.
6346         (get_fs_usage): Use full_read instead of safe_read.
6347
6348         * utime.c (utime_null): Use SAFE_READ_ERROR.
6349
6350 2002-12-11  Bruno Haible  <bruno@clisp.org>
6351
6352         * setenv.h: Rewritten to cope with systems that have setenv() but not
6353         unsetenv().
6354         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
6355         modifications:
6356
6357         2002-12-11  Bruno Haible  <bruno@clisp.org>
6358
6359                 * setenv.c (alloca): Fall back to malloc.
6360                 (freea): New macro.
6361                 (setenv): Use freea() to free memory allocated with alloca().
6362
6363         2002-11-13  Bruno Haible  <bruno@clisp.org>
6364
6365                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
6366                 function declarations.
6367                 * unsetenv.c (unsetenv): Likewise.
6368
6369         2002-03-04  Bruno Haible  <bruno@clisp.org>
6370
6371                 Portability to AIX 4.3.3.
6372                 * unsetenv.c: New file, extracted from setenv.c.
6373                 * setenv.c: Move the unsetenv() function to unsetenv.c.
6374
6375         2001-12-20  Bruno Haible  <bruno@clisp.org>
6376
6377                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
6378                 use malloc instead. For SunOS 4.
6379
6380         2001-12-11  Bruno Haible  <bruno@clisp.org>
6381
6382                 * setenv.c: Declare alloca.
6383                 (compar_fn_t): New typedef.
6384                 (KNOWN_VALUE, STORE_VALUE): Use it.
6385
6386         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
6387         setenv.h.
6388
6389 2002-12-10  Paul Eggert  <eggert@twinsun.com>
6390
6391         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
6392         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
6393         Choose values that are less likely to collide with system fnmatch
6394         options.
6395         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
6396         defined (e.g., a pure POSIX system).
6397         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
6398         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
6399
6400 2002-12-06  Jim Meyering  <jim@meyering.net>
6401
6402         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
6403
6404         Merge in changes from libc's misc/error.c, in preparation
6405         for the merge of gnulib's changes back into libc.
6406
6407         * error.c (_): Define only if not already defined.
6408         Move definition to follow all #include directives.
6409         Include unlocked-io.h only if !_LIBC.
6410         [_LIBC]: Include <libio/libioP.h>.
6411         [USE_IN_LIBIO]: Include <libio/iolibio.h>
6412         (fflush): Tweak definition to use INTUSE.
6413         (putc): Define.
6414
6415 2002-12-05  Paul Eggert  <eggert@twinsun.com>
6416
6417         * alloca.c [defined emacs]: Include "lisp.h".
6418         (xalloc_die) [defined emacs]: New macro.
6419         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
6420         [! defined emacs]: Include <xalloc.h>.
6421         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
6422         (pointer): Typedef to POINTER_TYPE *.
6423         (malloc): Remove decl; we now always use xmalloc.
6424         (alloca): Use old-style definition, since Emacs needs this.
6425         Check for arithmetic overflow when computing combined size.
6426
6427 2002-12-04  Paul Eggert  <eggert@twinsun.com>
6428
6429         Do not generate unlocked-io.h automatically, since it's easier to
6430         maintain it by hand.
6431
6432         * unlocked-io.h: New file, from GNU diffutils,
6433         but with proper copyright notice and attribution.
6434         * gen-uio: Remove.
6435         * Makefile.am: Add copyright notice.
6436         (libfetish_a_SOURCES): Add unlocked-io.h.
6437         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
6438         (DISTCLEANFILES, io_functions): Remove macros.
6439         (EXTRA_DIST): Remove gen_uio.
6440         (unlocked-io.h): Remove rule.
6441
6442 2002-12-04  Jim Meyering  <jim@meyering.net>
6443
6444         Reflect the fact that stat.c and lstat.c are no longer generated.
6445         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
6446         (DISTCLEANFILES): Likewise.
6447         (EXTRA_DIST): Likewise.
6448         (all_local): Don't depend on stat.c or lstat.c.
6449         (stat.c, lstat.c): Remove rules.
6450         (EXTRA_DIST): Remove xstat.in.
6451
6452         * xstat.in: Remove file.  Contents moved into stat.c.
6453         * stat.c: New file.  Contents mostly from xstat.in.
6454         * stat.c: Rework so that it may serve to define rpl_lstat, too.
6455         * lstat.c: New file. Simply #define LSTAT and include stat.c.
6456
6457         * safe-read.c: Rework so that it may serve to define safe_write, too.
6458         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
6459
6460 2002-12-03  Jim Meyering  <jim@meyering.net>
6461
6462         * safe-read.c, safe-write.c: Change variable names and comments, but
6463         not semantics, to minimize the differences between these two files.
6464         (safe_read): Change comment to mention SAFE_READ_ERROR.
6465
6466         * safe-read.c (IS_EINTR): Define.
6467         (safe_read): Use IS_EINTR in place of in-function cpp directives.
6468
6469 2002-12-02  Bruno Haible  <bruno@clisp.org>
6470
6471         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
6472         Define, taken from safe-read.c.
6473         (INT_MAX): Provide fallback.
6474         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
6475         * safe-write.h (SAFE_WRITE_ERROR): Define.
6476
6477         * safe-read.c (EINTR): Remove definition.
6478         (safe_read): Don't use EINTR if it is absent.
6479
6480 2002-12-02  Jim Meyering  <jim@meyering.net>
6481
6482         * safe-read.c (EINTR): Define.
6483         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6484         (INT_MAX): Provide fallback.
6485         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
6486
6487         * safe-read.h (SAFE_READ_ERROR): Define.
6488
6489 2002-12-01  Jim Meyering  <jim@meyering.net>
6490
6491         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
6492         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
6493
6494 2002-11-27  Paul Eggert  <eggert@twinsun.com>
6495
6496         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6497         hash_rehash): Replace `if (limit <= value) abort ();' with
6498         `if (! (value < limit)) abort ();', for readability.
6499
6500 2002-11-26    <karl@gnu.org>
6501
6502         * strdup.c: copy from libc again, with jim's ok.
6503         * .cppi-disable: re-add strdup.c
6504
6505 2002-11-25    <karl@gnu.org>
6506
6507         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
6508         instead of "strtol.c".
6509
6510 2002-11-25  Jim Meyering  <jim@meyering.net>
6511
6512         * mktime.c: Sync from libc, now that it has the latest fix.
6513
6514 2002-11-24    <karl@gnu.org>
6515
6516         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
6517         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
6518
6519 2002-11-24  Jim Meyering  <jim@meyering.net>
6520
6521         Update from coreutils:
6522
6523         * mktime.c: Merge in changes from libc.
6524
6525         Avoid a link-time failure on some Linux systems.
6526         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
6527         (__mon_yday): Declare with the STATIC attribute.
6528         (__mktime_internal): Likewise.
6529         Based on a report from Greg Schafer.
6530
6531 2002-11-23  Jim Meyering  <jim@meyering.net>
6532
6533         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
6534         Use `unsigned', not `int', as type of index.
6535
6536         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
6537
6538         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
6539
6540 2002-11-22  Paul Eggert  <eggert@twinsun.com>
6541
6542         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
6543         hint that one should use `if (! x) abort ();' rather than `assert
6544         (x);', and anyway it's one less thing to worry about configuring.
6545         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6546         hash_rehash, hash_insert): Use abort rather than assert.
6547
6548 2002-11-22  Paul Eggert  <eggert@twinsun.com>
6549
6550         * quotearg.h: Allow multiple inclusion by surrounding with
6551         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
6552         so that we can be included first.
6553         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
6554         * quotearg.c: Include quotearg.h immediately after config.h.
6555         No need to include stddef.h or sys/types.h any more.
6556         Surround local include files with "", not "<>".
6557         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
6558         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
6559         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
6560         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
6561         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
6562         (ISPRINT): Remove; no longer needed now that we assume C89.
6563
6564         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
6565         Preserve errno.
6566
6567         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
6568         quotearg_char): Use SIZE_MAX rather than
6569         (size_t) -1 when we are talking about "infinity".
6570
6571         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
6572
6573 2002-11-22  Bruno Haible  <bruno@clisp.org>
6574
6575         * safe-read.h: Assume C89. Add comments.
6576         (safe_read): Change return type to size_t.
6577         * safe-read.c (safe_read): Change return type to size_t. Handle byte
6578         counts > SSIZE_MAX correctly.
6579         * safe-write.h: New file.
6580         * safe-write.c: New file.
6581         * full-read.h: New file.
6582         * full-read.c: New file.
6583         * full-write.h: Assume C89. Add comments.
6584         * full-write.c: Include safe-write.h.
6585         (full_write): Rewritten to use safe_write.
6586         Suggested by Jim Meyering and Paul Eggert.
6587
6588 2002-11-21  Bruno Haible  <bruno@clisp.org>
6589
6590         Remove case insensitive option matching.
6591         * argmatch.h (argcasematch): Remove declaration.
6592         (ARGCASEMATCH): Remove macro.
6593         (__xargmatch_internal): Remove case_sensitive argument.
6594         (XARGMATCH): Update.
6595         (XARGCASEMATCH): Remove macro.
6596         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
6597         case_sensitive argument.
6598         (argcasematch): Remove function.
6599         (__xargmatch_internal): Remove case_sensitive argument.
6600         (main): Use XARGMATCH instead of XARGCASEMATCH.
6601
6602         * xmalloc.c: Change compile-time error message. Add comment about
6603         required autoconf version.
6604
6605 2002-11-21  Jim Meyering  <jim@meyering.net>
6606
6607         * strdup.c (strdup): Tweak comment and initial #if/#include.
6608
6609         Merge in changes from the coreutils.
6610
6611         2002-09-25  Paul Eggert  <eggert@twinsun.com>
6612         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
6613         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
6614         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
6615         int.  Work more efficiently if X is the same width as uintmax_t.
6616         Do not compare X to -1, to avoid bogus compiler warning.
6617         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
6618         Don't assume that f_frsize and f_bsize are the same type.
6619
6620         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
6621         on FreeBSD.
6622
6623         * makepath.c (make_path): Restore umask *before* creating the final
6624         component.
6625         (make_path): Minor reformatting.
6626
6627         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
6628         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
6629
6630         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
6631         ones.  At least on GNU/Linux systems, `auto' means something else.
6632         From Michael Stone.
6633
6634 2002-11-20  Paul Eggert  <eggert@twinsun.com>
6635
6636         Merge argmatch cleanups from Bison.  Assume C89.
6637
6638         * argmatch.c: Include config.h here, not in argmatch.h.
6639         Include stdlib.h, for EXIT_FAILURE.
6640         Always include <string.h>, since we assume C89.
6641         (EXIT_FAILURE): Remove pre-C89 bug workaround.
6642         * argmatch.h: Do not include <config.h> or <sys/types.h>.
6643         Include <stddef.h> instead, since it's all we need for size_t.
6644         (PARAMS): Remove.  All uses removed.
6645         (ARRAY_CARDINALITY): Do not bother to #undef.
6646         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
6647         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6648         Remove unnecessary parentheses.
6649         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6650         Insert necessary parentheses.
6651         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
6652         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
6653
6654 2002-11-19  Bruno Haible  <bruno@clisp.org>
6655
6656         * mbswidth.c: Include mbswidth.h right at the beginning.
6657         * mbswidth.h: Include <stddef.h>, for size_t.
6658
6659         * mbswidth.h (PARAMS): Remove macro.
6660         (mbswidth, mbsnwidth): Use ANSI C function declarations.
6661         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
6662
6663         * gcd.h (PARAMS): Remove macro.
6664         (gcd): Use ANSI C function declarations.
6665         * gcd.c (gcd): Likewise.
6666
6667 2002-11-15  Bruno Haible  <bruno@clisp.org>
6668
6669         * strcspn.c: Include <stddef.h>.
6670         (strcspn): Use ANSI C function declaration. Change return type to
6671         size_t. Use NULL.
6672         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
6673         (strpbrk): Use NULL.
6674         * strpbrk.h (PARAMS): Remove macro.
6675         (strpbrk): Use ANSI C function declaration.
6676         * strstr.c: Don't include <sys/types.h>.
6677         * strstr.h (PARAMS): Remove macro.
6678         (strstr): Use ANSI C function declarations.
6679
6680 2002-11-06  Bruno Haible  <bruno@clisp.org>
6681
6682         * gcd.h (gcd): Change argument type to 'unsigned long'.
6683         * gcd.c (gcd): Likewise.
6684
6685 2002-11-05  Bruno Haible  <bruno@clisp.org>
6686
6687         * gcd.h: New file, from gettext-0.11.5.
6688         * gcd.c: New file, from gettext-0.11.5.
6689
6690 2002-11-05  Bruno Haible  <bruno@clisp.org>
6691
6692         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6693         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6694         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6695         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6696
6697         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6698         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6699
6700         * closeout.c: Include gettext.h instead of <libintl.h>.
6701         * human.c: Include gettext.h instead of <libintl.h>.
6702         * quotearg.c: Include gettext.h instead of <libintl.h>.
6703         * rpmatch.c: Include gettext.h instead of <libintl.h>.
6704         * unicodeio.c: Include gettext.h instead of <libintl.h>.
6705         * userspec.c: Include gettext.h instead of <libintl.h>.
6706         * version-etc.c: Include gettext.h instead of <libintl.h>.
6707         * xmalloc.c: Include gettext.h instead of <libintl.h>.
6708         (textdomain): Remove definition.
6709         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
6710
6711         * long-options.c: Remove include of <libintl.h> and definition of _.
6712         * same.c: Remove include of <libintl.h> and definition of _.
6713
6714 2002-11-04  Bruno Haible  <bruno@clisp.org>
6715
6716         * stpcpy.h: New file, from GNU gettext-0.11.5.
6717         * strcase.h: New file, from GNU gettext-0.11.5.
6718         * strpbrk.h: New file, from GNU gettext-0.11.5.
6719         * strstr.h: New file, from GNU gettext-0.11.5.
6720         * xgetcwd.h: New file, from GNU gettext-0.11.5.
6721
6722 2002-05-09  Bruno Haible  <bruno@clisp.org>
6723
6724         * config.charset: Update for newest glibc. Add canonical names
6725         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
6726
6727 2002-05-09  Bruno Haible  <bruno@clisp.org>
6728
6729         * localcharset.c (get_charset_aliases): Add more Windows specific
6730         aliases.
6731
6732 2002-05-08  Owen Taylor  <otaylor@redhat.com>
6733
6734         * config.charset: A few additions for Solaris.
6735
6736 2001-12-05  Bruno Haible  <bruno@clisp.org>
6737
6738         * localcharset.c (locale_charset): Don't return an empty string.
6739
6740 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
6741
6742         * config.charset: msdos in uk_UA uses CP1125.
6743
6744 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
6745
6746         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
6747         * localcharset.c (locale_charset): Declare as extern "C".
6748
6749 2002-02-15  Bruno Haible  <bruno@clisp.org>
6750
6751         * config.charset [msdosdjgpp]: For Russian, use CP866.
6752
6753 2002-02-11  Bruno Haible  <bruno@clisp.org>
6754
6755         * config.charset: Add support for NetBSD.
6756
6757 2002-09-25    <karl@gnu.org>
6758
6759         * strdup.c: copy from libc/string (via ../config/srclist*).
6760         * getopt*: copy from libc/posix.
6761         * gettext.h: copy from gettext.
6762         * .cppi-disable: add strdup.c, gettext.h.
6763
6764 2002-07-01  Jim Meyering  <meyering@lucent.com>
6765
6766         * c-stack.c: Include sys/time.h.
6767         From Volker Borchert.
6768
6769 2002-06-11  Paul Eggert  <eggert@twinsun.com>
6770
6771         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6772         New macro.  Use it uniformly instead of
6773         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6774         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6775         reported by Vin Shelton.
6776
6777 2002-06-22  Jim Meyering  <meyering@lucent.com>
6778
6779         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6780         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6781
6782 2002-06-22  Paul Eggert  <eggert@twinsun.com>
6783
6784         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6785         Do not assume SA_SIGINFO behavior.
6786         Bug reported by Jim Meyering on NetBSD 1.5.2.
6787
6788 2002-06-22  Jim Meyering  <meyering@lucent.com>
6789
6790         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6791
6792         * exitfail.c, exitfail.h: Likewise.
6793         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6794
6795         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6796         of fnmatch.h.
6797         (EXTRA_DIST): Add fnmatch_loop.c.
6798         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6799
6800         * fnmatch_loop.c: New file, from diffutils-2.8.2.
6801         * fnmatch.c: Update from diffutils-2.8.2.
6802         * fnmatch_.h: New file.  From diffutils-2.8.2.
6803         * fnmatch.h: Remove file.
6804
6805 2002-06-18  Paul Eggert  <eggert@twinsun.com>
6806
6807         * file-type.h: Report an error if neither S_ISREG nor
6808         S_IFREG is defined, instead of using a test specific to glibc
6809         2.2.  This should be safe, since POSIX requires S_ISREG and
6810         Unix Version 7 had S_IFREG.  We don't need to check for
6811         <sys/types.h> since we don't use any symbols that it defines.
6812
6813 2002-06-15  Jim Meyering  <meyering@lucent.com>
6814
6815         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6816         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6817         have been included before this file.
6818
6819 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
6820
6821         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6822         so that each temporary file name is unique and valid in the first
6823         8 characters, for operation under DOS.
6824
6825 2002-06-15  Jim Meyering  <meyering@lucent.com>
6826
6827         Work even with DJGPP 2.03, which lacks support for symlinks.
6828         From Richard Dawe.
6829         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6830         is defined.
6831         * lchown.c (S_ISLNK): Likewise.
6832
6833 2002-06-14  Jim Meyering  <meyering@lucent.com>
6834
6835         * file-type.h: Use the version from diffutils-2.8.2.
6836         * file-type.c: Likewise.
6837
6838 2002-05-27  Jim Meyering  <meyering@lucent.com>
6839
6840         Fix a problem seen only on nonconforming systems whereby ls.c's
6841         use of localtime, and then of gettimeofday would cause trouble:
6842         the localtime call used to initialize rpl_gettimeofday's save
6843         mechanism would clobber ls's current local time information so
6844         that in any long listing the first file would always be listed
6845         with date 1970-01-01.  Analysis by Volker Borchert.
6846
6847         * gettimeofday.c (localtime): Undefine.
6848         (rpl_localtime): New function.
6849
6850 2002-05-22  Jim Meyering  <meyering@lucent.com>
6851
6852         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6853         * file-type.h: New file.
6854         * file-type.c (file_type): New file/function.  Extracted from diffutils.
6855
6856 2002-04-29  Paul Eggert  <eggert@twinsun.com>
6857
6858         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6859
6860 2002-04-28  Paul Eggert  <eggert@twinsun.com>
6861
6862         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6863         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
6864         of 127, since 64 is the largest conceivable number for ancient
6865         nonstandard hosts.
6866         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6867
6868 2002-04-28  Jim Meyering  <meyering@lucent.com>
6869
6870         * sig2str.c (WTERMSIG): Remove definition (unused).
6871
6872 2002-04-28  Paul Eggert  <eggert@twinsun.com>
6873
6874         * sig2str.h, sig2str.c: New files.
6875         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6876
6877 2002-04-24  Jim Meyering  <meyering@lucent.com>
6878
6879         * gettext.h: New file, from Gettext.
6880         * Makefile.am (INCLUDES): Remove -I../intl.
6881         (libfetish_a_SOURCES): Add gettext.h.
6882
6883 2002-04-16  Jim Meyering  <meyering@lucent.com>
6884
6885         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6886         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6887         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6888
6889 2002-04-12  Jim Meyering  <meyering@lucent.com>
6890
6891         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6892
6893 2002-03-10  Jim Meyering  <meyering@lucent.com>
6894
6895         * makepath.c (make_path): Remove a comma from a diagnostic.
6896         Suggestion from Santiago Vila.
6897
6898 2002-03-08  Jim Meyering  <meyering@lucent.com>
6899
6900         * rename.c: Mention that this wrapper is needed also on
6901         mips-dec-ultrix4.4 systems.
6902
6903 2002-03-02  Jim Meyering  <meyering@lucent.com>
6904
6905         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6906         not HAVE_CLOCK_SETTIME.
6907
6908 2002-02-27  Paul Eggert  <eggert@twinsun.com>
6909
6910         * nanosleep.h: Rename to....
6911         * timespec.h: New name for nanosleep.h.  All uses changed.
6912
6913         * gettime.c: New file.
6914         * settime.c: New file.
6915         * stime.c: Remove.
6916
6917         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6918         timespec.h.  Remove nanosleep.h.
6919
6920 2002-02-25  Paul Eggert  <eggert@twinsun.com>
6921
6922         * acl.c, acl.h: New files.
6923         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6924
6925 2002-02-24  Jim Meyering  <meyering@lucent.com>
6926
6927         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6928         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6929         cause trouble.  Reported by Nelson Beebe.
6930
6931 2002-02-23  Paul Eggert  <eggert@twinsun.com>
6932
6933         * path-concat.c (xpath_concat): Reorder code to pacify
6934         compilers that don't know that xalloc_die never returns.
6935
6936 2002-02-20  Jim Meyering  <meyering@lucent.com>
6937
6938         * getdate.c: Regenerate using bison-1.33.
6939
6940 2002-02-15  Paul Eggert  <eggert@twinsun.com>
6941
6942         * posixver.c, posixver.h: New files.
6943         * Makefile.am (libfetish_a_SOURCES): Add them.
6944
6945 2002-02-02  Paul Eggert  <eggert@twinsun.com>
6946             Bruno Haible  <bruno@clisp.org>
6947
6948         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6949         (fwrite_success_callback): New declaration.
6950         * unicodeio.c (unicode_to_mb): New function, extracted from
6951         print_unicode_char. Call failure callback instead of error.
6952         (fwrite_success_callback): New function.
6953         (exit_failure_callback): New function.
6954         (fallback_failure_callback): New function.
6955         (print_unicode_char): Call unicode_to_mb.
6956
6957 2002-01-26  Jim Meyering  <meyering@lucent.com>
6958
6959         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6960
6961 2002-01-22  Jim Meyering  <meyering@lucent.com>
6962
6963         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6964         Otherwise, some versions of automake would omit the rule that makes
6965         Makefile from Makefile.in.
6966
6967 2001-01-21  Paul Eggert  <eggert@twinsun.com>
6968
6969         * xmemcoll.h, xmemcoll.c: New files.
6970         * Makefile.am (libfetish_a_SOURCES): Add them.
6971         * memcoll.c: Include errno.h, and declare errno if not defined.
6972         (memcoll): Set errno to zero if there is no error.
6973
6974         * quotearg.c (quotearg_buffer_restyled):
6975         Fix bug with quoting buffers containing NUL when backslashing escapes.
6976         This bug was exposed by the other changes in this patch.
6977         (quotearg_n_options): New arg ARGSIZE.
6978         All callers changed.
6979         (quoting_options_from_style): New function.
6980         (quotearg_n_style): Use it.
6981         (quotearg_n_style_mem): New function.
6982
6983         * quotearg.h (quotearg_n_style_mem): New function.
6984
6985 2002-01-16  Jim Meyering  <meyering@lucent.com>
6986
6987         * getdate.y: Add three semicolons, each just before a closing brace.
6988         Bison (as of version 1.31) no longer papers over that mistake.
6989
6990 2002-02-14  Paul Eggert  <eggert@twinsun.com>
6991
6992         * backupfile.c (ISDIGIT): Comment fix.
6993         * getdate.y (ISDIGIT): Likewise.
6994         * posixtm.c (ISDIGIT, year): Likewise.
6995         * strverscmp.c (ISDIGIT): Likewise.
6996         * userspec.c (ISDIGIT): Likewise.
6997
6998 2002-01-05  Jim Meyering  <meyering@lucent.com>
6999
7000         * version-etc.c (version_etc_copyright): Update copyright year.
7001
7002 2001-01-19  Paul Eggert  <eggert@twinsun.com>
7003
7004         * closeout.c (close_stdout_status): If ferror (stdout), do
7005         not silently exit merely because the output buffer happens to
7006         have nothing pending.
7007
7008 2001-12-18  Paul Eggert  <eggert@twinsun.com>
7009
7010         See the big note in ../ChangeLog.
7011         * human.c (suffixes): Prefer K to k for 1024.
7012         (generate_suffix_backwards): New function.
7013         (human_readable_inexact): Use it.
7014         * xstrtol.c (__xstrtol): If there is no number but there
7015         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
7016         Accept 'K' as well as 'k'.
7017
7018 2001-12-15  Jim Meyering  <meyering@lucent.com>
7019
7020         * regex.h (__restrict_arr): Update from libc.
7021
7022         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
7023         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
7024         (STREQ): Define.
7025
7026 2001-12-10  Jim Meyering  <meyering@lucent.com>
7027
7028         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
7029         Instead, include "xalloc.h".
7030         (initbuffer): Don't cast xmalloc return value to char*.
7031         (readline): Reword comment.
7032         Don't cast xrealloc return value to char*
7033         Return NULL, not 0.
7034
7035 2001-12-09  Jim Meyering  <meyering@lucent.com>
7036
7037         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
7038         `signed and unsigned type in conditional expression'.
7039         * posixtm.c (posix_time_parse): Likewise.
7040
7041         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
7042
7043         * readtokens.c (readtoken): Declare an index to be of type unsigned
7044         to avoid a pedantic warning.
7045
7046         * getstr.c: Don't include assert.h.
7047         (getstr): Remove warning-evoking assertions.
7048         Return -1 if offset parameter is out of bounds.
7049         Change the type of a local from int to size_t.
7050
7051         * strftime.c (my_strftime_localtime_r): Include this function
7052         definition in the `#if ! HAVE_TM_GMTOFF' block.
7053
7054         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
7055         Include xalloc.h instead.
7056
7057 2001-12-02  Jim Meyering  <meyering@lucent.com>
7058
7059         * tempname.c: Don't declare getenv, thus reverting the change of
7060         2001-11-18.  It's no longer necessary, now that stdlib.h is always
7061         included.
7062
7063         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
7064         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
7065
7066 2001-11-30  Akim Demaille  <akim@epita.fr>
7067
7068         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
7069         before being defined.
7070
7071 2001-11-27  Paul Eggert  <eggert@twinsun.com>
7072
7073         * quotearg.h (quotearg_n, quotearg_n_style):
7074         First arg is int, not unsigned.
7075         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7076         (SIZE_MAX, UINT_MAX): New macros.
7077         (quotearg_n_options): Abort if N is negative.
7078         Avoid overflow check on hosts where size_t is 64 bits and int
7079         is 32 bits, as overflow is impossible there.
7080         Fix off-by-one typo that caused unnecessary reallocation.
7081
7082 2001-11-27  Jim Meyering  <meyering@lucent.com>
7083
7084         * tempname.c: Merge with version from libc.
7085         * regex.c: Likewise.
7086
7087         * tempname.c: Include stdlib.h unconditionally.  On some old systems
7088         for which STDC_HEADERS is 0, it was not included, resulting in a
7089         warning about an integer-to-pointer conversion problem with getenv.
7090         Reported by Volker Borchert.
7091
7092 2001-11-26  Jim Meyering  <meyering@lucent.com>
7093
7094         * gtod.h: Remove file.
7095         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
7096         * gettimeofday.c: Don't include gtod.h.
7097         (GTOD_init): Remove function.
7098         (rpl_gettimeofday): Do its job here instead, rather than aborting.
7099         Suggestion from Volker Borchert.
7100
7101 2001-11-23  Jim Meyering  <meyering@lucent.com>
7102
7103         * hash.h (struct hash_table): Don't define here.  Merely declare it.
7104         * hash.c (struct hash_table): Define it here instead.
7105
7106 2001-11-22  Jim Meyering  <meyering@lucent.com>
7107
7108         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
7109
7110 2001-11-18  Paul Eggert  <eggert@twinsun.com>
7111
7112         * tempname.c (TMP_MAX): Remove; no longer needed.
7113         (TEMPORARIES): New macro.
7114         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
7115         removes an artificial limitation (e.g. HP-UX 10.20, where
7116         TMP_MAX is 17576).
7117
7118 2001-11-18  Jim Meyering  <meyering@lucent.com>
7119
7120         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
7121         on SunOS 4.
7122
7123         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
7124         files will be created before anything else.
7125
7126 2001-11-17  Jim Meyering  <meyering@lucent.com>
7127
7128         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
7129         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
7130         rather than group writable.  Patch by Juan F. Codagnone.
7131
7132         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
7133         Instead, include "xalloc.h".
7134
7135         * mountlist.c: Include unlocked-io.h after all system headers.
7136         Remove explicit declarations of xmalloc, xrealloc,
7137         and xstrdup.  Instead, include "xalloc.h".
7138
7139         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
7140         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
7141         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
7142
7143         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
7144         Reported by Padraig Brady.
7145
7146         * mkstemp.c: #undef mkstemp.
7147         Include config.h.
7148         (rpl_mkstemp): Rename from mkstemp.
7149         Protoize.
7150
7151 2001-11-16  Jim Meyering  <meyering@lucent.com>
7152
7153         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
7154         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
7155         determine the amount of total physical memory, use pstat_getstatic.
7156         HPUX-11 doesn't define _SC_PHYS_PAGES.
7157         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
7158         If sysconf couldn't be used to determine the amount of available
7159         physical memory, use both pstat_getstatic and pstat_getdynamic.
7160         Based on a patch from Bob Proulx.
7161
7162 2001-11-05  Jim Meyering  <meyering@lucent.com>
7163
7164         * xstat.in (slash_aware_lstat): Correct a misleading comment.
7165
7166 2001-11-03  Jim Meyering  <meyering@lucent.com>
7167
7168         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
7169         in argmatch_to_argument call.
7170
7171         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
7172         argument.
7173
7174         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
7175         e.g., a fault due to an attempt to free a NULL pointer.
7176
7177 2001-11-01  Jim Meyering  <meyering@lucent.com>
7178
7179         * dirfd.c, dirfd.h: New files.
7180         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
7181
7182         * hash.c (hash_print) [TESTING]: Clean up.
7183
7184 2001-10-22  Paul Eggert  <eggert@twinsun.com>
7185
7186         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
7187         to avoid a warning if -Wall.
7188
7189 2001-10-21  Paul Eggert  <eggert@twinsun.com>
7190
7191         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
7192
7193 2001-10-21  Jim Meyering  <meyering@lucent.com>
7194
7195         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
7196         this code would end up calling gettext even in packages built
7197         with --disable-nls.
7198         * getopt.c (_): Likewise.
7199         * regex.c (_): Likewise.
7200
7201 2001-10-20  Paul Eggert  <eggert@twinsun.com>
7202
7203         * error.c (strerror_r): Do not declare unless !_LIBC.
7204         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
7205         Use strerror_r that is only a macro, even if it is not a function.
7206         (strerror): Check for HAVE_DECL_STRERROR before declaring.
7207         (private_strerror): Use prototypes, not old-style function definition.
7208         (print_errno_message): New function.
7209         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
7210         char*-flavored one.
7211         (error_tail, error, error_at_line): Use it.
7212
7213 2001-10-11  Jim Meyering  <meyering@lucent.com>
7214
7215         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
7216         and quote_n (1, ... to avoid clobbering a buffer.
7217
7218 2001-10-05  Jim Meyering  <meyering@lucent.com>
7219
7220         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
7221         * hash-pjw.c: New file (factored out of fileutils' remove.c).
7222         * hash-pjw.h: New file.
7223
7224 2001-09-30  Jim Meyering  <meyering@lucent.com>
7225
7226         * mountlist.c [MOUNTED_GETFSSTAT]:
7227         Include <sys/ucred.h>, for Apple Darwin.
7228         Include sys/mount.h and sys/fs_types.h only if available.
7229         (FS_TYPE): Define.
7230         (read_filesystem_list): Use FS_TYPE.
7231
7232 2001-09-29  Paul Eggert  <eggert@twinsun.com>
7233
7234         * exclude.c (excluded_filename): 0 -> false, since it's
7235         a boolean context.
7236
7237 2001-09-28  Paul Eggert  <eggert@twinsun.com>
7238
7239         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
7240         #defines strtoimax.  Also treat the other strto* functions
7241         like strtoimax.
7242
7243         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
7244         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
7245         (strtoimax, strtoumax): Do not declare if already defined as a macro.
7246
7247 2001-09-26  Jim Meyering  <meyering@lucent.com>
7248
7249         Most macros in unlocked-io.h had the wrong number of arguments.
7250         * gen-uio: New script.
7251         (USE_UNLOCKED_IO): Define to 1 if not already defined.
7252         * unlocked-io.hin: Remove file.
7253         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
7254         rather than trying to embed it here.
7255         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
7256         Reported by Padraig Brady.
7257
7258 2001-09-25  Volker Borchert  <bt@teknon.de>
7259
7260         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
7261
7262 2001-09-23  Jim Meyering  <meyering@lucent.com>
7263
7264         * mountlist.c: Remove useless parentheses in #if directives.
7265         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
7266         the deprecated MOUNTED symbol is no longer defined in mntent.h.
7267
7268 2001-09-22  Jim Meyering  <meyering@lucent.com>
7269
7270         * localcharset.c: Update from latest gettext.
7271         * config.charset: Likewise.
7272
7273 2001-09-20  Jim Meyering  <meyering@lucent.com>
7274
7275         * xstrtol.c (strtoimax): Guard declaration with
7276         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
7277         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
7278         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
7279         (strtoumax): Likewise, for completeness (it wasn't necessary).
7280
7281 2001-09-06  Paul Eggert  <eggert@twinsun.com>
7282
7283         * strtoimax.c (HAVE_LONG_LONG):
7284         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
7285         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
7286         to work around bug in IBM C compiler.
7287
7288 2001-09-16  Jim Meyering  <meyering@lucent.com>
7289
7290         * mkdir.c: New file.
7291
7292 2001-09-04  Paul Eggert  <eggert@twinsun.com>
7293
7294         * xgetcwd.c: Revert some of the previous change; intead,
7295         fix the HAVE_GETCWD_NULL code to behave more like the
7296         !HAVE_GETCWD_NULL code used to.
7297
7298         Include "xalloc.h".
7299         (xgetcwd): Do not return NULL when memory is exhausted; instead,
7300         invoke xalloc_die.
7301
7302 2001-09-04  Paul Eggert  <eggert@twinsun.com>
7303
7304         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
7305         Use ssize_t, not int, to store result of readlink.
7306         Check for ssize_t overflow as well as size_t overflow,
7307         as POSIX says the result of readlink is implementation-defined
7308         when ssize_t overflows.
7309         Remove unnecessary cast to char*.
7310         Use free+malloc instead of realloc, as the storage doesn't need
7311         to be preserved and it's clearer and can be more efficient that way.
7312         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
7313         * xreadlink.h (xreadlink): Update prototype.
7314
7315 2001-09-03  Paul Eggert  <eggert@twinsun.com>
7316
7317         * exclude.c (fnmatch_no_wildcards): Fix confusion between
7318         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
7319         spotted by Jim Meyering.
7320
7321 2001-09-03  Jim Meyering  <meyering@lucent.com>
7322
7323         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
7324
7325 2001-09-03  Paul Eggert  <eggert@twinsun.com>
7326
7327         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
7328         like the HAVE_GETCWD_NULL code.
7329         Include pathmax.h if not HAVE_GETCWD.
7330         Do not include xalloc.h.
7331         (INITIAL_BUFFER_SIZE): New symbol.
7332         Do not use xmalloc / xrealloc, since the caller is responsible for
7333         handling errors.  Preserve errno around `free' during failure.
7334         Do not overrun buffer when using getwd.
7335
7336 2001-09-03  Paul Eggert  <eggert@twinsun.com>
7337
7338         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
7339         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
7340
7341 2001-09-02  Jim Meyering  <meyering@lucent.com>
7342
7343         * error.c: Update from GNU libc.
7344
7345 2001-09-01  Jim Meyering  <meyering@lucent.com>
7346
7347         * xreadlink.c: New file.
7348         * xreadlink.h: New file.
7349         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
7350
7351         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
7352         doesn't conflict with sparc Solaris 7's definition in
7353         /usr/include/sys/int_types.h.
7354
7355         * exclude.c: Use `""', not `<>' to #include non-system header files.
7356         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
7357         and strncasecmp as r-values.  Unixware didn't have declarations.
7358
7359 2001-08-31  Jim Meyering  <meyering@lucent.com>
7360
7361         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
7362         Use an initial, malloc'd, buffer of length 128 rather than
7363         a statically allocated one of length 1024.
7364
7365 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7366
7367         * xgetcwd.c: Don't include pathmax.h.
7368         Include stdlib.h and unistd.h if available.
7369         Include xalloc.h.
7370         (xmalloc, xstrdup, free): Remove decls.
7371         (xgetcwd): Don't assume sizes fit in unsigned.
7372         Check for overflow when computing sizes.
7373         Simplify reallocation code.
7374
7375 2001-08-28  Paul Eggert  <eggert@twinsun.com>
7376
7377         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
7378
7379         * strtoimax.c: Renamed from strtoxmax.c, removing the
7380         old strtoimax.c.
7381
7382         Also, make the following further changes to make this file's
7383         configuration more similar to that of strtol.c:
7384         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
7385         (strtoumax, uintmax_t, strtoull, strtol): Remove.
7386         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
7387         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
7388         changed to signed values.
7389
7390         And make the following changes as well:
7391         Fix copyright notice, as 1999 was missing.
7392         (verify): New macro.
7393         (strtoimax): Check sizes at compile-time, not run-time.
7394         Prefer strtol to strtoll if both work.
7395         (main): Remove; it was not that useful and was a pain to maintain.
7396
7397         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
7398
7399 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7400
7401         * savedir.c (savedir): Remove size parameter, as POSIX says that
7402         a directory's st_size can have an arbitrary value, so the old
7403         usage could waste an arbitrary amount of memory.  All uses
7404         changed.
7405         * savedir.h: Update prototype.
7406
7407 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7408
7409         * xstrtol.c (strtoimax): New decl.
7410
7411 2001-08-28  Paul Eggert  <eggert@twinsun.com>
7412
7413         * xstrtol.h: Add copyright notice.
7414         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
7415         LONGINT_INVALID_SUFFIX_CHAR.
7416
7417 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7418
7419         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
7420         tm to be declared.
7421
7422 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7423
7424         * hash.c: Remove '2001' from copyright notice.
7425
7426 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7427
7428         * full-write.h: New file.
7429         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
7430         * full-write.c: Correct credits, as cccp.c no longer
7431         exists and anyway it was so heavily changed from the old cccp
7432         code as to be unrecognizable.  Include full-write.h.
7433         (full_write) Return size_t, with short writes meaning failure.
7434         All callers changed.  This fixes a bug with large buffers
7435         on 64-bit hosts.
7436         * utime.c: Include full-write.h.
7437
7438 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7439
7440         Merge 'exclude' changes from tar 1.13.22.
7441         This fixes one or two unlikely storage allocation overflow bugs,
7442         but doesn't change user-visible behavior otherwise.
7443
7444 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7445
7446         * exclude.c (bool): Declare, perhaps by including stdbool.h.
7447         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
7448         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
7449         Include if available.
7450         (<xalloc.h>): Include
7451         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
7452         (verify): New macro.  Use it to verify that EXCLUDE macros do not
7453         collide with FNM macros.
7454         (struct patopts): New struct.
7455         (struct exclude): Use it, as exclude patterns now come with options.
7456         (new_exclude): Support above changes.
7457         (new_exclude, add_exclude_file):
7458         Initial size must now be a power of two to simplify overflow checking.
7459         (free_exclude, fnmatch_no_wildcards): New function.
7460         (excluded_filename): No longer requires options arg, as the options
7461         are determined by add_exclude.  Now returns bool, not int.
7462         (excluded_filename, add_exclude):
7463         Add support for the fancy new exclusion options.
7464         (add_exclude, add_exclude_file): Now takes int options arg.
7465         Check for arithmetic overflow when computing sizes.
7466         (add_exclude_file): xrealloc might modify errno, so don't
7467         realloc until after errno might be used.
7468
7469         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
7470         New macros.
7471         (free_exclude): New decl.
7472         (add_exclude, add_exclude_file): Now takes int options arg.
7473         (excluded_filename): No longer requires options arg, as the options
7474         are determined by add_exclude.  Now returns bool, not int.
7475
7476 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7477
7478         * alloca.c (alloca): Arg is of type size_t, not unsigned.
7479
7480 2001-08-27  Jim Meyering  <meyering@lucent.com>
7481
7482         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
7483
7484         * version-etc.c (N_): Remove definition.
7485         Revert most of last change.
7486         Instead, simply don't mark the `Copyright...' string for translation.
7487         Based on advice from Paul Eggert.
7488
7489         * strtoxmax.c: Tweak comment.
7490
7491 2001-08-26  Jim Meyering  <meyering@lucent.com>
7492
7493         * version-etc.c (version_etc_copyright_fmt): Replace literal year
7494         of copyright with `%s' so translators don't get an untranslated
7495         message in 2002.
7496         (COPYRIGHT_YEAR): Define.
7497         (version_etc): Use fprintf rather than fputs.
7498         Suggestion from Ulrich Drepper.
7499
7500         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
7501
7502         * strtoll.c: New file, from GNU libc.
7503         * xstrtoimax.c: New file.
7504
7505         * xstrtol.h: Add xstrtoimax.
7506         * strtoumax.c: New file.  Simply include "strtoumax.c".
7507         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
7508
7509         * strtoumax.c: Factor to work both for unsigned and signed types, ...
7510         * strtoxmax.c: ... then renamed to this.
7511
7512 2001-08-13  Paul Eggert  <eggert@twinsun.com>
7513
7514         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
7515         Port to Solaris 8, where 'sed' requires a space after the 'r'
7516         command, and where sh dislikes "$/".  Clean up the spacing a bit.
7517         Redirect output to $tmp just once.
7518
7519 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
7520
7521         * addext.c (<errno.h>): Include.
7522         (errno): Declare if not defined.
7523         (addext): Work correctly when pathconf returns -1 and leaves
7524         errno alone because there is no limit.  Also, work even if
7525         pathconf returns a value greater than SIZE_MAX.
7526
7527 2001-08-12  Jim Meyering  <meyering@lucent.com>
7528
7529         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
7530         Simply `return getcwd (NULL, 0);'.
7531         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
7532         Use 1300 as initial value for length, not PATH_MAX.
7533
7534         * pathmax.h: Clean up cpp syntax.
7535
7536 2001-08-12  Jim Meyering  <meyering@lucent.com>
7537
7538         * gettimeofday.c: New file.
7539         * gtod.h: New file.
7540         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
7541
7542 2001-08-04  Jim Meyering  <meyering@lucent.com>
7543
7544         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
7545         to get in sync with glibc.
7546
7547 2001-08-03  Paul Eggert  <eggert@twinsun.com>
7548
7549         The following changes are from gettext 0.10.39 as maintained by
7550         Bruno Haible.
7551
7552         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
7553         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
7554         with inverted sense.  All uses changed.
7555
7556         * mbswidth.c: Don't include <limits.h>.
7557         Include <stdlib.h> and <string.h> unconditionally.
7558         (iswcntrl, mbsinit, ISCNTRL): New macros.
7559         (mbsnwidth): Use K&R style function declarations.
7560         Don't bother checking for MB_LEN_MAX == 1, since the compiler
7561         can optimize it when MB_CUR_MAX == 1.
7562         The width of control characters is zero, not 1.
7563
7564 2001-07-15  Jim Meyering  <meyering@lucent.com>
7565
7566         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
7567         (BUILT_SOURCES): Add unlocked-io.h.
7568         (io_functions): Define.
7569         (unlocked-io.h): New rule.
7570         (DISTCLEANFILES): Add unlocked-io.h.
7571         (all-local): Depend on unlocked-io.h, to ensure it is created.
7572
7573         * unlocked-io.hin: New file
7574
7575         * regex.c: Update from glibc.
7576
7577 2001-07-05  Jim Meyering  <meyering@lucent.com>
7578
7579         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
7580         recommendation.
7581         (libfetish_a_SOURCES): Put all .h files here instead.
7582         Remove a thus-exposed (better checks in automake) duplicate and
7583         two unnecessary .h files.
7584
7585 2001-06-11  Jim Meyering  <meyering@lucent.com>
7586
7587         * regex.c: Update from GNU libc.
7588
7589 2001-05-27  Jim Meyering  <meyering@lucent.com>
7590
7591         * readutmp.h (UT_TYPE): Define.
7592
7593 2001-05-24  Jim Meyering  <meyering@lucent.com>
7594
7595         * argmatch.c: Include "quote.h".
7596         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
7597         quote function.  Reported by Göran Uddeborg.
7598
7599 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
7600
7601         * dirname.c (dir_name): Compute append_dot using path, not newpath
7602         which is not yet declared.
7603
7604 2001-05-11  Paul Eggert  <eggert@twinsun.com>
7605
7606         * Makefile.am (libfetish_a_SOURCES):
7607         Add strftime.c, since we now compile it on all hosts.
7608
7609         * strftime.c (my_strftime):
7610         Define to nstrftime if emacs, but only if my_strftime is not defined.
7611         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
7612         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
7613         Add one more extra argument: a nanoseconds value.
7614         All uses changed.
7615         (ns): New macro.
7616         (my_strftime function): Add %N format.
7617         (emacs_strftimeu): Renamed from emacs_strftime,
7618         with extra ut argument.
7619
7620 2001-05-11  Paul Eggert  <eggert@twinsun.com>
7621
7622         dirname code cleanup.  base_name now behaves more compatibly
7623         with POSIX basename when given file names that have trailing
7624         slashes, and similarly for dir_name.  Add new primitives
7625         base_len and dir_len.  Put the directory-name-related decls
7626         into dirname.h.
7627
7628         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
7629         * backupfile.c (base_name): Likewise.
7630         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
7631         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
7632         * makepath.c (strip_trailing_slashes): Likewise.
7633         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
7634         Likewise.
7635         * rename.c (strip_trailing_slashes): Likewise.
7636         * same.c (base_name): Likewise.
7637         * stripslash.c (ISSLASH): Likewise.
7638
7639         * addext.c: Include <dirname.h> after size_t is defined.
7640         * backupfile.c: Likewise.
7641
7642         * addext.c (addext): Use base_len to trim redundant
7643         trailing slashes instead of doing it ourselves.
7644         But do not trim the last slash if it is not redundant.
7645
7646         * backupfile.c (find_backup_file_name,
7647         max_backup_version): Use base_len instead of rolling it ourselves.
7648         Handle the case of "" and (on DOS) "C:" correctly.
7649
7650         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
7651         Include <string.h>, <dirname.h>.
7652         (base_name): Allow file names ending in slashes, other than names
7653         that are all slashes.  In this case, return the basename followed
7654         by the slashes.  This is more general, and can be used in places
7655         where the original base_name purposely had an assertion failure.
7656         (base_len): New function.
7657
7658         * dirname.c: Include <string.h> instead of <stdlib.h>.
7659         Do not include <assert.h>; no longer needed.
7660         Include xalloc.h.
7661         (memrchr): Remove decl.
7662         (dir_name_r): Remove.
7663         (dir_len): Renamed from dirlen.  All callers changed.
7664         Rewrite in terms of base_name, for simplicity and consistency.
7665         (dir_name): Never return NULL.  All callers changed.
7666         Do not include <stdlib.h> in test program; no longer needed.
7667         return 0; is fine for test program.
7668
7669         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7670         New macros.
7671         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7672
7673         * path-concat.c (path_concat): Use base_len to compute
7674         base length, not strlen; this means we cannot rely on memcpy
7675         to null-terminate.
7676
7677         * same.c (STREQ): Remove.
7678         (same_name): Handle the case where the basename ends in trailing '/'.
7679
7680         * stripslash.c (strip_trailing_slashes): Return nonzero if
7681         a slash was stripped.  Do not strip the last slash after a
7682         file system prefix.
7683
7684 2001-04-08  Jim Meyering  <meyering@lucent.com>
7685
7686         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
7687         recomputed; that's necessary when the offset spans a DST transition.
7688         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
7689
7690 2001-04-02  Jim Meyering  <meyering@lucent.com>
7691
7692         * regex.h, regex.c: Update from GNU libc.
7693
7694 2001-03-19  Paul Eggert  <eggert@twinsun.com>
7695
7696         * version-etc.c (version_etc_copyright): Update to 2001.
7697
7698 2001-03-16  Paul Eggert  <eggert@twinsun.com>
7699
7700         * tempname.c (uint64_t): Define to uintmax_t if
7701         not defined, and if UINT64_MAX is not defined.
7702         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
7703         Reported by John David Anglin.
7704
7705 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
7706
7707         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
7708         alias if codeset is empty.
7709         * config.charset (BeOS): Use wildcard syntax.
7710
7711 2001-03-13  Jim Meyering  <meyering@lucent.com>
7712
7713         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
7714         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7715         From Bruno Haible.
7716
7717 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
7718
7719         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7720         Don't return NULL.
7721         * unicodeio.c (print_unicode_char): Simplify accordingly.
7722
7723 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
7724
7725         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7726         support for DOS/DJGPP.
7727
7728 2001-02-28  Paul Eggert  <eggert@twinsun.com>
7729
7730         * Makefile.am (libfetish_a_SOURCES):
7731         Add dup-safer.c, fopen-safer.c.
7732         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7733
7734         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7735
7736 2001-02-25  Paul Eggert  <eggert@twinsun.com>
7737
7738         The mkstemp replacement is taken from glibc 2.2.2, with some
7739         portability fixes for use outside glibc, as follows:
7740
7741         * tempname.c (struct_stat64): New macro.
7742         (direxists, __gen_tempname): Use it.
7743         This avoids a portability problem with Solaris 8.
7744
7745         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7746         (<stddef.h>, <stdint.h>, <string.h>):
7747         Include only if STDC_HEADERS || _LIBC.
7748         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7749         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7750         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7751         (__set_errno): Define this macro if <errno.h> doesn't.
7752         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7753         Define these macros if <stdio.h> doesn't.
7754         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7755         Define these macros if <sys/stat.h>
7756         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7757         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7758         __xstat64): Define if not _LIBC.
7759         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7760         (__gen_tempname): Invoke gettimeofday only if
7761         HAVE_GETTIMEOFDAY || _LIBC;
7762         otherwise, fall back on plain "time".
7763         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7764
7765         * mkstemp.c (__GT_FILE): Define to zero if not defined.
7766
7767         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7768
7769 2001-02-17  Jim Meyering  <meyering@lucent.com>
7770
7771         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
7772         around included file name.
7773
7774         * strnlen.c (__strnlen): Merge in a change from GNU libc.
7775
7776         * strftime.c: Update from GNU libc (the only changes were to comments).
7777
7778 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
7779
7780         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7781
7782 2001-02-17  Paul Eggert  <eggert@twinsun.com>
7783
7784         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7785         Remove workaround macros for hosts that have mbrtowc but not
7786         mbstate_t, as we now insist on proper declarations for both
7787         before using mbrtowc.
7788
7789 2001-02-17  Jim Meyering  <meyering@lucent.com>
7790
7791         * regex.c: Update from libc.
7792
7793 2001-02-16  Paul Eggert  <eggert@twinsun.com>
7794
7795         * alloca.c (malloc): Undef before defining, since stdlib.h
7796         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
7797         Reported by Mark Hounschell via Paul Eggert.
7798
7799 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
7800
7801         * config.charset: Update for FreeBSD 4.2.
7802
7803 2001-01-26  Jim Meyering  <meyering@lucent.com>
7804
7805         * quotearg.c: Include stddef.h.
7806         * quote.c: Include stddef.h.
7807         Reported by Axel Kittenberger.
7808
7809         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7810         line in double quotes so that it evokes a better diagnostic.
7811         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7812         Reported by Axel Kittenberger.
7813
7814 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
7815
7816         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7817         to avoid a warning.  Add back 'const' to inptr.
7818
7819 2001-01-16  Jim Meyering  <meyering@lucent.com>
7820
7821         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7822         From Bruno Haible.
7823
7824 2001-01-14  Jim Meyering  <meyering@lucent.com>
7825
7826         * rename.c: New file.  From Volker Borchert.
7827         Include stdlib.h, string.h or strings.h, and xalloc.h.
7828         Use strip_trailing_slashes rather than open-coding it.
7829
7830 2001-01-03  Paul Eggert  <eggert@twinsun.com>
7831
7832         * strftime.c: Sync with glibc time/strftime.c 1.81.
7833
7834 2001-01-03  Jim Meyering  <meyering@lucent.com>
7835
7836         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7837         local `inptr' to avoid warning with some system declarations of iconv.
7838
7839 2000-12-29  Paul Eggert  <eggert@twinsun.com>
7840
7841         * modechange.c: Do not assume that mode_t uses the
7842         traditional octal encoding.  E.g. "chmod 1 FOO" should set
7843         the other-execute bit of FOO even if S_IXOTH != 1.
7844
7845         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7846         WOTH, XOTH, ALLM): New macros.
7847         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7848          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7849         Use them.
7850         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7851         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7852         (mode_compile):
7853         No need to use uintmax_t; unsigned long is long enough.
7854         Don't bother to get suffix since we don't use it.
7855
7856 2000-12-24  Jim Meyering  <meyering@lucent.com>
7857
7858         * hash.c (is_prime): Return explicit boolean values.
7859         (hash_get_first): Return NULL to appease Irix5.6's 89.
7860         Reported by Nelson Beebe.
7861
7862 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
7863
7864         * localcharset.c (locale_charset): Add support for Win32.
7865
7866 2000-12-18  Paul Eggert  <eggert@twinsun.com>
7867
7868         * physmem.h, physmem.c: New files.
7869
7870         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7871         (noinst_HEADERS): Add physmem.h.
7872
7873         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7874         't' for compatibility with Solaris 8 sort.
7875
7876 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
7877
7878         * config.charset: Add support for BeOS.
7879
7880 2000-12-16  Jim Meyering  <meyering@lucent.com>
7881
7882         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7883         SHELLS_FILE to a file name that's useful on djgpp systems.
7884         Include stdlib.h.
7885         (ADDITIONAL_DEFAULT_SHELLS): Define.
7886         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7887         Based mostly on a patch from Prashant TR.
7888
7889 2000-12-16  Jim Meyering  <meyering@lucent.com>
7890
7891         This bug had a serious impact on chown: `chown N:M FILE' (for integer
7892         N and M) would have treated it like `chown N:N FILE'.
7893
7894         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7895
7896 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
7897
7898         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7899         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7900         to the list of canonical encodings. Rename EUC-CN to GB2312.
7901
7902 2000-12-08  Andreas Schwab  <schwab@suse.de>
7903
7904         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7905         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7906
7907 2000-12-07  Jim Meyering  <meyering@lucent.com>
7908
7909         * stripslash.c (ISSLASH): Define.
7910         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7911         From Prashant TR.
7912
7913         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7914         (dir_name_r): Declare this function as static.
7915         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7916         manifest itself on a name containing a mix of slashes and
7917         backslashes.
7918         Make this function work with names starting with a DOS-style
7919         drive letter and colon prefix.
7920         (dir_name): Append `.' if necessary.
7921         Based mostly on patches from Prashant TR and Eli Zaretskii.
7922
7923         * dirname.h (dir_name_r): Remove prototype.
7924
7925 2000-12-05  Jim Meyering  <meyering@lucent.com>
7926
7927         * dirname.c (dir_name_r): Add `const' in a few local declarations.
7928
7929 2000-12-04  Jim Meyering  <meyering@lucent.com>
7930
7931         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7932         Also include memory.h, stdlib.h, unistd.h if appropriate.
7933         Reported by Andreas Jaeger (conflicting declaration of malloc).
7934
7935 2000-12-02  Jim Meyering  <meyering@lucent.com>
7936
7937         * closeout.h: Make idempotent, to avoid some obscure warnings.
7938
7939 2000-12-01  Paul Eggert  <eggert@twinsun.com>
7940
7941         * memrchr.c: Include <config.h> before any system include file.
7942
7943 2000-11-29  Paul Eggert  <eggert@twinsun.com>
7944
7945         * dirname.c (dir_name_r): Fix typo: int -> size_t.
7946
7947 2000-11-26  Jim Meyering  <meyering@lucent.com>
7948
7949         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
7950
7951 2000-11-22  Paul Eggert  <eggert@twinsun.com>
7952
7953         * strftime.c (my_strftime): Do not invoke mbrlen with a
7954         size of (size_t) -1; it's not portable.
7955
7956 2000-11-17  Akim Demaille  <akim@epita.fr>
7957
7958         * obstack.h: Formatting changes.
7959         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7960         prevent type checking.
7961         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7962         cast the value to (void *): assigning a `foo *' to a `void *'
7963         variable is valid.
7964         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7965
7966 2000-11-17  Jim Meyering  <meyering@lucent.com>
7967
7968         * strstr.c: Update from GNU libc.
7969
7970 2000-11-16  Jim Meyering  <meyering@lucent.com>
7971
7972         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7973
7974 2000-11-11  Jim Meyering  <meyering@lucent.com>
7975
7976         * error.c: Add a couple #includes, merging from GNU libc version.
7977
7978 2000-11-10  Jim Meyering  <meyering@lucent.com>
7979
7980         * obstack.h: Update from GNU libc.
7981         * obstack.c: Likewise.
7982
7983 2000-11-06  Paul Eggert  <eggert@twinsun.com>
7984
7985         * getusershell.c (setusershell): Use rewind rather than
7986         fseek/fseeko, to avoid configuration hassles with fseeko.
7987         Don't bother opening SHELLS_FILE if shellstream is NULL;
7988         it's not necessary.
7989
7990 2000-11-05  Jim Meyering  <meyering@lucent.com>
7991
7992         * makepath.h (make_dir): Declare.
7993         * makepath.c (make_dir): Remove `static' attribute.
7994         Tweak a comment.
7995
7996 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
7997
7998         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
7999         last one in a bucket, advance to the next bucket.
8000
8001 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
8002
8003         * fnmatch.c: Do not comment out all the code if we are using
8004         the GNU C library, because in some cases we are replacing buggy
8005         code in the GNU C library itself.
8006
8007 2000-10-30  Paul Eggert  <eggert@twinsun.com>
8008
8009         * error.h, getline.h, modechange.h:
8010         Remove "2000" from Copyright line, as the file hasn't been
8011         changed this year other than in the copyright notice.
8012
8013         * xalloc.h: Add "2000" to Copyright line, as this file
8014         was changed this year.
8015
8016 2000-10-30  Paul Eggert  <eggert@twinsun.com>
8017
8018         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
8019         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
8020         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
8021
8022 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
8023
8024         * regex.h (__restrict_arr): Move definition out of #ifndef block.
8025         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
8026         doesn't define __restrict_arr.
8027
8028 2000-10-29  Jim Meyering  <meyering@lucent.com>
8029
8030         * xstat.in: Fix grammar in comment.
8031
8032 2000-10-28  Jim Meyering  <meyering@lucent.com>
8033
8034         * memchr.c: Update from libc.
8035         Adjust for portability:
8036         [HAVE_STDLIB_H]: Include stdlib.h.
8037         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
8038         Undef __memchr, too.
8039         [!weak_alias]: Define __memchr to memchr.
8040
8041         * regex.c: Update from libc.
8042         * regex.h: Likewise.
8043         * getopt1.c: Likewise.
8044         * memcmp.c: Likewise.
8045
8046         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
8047         Avoid using fseek, when possible -- it's broken by design.
8048         Patch by Ulrich Drepper.
8049
8050 2000-10-26  Jim Meyering  <meyering@lucent.com>
8051
8052         * strftime.c: Update from libc.
8053
8054 2000-10-25  Jim Meyering  <meyering@lucent.com>
8055
8056         * obstack.c: Update from libc.
8057
8058 2000-10-23  Jim Meyering  <meyering@lucent.com>
8059
8060         * hard-locale.c (hard_locale): Revert last change -- it was simply
8061         wrong.  That set_locale call must not have any side effects.
8062         From Paul Eggert.
8063
8064 2000-10-22  Jim Meyering  <meyering@lucent.com>
8065
8066         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
8067         [CYCLIC]: Remove now-unused definition.
8068
8069         * save-cwd.c (O_DIRECTORY): Define, if needed.
8070         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
8071         Suggestion from Ulrich Drepper.
8072
8073 2000-10-21  Jim Meyering  <meyering@lucent.com>
8074
8075         * dirname.c (dir_name_r): New function, factored out of dir_name.
8076         (dir_name): Use dir_name_r.
8077         * dirname.h (dir_name_r): Declare it.
8078
8079 2000-10-21  Jim Meyering  <meyering@lucent.com>
8080
8081         * dirname.c (memrchr): Declare if necessary.
8082         (dir_name): Remove the restriction that there be no
8083         trailing slashes.  Now, this code skips past them, effectively
8084         ignoring them.
8085         [TEST_DIRNAME] (main): New unit tests.
8086
8087         * memrchr.c: New file from GNU libc.
8088         Undef __memrchr, too.
8089         [!weak_alias]: Define __memrchr to memrchr.
8090         Guard weak_alias use with `#ifdef weak_alias'.
8091
8092 2000-10-17  Jim Meyering  <meyering@lucent.com>
8093
8094         * quote.h (PARAMS): Define and use.
8095         Reported by Akim Demaille.
8096
8097         * getopt.c: Update from libc.
8098
8099 2000-10-16  Jim Meyering  <meyering@lucent.com>
8100
8101         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
8102         From Jan Fedak.
8103
8104 2000-09-25  Jim Meyering  <meyering@lucent.com>
8105
8106         * md5.h (rol): Define (from GnuPG).
8107
8108         * sha.c: Give credit (GnuPG) where due.
8109         (M): Use rol rather than open-coding it.
8110         Add a FIXME comment.
8111
8112 2000-09-21  Jim Meyering  <meyering@lucent.com>
8113
8114         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
8115         Reported by Michael Stone.
8116
8117 2000-09-20  Jim Meyering  <meyering@lucent.com>
8118
8119         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
8120         (noinst_HEADERS): Add sha.h.
8121         Based on code from Scott G. Miller and from GnuPG.
8122
8123 2000-09-15  Jim Meyering  <meyering@lucent.com>
8124
8125         * regex.c: Update from libc.
8126
8127 2000-09-10  Jim Meyering  <meyering@lucent.com>
8128
8129         * getopt.c (_getopt_internal): Update from glibc.
8130
8131 2000-09-09  Jim Meyering  <meyering@lucent.com>
8132
8133         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
8134         think it should be used as a general replacement for isascii.
8135         * fnmatch.c: Likewise.
8136         * mbswidth.c: Likewise
8137         * regex.c: Likewise.
8138
8139         Don't use atoi.
8140         * userspec.c: Include sys/param.h and limits.h.
8141         Include xstrtol.h.
8142         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8143         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
8144         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
8145         UID, GID.  Check range.
8146
8147 2000-09-06  Jim Meyering  <meyering@lucent.com>
8148
8149         * getopt.c (_getopt_internal): Update from glibc.
8150
8151 2000-08-30  Jim Meyering  <meyering@lucent.com>
8152
8153         * strftime.c: Merge in changes from GNU libc.
8154
8155 2000-08-26  Jim Meyering  <meyering@lucent.com>
8156
8157         * closeout.c: Include "__fpending.h".
8158         (close_stdout_status): Return right away if there's nothing to flush.
8159
8160         * Makefile.am (noinst_HEADERS): Add __fpending.h.
8161         * __fpending.c: New file.
8162         * __fpending.h: New file.
8163
8164 2000-08-07  Paul Eggert  <eggert@twinsun.com>
8165
8166         Standardize on "memory exhausted" instead of "Memory exhausted"
8167         or "virtual memory exhausted".
8168         * obstack.c (print_and_abort): Use "memory exhausted", not
8169         "virtual memory exhausted".
8170         * same.c (same_name): Invoke xalloc_die instead of printing
8171         our own message.
8172         * userspec.c (parse_user_spec): Likewise.
8173         * bumpalloc.h: comment fix
8174         * same.c, userspec.c: Include xalloc.h.
8175
8176         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
8177         not char *const and pointing to a constant array.
8178         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
8179         (xrealloc): Comment fix.
8180
8181         * userspec.c (parse_user_spec):
8182         Don't translate a message until just before returning,
8183         to avoid unnecessary translation.
8184
8185 2000-08-07  Jim Meyering  <meyering@lucent.com>
8186
8187         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
8188         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
8189         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
8190         getgroups.c, gethostname.c, getopt.h, group-member.c,
8191         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
8192         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
8193         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
8194         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
8195         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
8196         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
8197         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
8198         yesno.c: Back out Copyright date changes for each file with no change
8199         this year.  This eases coordination with other programs using the same
8200         source code modules.  From Paul Eggert.
8201
8202 2000-08-03  Greg McGary  <greg@mcgary.org>
8203
8204         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
8205         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
8206         (EXTEND_BUFFER): Use them.
8207
8208 2000-08-01  Jim Meyering  <meyering@lucent.com>
8209
8210         * dirname.c (ISSLASH): Define.
8211         (BACKSLASH_IS_PATH_SEPARATOR): Define.
8212         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
8213         both `\' and `/' may be use as path separators.
8214         Based on a patch from Prashant TR.
8215
8216 2000-07-31  Paul Eggert  <eggert@twinsun.com>
8217
8218         * quotearg.c (quotearg_n_options): Don't make the initial
8219         slot vector a constant, since it might get modified.
8220
8221 2000-07-31  Jim Meyering  <meyering@lucent.com>
8222
8223         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
8224         * obstack.c (print_and_abort): Likewise.
8225
8226 2000-07-30  Paul Eggert  <eggert@twinsun.com>
8227
8228         * quotearg.c (quotearg_n_options): Preallocate a slot 0
8229         buffer, so that the caller can always quote one small
8230         component of a "memory exhausted" message in slot 0.
8231         From a suggestion by Jim Meyering.
8232
8233 2000-07-30  Jim Meyering  <meyering@lucent.com>
8234
8235         * makepath.c (make_path): Quote the other instance, too.
8236
8237         * quotearg.c (N_STATIC_SLOTVECS): Define.
8238         (STATIC_BUF_SIZE): Define.
8239         (quotearg_n_options): Use only statically allocated storage when
8240         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
8241         than STATIC_BUF_SIZE.
8242
8243 2000-07-29  Jim Meyering  <meyering@lucent.com>
8244
8245         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
8246         * dirname.c (dir_name): Likewise.
8247
8248         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
8249
8250         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
8251         (dir_name): Assert that there are no trailing slashes.
8252
8253 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
8254
8255         * mbswidth.h (mbswidth): Add a flags argument.
8256         (mbswidth): New declaration.
8257         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
8258         * mbswidth.c (mbswidth): Add a flags argument.
8259         (mbsnwidth): New function.
8260
8261 2000-07-24  Jim Meyering  <meyering@lucent.com>
8262
8263         * mbswidth.c: Remove useless #else.  From Bruno Haible.
8264
8265 2000-07-23  Paul Eggert  <eggert@twinsun.com>
8266
8267         * mbswidth.c (_XOPEN_SOURCE):
8268         Don't define; this causes problems on Solaris 7.
8269         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
8270
8271 2000-07-23  Paul Eggert  <eggert@twinsun.com>
8272
8273         * quotearg.c:
8274         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
8275         so that mbstate_t is always defined.
8276
8277         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
8278         be 1 in at least one GCC installation, and this configuration
8279         error is likely to be common.  Ignoring MB_LEN_MAX hurts
8280         performance on hosts that have mbrtowc but have only unibyte
8281         locales, but I assume these hosts are rare.
8282
8283 2000-07-23  Paul Eggert  <eggert@twinsun.com>
8284
8285         * quotearg.c: Streamline by invoking multibyte code only if needed.
8286         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
8287         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
8288         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
8289         invoke multibyte primitives.
8290
8291 2000-07-23  Jim Meyering  <meyering@lucent.com>
8292
8293         * basename.c (base_name): Add an assertion.
8294
8295 2000-07-15  Bruno Haible  <clisp.cons.org>
8296
8297         * quotearg.c: When the system forces us to redefine mbstate_t,
8298         shadow its mbsinit function.
8299
8300 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
8301
8302         * mbswidth.h: New file.
8303         * mbswidth.c: New file.
8304         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
8305         (noinst_HEADERS): Add mbswidth.h.
8306
8307 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
8308
8309         * config.charset: Add support for FreeBSD. Improve support for HP-UX
8310         and IRIX 6.
8311
8312 2000-07-15  Jim Meyering  <meyering@lucent.com>
8313
8314         * makepath.c: Include quote.h.
8315         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
8316         corresponding argument in a `quote (...)' call.
8317         Give better diagnostics.
8318
8319         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
8320         (noinst_HEADERS): Add quote.h.
8321
8322         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
8323         from tar's src/misc.c.
8324         * quote.h: New file.  Prototypes for same.
8325
8326 2000-07-10  Paul Eggert  <eggert@twinsun.com>
8327
8328         From a suggestion by Bruno Haible.
8329         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
8330         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
8331         to decide whether to define the BeOS workaround macro;
8332         this adjusts to the change to AC_MBSTATE_T.
8333
8334 2000-07-13  Paul Eggert  <eggert@twinsun.com>
8335
8336         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
8337
8338         * quotearg.c (quoting_style_args, quoting_style_vals,
8339         quotearg_buffer_restyled): Add support for
8340         clocale_quoting_style.  Undo previous change to
8341         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
8342         and "{RIGHT QUOTATION MARK}" msgids.
8343
8344 2000-07-05  Paul Eggert  <eggert@twinsun.com>
8345
8346         The old behavior of quoting `like this' doesn't look good with
8347         newer, ISO-style fonts.  See:
8348         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
8349
8350         Instead, quote "like this" by default.  Let the translator
8351         tailor the locale-specific quoting behavior by providing
8352         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
8353
8354         * quotearg.c (N_): New macro.
8355         (gettext_default): New function.
8356         (quotearg_buffer_restyled): Use
8357         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
8358         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
8359
8360 2000-07-09  Jim Meyering  <meyering@lucent.com>
8361
8362         * Most files: Update copyright dates to include 2000.
8363
8364 2000-07-08  Jim Meyering  <meyering@lucent.com>
8365
8366         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
8367         if not defined.
8368         (xgethostname): Remove now-unnecessary #ifdef.
8369         Move declaration of `err' into loop where it's used.
8370
8371 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
8372
8373         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
8374         by allocating a larger buffer. Test the gethostname return value for
8375         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
8376         returns an error and ENAMETOOLONG isn't defined.
8377
8378 2000-07-05  Paul Eggert  <eggert@twinsun.com>
8379         and Bruno Haible  <haible@clisp.cons.org>
8380
8381         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
8382
8383 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
8384
8385         * quotearg.c (struct quoting_options): Simplify quote_these_too
8386         dimension.
8387
8388 2000-07-03  Jim Meyering  <meyering@lucent.com>
8389
8390         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
8391         Reported by Bruno Haible.
8392
8393 2000-07-04  Jim Meyering  <meyering@lucent.com>
8394
8395         * quotearg.c: Make inclusion of <wchar.h> independent of whether
8396         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
8397         lacks mbrtowc.
8398
8399 2000-07-03  Paul Eggert  <eggert@twinsun.com>
8400         and Bruno Haible  <haible@clisp.cons.org>
8401
8402         * quotearg.c (mbrtowc):
8403         Assign to *pwc, and return 1 only if result is nonzero.
8404         (iswprint): Use ISPRINT when substituting our own mbrtowc.
8405
8406 2000-07-03  Jim Meyering  <meyering@lucent.com>
8407
8408         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
8409         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
8410         From Bob Proulx.
8411
8412 2000-07-02  Jim Meyering  <meyering@lucent.com>
8413
8414         * quotearg.c (mbstate_t): Don't define here.
8415
8416 2000-07-02  Jim Meyering  <meyering@lucent.com>
8417
8418         * nanosleep.c (SIGCONT): Define if not already defined.
8419
8420 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8421
8422         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
8423         per change in ../m4/ls-mntd-fs.m4.
8424         (read_filesystem_list): Ignore symbolic links.
8425
8426 2000-06-29  Jim Meyering  <meyering@lucent.com>
8427
8428         * same.c: Include <string.h> or <strings.h>, as appropriate,
8429         for declaration of strcmp.
8430
8431         * long-options.c: Include <stdlib.h>, for declaration of exit.
8432
8433         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
8434         Avoid warning by casting result to `char *' to remove `const'.
8435
8436 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8437
8438         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
8439
8440 2000-06-26  Paul Eggert  <eggert@twinsun.com>
8441
8442         savedir now sets errno on failure and invokes xmalloc to get memory.
8443         Fix a couple of other minor bugs while we're at it.
8444
8445         * savedir.c (<unistd.h>): Do not include; there's no need.
8446         (NAMLEN): Remove macro.
8447         (malloc, realloc): Remove decls.
8448         (stpcpy): Likewise.
8449         ("xalloc.h"): Include.
8450         (NAME_SIZE_DEFAULT): New macro.
8451         (savedir): Use xmalloc / xrealloc to allocate memory.
8452         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
8453         Skip "" directory entries.
8454         Use strlen to calculate directory entry length, since the old method
8455         is rarely used these days and isn't worth supporting.
8456         Don't use a pointer after freeing it.
8457         Check for integer overflow when calculating allocation size.
8458         Use memcpy to copy entries, instead of stpcpy.
8459         Set errno properly when returning NULL.
8460         Check for readdir error.
8461
8462 2000-06-26  Jim Meyering  <meyering@lucent.com>
8463
8464         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
8465
8466 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8467
8468         * getusershell.c (xmalloc, xrealloc): Remove functions.
8469         Include xalloc.h.
8470         Don't include <stdlib.h>.  Don't declare malloc, realloc.
8471
8472 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
8473
8474         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
8475
8476 2000-06-24  Jim Meyering  <meyering@lucent.com>
8477
8478         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
8479
8480 2000-06-21  Jim Meyering  <meyering@lucent.com>
8481
8482         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
8483
8484 2000-06-19  Paul Eggert  <eggert@twinsun.com>
8485
8486         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
8487         (mbrtowc, mbstate_t): Define substitutes if
8488         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
8489         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
8490         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
8491
8492 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8493
8494         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
8495         than 1024, return a memory chunk of least possible size, instead
8496         of size PATH_MAX + 2. In the loop, increment the size proportionally.
8497         Use free/xmalloc instead of xrealloc to avoid copying for very long
8498         paths.
8499
8500 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8501
8502         * canon-host.c (canon_host): Use malloc and memcpy to copy an
8503         address, not strdup.  Include <stdlib.h> and don't declare free().
8504
8505 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8506
8507         * path-concat.c (path_concat): Don't access dir[-1] if dir is
8508         the empty string.
8509
8510 2000-06-21  Jim Meyering  <meyering@lucent.com>
8511
8512         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
8513         (noinst_HEADERS): Add getstr.h.
8514
8515         * getline.c (getstr): Move into a separate file.
8516         * getstr.c (getstr): New file, extracted from getline.c, with
8517         the following changes: new parameter, delim2; both delim[12]
8518         parameters have type `int', not `char'.  The latter would lose
8519         with 8-bit delimiters.
8520         * getstr.h: New file.
8521
8522 2000-06-19  Jim Meyering  <meyering@lucent.com>
8523
8524         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
8525
8526 2000-06-18  Jim Meyering  <meyering@lucent.com>
8527
8528         * mkdir.c: Remove file, due mainly to copyright incompatibility.
8529         Besides, these days every porting target provides a mkdir function.
8530
8531         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
8532         (this snippet comes from src/system.h).
8533
8534 2000-06-15  Paul Eggert  <eggert@twinsun.com>
8535
8536         * human.c (adjust_value): New function.
8537         (human_readable_inexact): Apply rounding style even when
8538         printing approximate values.
8539
8540 2000-06-14  Paul Eggert  <eggert@twinsun.com>
8541
8542         * human.c (human_readable_inexact): Allow an input block
8543         size that is not a multiple of the output block size, and vice versa.
8544         Reported by Piergiorgio Sartor.
8545
8546 2000-06-14  Paul Eggert  <eggert@twinsun.com>
8547
8548         * getdate.y (get_date): Apply relative times after time
8549         zone indicator, not before.  Reported by Todd A. Jacobs.
8550
8551 2000-06-13  Jim Meyering  <meyering@lucent.com>
8552
8553         * Makefile.am (all-local): Depend on lstat.c and stat.c.
8554
8555         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
8556
8557 2000-06-12  Paul Eggert  <eggert@twinsun.com>
8558
8559         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
8560
8561 2000-06-04  Paul Eggert  <eggert@twinsun.com>
8562
8563         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
8564
8565 2000-06-04  Jim Meyering  <meyering@lucent.com>
8566
8567         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
8568         SunOS 4.1.4 for which gid_t is an unsigned type.
8569
8570 2000-06-03  Jim Meyering  <meyering@lucent.com>
8571
8572         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
8573
8574 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
8575
8576         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
8577         newer, don't install charset.alias.
8578         * config.charset: Change the Linux/glibc rules so they become empty
8579         on glibc-2.1 or newer.
8580
8581 2000-06-02  Jim Meyering  <meyering@lucent.com>
8582
8583         * mountlist.c: Back out last change.  Instead, do this...
8584         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
8585         member using the same `ignore'-testing code.
8586         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
8587         fs_type strings.
8588         From Mark D. Roth.
8589
8590 2000-05-29  Jim Meyering  <meyering@lucent.com>
8591
8592         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
8593         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
8594
8595 2000-05-22  Jim Meyering  <meyering@lucent.com>
8596
8597         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
8598
8599 2000-05-18  Jim Meyering  <meyering@lucent.com>
8600
8601         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
8602         back, too, since it may have been modified by allocate_entry.
8603         (hash_delete): Rewrite to use neither the assignment operator
8604         nor the comma operator in an if-expression.
8605
8606 2000-05-15  Paul Eggert  <eggert@twinsun.com>
8607
8608         * closeout.c:
8609         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
8610         Remove; no longer needed.
8611         "quotearg.h": Add include.
8612         (file_name): Do not bother to explicitly initialize to NULL; it's less
8613         efficient on some hosts.
8614         (close_stdout_status): Remove test as to whether stdout was already
8615         closed; it breaks for the case "echo x | sort >&-".
8616         Quote file name colons.
8617         Do not assume that _("write error") lacks format strings.
8618
8619 2000-05-15  Jim Meyering  <meyering@lucent.com>
8620
8621         * version-etc.c (version_etc_copyright): Update the copyright string
8622         used in all --version output.
8623
8624 2000-05-14  Jim Meyering  <meyering@lucent.com>
8625
8626         * closeout.c (close_stdout_set_file_name): New function.
8627         (close_stdout_status): Use new file-scoped global.
8628         Return right away if fstat says the stdout file descriptor is invalid.
8629         * closeout.h (close_stdout_set_file_name): Declare.
8630
8631 2000-05-10  Jim Meyering  <meyering@lucent.com>
8632
8633         * closeout.c [default_exit_status]: New file-scoped variable.
8634         (close_stdout_set_status): New function.
8635         * closeout.h (close_stdout_set_status): Declare.
8636
8637 2000-05-08  Jim Meyering  <meyering@lucent.com>
8638
8639         * long-options.c: Don't include closeout.h.
8640         (parse_long_options): Don't call close_stdout for --version.
8641
8642 2000-05-06  Jim Meyering  <meyering@lucent.com>
8643
8644         * strnlen.c: Undefine __strnlen and strnlen.
8645         [!weak_alias]: Define __strnlen to strnlen.
8646
8647         * atexit.c: New file, from libiberty.
8648
8649 2000-05-06  Jim Meyering  <meyering@lucent.com>
8650
8651         * closeout.c (close_stdout_status): Also check for errors on the
8652         stderr stream.
8653
8654 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
8655
8656         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
8657         instead of xmalloc, xrealloc, path_concat.
8658         (locale_charset): Treat empty environment variables as absent.
8659         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
8660
8661 2000-05-04  Jim Meyering  <meyering@lucent.com>
8662
8663         * getopt.c: Update from glibc.
8664         * obstack.c: Likewise.
8665         * obstack.h: Likewise.
8666         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
8667
8668         * regex.h: Likewise.
8669         * strndup.c: Likewise.
8670         * strnlen.c: New file, from glibc.
8671
8672 2000-05-01  Jim Meyering  <meyering@lucent.com>
8673
8674         * full-write.c (full_write): Remove `FIXME' part of comment.
8675
8676 2000-04-29  Jim Meyering  <meyering@lucent.com>
8677
8678         * path-concat.c: Declare strdup only if it's not defined.
8679         * canon-host.c: Likewise.
8680
8681 2000-04-28  Jim Meyering  <meyering@lucent.com>
8682
8683         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
8684         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
8685         included first, then limits.h is included by locale.h by libintl.h.
8686         From John David Anglin.
8687
8688 2000-04-25  Jim Meyering  <meyering@lucent.com>
8689
8690         * makepath.c (S_IRWXUGO): Define.
8691         (make_path): Always perform explicit chmod if MODE specifies any
8692         of the `special' permission bits.  Prompted by a bug report against
8693         install from Mate Wierdl and Joost van Baal.
8694
8695 2000-04-18  Jim Meyering  <meyering@lucent.com>
8696
8697         * README: New file.
8698
8699         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
8700         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
8701
8702 2000-04-17  Jim Meyering  <meyering@lucent.com>
8703
8704         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
8705         the definition of it to rpl_strftime also defined-away the system's
8706         declaration.
8707
8708 2000-04-15  Jim Meyering  <meyering@lucent.com>
8709
8710         Use `C' to denote so-called `contiguous' files, the same way
8711         that tar does.
8712         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
8713         (ftypelet): Use S_ISCTG.
8714         From Michael Deutschmann.
8715
8716 2000-04-14  Jim Meyering  <meyering@lucent.com>
8717
8718         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8719
8720 2000-04-08  Jim Meyering  <meyering@lucent.com>
8721
8722         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8723         names don't conflict.  Reported by Eli Zaretskii.
8724
8725 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
8726
8727         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8728         bug.  Deal with the different error behavior of Irix iconv.
8729
8730 2000-04-07  Jim Meyering  <meyering@lucent.com>
8731
8732         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8733         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
8734
8735 2000-04-05  Jim Meyering  <meyering@lucent.com>
8736
8737         Portability tweaks required for ultrix4.3.
8738         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8739         * readutmp.c: Include sys/types.h before sys/stat.h.
8740         * canon-host.c: Declare strdup.
8741         * path-concat.c: Likewise.
8742         From John David Anglin.
8743
8744 2000-04-04  Jim Meyering  <meyering@lucent.com>
8745
8746         Be more DOS 8.3-friendly.
8747         * ref-add.sin: Renamed from ref-add.sed.in.
8748         * ref-del.sin: Renamed from ref-del.sed.in.
8749         * Makefile.am: Reflect renaming.
8750         Reported by Eli Zaretskii.
8751
8752         Use a temporary file name that won't clash with `charset.alias'
8753         in the DOS 8.3 name space.
8754         * Makefile.am (charset_tmp): Define.
8755         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8756         (uninstall-local): Likewise.
8757         Reported by Eli Zaretskii.
8758
8759 2000-03-29  Paul Eggert  <eggert@twinsun.com>
8760
8761         * time/strftime.c (my_strftime): Make sure we call the system
8762         strftime, not ourselves, when invoking the underlying strftime.
8763
8764 2000-03-24  Jim Meyering  <meyering@lucent.com>
8765
8766         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8767         (charset_alias): Define.
8768         (install-exec-local): Factor out common code.
8769         (uninstall-local): Split lines longer than 80.
8770         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8771         (SUFFIXES): Define.
8772         (.sed.in.sed): New rule.  Don't redirect directly to $@.
8773         (CLEANFILES): Add ref-add.sed and ref-del.sed.
8774
8775 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
8776
8777         * config.charset: Output a line containing "Packages using this file".
8778         * ref-add.sed.in, ref-del.sed.in: New files.
8779         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8780         ref-del.sed): New rules.
8781
8782 2000-03-17  Jim Meyering  <meyering@lucent.com>
8783
8784         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8785         Otherwise, include <strings.h>
8786
8787 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
8788
8789         * unicodeio.c (utf8_wctomb): New function.
8790         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8791         format instead of in UCS-4 with platform dependent endianness.
8792
8793 2000-03-07  Paul Eggert  <eggert@twinsun.com>
8794
8795         * savedir.c (savedir): Work even if directory size is
8796         negative; this can happen with some screwy NFS configurations.
8797
8798 2000-03-06  Jim Meyering  <meyering@lucent.com>
8799
8800         * localcharset.c (get_charset_aliases): Don't try to free file_name
8801         if it's NULL (because we ran out of memory).  From Bruno Haible.
8802
8803 2000-03-05  Jim Meyering  <meyering@lucent.com>
8804
8805         * localcharset.c ("path-concat.h"): Include.
8806         (get_charset_aliases): Use path_concat instead of ANSI string
8807         concatenation.
8808
8809         * unicodeio.h (PARAMS): Define.
8810         Use it to guard prototype.
8811
8812 2000-03-04  Jim Meyering  <meyering@lucent.com>
8813
8814         * Makefile.am (install-exec-local): Create $(libdir) before installing
8815         into it.
8816         (uninstall-local): Uncomment this rule so `make distcheck' works
8817         once again.
8818
8819         * unicodeio.c (<errno.h>): Include it.
8820         (errno): Declare if not defined.
8821
8822         * localcharset.c: Add Bruno's comment justifying use of volatile.
8823
8824         * config.charset: New version, incorporating remarks from a linux
8825         i18n mailing list.  From Bruno Haible.
8826
8827 2000-03-02  Jim Meyering  <meyering@lucent.com>
8828
8829         * Makefile.am (EXTRA_DIST): Add config.charset.
8830
8831 2000-03-01  Jim Meyering  <meyering@lucent.com>
8832
8833         * localcharset.c: Guard some #includes with `#if HAVE_...'.
8834         * unicodeio.c: Likewise.
8835
8836 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
8837
8838         * config.charset: New file.
8839         * localcharset.c: New file.
8840         * unicodeio.h, unicodeio.c: New files.
8841         * Makefile.am (DEFS): Add -DLIBDIR=...
8842         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8843         (noinst_HEADERS): Add unicodeio.h.
8844         (all-local, install-exec-local, charset.alias): New targets.
8845
8846 2000-02-28  Paul Eggert  <eggert@twinsun.com>
8847
8848         * quotearg.c (ALERT_CHAR): New macro.
8849         (quotearg_buffer_restyled): Use it.
8850
8851 2000-02-27  Jim Meyering  <meyering@lucent.com>
8852
8853         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8854         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8855
8856         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8857         not `#if STDC_HEADERS'.
8858         Declare malloc if needed.
8859
8860         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8861         now that autoconf always defines the HAVE_DECL_ symbols.
8862         * human.c: Likewise.
8863         * same.c: Likewise.
8864         * strtoumax.c: Likewise.
8865
8866         * backupfile.c: Arrange for cpp to fail if the configure-time
8867         declaration check was not run.
8868         * hash.c: Likewise.
8869         * human.c: Likewise.
8870         * same.c: Likewise.
8871         * strtoumax.c: Likewise.
8872
8873         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8874         then first look up the entire `.'-containing string as a login name.
8875
8876 2000-02-18  Paul Eggert  <eggert@twinsun.com>
8877
8878         * getdate.y: Handle two-digit years with leading zeros correctly.
8879         (textint): New typedef.
8880         (parser_control): Member year changed from int to textint.
8881         All uses changed.
8882         (YYSTYPE): Removed; replaced by %union with int and textint members.
8883         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8884         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8885         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8886         (tSNUMBER, tUNUMBER): Now of type <textintval>.
8887         (date, number, to_year): Use width of number in digits, not its value,
8888         to determine whether it's a 2-digit year, or a 2-digit time.
8889         (yylex): Store number of digits of numeric tokens.
8890         Reported by John Kendall.
8891
8892         (parser_control): Changed from struct parser_control to typedef (for
8893         consistency).  All uses changed.
8894
8895         (tID): Removed; not used.
8896         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8897
8898 2000-02-14  Paul Eggert  <eggert@twinsun.com>
8899
8900         * getpagesize.h (getpagesize): Port to VMS for Alpha;
8901         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8902
8903 2000-02-12  Jim Meyering  <meyering@lucent.com>
8904
8905         * userspec.c (ISDIGIT): Define it.
8906         (isdigit): Remove definition.
8907         (is_number): Use ISDIGIT, not isdigit.
8908         <libintl.h>: Include.
8909         (_ and N_): Define.
8910         (parse_user_spec): Mark translatable strings.
8911
8912 2000-02-10  Jim Meyering  <meyering@lucent.com>
8913
8914         With these changes, nanosleep.[ch] are finally enough like the other
8915         lib/* replacement files to compile on a few more losing systems.
8916
8917         * nanosleep.h: Don't include config.h.
8918         Remove prototype from declaration of nanosleep.
8919         (PARAMS): Remove now-unneeded definition.
8920         * nanosleep.c: #undef nanosleep.
8921         (rpl_nanosleep): Rename from nanosleep.
8922
8923 2000-02-03  Jim Meyering  <meyering@lucent.com>
8924
8925         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8926         rather than with `#if HAVE_UTMPNAME'.
8927
8928 2000-02-01  Jim Meyering  <meyering@lucent.com>
8929
8930         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
8931
8932 2000-01-31  Jim Meyering  <meyering@lucent.com>
8933
8934         * nanosleep.h (nanosleep): Guard declaration with
8935         `#if ! HAVE_DECL_NANOSLEEP'.
8936         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8937         the declaration in that vendor's sys/timers.h.
8938         Reported by Christian Krackowizer.
8939
8940         * quotearg.c (ISASCII): Add #undef and move definition to follow
8941         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8942         (ISPRINT): Likewise.
8943         Reported by Tom Tromey.
8944
8945 2000-01-30  Jim Meyering  <meyering@lucent.com>
8946
8947         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8948         uses of ->ut_name.  The latter doesn't work with new Linux header files
8949         where only utmpx.ut_user is declared.
8950
8951         * readutmp.h (UT_USER): Define.
8952
8953 2000-01-23  Jim Meyering  <meyering@lucent.com>
8954
8955         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8956         obstack.c.
8957
8958 2000-01-22  Jim Meyering  <meyering@lucent.com>
8959
8960         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8961         [! HAVE_DECL_STRTOULL]: Declare strtoull.
8962         Required for some AIX systems.  Reported by Christian Krackowizer.
8963         [TESTING] (main): New function.
8964
8965         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
8966         * dirname.c (dir_name): Support for DOS-style file names with drive
8967         letters.
8968
8969         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8970
8971         * strverscmp.c (ISDIGIT): Define.
8972         (strverscmp): Use ISDIGIT, not isdigit.
8973
8974 2000-01-17  Paul Eggert  <eggert@twinsun.com>
8975
8976         * nanosleep.c (nanosleep):
8977         Don't use SA_INTERRUPT to decide whether to call sigaction, as
8978         POSIX.1 doesn't require SA_INTERRUPT and some systems
8979         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
8980         it's been part of POSIX.1 since day 1 (in 1988).
8981
8982 2000-01-17  Jim Meyering  <meyering@lucent.com>
8983
8984         * interlock: Remove unused file.  Reported by François Pinard.
8985
8986 2000-01-16  Paul Eggert  <eggert@twinsun.com>
8987
8988         * quotearg.c (quotearg_buffer_restyled): Do not quote
8989         alert, backslash, formfeed, and vertical tab unnecessarily in
8990         shell quoting style.
8991
8992
8993 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
8994 Free Software Foundation, Inc.
8995 Copying and distribution of this file, with or without modification,
8996 are permitted provided the copyright notice and this notice are preserved.