151220cce87b60636accfbc8748336de4480be1a
[gnulib.git] / lib / ChangeLog
1 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4         (futimens): New function, which uses futimes if available.
5         (futimens, utimens): Support timespec==NULL, with same semantics
6         as utime and utimens.
7         * utimens.h (futimens): New decl.
8
9 2004-11-23  Jim Meyering  <jim@meyering.net>
10
11         * __fpending.c: Add comment.
12
13 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
14
15         * lib/getopt_.h: Re-addition of __getopt_argv_const caused
16         redefinition warnings. To avoid them, include the defines
17         in `#if !defined __need_getopt ... #endif'. The only place
18         where __getopt_argv_const is used is in definitions
19         of getopt_long and getopt_long_only below, which are as well
20         protected by `#ifndef __need_getopt'.
21         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
22         __need_getopt after including <stdio.h> and <unistd.h> These
23         headers might have defined it.
24
25 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
26
27         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
28         New macros.
29         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
30         optopt): Use them instead of invoking ## directly; otherwise, the
31         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
32
33 2004-11-19  Bruno Haible  <bruno@clisp.org>
34
35         * strtok_r.c: Move comments from here...
36         * strtok_r.h: ... to here.
37
38 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
39
40         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
41         might fail.  Problem reported by Yoann Vandoorselaere.
42         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
43         that mishandle size_t overflow.
44
45 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
46
47         * canon-host.c: Include "strdup.h".
48         (canon_host): Use getaddrinfo if available, so that IPv6 works.
49         Use strdup instead of malloc/strcpy to duplicate strings.
50
51         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
52         (human_space_before_unit): New constant.
53         * human.c (human_readable): Support it.
54
55         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
56         (xgetcwd): Set errno correctly when failing.
57         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
58         the failure is actually due to a PATH_MAX problem.
59
60         Further getopt changes to make it more likely that glibc will
61         buy the changes back.
62         * getopt.c (POSIXLY_CORRECT): New constant.
63         (getopt): Use it, so to preserve glibc semantic
64         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
65         when compiling for libc.
66         * getopt_.h (__getopt_argv_const): Bring it back.
67         (getopt_long, getopt_long_only): Use it.
68
69         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
70         New arg POSIXLY_CORRECT.  All callers changed.
71         (getopt): Argv is now char * const *, as per standard.
72         (_getopt_internal_r, _getopt_internal): Argv is now char **,
73         not char *__getopt_argv_const *.
74         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
75         _getopt_long_only_r): Likewise.
76         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
77         * getopt_int.h (_getopt_internal, _getopt_internal_r,
78         _getopt_long_r, _getopt_long_only_r): Likewise.
79         * getopt_.h (__getopt_argv_const): Remove.
80         (getopt): Argv is now char * const *, as per standard.
81
82         * getdate.y (tORDINAL): New token.
83         (day, relunit): Allow it for relative times.
84         (relative_time_table): Use tORDINAL for ordinals.
85
86 2004-11-15  Jim Meyering  <jim@meyering.net>
87
88         * closeout.c: Include "__fpending.h" once again.
89         Include <stdbool.h>.
90         (close_stdout): Don't fail just because stdout was closed initially,
91         since some programs don't write to stdout in the normal course of
92         operation (other than --version and --help), and we don't want this
93         function to make e.g. `touch file >&-' fail.
94         But do fail if it was closed and someone has tried to write to it.
95         E.g., `printf foo >&-' must fail.
96
97 2004-11-11  Simon Josefsson  <jas@extundo.com>
98
99         * strtok_r.h, strtok_r.c: New file.
100
101 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
102
103         * getopt_.h (__getopt_argv_const): New macro, to be used so that
104         we can stop lying to compilers about the constness of argv when we
105         are compiled outside glibc.
106         (getopt, getopt_long, getopt_long_only): Use it.
107         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
108         getopt): Likewise.
109         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
110         _getopt_long_only_r): Likewise.
111         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
112         _getopt_long_only_r): Likewise.
113
114         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
115         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
116         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
117         the other external symbols.
118         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
119         declaration, since the above renaming now works around collisions.
120
121 2004-11-11  Jim Meyering  <jim@meyering.net>
122
123         * linebreak.c: Remove trailing blanks.
124         * alloca_.h: Likewise.
125         * acosl.c: Likewise.
126         * euidaccess.c: Likewise.
127         * allocsa.h: Likewise.
128
129 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
130
131         * mktime.c (SHR): New macro, which is a portable
132         substitute for >> that should work even on Crays.
133         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
134         Problem reported by Mark D. Baushke in
135         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
136         * getdate.y (SHR): Likewise.
137         (tm_diff): Use it.
138         * strftime.c (SHR): Likewise.
139         (tm_diff): Use it.
140         * quotearg.c (struct quoting_options): Use unsigned int for
141         quote_these_too, so that right shifts are well defined.  All uses
142         changed.
143
144 2004-11-10  Simon Josefsson  <jas@extundo.com>
145
146         * getaddrinfo.h, getaddrinfo.c: New files.
147
148 2004-11-10  Jim Meyering  <jim@meyering.net>
149
150         Ensure that no close failure goes unreported.
151         * closeout.c (close_stdout): Always close stdout.  I.e., don't
152         return early when it seems there's nothing to flush.
153         Don't include __fpending.h.
154
155 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
156
157         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
158
159 2004-11-05  Bruno Haible  <bruno@clisp.org>
160
161         * readlink.c: Include stddef.h, needed for size_t on Woe32.
162         Reported by Mark D. Baushke <mdb@cvshome.org>.
163
164 2004-11-04  Bruno Haible  <bruno@clisp.org>
165
166         2004-09-11  Bruno Haible  <bruno@clisp.org>
167                 * allocsa.valgrind: New file.
168         2004-02-06  Bruno Haible  <bruno@clisp.org>
169                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
170                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
171                 Reported by Christopher Seip <chris.seip@hp.com>.
172
173 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
174
175         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
176         with errno == ERANGE if the buffer is too small.
177         Problem reported by Mark D. Baushke.
178
179 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
180
181         * xreadlink.c (MAXSIZE): New macro.
182         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
183         size does not exceed MAXSIZE.  Avoid cast.
184         As suggested by Mark D. Baushke in
185         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
186         if readlink fails with buffer size just under MAXSIZE, try again
187         with MAXSIZE.
188
189 2004-11-02  Derek R. Price  <derek@ximbiot.com>
190        and  Paul Eggert  <eggert@cs.ucla.edu>
191
192         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
193         (get_date): Overparenthesize to avoid GCC warning.
194
195 2004-11-02  Bruno Haible  <bruno@clisp.org>
196
197         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
198         function returns void.
199
200 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
201
202         * lib/getpass.c (fflush_unlocked, flockfile, funlockfile)
203         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
204         already declared.
205
206 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
207
208         * getdate.y: Add support for TZ="foo" within a date string.
209         Fix some bugs near time_t boundaries.  Reject dates with
210         out-of-range components, e.g., "Sept 31".
211         Include <stdlib.h>, "setenv.h", "xalloc.h".
212         (ISDIGIT_LOCALE): Remove; unused.
213         Note that the TZ and time functions used here are not reentrant.
214         (mktime_ok, get_tz): New functions.
215         (TZBUFSIZE): New constant.
216         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
217         This requires that we sometimes generate our own TZ="XXX..." setting.
218
219 2004-10-27  Derek R. Price  <derek@ximbiot.com>
220
221         * mktime.c (not_equal_tm): Remove redundant check.
222
223 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
224
225         * getdate.y: Use Bison 1.875 features, and some minor
226         code cleanups.  This change does not affect semantics.
227         Don't include <stdlib.h>; no longer needed.
228         Don't include unlocked-io.h; only the "#if TEST" code uses
229         stdio, and performance isn't crucial there.
230         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
231         Bison 1.875 features as described below.
232         All uses of "PC." replaced by "pc->".
233         (YYSTYPE): Add a forward declaration.
234         (yylex, yyerror): Use full prototypes in forward decls.
235         Use "%pure-parser" rather than obsolescent "%pure_parser".
236         Use %parse-param and %lex-param instead of obsolescent
237         YYPARSE_PARAM and YYLEX_PARAM.
238         (meridian_table, month_and_day_table, time_units_table,
239         relative_time_table, time_zone_table, military_table,
240         lookup_zone, lookup_word, get_date):
241         Use NULL instead of 0 where appropriate.
242         (to_hour): Avoid abort (), to avoid a dependency on
243         stdlib.h.
244         (yyerror, yylex): Now accepts parser_control * arg.
245         (main) [TEST]: Use '\0' rather than 0 for char.
246
247 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
248
249         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
250         It's now the caller's responsibility to handle the case where
251         !HAVE_GETPAGESIZE && !defined getpagesize.
252
253         * mktime.c (leapyear): Arg is long int, not int.
254
255 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
256
257         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
258
259 2004-10-12  Simon Josefsson  <jas@extundo.com>
260
261         * getpass.c (fflush_unlocked, flockfile, funlockfile)
262         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
263         to real functions.
264
265 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
266
267         * vsnprintf.h: New file.
268         * vsnprintf.c: New file.
269
270 2004-10-07  Bruno Haible  <bruno@clisp.org>
271
272         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
273         into the provided buffer.
274
275 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
276
277         * diacrit.c, diacrit.h: Add GPL notice.
278
279         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
280         * atanl.c (atanl): Keep the code as similar to glibc as possible.
281         * logl.c (logl): Keep the code as similar to glibc as possible.
282         This avoids a potential constant-folding bug.
283
284 2004-10-05  Bruno Haible  <bruno@clisp.org>
285
286         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
287
288 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
289
290         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
291         * xmalloc.c (xmemdup): Likewise.
292         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
293         XFREE): Remove these long-obsolescent macros.
294         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
295         * xstrdup.c: Remove.
296
297         * regex.c (re_comp): Cast gettext return value to char *,
298         Problem reported by Martin Neitzel via Mark D. Baushke.
299
300 2004-10-04  Simon Josefsson  <jas@extundo.com>
301
302         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
303         '#ifdef USE_UNLOCKED_IO'.
304
305 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
306
307         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
308         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
309         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
310         regex.c, sha1.c, version-etc.c, yesno.c:
311         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
312         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
313         the includer's responsibility.
314
315         Sync from coreutils.
316
317         * modechange.c (mode_compile): Don't decrement a pointer that
318         points to the start of a string, as the C Standard says the
319         resulting behavior is undefined.
320
321         * backupfile.h (enum backuptype): Rename none -> no_backups,
322         simple -> simple_backups, numbered_existing ->
323         numbered_existing_backups, numbered -> numbered_backups
324         to avoid shadowing problems.  All uses changed.
325         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
326         * backupfile.c (check_extension, numbered_backup):
327         Rename locals to avoid shadowing 'basename'.
328         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
329         once.
330
331         * .cppi-disable: Add getopt_.h, getopt_int.h.
332         * .cvsignore: Add getopt.h.
333
334 2004-10-04  Simon Josefsson  <jas@extundo.com>
335
336         * memmem.h: New file.
337         * memmem.c: New file, taken from glibc.
338
339 2004-10-02  Jim Meyering  <jim@meyering.net>
340
341         * dirfd.h, getpagesize.h: Add copyright notice.
342
343 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
344
345         * snprintf.c: Remove comments as to why each header is needed.
346
347 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
348
349         * strsep.h: New file.
350         * strsep.c: New file.
351
352 2004-10-01  Simon Josefsson  <jas@extundo.com>
353
354         * snprintf.c (snprintf): Handle size==0.
355
356 2004-10-01  Simon Josefsson  <jas@extundo.com>
357             Bruno Haible  <bruno@clisp.org>
358
359         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
360         (snprintf): Declare 'args'.
361
362 2004-09-30  Simon Josefsson  <jas@extundo.com>
363
364         * snprintf.h, snprintf.c: New files.
365
366 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
367
368         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
369         (hol_entry_help): Never translate an empty string.
370         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
371         * argp.h (OPTION_NO_TRANS): New option.
372
373 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
374
375         * xvasprintf.c: Include xalloc.h.
376         (xvasprintf): Use xalloc_die, not xmalloc_die.
377
378 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
379
380         * dummy.c: Change copyright notice to FSF, and license to GPL.
381
382 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
383
384         * argp-pvh.c (argp_program_version_hook): Provide initial value.
385         Problem reported by Bruno Haible in:
386         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
387
388 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
389
390         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
391         in case some system header has #define'd it.  Problem reported by
392         Soeren D. Schulze in
393         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
394
395 2004-09-08  Bruno Haible  <bruno@clisp.org>
396
397         * stdint_.h.in: New file, taken from GNU clisp.
398
399 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
400
401         * xvasprintf.h: New file.
402         * xvasprintf.c: New file.
403         * xasprintf.c: New file.
404
405 2004-09-08  Bruno Haible  <bruno@clisp.org>
406
407         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
408         is > INT_MAX.
409         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
410
411 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
412
413         Import from coreutils.
414         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
415         strings on unbounded length.  alloca's performance benefits aren't
416         that important here.
417         (V_STRDUP): Remove.
418         (parse_with_separator): New function, with most of the internals
419         of the old parse_user_spec.  Allow user to omit both user and group,
420         for compatibility with FreeBSD.
421         Clone only the user name, not the entire spec.
422         Do not set *uid, *gid unless entirely successful.
423         Avoid memory leak in some failing cases.
424         Fix regression for USER.GROUP reported by Dmitry V. Levin in
425         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
426         (parse_user_spec): Rewrite to use parse_with_separator.
427
428 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
429
430         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
431         its complicated substitute.
432         * argp-help.c: Include <errno.h>, for program_invocation_short_name
433         and program_invocation_name.
434         (__argp_basename) [!_LIBC]: Remove; the only use was
435         replaced by its body.
436         (__argp_short_program_name): Change condition from
437         !defined __argp_short_program_name to
438         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
439         to match argp-namefrob.h.
440         (__argp_failure): Don't assume strerror_r returns char *.
441         * argp-parse.c (N_): Define unconditionally.
442         (argp_default_options): Fill out initializers with 0 to avoid
443         gcc warnings.
444
445 2004-08-12  Simon Josefsson  <jas@extundo.com>
446
447         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
448         * getopt_.h: Renamed from getopt.h.
449
450 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
451
452         Merge from coreutils.
453
454         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
455         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
456         for Reliant Unix 5.43.
457
458         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
459         (union fooround): Use uintmax_t, not long int.
460         The rest is a merge from libc:
461         [defined _LIBC]: Include <shlib-compat.h>.
462         (_obstack) [defined _LIBC]: Remove after 2.3.4.
463
464         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
465
466         * strverscmp.c: Convert to UTF-8.
467
468 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
469
470         * obstack.h (obstack_empty_p):
471         Don't assume that chunk->contents is suitably aligned.
472         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
473         Likewise. Problem reported by Benno in
474         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
475
476         * chown.c (rpl_chown): Work even if the file is writeable but not
477         readable.  This could be improved further but it'd take some work.
478
479 2004-08-08  Simon Josefsson  <jas@extundo.com>
480
481         * xgethostname.c: Don't include error.h (not used).
482
483         * getpass.h: Add.
484         * getpass.c: Include getpass.h first.
485
486 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
487
488         * xalloc-die.c: New files.
489         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
490         All uses removed.
491         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
492         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
493         (_, N_, xalloc_die): Move to xalloc-die.c.
494         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
495         so that we needn't mess with xalloc_msg_memory_exhausted.
496
497         * sha1.h: Renamed from sha.h.
498         (SHA1_H): Renamed from _SHA_H.
499         (sha1_ctx): Renamed from sha_ctx.
500         (sha1_init_ctx): Renamed from sha_init_ctx.
501         (sha1_process_block): Renamed from sha_process_block.
502         (sha1_process_bytes): Renamed from sha_process_bytes.
503         (sha1_finish_ctx): Renamed from sha_finish_ctx.
504         (sha1_read_ctx): Renamed from sha_read_ctx.
505         (sha1_stream): Renamed from sha_stream.
506         (sha1_buffer): Renamed from sha_buffer.
507         * sha1.c: Likewise; renamed from sha.c.
508         Do not include <sys/types.h>.
509         Include <stddef.h> rather than <stdlib.h>.
510
511 2004-08-08  Bruno Haible  <bruno@clisp.org>
512
513         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
514         FILESYSTEM_PREFIX_LEN.
515         * progreloc.c: Likewise.
516         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
517
518 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
519
520         Merge from tar.
521         * argp-help.c (make_hol, hol_append): Don't assume that
522         SIZE_MAX is a valid preprocessor constant.
523         (__argp_basename): Change from "#ifndef _LIBC"
524         to "#ifndef __argp_short_program_name", so that
525         we don't compile these functions for tar.
526
527         More merges from coreutils.
528         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
529         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
530         yesno.h: New files.
531         * addext.c: Remove; no longer needed.
532         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
533         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
534         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
535         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
536         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
537         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
538         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
539         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
540         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
541         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
542         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
543         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
544         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
545         Import changes from coreutils.
546
547 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
548
549         Merge from coreutils.
550
551         * .gdb-history: Remove; this doesn't belong here.
552
553         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
554         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
555         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
556
557         * dirname.h: Include <stdbool.h>.
558         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
559         for consistency with POSIX terminology.  All uses changed.
560         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
561         (strip_trailing_slashes): Use bool for booleans.
562         * stripslash.c (strip_trailing_slashes): Likewise.
563
564         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
565         sometimes returns a positive errno value even when it succeeds.
566         (print_errno_message) [!LIBC]: Fall back on strerror if
567         __strerror_r fails.
568
569         * path-concat.c (mempcpy): Don't define if a system header defines it.
570         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
571         (longest_relative_suffix): New function.
572         (path_concat): Use it.  Assume first argument is not NULL.
573         Port to DOS.  Omit redundant separators.
574         Report an error instead of returning NULL.
575         Use mempcpy instead of memcpy.
576         (xpath_concat): Remove: not declared or used.
577
578         * same.h: Include <stdbool.h>
579         (same_name): Return bool, not int.
580         * same.c (same_name): Likewise.
581         (errno): Don't declare; we assume C89 or better now.
582
583         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
584         if not already defined.
585
586         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
587         * dup-safer.c (errno): Likewise.
588
589 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
590
591         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
592         working.
593
594 2004-08-03  Simon Josefsson  <jas@extundo.com>
595
596         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
597         * progname.h: Don't include stdbool.h.
598
599 2004-08-02  Simon Josefsson  <jas@extundo.com>
600
601         * getsubopt.h: New file, with comments from Bruno Haible.
602         * getsubopt.c: New file, from glibc, but slightly modified based on
603         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
604
605 2004-08-01  Simon Josefsson  <jas@extundo.com>
606
607         * xgetdomainname.c: Include stdlib.h, for free().
608
609 2004-07-16  Simon Josefsson  <jas@extundo.com>
610
611         * dummy.c: New file.
612
613 2004-07-16  Bruno Haible  <bruno@clisp.org>
614
615         * backupfile.h: Add extern "C" for C++.
616         * closeout.h: Likewise.
617         * copy-file.h: Likewise.
618         * findprog.h: Likewise.
619         * full-write.h: Likewise.
620         * pathname.h: Likewise.
621         * progname.h: Likewise.
622         * stpcpy.h: Likewise.
623         * stpncpy.h: Likewise.
624         * strcase.h: Likewise.
625         * strstr.h: Likewise.
626         * xalloc.h: Likewise.
627
628         * mbswidth.h: Add extern "C" for C++.
629         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
630
631 2004-07-09  Simon Josefsson  <jas@extundo.com>
632
633         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
634         failed without this.)
635
636 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
637
638         * fchown-stub.c: New file.
639
640 2004-06-24  Jim Meyering  <jim@meyering.net>
641
642         * obstack.h (obstack_base): Cast to (void *), per documentation.
643
644 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
645
646         * argz.c, argz_.h: New files, which are autoupdated from libtool.
647
648 2004-06-01  Jim Meyering  <jim@meyering.net>
649
650         * calloc.c: New file.
651
652 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
653
654         * getdate.y (yylex): Allow space between sign and number.
655         Problem reported by Dan Jacobson.
656
657 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
658        and  Jim Meyering  <jim@meyering.net>
659
660         Merge from coreutils CVS.
661
662         * stat-macros.h: New file, with contents from file-type.h
663         and coreutils' system.h.
664         * file-type.c: Include "stat-macros.h".
665         * file-type.h (file_type): Move all macro definitions to new file,
666         stat-macros.h.
667
668         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
669         Wrap old code with this conditional.
670         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
671         function that does not dereference symlinks.
672         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
673
674         * xreadlink.c: Include xreadlink.h first, to catch .h file
675         dependency problems.
676         (xreadlink): Accept new arg SIZE, for efficiency.
677         All decls and uses changed.
678         * xreadlink.h: Include <stddef.h>, for size_t.
679
680         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
681         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
682
683         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
684
685 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
686
687         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
688         macros to be defined.
689         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
690         the allocator returns NULL because the requested size is zero.
691
692 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
693
694         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
695         var.  Add comment explaining why libc still defines it.  This
696         merges the following patch from glibc:
697         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
698
699 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
700
701         * obstack.c (_obstack): Remove unused variable.  It hasn't been
702         present in glibc since revision 1.1 of this file.
703         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
704         obstack_alignment_mask, obstack_alloc, obstack_base,
705         obstack_blank, obstack_blank_fast, obstack_chunk_size,
706         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
707         obstack_grow0, obstack_init, obstack_int_grow,
708         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
709         obstack_next_free, obstack_object_size, obstack_ptr_grow,
710         obstack_ptr_grow_fast, obstack_room): Remove declarations of
711         nonexistent functions.
712
713 2004-05-17  Derek R. Price  <derek@ximbiot.com>
714             Paul Eggert  <eggert@cs.ucla.edu>
715
716         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
717
718 2004-05-14  Bruno Haible  <bruno@clisp.org>
719
720         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
721         that consists of a '.' followed by an empty digit string.
722         Patch by Tor Lillqvist <tml@iki.fi>.
723
724 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
725
726         Port obstack to the AS/400, where pointers are 16 bytes wide and
727         you cannot cast an integer to a valid pointer.  This patch is
728         currently waiting to be integrated into glibc; see
729         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
730
731         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
732         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
733         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
734         (struct obstack): temp member is now a union of a pointer and
735         an integer, instead of an integer.  All integer uses changed.
736         This does not affect the physical layout of struct obstack,
737         except on hosts (like the AS/400) where the size or alignment of
738         void * is greater than that of ptrdiff_t.
739         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
740         __STDC__)]: Store temporary in pointer member of union, not
741         integer member.
742         * obstack.c: Include <stddef.h>, for offsetof.
743         (struct fooalign): Remove; it doesn't need a name.
744         (union fooround): Change double to long double, and add void *.
745         (DEFAULT_ALIGNMENT): Use offsetof to compute.
746         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
747         not a macro.  Hence the values are always int; so remove all
748         casts-to-int in uses.
749
750 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
751             Derek Price  <derek@ximbiot.com>
752
753         * alloca.c: Include <alloca.h>, to get our interface.
754         * alloca_.h: Use __alloca on AIX, so that we don't have to
755         include <alloca.h> first.  Use C89 prototype for alloca; this
756         requires including <stddef.h> for size_t.  Use extern "C" if C++.
757         Use #elif for simplicity, since we can assume C89 now.
758         Don't try to source the system alloca.h since it will not be found
759         and to prevent recursively including its replacement.
760         * fnmatch.c: Include <alloca.h> instead of opencoding.
761         * lib/regex.c: Likewise.
762
763 2004-05-16  Derek Price  <derek@ximbiot.com>
764             Paul Eggert  <eggert@cs.ucla.edu>
765
766         getline cleanup.  This changes the getndelim2 API: both order of
767         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
768         no delimiter).
769
770         * getline.c: Don't include stddef.h or stdio.h, since our
771         interface does that.
772         (getline): Always use getdelim, so that we don't have two
773         copies of this code.
774         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
775         if available.
776         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
777         (GETNDELIM2_MAXIMUM): New macro.
778         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
779         instead of the old practice of delim2==0.  All callers changed.
780         Return -1 on overflow, instead of returning junk.
781         Do not set *linesize unless allocation succeeds.
782         * getndelim2.h: Do not include stddef.h; no longer needed, now
783         that we include sys/types.h.
784         * getnline.h: Likewise.
785         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
786         (getndelim2): Reorder arguments.
787         * getnline.c (getnline, getndelim):
788         Don't discard the NMAX argument.
789         (getnline): Invoke getndelim, to avoid code duplication.
790         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
791         of (size_t) -1 by callers of the getnline family.
792
793 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
794
795         * nanosleep.c (suspended): Change its type from int to
796         sig_atomic_t volatile.
797         (first_call): Make it private to rpl_nanosleep, and have it
798         be zero initially as that's a bit faster.
799         (my_usleep): Round up fractional times instead of truncating them,
800         as this is the usual meaning for 'sleep'.
801
802         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
803         doesn't work.
804         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
805         (ENOSYS): Define if not defined.
806         (settime): Fall back on stime if it exists and settimeofday fails.
807         But don't bother with fallbacks if a method fails with errno == EPERM.
808
809 2004-05-11  Jim Meyering  <jim@meyering.net>
810
811         Prior to this change, the save_cwd caller required read access to the
812         current directory on most systems (ones with the fchdir function).
813
814         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
815         fails, try write-only, and finally, resort to using xgetcwd.
816
817 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
818
819         * obstack.c, obstack.h: Import changes from libc.
820
821 2004-04-28  Bruno Haible  <bruno@clisp.org>
822
823         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
824         implicitly appends .exe to executables.
825         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
826         accepts Windows pathnames.
827         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
828         Cygwin like Windows, since it now accepts Windows pathnames.
829         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
830         Cygwin like Windows, since it now accepts Windows pathnames.
831         Reported by Derek Robert Price <derek@ximbiot.com>.
832
833 2004-04-20  Jim Meyering  <jim@meyering.net>
834
835         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
836
837 2004-04-20  Jim Meyering  <jim@meyering.net>
838             Bruno Haible  <bruno@clisp.org>
839
840         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
841         memory when realloc fails.
842
843 2004-04-18  Jim Meyering  <jim@meyering.net>
844
845         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
846         don't leak memory and do call END_UTMP_ENT.
847
848 2004-04-11  Paul Eggert  <eggert@twinsun.com>
849
850         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
851         (CHAR_BIT): Remove, since we assume C89.
852         Include <stdint.h> if available, as per current Autoconf CVS advice.
853
854 2004-03-30  Paul Eggert  <eggert@twinsun.com>
855
856         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
857         not bool, to be more consistent with Unix conventions.
858         Suggested by Bruno Haible.
859
860         Merge from coreutils.
861
862         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
863         New files.
864
865         * getdate.h: Include stdbool.h, and timespec.h instead of
866         the usual <time.h> dance.
867         (get_date): Change signature to support fractional time stamps.
868         All callers changed.
869         * getdate.y: Include "getdate.h" first, as we can now
870         assume C89 and don't need to worry about 'const'.
871         Similarly, include "unlocked-io.h" near start, not in middle.
872         Include <limits.h>.
873         (textint.value): Use long int rather than int.
874         (textint.digits): Use size_t rather than int.
875         (BILLION, LOG10_BILLION): New constants.
876         (parser_control): New member rel_ns.  Members day_ordinal,
877         time_zone, month, day, hour, minutes, rel_year, rel_month,
878         rel_day, rel_hour, rel_minutes, rel_seconds
879         are now long int, not int.  Member seconds is now struct timespec,
880         not int.  New member timespec_seen.  Members dates_seen, days_seen,
881         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
882         not int.
883         (%union.intval): Now long int, not int.
884         New member timespec.
885         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
886         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
887         (spec): Now is a timespec or an item list.
888         (timespec, items): New nonterminals.
889         (time, rel, relunit, number, get_date):
890         Add support for fractional seconds.
891         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
892         (gmtime, localtime, mktime): Remove decls; not needed with C89.
893         (to_hour): First arg is now long int, not int.
894         (to_year): Returns long int, not int.
895         Don't treat year -70 like 70.
896         (tm_diff): Returns long int, not int.
897         (lookup_word): Use bool instead of int when appropriate.
898         (yylex): Use size_t for count, not int.
899         Detect overflow when parsing large integer constants.
900         Add support for fractions.
901         (get_date): Make pointers 'const' if possible.
902         Use more-portable code to detect integer overflow.
903         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
904         Don't use ctime; it's not reliable if the year has >4 digits.
905
906         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
907         This is for compatibility with BSD.
908
909         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
910         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
911         From coreutils' system.h.
912
913         * userspec.c: Don't include "posixver.h".
914         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
915         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
916         compatible extension.  Simplify code by removing a boolean int
917         that was always nonzero if a string was nonnull.
918
919 2004-03-30  Jim Meyering  <jim@meyering.net>
920
921         Merge from coreutils.
922
923         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
924
925         * readtokens.c (readtoken): Don't leak 64 bytes when reading
926         an empty input stream.
927
928         * readtokens.c: Include <stdbool.h>.
929         (readtoken): Use `size_t' rather than int/long.
930         All callers adjusted.
931         Use `bool' rather than `int' where appropriate.
932         Use memset rather than an explicit loop.
933         Use x2nrealloc rather than xrealloc.
934         Allow the use of `\0' as a delimiter.
935         (readtokens): Likewise.
936         * readtokens.h (readtoken, readtokens): Update prototypes.
937
938 2004-03-30  Bruno Haible  <bruno@clisp.org>
939
940         * getloadavg.c (getloadavg): Don't assume setlocale returns
941         nonnull.
942
943 2004-03-29  Paul Eggert  <eggert@twinsun.com>
944
945         Merge changes to getloadavg.c from coreutils and Emacs.
946
947         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
948         Define to an expression, not to the empty string.
949         Include cloexec.h and xalloc.h.
950         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
951         Use set_cloexec_flag rather than rolling our own.
952         * cloexec.c, cloexec.h: New files.
953
954 2004-03-18  Paul Eggert  <eggert@twinsun.com>
955
956         * getopt.h: Sync with libc CVS.
957
958 2004-03-18  Paul Eggert  <eggert@twinsun.com>
959             Bruno Haible  <bruno@clisp.org>
960
961         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
962         not on all platforms that have <wchar.h>.
963         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
964
965 2004-03-09  Paul Eggert  <eggert@twinsun.com>
966
967         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
968         Sync with libc CVS.
969         * getopt_int.h: New file, also synced from libc.
970
971 2004-03-07  Paul Eggert  <eggert@twinsun.com>
972
973         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
974         '#if' expressions.  Unlike the code it replaces, it does not
975         depend on (defined _SC_PAGESIZE).  However, it does depend on
976         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
977         first reported by Jason Andrade in
978         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
979
980 2004-01-18  Simon Josefsson  <jas@extundo.com>
981
982         * strdup.h: New file.
983         * strdup.c: Include it.
984         * path-concat.c: Include strdup.h. Drop strdup declaration.
985         * userspec.c: Include strdup.h. Drop strdup declaration.
986
987 2004-02-06  Karl Berry  <karl@gnu.org>
988
989         * config.charset: update from gettext 0.14.1.
990
991 2004-02-05  Paul Eggert  <eggert@twinsun.com>
992
993         Add comments and code, prompted by suggestions from Bruno Haible
994         for sh-quote.
995         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
996         describing the enum quoting_style values.
997         * quotearg.c (quotearg_alloc): New function.
998         (quotearg_buffer_restyled): Treat lone { and } as special.
999         Treat = as special.  Work around bug with older shells
1000         that "see" a '\' that is really the 2nd byte of a multibyte char.
1001         Quote empty string with shell_quoting_style.
1002
1003 2004-02-03  Bruno Haible  <bruno@clisp.org>
1004
1005         * pipe.h: New file, from GNU gettext.
1006         * pipe.c: New file, from GNU gettext.
1007
1008 2004-01-27  Bruno Haible  <bruno@clisp.org>
1009
1010         * execute.h: New file, from GNU gettext.
1011         * execute.c: New file, from GNU gettext.
1012         * w32spawn.h: New file, from GNU gettext.
1013
1014 2004-01-23  Paul Eggert  <eggert@twinsun.com>
1015
1016         Exit-status fix from coreutils.
1017
1018         Use exit_failure consistently in place of EXIT_FAILURE,
1019         so that program exit statuses are consistent on failure.
1020
1021         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
1022         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
1023         * argmatch.h: Comment fix to match the above.
1024         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
1025         Now a macro referring to exit_failure, instead of a separate
1026         variable.  Include "exitfail.h" to get it.
1027         * xstrtol.h: Include "exitfail.h".
1028         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
1029
1030         * long-options.c (parse_long_options): Use prototype
1031         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
1032         for clarity.
1033
1034 2004-01-21  Jim Meyering  <jim@meyering.net>
1035
1036         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
1037         so as not to conflict with a different-sized __mktime_internal
1038         function in GNU libc.
1039         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
1040         Problem building statically-linked `ls' reported by Michael Brunnbauer.
1041
1042 2004-01-18  Paul Eggert  <eggert@twinsun.com>
1043
1044         Merge from diffutils.
1045
1046         * file-type.c (file_type): Add typed memory objects.
1047         * file-type.h (S_TYPEISTMO): New macro.
1048
1049         * c-stack.h (c_stack_action): Remove argv argument.
1050         * c-stack.c (c_stack_action): Likewise.  All uses changed.
1051         (die): Don't calculate message unless segv_action returns.
1052         (get_stack_location, min_address_from_argv, max_address_from_argv,
1053         volatile stack_base, volatile_stack_size): Remove.
1054         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
1055         that every segmentation violation is a stack overflow.  (Ouch!)
1056         See Debian bug 136249 (still outstanding) for more info about why
1057         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
1058
1059 2003-11-30  Bruno Haible  <bruno@clisp.org>
1060
1061         Safer stack allocation.
1062         * setenv.c: Include allocsa.h.
1063         (alloca): Remove fallback definition.
1064         (freea): Remove macro.
1065         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
1066         instead of freea.
1067
1068 2003-10-17  Bruno Haible  <bruno@clisp.org>
1069
1070         * binary-io.h: Avoid warnings on Cygwin.
1071
1072 2003-12-28  Bruno Haible  <bruno@clisp.org>
1073
1074         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
1075         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
1076
1077 2003-11-28  Bruno Haible  <bruno@clisp.org>
1078
1079         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
1080
1081 2003-11-27  Bruno Haible  <bruno@clisp.org>
1082
1083         * wait-process.c: On Windows, include windows.h. Needed on mingw.
1084
1085 2003-11-17  Bruno Haible  <bruno@clisp.org>
1086
1087         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
1088
1089 2003-11-24  Bruno Haible  <bruno@clisp.org>
1090
1091         * xallocsa.h: New file, from GNU gettext.
1092         * xallocsa.c: New file, from GNU gettext.
1093
1094 2003-11-24  Bruno Haible  <bruno@clisp.org>
1095
1096         * allocsa.h: New file, from GNU gettext.
1097         * allocsa.c: New file, from GNU gettext.
1098
1099 2003-11-24  Bruno Haible  <bruno@clisp.org>
1100
1101         * eealloc.h: New file.
1102
1103 2004-01-15  Jim Meyering  <jim@meyering.net>
1104
1105         Merge from coreutils.
1106
1107         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
1108         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
1109         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
1110
1111         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
1112         optional configure-time default.
1113
1114         * version-etc.c (version_etc_copyright): Update copyright date.
1115
1116         * xreadlink.c (xreadlink): Correct outdated comment.
1117
1118 2004-01-15  Paul Eggert  <eggert@twinsun.com>
1119
1120         Merge from coreutils.
1121
1122         * posixver.c: Include posixver.h.
1123
1124         * same.c: Include <stdbool.h>, <limits.h>.
1125         (_POSIX_NAME_MAX): Define if not defined.
1126         (MIN): New macro.
1127         (same_name): If file names are silently truncated, report
1128         that the file names are the same if they are the same after
1129         the silent truncation.
1130
1131         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
1132         conversion function.
1133         * xstrtod.c (xstrtod): Likewise.  All callers changed to
1134         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
1135         longer needed.
1136
1137 2004-01-14  Paul Eggert  <eggert@twinsun.com>
1138
1139         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
1140         with like-named macro in fnmatch.c.
1141         (EXT): Use an internal constant instead.
1142
1143         Merge fnmatch patches from glibc.
1144         * fnmatch.c (mbsinit): Remove define.
1145         Add libc_hidden_ver (__fnmatch, fnmatch).
1146         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
1147         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
1148
1149 2003-12-14  Karl Berry  <karl@gnu.org>
1150
1151         * config.charset: update from gettext-runtime.
1152
1153 2003-12-03  Paul Eggert  <eggert@twinsun.com>
1154
1155         * getgroups.c (getgroups): xmalloc takes one argument, not two.
1156         Bug reported by Alfred M. Szmidt.
1157
1158 2003-11-29  Karl Berry  <karl@gnu.org>
1159
1160         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
1161
1162 2003-11-23  Paul Eggert  <eggert@twinsun.com>
1163             Bruno Haible  <bruno@clisp.org>
1164
1165         * printf-parse.h: Don't include sys/types.h.
1166         (ARG_NONE): New macro.
1167         (char_directive): Change type of *arg_index fields to size_t.
1168         * printf-parse.c: Don't include sys/types.h.
1169         (SSIZE_MAX): Remove macro.
1170         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
1171         Remove unnecessary overflow check.
1172         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
1173         fields.
1174
1175 2003-11-24  Paul Eggert  <eggert@twinsun.com>
1176
1177         * alloca.c: Remove dependency on xalloc module.
1178         (xalloc_die): Remove.
1179         (memory_full) [!defined emacs]: New macro.
1180         [!defined emacs]: Don't include xalloc.h.
1181         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
1182         address arithmetic overflows.  Change datatypes a bit to avoid
1183         unnecessary casts.
1184
1185 2003-11-22  Jim Meyering  <jim@meyering.net>
1186
1187         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
1188
1189 2003-11-17  Bruno Haible  <bruno@clisp.org>
1190
1191         * vasnprintf.c (alloca): Remove fallback definition.
1192         (freea): Remove definition.
1193         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
1194         Reported by Paul Eggert.
1195
1196 2003-11-17  Jim Meyering  <jim@meyering.net>
1197
1198         On systems without utime and without a utimes function capable of
1199         dealing with a NULL struct utimbuf* argument, this utime replacement
1200         could -- in unusual circumstances -- leak a file descriptor.
1201         * utime.c: Include <unistd.h> and <errno.h>.
1202         (utime_null): Be sure to close `fd' and to preserve errno.
1203         Reported by Geoff Collyer via Arnold Robbins.
1204
1205 2003-11-16  Paul Eggert  <eggert@twinsun.com>
1206             Bruno Haible  <bruno@clisp.org>
1207
1208         Protect against address arithmetic overflow.
1209         * printf-args.h: Include stddef.h.
1210         (arguments): Change type of field 'count' to size_t.
1211         * printf-args.c (printf_fetchargs): Use size_t instead of
1212         'unsigned int' where appropriate.
1213         * printf-parse.h: Include sys/types.h.
1214         (char_directive): Change type of *arg_index fields to ssize_t.
1215         (char_directives): Change type of fields 'count', max_*_length to
1216         size_t.
1217         * printf-parse.c: Include sys/types.h and xsize.h.
1218         (SSIZE_MAX): Define fallback value.
1219         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
1220         instead of 'int' where appropriate. Check a_allocated, d_allocated
1221         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
1222         * vasnprintf.c: Include xsize.h.
1223         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
1224         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
1225         overflow. Avoid wraparound when converting a width or precision from
1226         decimal to binary.
1227
1228 2003-11-16  Bruno Haible  <bruno@clisp.org>
1229
1230         Update from GNU gettext.
1231         * printf-parse.c: Generalize to it can be compiled for wide strings.
1232         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
1233         * vasnprintf.c: Generalize to it can be compiled for wide strings.
1234         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
1235         SNPRINTF): New macros.
1236         Don't include <alloca.h> if the file is used inside libintl.
1237         (local_wcslen): New function, for Solaris 2.5.1.
1238         (VASNPRINTF): Use it instead of wcslen.
1239
1240 2003-11-16  Bruno Haible  <bruno@clisp.org>
1241
1242         * xsize.h (xmax): New function.
1243         (xsum, xsum3, xsum4): Declare as "pure" functions.
1244
1245 2003-11-12  Paul Eggert  <eggert@twinsun.com>
1246
1247         * xalloc.h: Do not include <limits.h> or <stdint.h>.
1248         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
1249         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
1250         heuristic is just as accurate as far as we know, and it removes a
1251         dependency on size_max.m4 and ptrdiff_max.m4.
1252
1253 2003-11-12  Paul Eggert  <eggert@twinsun.com>
1254
1255         * xstrtol.c (__xstrtol): Remove "break" immediately after
1256         "return", to pacify some unknown compiler.  Problem reported
1257         by Joerg Schilling.
1258
1259 2003-11-11  Bruno Haible  <bruno@clisp.org>
1260
1261         * xsize.h (SIZE_MAX): Remove fallback definition.
1262         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
1263         defined.
1264
1265 2003-11-10  Paul Eggert  <eggert@twinsun.com>
1266
1267         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
1268         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
1269         rejected some allocations of exactly SIZE_MAX - 2 bytes.
1270         From Bruno Haible.
1271         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
1272         not (size_t) -1, since it's defined here.
1273
1274 2003-11-06  Paul Eggert  <eggert@twinsun.com>
1275
1276         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
1277         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
1278         Reject sizes of exactly SIZE_MAX bytes.
1279         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
1280         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
1281
1282 2003-11-05  Bruno Haible  <bruno@clisp.org>
1283
1284         * xsize.h: Include limits.h, to avoid a possible collision with
1285         SIZE_MAX defined in <limits.h> on Solaris.
1286
1287 2003-11-04  Bruno Haible  <bruno@clisp.org>
1288
1289         * xsize.h: New file.
1290         * linebreak.c: Include xsize.h.
1291         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
1292         argument for overflow.
1293         Suggested by Paul Eggert.
1294
1295 2003-10-31  Bruno Haible  <bruno@clisp.org>
1296
1297         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
1298         to avoid (extremely rare) race condition.
1299         Suggested by Paul Eggert.
1300
1301 2003-11-03  Jim Meyering  <jim@meyering.net>
1302
1303         * userspec.c: Include "userspec.h".
1304         * userspec.h: New file.
1305
1306 2003-10-31  Paul Eggert  <eggert@twinsun.com>
1307
1308         * mountlist.h (struct mount_entry.me_type_malloced): New member.
1309         * mountlist.c (SIZE_MAX): Define if not defined already.
1310         (read_filesystem_list): Set and use me_type_malloced.
1311         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
1312         whatever the type happens to be), for brevity and consistency.
1313         Check for size calculation overflow on Alphas running OSF/1.
1314
1315 2003-10-31  Jim Meyering  <jim@meyering.net>
1316
1317         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
1318
1319         * linebuffer.c: Include <string.h> for declaration of memset.
1320
1321 2003-10-30  Paul Eggert  <eggert@twinsun.com>
1322             Bruno Haible  <bruno@clisp.org>
1323
1324         * vasprintf.c: Include <limits.h>, <stdlib.h>.
1325         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
1326
1327 2003-10-29  Paul Eggert  <eggert@twinsun.com>
1328
1329         * xalloc.h (xalloc_oversized): Now a macro, not a function,
1330         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
1331         no longer needed.
1332         * quotearg.c (quotearg_n_options): Use it.
1333         * group-member.c: Include <stdbool.h>.
1334         (free_group_info): Arg is now const *; don't free arg.
1335         (get_group_info): Now returns bool and accepts struct group_info *,
1336         rather than returning a malloc'ed struct group_info *.
1337         All uses changed.  Check for overflow in internal size calculation.
1338
1339         * getusershell.c (readname): Simplify the code by using x2nrealloc
1340         rather than xmalloc/xrealloc.
1341         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
1342         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
1343         conformance bug: the old code used a pointer after freeing the
1344         storage that it addressed.
1345         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
1346         rather than doing it by hand.
1347         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
1348         the buffer preserved.  Use free and xmalloc instead.
1349         * quotearg.c (quotearg_n_options): Likewise.
1350         Use a simpler test for size overflow.  Don't use xalloc_oversized
1351         because unsigned int might be wider than size_t (!); this suggests
1352         that we should switch from unsigned int to size_t for slot numbers.
1353
1354 2003-10-27  Bruno Haible  <bruno@clisp.org>
1355
1356         * stdbool_.h: Better support for BeOS.
1357
1358 2003-10-27  Paul Eggert  <eggert@twinsun.com>
1359
1360         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
1361         to allocate the returned structure.  Do not allocate a subarray,
1362         as x2nrealloc will do that.
1363         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
1364         instead of xnrealloc.
1365         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
1366
1367 2003-10-26  Paul Eggert  <eggert@twinsun.com>
1368
1369         * xalloc.h (xalloc_oversized): New static inline function, for
1370         callers that want to do their own size-overflow checking.  Include
1371         <stdbool.h>, since xalloc_oversized returns bool.
1372         * xalloc.c (array_size_overflow): Remove.  All callers changed
1373         to use xalloc_oversized.
1374
1375         Add two functions x2realloc, x2nrealloc, for programs that grow
1376         arrays dynamically by doubling their sizes.
1377         * xalloc.h (x2realloc, x2nrealloc): New decls.
1378         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
1379         New functions.
1380
1381         Port to C99 semantics for 'inline' of external functions.
1382         Bug reported by Bruno Haible.
1383         * xmalloc.c (xnmalloc_inline): New static inline function,
1384         with the old contents of xnmalloc.
1385         (xnmalloc, xmalloc): Use it.
1386         (xnrealloc_inline): New static inline function,
1387         with the old contents of xnrealloc.
1388         (xnrealloc, xrealloc): Use it.
1389
1390         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
1391
1392 2003-10-25  Paul Eggert  <eggert@twinsun.com>
1393
1394         Fix several address-calculation bugs in the hash modules,
1395         plus some minor code cleanup.
1396
1397         * hash.h: Include <stdbool.h>, for bool.
1398         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
1399         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
1400         hash_get_n_entries, hash_get_max_bucket_length,
1401         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
1402         hash_rehash): Use size_t rather than unsigned.
1403         * hash.c (struct hash_table, hash_get_n_buckets,
1404         hash_get_n_buckets_used, hash_get_n_entries,
1405         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
1406         hash_get_entries, hash_do_for_each, hash_string, is_prime,
1407         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
1408         Likewise.
1409         (SIZE_MAX): Define if not defined.
1410         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
1411         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
1412         hash_print):
1413         Use const * when possible.
1414         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
1415         (check_tuning): Fix bug: if tuning parameters were very close to
1416         0 or 1, rounding errors could have caused subscript violations.
1417         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
1418         (hash_initialize): Add 'fail:' label
1419         to free table and return NULL, and use it to simplify code.
1420         Use calloc rather than clearing the storage ourself.
1421         (hash_initialize, hash_rehash): Check for arithmetic overflow in
1422         buffer size calculations.
1423         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
1424         Include <stddef.h>, for size_t.
1425         * hash-pjw.c (hash_pjw): Likewise.
1426         Switch to method described by Bruno Haible.
1427         Include <limits.h>, for CHAR_BIT.
1428         (SIZE_BITS): New macro.
1429
1430 2003-10-21  Paul Eggert  <eggert@twinsun.com>
1431
1432         * getndelim2.c (getndelim2): When size calculation overflows,
1433         ceiling the allocation at NMAX bytes rather than silently
1434         discarding input bytes before NMAX is reached.  This makes
1435         a difference only if NMAX exceeds SIZE_MAX / 2.
1436
1437         * obstack.c: Merge from glibc.
1438         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
1439         Add libc_hidden_def (_obstack_newchunk).
1440         (_obstack_free) [! defined _LIBC]: Remove.
1441         [defined _LIBC]: Make a strong alias from obstack_free, rather than
1442         a clone of the function body.
1443         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
1444         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
1445
1446         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
1447         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
1448         arg to memcpy.
1449
1450         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
1451         (obstack_ptr_grow_fast, obstack_int_grow_fast):
1452         Don't use lvalue casts, as GCC plans to remove support for them
1453         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
1454         was also present in the non-GCC version, indicating that this
1455         code had always been buggy and had never been widely used.
1456         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
1457         Use the fast variant of each macro, rather than copying the
1458         definiens of the fast variant; that way, we'll be more likely to
1459         catch future bugs in the fast variants.
1460
1461 2003-10-20  Bruno Haible  <bruno@clisp.org>
1462
1463         * wait-process.h: New file, from GNU gettext.
1464         * wait-process.c: New file, from GNU gettext.
1465
1466 2003-10-19  Jim Meyering  <jim@meyering.net>
1467
1468         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
1469
1470 2003-10-16  Paul Eggert  <eggert@twinsun.com>
1471
1472         * getgroups.c: Include <errno.h>, <stdlib.h>.
1473         (getgroups): First arg is int, not size_t.
1474         Don't let 'free' mangle errno.
1475
1476 2003-10-16  Jim Meyering  <jim@meyering.net>
1477
1478         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
1479
1480 2003-10-15  Paul Eggert  <eggert@twinsun.com>
1481
1482         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
1483         (SIZE_MAX): Remove.
1484         (new_exclude, add_exclude_file): Initial size no longer needs to
1485         be a power of 2.
1486         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
1487         our own address arithmetic overflow checking.
1488
1489         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
1490         (fnmatch): Do not alloca more than 2000 wide characters;
1491         instead, use malloc for large buffers.
1492         Check for address arithmetic overflow, and return -1
1493         with errno set to ENOMEM in that case.
1494         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
1495         (NEW_PATTERN): Do not alloca more than 8000 bytes;
1496         instead, return -1.  Check for address arithmetic overflow.
1497
1498 2003-10-14  Paul Eggert  <eggert@twinsun.com>
1499
1500         Handle invalid suffixes and overflow independently, so that
1501         callers can treat them independently as needed.  Fix some bugs in
1502         suffix handling, e.g., "100k@" was not diagnosed as an invalid
1503         suffix for a human-readable blocksize.  The major caller-visible
1504         change is the addition of a new
1505         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
1506         that both overflow and suffix chars were found.
1507
1508         * human.c (humblock): Don't check separately for invalid suffix
1509         char; that is xstrtoumax's job (now that its bug is fixed).
1510         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
1511         INTMAX_MAX]: New macros.
1512         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
1513         TYPE_MAXIMUM): New macros.
1514         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
1515         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
1516         if overflow occurs, as it's what __strtol does and it's more useful
1517         in practice.
1518         (__xstrtol): If __strtol reports some error other than ERANGE,
1519         reflect it to the caller as LONGINT_INVALID.  If it reports
1520         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
1521         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
1522         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
1523         value.
1524         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
1525         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
1526         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
1527         [defined UINTMAX_MAX]: New macros.
1528
1529 2003-10-14  Bruno Haible  <bruno@clisp.org>
1530
1531         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
1532         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
1533         Also use volatile where needed.
1534
1535 2003-10-12  Paul Eggert  <eggert@twinsun.com>
1536
1537         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
1538         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
1539         and define in terms of the other primitives.
1540         * xmalloc.c: Include stdbool.h; do not include exit.h.
1541         (SIZE_MAX): Define if not already defined.
1542         (array_size_overflow): New function.
1543         (xalloc_die): Abort instead of exiting if 'error' returns.
1544         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
1545         (xmalloc, xrealloc): Use them.
1546         (xcalloc): Check for address arithmetic overflow.
1547         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
1548         a bit faster than strcpy.
1549
1550 2003-10-08  Paul Eggert  <eggert@twinsun.com>
1551
1552         Merge getpass from libc, plus a few fixes.
1553
1554         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
1555         Include <stdbool.h>.
1556         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
1557         __fsetlocking to empty.
1558         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
1559         do include <bits/libc-lock.h>.
1560         Do not include <fcntl.h>; not needed.
1561         [_LIBC]: Include <wchar.h>.
1562         (NOTCANCEL_MODE): New macro.
1563         (flockfile, funlockfile) [_LIBC]: New macros.
1564         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
1565         [!_LIBC]: New macros.
1566         (call_fclose): New function.
1567         (getpass): Use it.  Save tty stream separately; this simplifies the
1568         code and makes it more reliable if stdin happens to equal stdout.
1569         Invoke __fsetlocking on tty.
1570         Handle thread cancellation if needed.
1571         Namespace cleanup (use __tcgetattr, __getline).
1572         Use bool for Booleans.
1573         [USE_IN_LIBIO]: Handle wide streams.
1574         [!_LIBC]: Unconditionally do the fseek, since we don't know what
1575         stream might go where.
1576
1577         * unlocked-io.h: Include <stdio.h>, so that the caller
1578         doesn't have to include <stdio.h> before us.
1579         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
1580         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
1581         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
1582         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
1583         if not declared, so that we can use getpass.c code from libc without
1584         rewriting it.
1585         (flockfile, ftrylockfile, funlockfile): New macros.
1586
1587 2003-10-06  Bruno Haible  <bruno@clisp.org>
1588
1589         * version-etc-2.h: Remove file.
1590         * version-etc-2.c: Remove file.
1591
1592 2003-09-25  Jim Meyering  <jim@meyering.net>
1593             Bruno Haible  <bruno@clisp.org>
1594
1595         This lets translators provide better translations for the
1596         "Written by ..." part of --version output.
1597         * version-etc.h: Include stdarg.h.
1598         (version_etc_copyright): Declare as readonly.
1599         (version_etc): Make this function variadic with a NULL-terminated list
1600         of author name strings.
1601         (version_etc_va): New declaration.
1602         * version-etc.c: Include stdarg.h, stdlib.h.
1603         (version_etc_copyright): Declare as readonly.
1604         (version_etc_va): New function. Provide a different translatable string
1605         for each possible number of authors < 10. Abbreviate when there are 10
1606         authors or more.
1607         (version_etc): Make this function variadic. Call version_etc_va.
1608         Suggestion from Gary V. Vaughan.
1609
1610         * long-options.h (parse_long_options): Change prototype: the authors
1611         string is moved to the end and becomes variadic.
1612         * long-options.c: Include stdarg.h.
1613         (parse_long_options): Make this function variadic, too.
1614         Call version_etc_va, not version_etc.
1615
1616 2003-10-06  Bruno Haible  <bruno@clisp.org>
1617
1618         * fatal-signal.h: New file, from GNU gettext.
1619         * fatal-signal.c: New file, from GNU gettext.
1620
1621 2003-10-04  Karl Berry  <karl@gnu.org>
1622
1623         * argp*: update from libc.
1624
1625 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
1626
1627         * getpass.c (getpass): Use a no-op fseek when switching from input to
1628         output mode on the same stream.
1629
1630 2003-09-29  Paul Eggert  <eggert@twinsun.com>
1631
1632         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
1633         Fix arg typo in previous patch.
1634
1635 2003-09-28  Jim Meyering  <jim@meyering.net>
1636
1637         * error.c: Correct cpp indentation.
1638
1639 2003-09-27  Paul Eggert  <eggert@twinsun.com>
1640
1641         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
1642         Omit the special code that used __typeof__, since we worry that
1643         it could be more trouble than it's worth.  See:
1644         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
1645         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
1646
1647         * free.c: New file.
1648
1649 2003-09-26  Jim Meyering  <jim@meyering.net>
1650
1651         * error.c (error_tail): Move some declarations
1652         into inner scope where the local variables are used.
1653
1654 2003-09-26  Bruno Haible  <bruno@clisp.org>
1655
1656         * stpncpy.h (gnu_stpncpy): New declaration.
1657         (stpncpy): Define as alias for gnu_stpncpy.
1658         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
1659
1660 2003-09-26  Paul Eggert  <eggert@twinsun.com>
1661
1662         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
1663         (error_tail): Do not loop, reallocating temporary buffer, since
1664         the output cannot contain more wide characters than the input
1665         contains bytes, the size must be big enough already.  This avoids
1666         one potential size overflow calculation.  Check for size overflow
1667         when calculating temporary buffer size.  Free temporary buffer
1668         when done, if it was allocated with malloc; this plugs a memory
1669         leak.  Remove casts from void * to pointers, that are no longer
1670         needed now that we're assuming C89 or better.
1671
1672         Merge error changes from glibc.
1673
1674         * error.c, error.h: Update copyright notice header to match glibc.
1675         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
1676         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
1677         Disable cancellation while printing error.
1678         * error.h: Prepend __ to parameter names.
1679
1680 2003-09-25  Karl Berry  <karl@gnu.org>
1681
1682         * argp-fmtstream.c, argp-help.c: update from libc.
1683
1684 2003-09-25  Bruno Haible  <bruno@clisp.org>
1685
1686         * version-etc-2.h: New file, from version-etc.h with modifications.
1687         * version-etc-2.c: New file, from version-etc.c with modifications.
1688
1689 2003-09-25  Simon Josefsson  <jas@extundo.com>
1690
1691         * xgetdomainname.h: New file.
1692         * xgetdomainname.c: New file.
1693
1694 2003-09-25  Simon Josefsson  <jas@extundo.com>
1695             Bruno Haible  <bruno@clisp.org>
1696
1697         * getdomainname.h: New file.
1698         * getdomainname.c: New file.
1699
1700 2003-09-24  Paul Eggert  <eggert@twinsun.com>
1701
1702         * linebuffer.c (freebuffer): Don't free the argument, just
1703         the buffer associated with the argument.  Bug reported by
1704         Simon Josefsson.
1705
1706 2003-09-19  Karl Berry  <karl@gnu.org>
1707
1708         * argp.h: update from libc.
1709
1710 2003-09-16  Paul Eggert  <eggert@twinsun.com>
1711
1712         * linebuffer.c (readlinebuffer): Return NULL immediately upon
1713         input error, instead of returning NULL the next time we are called
1714         (and therefore losing track of errno).
1715
1716 2003-09-15  Paul Eggert  <eggert@twinsun.com>
1717
1718         * getndelim2.c (getndelim2): Don't trash errno when a read
1719         fails, so that the caller gets the proper errno.
1720
1721         * readutmp.c (read_utmp): Likewise.
1722         Check for fstat error.  Close stream and free storage
1723         when failing.
1724
1725 2003-09-14  Bruno Haible  <bruno@clisp.org>
1726
1727         * fwriteerror.h: New file.
1728         * fwriteerror.c: New file.
1729
1730 2003-09-14  Jim Meyering  <jim@meyering.net>
1731
1732         * getloadavg.c: Correct cpp indentation.
1733         * strdup.c: Likewise.
1734         * vasnprintf.c: Likewise.
1735
1736 2003-09-12  Paul Eggert  <eggert@twinsun.com>
1737
1738         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
1739         * obstack.c [!defined _LIBC]: Likewise.
1740         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
1741         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
1742         * exitfail.c: Don't include stdlib.h; no longer needed.
1743
1744         More changes to assume C89 or better.
1745
1746         * error.c (error_tail): Assume vprintf.
1747
1748         * argmatch.c (getenv): Remove decl.
1749         * progreloc.c (get_full_program_name): Define via prototype.
1750         * setenv.c (clearenv): Likewise.
1751         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
1752         needed.
1753         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
1754         (malloc, memcpy): Remove decls.
1755         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
1756         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
1757         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
1758         (memcpy): Remove macro.
1759         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
1760         (__P): Remove.  All uses removed.
1761         (PTR): Remove.  All uses changed to void *.
1762         (CHAR_BIT, NULL): Remove.
1763         (spaces, zeros, memset_space, memset_zero)
1764         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
1765         Remove.
1766         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
1767         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
1768         Define with prototype.
1769         Remove now-unnecessary prototype decl.
1770         (extra_args_spec): Assume ANSI C.  All uses changed.
1771         (extra_args_spec_iso): Remove.
1772         (my_strftime, emacs_strftimeu): Define via prototype.
1773         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
1774         unconditionally.
1775         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
1776         * strtoimax.c: Include <stdlib.h> unconditionally.
1777         (strtoul, strtol): Remove decls.
1778         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
1779         LONG_MAX): Remove.
1780         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
1781         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
1782         (LOCALE_PARAM_PROTO): New macro.
1783         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
1784         (INTERNAL (strtol), strtol): Define with a prototype.
1785         (PARAMS): Remove.  All uses removed.
1786         * tempname.c: Include <string.h> unconditionally.
1787         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
1788         * xgethostname.c (main): Define with a prototype.
1789         * xmalloc.c: Include "xalloc.h" first, to check interface.
1790         Include <stdlib.h> unconditionally.
1791         (calloc, malloc, realloc, free): Remove decls.
1792         * xstrtod.c: Include "xstrtod.h" first, to check interface.
1793         Include <stdlib.h> unconditionally.  Sort include file names.
1794         (strtod): Remove.
1795         (xstrtod): Define with a prototype.
1796         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
1797         (strtol, strtoul): Remove decls.
1798
1799 2003-09-11  Paul Eggert  <eggert@twinsun.com>
1800
1801         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
1802         Include <stdlib.h>, <string.h> unconditionally.
1803         Remove now-unnecessary cast to char *.
1804         * strnlen.c: Include <string.h> unconditionally.
1805         * yesno.c (yesno): Define with a prototype.
1806
1807 2003-09-10  Bruno Haible  <bruno@clisp.org>
1808
1809         * strcspn.c: Include <string.h> unconditionally.
1810         * strpbrk.c: Include <string.h> unconditionally.
1811         * strstr.c: Include <string.h> unconditionally.
1812         * unicodeio.c: Include <string.h> unconditionally.
1813         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
1814         * unsetenv.c: Likewise.
1815         * xreadlink.c: Include <stdlib.h> unconditionally.
1816         * yesno.c: Include <stdlib.h> unconditionally.
1817         (rpmatch): Add prototype.
1818
1819 2003-09-10  Jim Meyering  <jim@meyering.net>
1820
1821         * error.c: Correct indentation of cpp directives.
1822
1823 2003-09-09  Paul Eggert  <eggert@twinsun.com>
1824
1825         More K&R removal.
1826
1827         * acosl.c (main): Use a prototype.
1828         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
1829         tanl.c: Likewise.
1830
1831         * getloadavg.c (getloadavg, main): Define via prototypes.
1832
1833         * getopt.h (struct option.name): Assume C89, and use 'const'.
1834         (getopt, etopt_long, getopt_long_only, _getopt_internal)
1835         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
1836         with a prototype.
1837         * getopt.c (const): Remove macro.
1838         Include <string.h> unconditionally.
1839         (my_index): Remove; all uses changed to strchr.
1840         (strlen): Remove decl.
1841         (exchange): Remove forward decl; no longer needed.
1842         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
1843         Define with prototype.
1844         * getopt1.c (const): Remove macro.
1845         (getopt_long, getopt_long_only, main): Define with prototype.
1846
1847         * getugroups.c: Include <string.h> unconditionally.
1848
1849         * getusershell.c: Include <stdlib.h> unconditionally.
1850         (getusershell, setusershell, endusershell, readname, main):
1851         Define with prototypes.
1852
1853         * group-member.c: Include group-member.h first.
1854         Include <stdlib.h> unconditionally.
1855
1856         * hard-locale.c: Include hard-locale.h first.
1857         Include <stdlib.h>, <string.h> unconditionally.
1858
1859         * hash.c (free, malloc): Remove decls.
1860         Include <stdlib.h> unconditionally.
1861
1862         * human.c: Include <stdlib.h>, <string.h> unconditionally.
1863         (getenv): Do not declare.
1864
1865         * idcache.c: Include <string.h> unconditionally.
1866
1867         * long-options.c: Include long-options.h first, to test interface.
1868         Include <stdlib.h> unconditionally.
1869
1870         * makepath.c: Include makepath.h first, to test interface.
1871         Include <stdlib.h> and <string.h> unconditionally.
1872
1873         * linebuffer.c: Include <stdlib.h>.
1874         (free): Remove decl.
1875
1876         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
1877         rpl_malloc returns void *, not char *.
1878         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
1879
1880         * md5.h: Include <limits.h> unconditionally.
1881         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
1882         (__P): Remove; all uses removed.
1883         * md5.c: Include "md5.h" first.
1884         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
1885         md5_buffer, md5_process_bytes, md5_process_block):
1886         Define with prototypes.
1887         * sha.h (__P): Remove all uses.  (It wasn't defined??)
1888         * sha.c: Include "sha.h" first.
1889         Include <stdlib.h>, <string.h> unconditionally.
1890
1891         * memchr.c (__ptr_t): Remove; all uses changed to void *.
1892         * memcmp.c (__ptr_t): Likewise.
1893         * memrchr.c (__ptr_t): Likewise.
1894         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
1895         Include <string.h> unconditionally.
1896         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
1897         * memchr.c: Include <stdlib.h> unconditionally.
1898         * memchr.c (LONG_MAX): Remove.
1899         * memrchr.c (LONG_MAX): Likewise.
1900         * memchr.c (__memchr): Define via a prototype.
1901         * memrchr.c (__memrchr): Likewise.
1902         * memcmp.c (__P): Remove, and remove all uses.
1903         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
1904         Remove forward decls; no longer needed.
1905         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
1906         Use types required by C89 in prototype.
1907
1908         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
1909         * savedir.c: Likewise.
1910         * mkdir.c (free): Remove decl.
1911         * rmdir.c (rmdir): Define with a prototype.
1912         * savedir.c: Include savedir.h first, to test interface.
1913
1914         * mktime.c (STDC_HEADERS): Remove.
1915         Include <stdlib.h>, <string.h> unconditionally.
1916
1917         * modechange.c: Include <stdlib.h> unconditionally.
1918         (malloc): Remove decl.
1919
1920         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
1921         (free): Remove decl.
1922
1923         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
1924         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
1925         (This type really should be intptr_t, but that's a C99ism.)
1926         (_obstack_memcpy): Remove: all uses changed to memcpy.
1927         Include <string.h> unconditionally.
1928         (struct obstack): Assume __STDC__ for types of members
1929         chunkfun, freefun, extra_arg.
1930         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
1931         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
1932         obstack_begin, obstack_specify_allocation,
1933         obstack_specify_allocation_with_arg, obstack_chunkfun,
1934         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
1935         Remove unprototyped decls and the macros that use them.
1936         * obstack.c (POINTER): Remove.  All uses changed to void *.
1937         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
1938         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
1939         (defined __STDC__ && __STDC__)]:
1940         Remove nonprototyped code.
1941         Include <stdlib.h> unconditionally.
1942         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
1943         _obstack_allocated_p, _obstack_free, obstack_free,
1944         _obstack_memory_used, print_and_abort):
1945         Define using prototypes.
1946         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
1947         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
1948         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
1949         obstack_next_free, obstack_object_size, obstack_room) [0]:
1950         Remove unused, unprototyped code.
1951
1952         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
1953
1954         * physmem.c (physmem_total, physmem_available, main): Define
1955         with prototypes.
1956
1957         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
1958         (main): Define with a prototype.
1959
1960         * posixver.c (getenv): Remove decl.
1961
1962         * putenv.c (malloc): Returns void *, not char *.
1963         Include <string.h> unconditionally.
1964         (strchr, memcpy, NULL): Do not define.
1965
1966         * readtokens.c: Include readtokens.h first, to test interface.
1967         Include <stdlib.h>, <string.h> unconditionally.
1968         (init_tokenbuffer): Define with a prototype.
1969
1970         * regex.c (PARAMS): Remove.  All uses removed.
1971         All uses of _RE_ARGS removed, too.
1972         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1973         unconditionally.
1974         (bzero): Assume memset exists.
1975         (memcmp, memcpy, NULL): Remove.
1976         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
1977         char, or assignments to local vars of type signed char.
1978         (init_syntax_once, PREFIX(extract_number_and_incr),
1979         PREFIX(print_partial_compiled_pattern),
1980         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
1981         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
1982         PREFIX(regex_grow_registers), PREFIX(regex_compile),
1983         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
1984         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
1985         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
1986         wcs_compile_range, byte_compile_range, truncate_wchar,
1987         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
1988         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
1989         count_mbs_length, wcs_re_match_2_internal,
1990         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
1991         PREFIX(alt_match_null_string_p),
1992         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
1993         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
1994         regfree, PREFIX(extract_number)): Define with prototype.  Remove
1995         now-unnecessary declaration, if any.
1996         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
1997         regcomp, regexec):
1998         Remove now-unnecessary casts among pointer types.
1999         * regex.h (_RE_ARGS): Remove.  All uses removed.
2000
2001         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
2002         (free): Remove decl.
2003
2004         * rpmatch.c: Include <stdlib.h> unconditionally.
2005
2006         * same.c: Include <stdlib.h>, <string.h> unconditionally.
2007         (free): Remove decl.
2008
2009         * save-cwd.c: Include <stdlib.h> unconditionally.
2010         * xgetcwd.c: Likewise.
2011
2012         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
2013         (free): Remove decl.
2014
2015         * strchrnul.c (strchrnul): Define with a prototype.
2016         Fix bug: c_in was not converted to char before searching.
2017
2018         The following changes are not K&R related:
2019
2020         * group-member.h: Include <sys/types.h>, so that this file is
2021         self-contained.
2022         * makepath.h: Likewise.
2023
2024         * getusershell.c (readname, default_index, line_size, readname):
2025         Use size_t, not int, for sizes.
2026         (readname): If the size overflows, report an error instead of
2027         looping forever.
2028
2029 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
2030
2031         * getndelim2.c: Assume stdlib.h per the C89 spec.
2032
2033 2003-09-08  Paul Eggert  <eggert@twinsun.com>
2034
2035         Assume C89 or better; remove K&R cruft.
2036         A few of these changes were first proposed by Derek Robert Price
2037         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
2038
2039         * addext.c: Include <string.h> unconditionally.
2040         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
2041         Don't declare getenv or malloc.
2042
2043         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
2044         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
2045         (NULL): Remove.
2046         (find_stack_direction, alloca): Use prototypes.
2047
2048         * atexit.c (atexit): Define using a prototype.
2049
2050         * basename.c, dirname.c, stripslash.c:
2051         Include <string.h> unconditionally.
2052
2053         * bcopy.c: Include <stddef.h>.
2054         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
2055
2056         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
2057
2058         * error.h (error, error_at_line, error_print_progname)
2059         [! (defined (__STDC__) && __STDC__)]: Remove decls.
2060         * error.c: Include error.h first, to check interface.
2061         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
2062         (VA_START): Remove; all uses changeed to va_start.
2063         (exit, strerror): Remove decls.
2064         (error_print_progname): Prototype uncondionally.
2065         Don't include <errno.h>; no longer needed.
2066         (private_strerror): Remove.
2067         (error_tail): Always define.
2068         (error, error_at_line): Assume C89 or better; always use prototypes.
2069         * fatal.c: Include "fatal.h" first, to test interface.
2070         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
2071         (VA_START): Remove; all uses changed to va_start.
2072         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
2073         this case.
2074         (exit): Remove decl.
2075         (fatal): Prototype unconditionally.  Assume va_start works.
2076         Abort at end, to pacify gcc.
2077
2078         * euidaccess.c (main): Define with a prototype.
2079
2080         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
2081
2082         * exitfail.c: Include <stdlib.h> unconditionally.
2083
2084         * fnmatch_.h (__P): Remove.  All uses changed to assume
2085         prototypes.
2086         * fnmatch.c: Include fnmatch.h first, to test interface.
2087         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
2088         (getenv): Remove decl.
2089         (fnmatch): Define using a prototype.
2090         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
2091         (FCT): Define using a prototype.
2092
2093         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
2094
2095         * gethostname.c: Include <stddef.h>.
2096         (gethostname): Define with prototype.  Length is size_t, not int.
2097
2098 2003-09-08  Paul Eggert  <eggert@twinsun.com>
2099
2100         * getversion.c: Remove; was migrated to backupfile.c in 1997.
2101         getversion.c should have been removed then, but was accidentally
2102         preserved.
2103
2104         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
2105         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
2106
2107 2003-09-07  Paul Eggert  <eggert@twinsun.com>
2108
2109         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
2110         copy_tm_result.  Bug reported by Simon Josefsson in
2111         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
2112
2113 2003-09-06  Paul Eggert  <eggert@twinsun.com>
2114
2115         * time_r.c, time_r.h: New files.
2116
2117         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
2118         __localtime_r.
2119         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
2120         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
2121
2122         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
2123         __gmtime_r.
2124         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
2125         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
2126         Include <time_r.h>.
2127
2128         * timegm.c: Switch to glibc implementation, with the following changes:
2129         [defined HAVE_CONFIG_H]: Include <config.h>.
2130         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
2131         (__mktime_internal) [!defined _LIBC]: New decl.
2132         (__gmtime_r) [!defined _LIBC]: New macro and function.
2133         (timegm): Use a prototype, since gnulib assumes C89.
2134         Do not bother declaring tmp to be const, as it's not really usefu.
2135         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
2136         (timegm): Declare only if HAVE_DECL_TIMEGM.
2137
2138 2003-09-03  Paul Eggert  <eggert@twinsun.com>
2139
2140         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
2141         Bug reported by Lute Kamstra in
2142         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
2143
2144         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
2145         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
2146         course with correspondingly smaller numbers for tomorrow and
2147         yesterday.  From Tadayoshi Funaba.  Originally installed into
2148         sh-utils on 1999-08-07, but the patch got lost (I guess during the
2149         coreutils merge?).
2150
2151 2003-08-31  Simon Josefsson  <jas@extundo.com>
2152
2153         * timegm.h: New file.
2154         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
2155
2156 2003-08-31  Karl Berry  <karl@gnu.org>
2157
2158         * argp.h: update from libc.
2159
2160 2003-08-28  Bruno Haible  <bruno@clisp.org>
2161
2162         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
2163         warning on QNX, which defines O_BINARY to 000000.
2164
2165 2003-08-24  Bruno Haible  <bruno@clisp.org>
2166
2167         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
2168         MSVC7 <stdio.h> is included later.
2169
2170 2003-08-20  Bruno Haible  <bruno@clisp.org>
2171
2172         * progname.h: New file, from GNU gettext.
2173         * progname.c: New file, from GNU gettext.
2174         * progreloc.c: New file, from GNU gettext.
2175
2176 2003-08-19  Bruno Haible  <bruno@clisp.org>
2177
2178         * xstrdup.c: Assume <string.h> exists.
2179
2180 2003-08-18  Jim Meyering  <jim@meyering.net>
2181
2182         * setenv.h: Indent nested cpp directive.
2183         * vasnprintf.c: Remove trailing blanks.
2184
2185 2003-08-17  Simon Josefsson  <jas@extundo.com>
2186             Bruno Haible  <bruno@clisp.org>
2187
2188         * xstrndup.h: New file.
2189         * xstrndup.c: New file.
2190
2191 2003-08-17  Bruno Haible  <bruno@clisp.org>
2192
2193         * strndup.h: New file.
2194
2195 2003-08-16  Paul Eggert  <eggert@twinsun.com>
2196
2197         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
2198         space, undoing this 2003-08-12 change:
2199         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
2200
2201 2003-08-16  Jim Meyering  <jim@meyering.net>
2202
2203         Merge from coreutils.
2204         * xstrtoimax.c: #else #if -> #elif.
2205         * xstrtoumax.c: Likewise.
2206
2207 2003-08-15  Paul Eggert  <eggert@twinsun.com>
2208
2209         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
2210         rather than tab, after '#' in shell-script copyright notices.
2211         Suggested by Bruno Haible.
2212
2213 2003-08-15  Jim Meyering  <jim@meyering.net>
2214         and Paul Eggert  <eggert@twinsun.com>
2215
2216         Merge from coreutils.
2217         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
2218         member but strut utmpx does not.  Needed for AIX 4.3.3.
2219         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
2220
2221 2003-08-15  Jim Meyering  <jim@meyering.net>
2222
2223         Merge from coreutils.
2224         * xgethostname.c: Include <stdlib.h>.
2225         (xghostname): Don't exit for anything other than memory-related
2226         failure; just return NULL.
2227         * userspec.c: Include "posixver.h".
2228         (parse_user_spec): Accept `.' as a separator only
2229         in pre-POSIX-200112 mode.
2230         * strtoimax.c: Use #elif rather than #else #if.
2231         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
2232         Remove function, now that we can rely on a working tzset function.
2233         [!_LIBC]: Ensure that the required autoconf test has been run.
2234         [!defined _NL_CURRENT && HAVE_STRFTIME]:
2235         Use underlying_strftime for %r.
2236         * sha.c: Merge in some clean-up and optimization changes from glibc.
2237         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
2238         Ensure that it is a multiple of 64.
2239         Rearrange loop exit tests so as to avoid performing an
2240         additional fread after encountering an error or EOF.
2241         * realloc.c: Update copyright date.
2242
2243 2003-08-14  Jim Meyering  <jim@meyering.net>
2244
2245         Merge from coreutils.
2246         * obstack.h: Whitespace changes.
2247         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
2248         and xcalloc return values.
2249         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
2250         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
2251         hang on OSF/1 5.1 for DIR on both local and remote file systems.
2252         Reported by (and fix confirmed by) Nelson H. F. Beebe.
2253         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2254         error from mntctl.
2255         Use mntctl's return value to drive the entry-processing loop, since
2256         we can't rely on the value of the vmt_length member in the last
2257         entry.  On some systems doing so could result in exhausting
2258         virtual memory.  Based in part on a patch from Mike Jetzer.
2259
2260 2003-08-14  Jim Meyering  <jim@meyering.net>
2261         and Paul Eggert  <eggert@twinsun.com>
2262
2263         Merges from coreutils, plus other fixes.
2264         * physmem.c: Merge in portability changes from gcc/libiberty
2265         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
2266         for credits and details.  Thanks to Kaveh Ghazi for helping
2267         to keep these files in sync.
2268         (ARRAY_SIZE): Define it.
2269         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
2270         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
2271         (memcasecmp): Don't assume size_t fits in unsigned int.
2272         Remove casts and duplicate code.
2273         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
2274         (memcpy): Remove definition.
2275         Merge in some clean-up and optimization changes from glibc.
2276         [BLOCKSIZE]: Move definition to top of file.
2277         Ensure that it is a multiple of 64.
2278         Rearrange loop exit tests so as to avoid performing an
2279         additional fread after encountering an error or EOF.
2280         * md5.h (md5_uintptr): Define.
2281         * makepath.c (CLEANUP_CWD): Report an error if we failed to
2282         return to the initial working directory.  Preserve errno
2283         for caller.
2284         * idcache.c: Include "xalloc.h".
2285         (xmalloc, xrealloc): Remove decls.
2286         (getuser): Remove casts no longer required in C89.
2287         * human.c: Include stdio.h, for sprintf.
2288         * group-member.c: Include "xalloc.h".
2289         (xmalloc, xrealloc): Remove decls.
2290         (get_group_info): Remove casts no longer required in C89.
2291         * getusershell.c (readname): Remove casts no longer required in C89.
2292         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
2293         * getline.c: Whitespace fix, from coreutils.
2294
2295 2003-08-13  Paul Eggert  <eggert@twinsun.com>
2296
2297         * exclude.c: Include <ctype.h>
2298         (IN_CTYPE_DOMAIN): New macro.
2299         (is_space): New fn.
2300         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
2301         and empty lines.
2302
2303         * argp-help.c, argp-parse.c, config.charset, getopt.h:
2304         Undo previous (whitespace-only) change.
2305
2306 2003-08-12  Paul Eggert  <eggert@twinsun.com>
2307
2308         * argp-help.c, argp-parse.c, config.charset, getopt.h:
2309         Normalize leading white space and remove trailing white space.
2310         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
2311         notice, as per ../config/srclist-update.
2312
2313         Merge from coreutils.
2314         * euidaccess.h: New file.
2315         * euidaccess.c: Include it.
2316         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
2317         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
2318         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
2319
2320 2003-08-11  Bruno Haible  <bruno@clisp.org>
2321
2322         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
2323         (vasnprintf): Use it instead of wcslen.
2324
2325 2003-08-11  Bruno Haible  <bruno@clisp.org>
2326
2327         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
2328         value to ensure that _Bool promotes to int. Use #define for _Bool when
2329         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
2330
2331 2003-08-10  Karl Berry  <karl@gnu.org>
2332
2333         * regex.h: update from libc (whitespace fix).
2334
2335 2003-08-09  Paul Eggert  <eggert@twinsun.com>
2336
2337         Merge some files from coreutils.  These changes were
2338         originally made by Jim Meyering.
2339         * acl.c: Include <sys/types.h> before <sys/stat.h>;
2340         many older Unixes require this.
2341         * alloca.c (alloca): Remove cast to argument of free;
2342         no longer needed in C89.
2343         * alloca_.h, regex.h: Fix white space to match
2344         what GNU indent does.
2345
2346 2003-08-05  Paul Eggert  <eggert@twinsun.com>
2347
2348         * bumpalloc.h: Remove.
2349
2350 2003-08-04  Paul Eggert  <eggert@twinsun.com>
2351
2352         * getloadavg.c: Change copyright notice and spacing to conform to
2353         GNU coding style.
2354
2355         Merge from coreutils.
2356         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
2357         From glibc.
2358         * getdate.y (date): Also accept dates like May-23-2003; suggestion
2359         from Karl Berry, implemented by Jim Meyering.
2360         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
2361         from Dmitry V. Levin.
2362         Remove anachronistic cast of xrealloc.
2363         * fnmatch_.h (__const): Remove.  Use 'const'.
2364         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
2365         type. Otherwise, it wouldn't compile with at least /bin/cc on
2366         ymp-cray-unicos9.0.2.X.
2367         Combine two mostly-identical uses of alloca into one.
2368         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
2369
2370 2003-08-04  Dave Love <d.love@dl.ac.uk>
2371
2372         [From Emacs.]
2373
2374         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
2375         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
2376         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
2377         obsolete NLIST_NAME_UNION.
2378         [__GNU__]: Undef BSD and FSCALE.
2379         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
2380
2381 2003-08-03  Paul Eggert  <eggert@twinsun.com>
2382
2383         * stdbool_.h (_Bool): Make it signed char, instead of
2384         an enum type, so that it's guaranteed to promote to int.  See:
2385         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
2386
2387 2003-07-31  Paul Eggert  <eggert@twinsun.com>
2388
2389         * strerror.c: Include config.h, limits.h.  Declare sprintf.
2390         (strerror): Don't assume that a printable int fits in 14 bytes.
2391
2392 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
2393             Bruno Haible  <bruno@clisp.org>
2394
2395         * getline.h (getline, getdelim): Change return type to ssize_t.
2396         * getline.c (getline, getdelim): Likewise.
2397         Remove _GNU_SOURCE define; now it's defined in config.h through
2398         m4/getline.m4.
2399
2400 2003-07-22  Paul Eggert  <eggert@twinsun.com>
2401
2402         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
2403         over-parenthesization in macros.
2404
2405         Sync with coreutils.
2406
2407         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
2408         required by C99.
2409
2410         Use `exit_failure' for xalloc and xmemcoll instead of their own
2411         private exit-failure variables.
2412         * xalloc.h (xalloc_exit_failure): Remove.
2413         * xmalloc.c: Likewise.  Include exitfail.h.
2414         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
2415         * xmemcoll.h (xmemcoll_exit_failure): Remove.
2416         * xmemcoll.c: Likewise.  Include exitfail.h.
2417         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
2418
2419 2003-07-18  Paul Eggert  <eggert@twinsun.com>
2420
2421         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
2422         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
2423         to test that it can stand by itself.  Include "exitfail.h".
2424         Clients should set exit_failure instead.
2425         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
2426
2427 2003-07-18  Andreas Schwab  <schwab@suse.de>
2428
2429         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
2430
2431 2003-07-18  Bruno Haible  <bruno@clisp.org>
2432
2433         * getndelim2.h: New file.
2434         * getndelim2.c: Make into a module of its own. Include config.h,
2435         getndelim2.h.
2436         (getndelim2): Make non-static. Change return type to ssize_t.
2437         * getline.h: Change argument names.
2438         * getline.c: Include getndelim2.h instead of getndelim2.c.
2439         * getnline.c: Include getndelim2.h.
2440
2441 2003-07-17  Bruno Haible  <bruno@clisp.org>
2442
2443         * Makefile.am: Remove file.
2444         * Makefile.in: Remove file.
2445
2446 2003-07-17  Bruno Haible  <bruno@clisp.org>
2447
2448         * getnline.h: New file.
2449         * getnline.c: New file.
2450         * getndelim2.c: New file, extracted from getline.c.
2451         (getndelim2): Renamed from getdelim2, with added nmax argument.
2452         * getline.c: Include getndelim2.c.
2453         (getdelim2): Moved out to getndelim2.c.
2454         (getline, getdelim): Update.
2455
2456 2003-07-15    <karl@gnu.org>
2457
2458         * vasnprintf.c: update from gettext.
2459
2460 2003-07-15  Jim Meyering  <jim@meyering.net>
2461
2462         * makepath.c (make_path): Enclose diagnostic in _(...).
2463
2464 2003-07-14  Paul Eggert  <eggert@twinsun.com>
2465
2466         * asnprintf.c, asprintf.c, config.charset, gettext.h,
2467         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
2468         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
2469         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
2470         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
2471         updated automatically by ../config/srclist-update.  This changes
2472         their license from LPGL to GPL.
2473
2474 2003-07-14  Jim Meyering  <jim@meyering.net>
2475
2476         Don't emit diagnostics.  Let callers do that.
2477         * save-cwd.c: Don't include "error.h".
2478         (save_cwd): Don't call error.  Ensure that errno is valid
2479         when returning nonzero.
2480
2481         * save-cwd.h (restore_cwd): Update prototype.
2482         * save-cwd.c (restore_cwd): Remove two parameters.
2483         Simplify.  Don't call error upon failure.  Let callers do that.
2484         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
2485         when auditing is enabled.  But don't bother updating the #if.
2486
2487 2003-07-14  Simon Josefsson  <jas@extundo.com>
2488
2489         * mempcpy.h: New file.
2490         * mempcpy.c: New file.
2491
2492 2003-07-14  Paul Eggert  <eggert@twinsun.com>
2493
2494         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
2495         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
2496         unicodeio.c, unicodeio.h, unlocked-io.h:
2497         Switch from LGPL to GPL.
2498
2499 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
2500
2501         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
2502         it breaks C++ compilation.
2503         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
2504
2505 2003-07-10  Jim Meyering  <jim@meyering.net>
2506
2507         * vasnprintf.c: Remove trailing blanks.
2508         Make cpp indentation consistent.
2509
2510 2003-07-09  Paul Eggert  <eggert@twinsun.com>
2511
2512         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
2513         posixver.c, strftime.c, strnlen.c, strverscmp.c:
2514         Switch from LGPL to GPL.
2515
2516 2003-07-07  Paul Eggert  <eggert@twinsun.com>
2517
2518         * mktime.c: Fix some boundary cases and remove need for floating point.
2519
2520         Issue a compile-time diagnostic if time_t is floating point, or if
2521         two's complement arithmetic is not in effect, or if arithmetic
2522         right shift does not propagate the sign.  These assumptions were
2523         all in the original code but they weren't checked.
2524
2525         (TIME_T_MIDPOINT, verify): New macros.
2526         (__isleap): Remove; it has integer overflow problems.
2527         (leapyear): New function, without those problems.
2528         (ydhms_tm_diff): Remove; splitting into two parts.
2529         (ydhms_diff): New function, containing the arithmetic part of
2530         the old ydhms_tm_diff function.  Issue a compile-time
2531         diagnostic if we are not using C99 integer division.
2532         Avoid casts when possible.
2533         (guess_time_tm): New function, containing the checking part of
2534         the old ydhms_tm_diff function.  Return the new value, rather than
2535         the difference between it and the old.  Accept a new argument T
2536         so that *T specifies the old value.  Check for overflow in the result.
2537
2538         (__mktime_internal): Use a time_t offset, not a long int offset.
2539         This undoes the 2003-06-04 change, which is no longer needed now
2540         that we have better overflow checking.
2541         (localtime_offset): Likewise.
2542
2543         (__mktime_internal): Avoid harmful overflow on hosts where time_t
2544         and long are 64-bit but int is only 32-bit.
2545         (ydhms_diff): Use long int to store year1 and yday1.
2546         Issue a compile-time diagnostic if long int is not wide enough.
2547
2548         (__mktime_internal): Use long int to store adjusted year and yday.
2549         Use plain C rather than preprocessor commands, if that doesn't
2550         affect efficiency.
2551         Check for overflow (and try to repair) after each probe
2552         rather than checking only at the very end.  This avoids some bugs
2553         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
2554         does not equal GMT offset at maximum time).
2555         Use integer to check for overflow rather than floating point; this
2556         is more portable to non-IEEE hosts, and is a tad faster.
2557         When we detect that we are oscillating between two values,
2558         don't check whether tm_isdst has the requested value, since
2559         we already know the answer.  When tm_isdst has the wrong value,
2560         use a different heuristic to find the right one, based on the
2561         extreme values actually observed in practice in tz2003a,
2562         rather than the (overly optimistic) "previous 3 calendar quarters".
2563
2564         (not_equal_tm, print_tm, check_result): Use "const T" rather than
2565         "T const" to accommodate glibc style.
2566         (check_result): Use less-confusing report format.  "long" -> "long int.
2567         (main): Likewise.
2568         Don't loop if the iteration overflows time_t.
2569         Allow a negative step in the iteration.
2570
2571 2003-07-01  Paul Eggert  <eggert@twinsun.com>
2572
2573         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
2574         having it depend on HAVE_SYS_TYPES_H.
2575
2576 2003-06-25  Bruno Haible  <bruno@clisp.org>
2577
2578         * readlink.c: New file.
2579
2580 2003-06-20  Bruno Haible  <bruno@clisp.org>
2581
2582         Assume C89, so PARAMS isn't needed.
2583         * unicodeio.h (PARAMS): Remove.
2584         * unicodeio.c: Don't use PARAMS.
2585
2586 2003-06-18  Jim Meyering  <jim@meyering.net>
2587
2588         Merge changes from coreutils.
2589         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
2590         Remove explicit declarations of xmalloc and realloc.
2591         Include xalloc.h.
2592         (read_utmp): Remove anachronistic cast of xmalloc.
2593
2594 2003-06-17  Paul Eggert  <eggert@twinsun.com>
2595
2596         Assume C89, so PARAMS isn't needed.
2597         * backupfile.h (PARAMS): Remove.  All uses removed.
2598         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
2599         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
2600         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
2601         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
2602         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
2603         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
2604         xstrtol.h: Likewise.
2605         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
2606         same.h, strverscmp.h: Do not include config.h; no longer needed.
2607         Anyway, config.h should always be included before any other file.
2608
2609 2003-06-11  Simon Josefsson  <jas@extundo.com>
2610
2611         * sysexit_.h: New file.
2612
2613 2003-05-20  Derek Price  <derek@ximbiot.com>
2614
2615         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
2616
2617 2003-06-10  Simon Josefsson  <jas@extundo.com>
2618
2619         * strchrnul.h: New file.
2620         * strchrnul.c: New file.
2621
2622 2003-06-10  Simon Josefsson <jas@extundo.com>
2623
2624         * argp.h: New file, from glibc.
2625         * argp-ba.c: New file, from glibc.
2626         * argp-eexst.c: New file, from glibc.
2627         * argp-fmtstream.c: New file, from glibc.
2628         * argp-fmtstream.h: New file, from glibc.
2629         * argp-fs-xinl.c: New file, from glibc.
2630         * argp-help.c: New file, from glibc.
2631         * argp-namefrob.h: New file, from glibc.
2632         * argp-parse.c: New file, from glibc.
2633         * argp-pv.c: New file, from glibc.
2634         * argp-pvh.c: New file, from glibc.
2635         * argp-xinl.c: New file, from glibc.
2636
2637 2003-06-07  Jim Meyering  <jim@meyering.net>
2638
2639         * readtokens.h: Put `Free Software Foundation, Inc.'
2640         in place of my name in the copyright comment.
2641         Remove definition and uses of __P.
2642
2643         From coreutils.
2644         * stat.c: Don't declare xmalloc explicitly.
2645         Instead, include "xalloc.h".
2646         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
2647         xrealloc, and xcalloc return values.
2648         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
2649         Improve comment.
2650         * xgetcwd.h: Remove definition/uses of PARAMS.
2651
2652 2003-06-06  Jim Meyering  <jim@meyering.net>
2653
2654         * stdbool_.h: Renamed from stdbool.h.in.
2655
2656 2003-06-06  Jim Meyering  <jim@meyering.net>
2657
2658         Merge from coreutils.
2659         * same.c: (same_name): Declare *_basename locals to be `const'.
2660         Consolidate declarations and initializations of *_base* locals.
2661
2662         Merge from coreutils.
2663         This avoids a core dump on systems without GNU putenv,
2664         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
2665         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
2666         (unsetenv): New static function, from GNU libc.
2667         (rpl_putenv): Use it.
2668
2669         * modechange.c: Remove trailing blanks.
2670
2671         Merge from coreutils.
2672         * fsusage.c: Remove declaration of statfs.
2673         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
2674
2675         * posixtm.c: Include <stdbool.h> unconditionally.
2676
2677 2003-06-05  Paul Eggert  <eggert@twinsun.com>
2678
2679         * mktime.c (__mktime_internal): When resolving a tm_isdst
2680         mismatch, look in future quarters as well as past.  This fixes a
2681         bug when processing fall-backwards gaps immediately after a long
2682         period of daylight-saving time.
2683
2684         * mktime.c: Assume freestanding C89 or better.
2685         (HAVE_LIMITS_H): Remove.  Assume it's 1.
2686         (__P): Remove; not used.
2687         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
2688         (mktime, not_equal_tm, print_tm, check_result,
2689         main): Use prototypes.  Use const * where appropriate.
2690         (main): Fix typo in testing code that uncovered by above changes.
2691         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
2692
2693 2003-06-04  Paul Eggert  <eggert@twinsun.com>
2694
2695         * mktime.c: Fix Debian bug 177940
2696         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
2697         (localtime_offset): Now long int, not time_t, because we want it
2698         to be guaranteed to be signed.  All uses changed.
2699         (__mktime_internal): If overflow would occur when adding offset,
2700         don't add it.
2701
2702         Merge 'human' changes from coreutils.  Rewrite to support
2703         locale-specific notations like thousands separators.
2704         * human.c: Simplify authorship notice.
2705         Include human.h immediately after config.h.
2706         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
2707         <limits.h>: Do not include, since human.h does.
2708         (SIZE_MAX, UINTMAX_MAX): New macros.
2709         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
2710         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
2711         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
2712         (power_letter): Renamed from suffixes.
2713         (generate_suffix_backwards): Remove.
2714         (adjust_value): Now takes int style (because of human.h changes)
2715         and long double value (for greater precision on some platforms).
2716         (group_number): New function.
2717         (human_readable): Use it.  Use integer options, not enum.
2718         Put the options before the sizes in the arg list.
2719         Support all the new options.
2720         The old human_readable function has been removed;
2721         use inttostr.h instead.
2722         (human_readable, default_block_size, humblock):
2723         Use uintmax_t, not int, for block sizes.
2724         (human_readable_inexact, block_size_types): Remove.
2725         (block_size_opts): New constant.
2726         (human_options): Renamed from human_block_size, with new signature
2727         that allows block sizes up to UINTMAX_MAX.  All callers changed.
2728         * human.h: Add copyright and authorship notice.
2729         Include <limits.h> and <stdbool.h> unconditionally.
2730         (PARAMS): Remove.  All uses removed.
2731         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
2732         (enum human_inexact_style): Remove tag; now a nameless enum.
2733         (human_floor, human_ceiling, human_round_to_even): Now have
2734         values 2, 0, 1 rather than -1, 1, 0.
2735         (human_group_digits, human_suppress_point_zero, human_autoscale,
2736         human_base_1024, human_SI, human_B): New constants.
2737         (human_readable_inexact, human_block_size): Remove.
2738         (human_readable): Size args are now uintmax_t, not int.
2739         (human_options): New decl.
2740
2741         * exclude.c: (new_exclude, add_exclude): Remove casts that are
2742         unnecessary now that we assume C89 or better.  This change
2743         imported from coreutils.
2744
2745         * mktime.c (__mktime_internal): Do not reject negative timestamps
2746         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
2747         in the 2003-05-30 sync from glibc.
2748
2749         .h files should stand alone, but we shouldn't include <sys/types.h>
2750         if we can get away with just <stddef.h>.
2751
2752         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
2753         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
2754         rather than <sys/types.h>, as we merely need size_t.
2755         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
2756         to get size_t.
2757         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
2758         Include <stdio.h>, to get FILE.
2759         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
2760         memcasecmp.h has included <stddef.h> and all we need is size_t.
2761         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
2762         our interface, instead of including <sys/types.h>
2763
2764 2003-06-02  Paul Eggert  <eggert@twinsun.com>
2765
2766         [from coreutils]
2767         Fix some minor time-related bugs with POSIX time arguments.
2768         Some valid time stamps were being rejected (notably -1, and
2769         time stamps before 1900 on 64-bit hosts).  And some invalid
2770         time stamps were being accepted, e.g. September 31.
2771
2772         * posixtm.h (posixtime): Return bool instead of time_t, so
2773         that we can return (time_t) -1 successfully.
2774         * posixtm.c: Likewise.
2775         [HAVE_STDBOOL_H]: Include <stdbool.h>.
2776         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
2777         (t): Remove static var.
2778         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
2779         of static var.  All uses changed.
2780         (year): Do not reject years before 1900; they can occur with
2781         64-bit time_t.
2782         (posix_time_parse): Do not check for out-of-range components;
2783         that is now the caller's responsibility, since our checks were
2784         only approximations.
2785         (posixtime): Use mktime to check for out-of-range components,
2786         since it knows them exactly.
2787         If mktime returns (time_t) -1, check whether an error actually occurred
2788         by invoking localtime on -1.
2789         (main) [TEST_POSIXTIME]: Check for input data errors, and report
2790         posixtime failures better.
2791         Improve the test data (in comments only).
2792
2793 2003-05-30    <karl@gnu.org>
2794
2795         * mktime.c: update from libc.
2796
2797 2003-05-30  Bruno Haible  <bruno@clisp.org>
2798
2799         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
2800         * localcharset.h: Likewise.
2801         * localcharset.c: Likewise.
2802
2803 2003-05-28  Paul Eggert  <eggert@twinsun.com>
2804
2805         Assume the headers required for C89 freestanding compilers.
2806         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
2807         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
2808         without checking for HAVE_LIMITS_H.
2809         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
2810         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
2811         to do that.
2812         * fatal.c: Include <stdarg.h> without checking for __STDC__.
2813         * exclude.c: Include <stdbool.h> unconditionally.
2814         * tempname.c: Include <stddef.h> unconditionally.
2815         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
2816         * modechange.c, rpmatch.c (NULL): Don't define, since
2817         <stddef.h> does that.
2818         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
2819         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
2820         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
2821         * xstrtol.c: Likewise.
2822         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
2823         * savedir.c: Include <stddef.h> instead of defining NULL.
2824
2825         * addext.c (addext): Use assignment rather than cast, to avoid
2826         warnings on some platforms.
2827
2828         * mktime.c (__mktime_internal): Do not reject negative timestamps
2829         arbitrarily.
2830
2831 2003-05-10  Bruno Haible  <bruno@clisp.org>
2832
2833         * linebreak.c (iconv_string_length): Don't return -1 just because the
2834         string is longer than 4 KB.
2835
2836 2003-05-12  Jim Meyering  <jim@meyering.net>
2837
2838         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
2839         the space-padded-by-default conversion specifiers, %e, %k, %l.
2840
2841 2003-05-03  Bruno Haible  <bruno@clisp.org>
2842
2843         Upgrade to Unicode-4.0.
2844         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
2845         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
2846         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
2847         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
2848         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
2849         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
2850         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
2851         Change width of U+E0100..U+E01EF from 1 to 0.
2852
2853 2003-04-25  Bruno Haible  <bruno@clisp.org>
2854
2855         * copy-file.c: Include <stddef.h>, for size_t.
2856
2857 2003-04-25  Jim Meyering  <jim@meyering.net>
2858
2859         * copy-file.c (copy_file_preserving): Declare buf_size to be
2860         of type size_t, not int.
2861
2862 2003-04-11  Jim Meyering  <jim@meyering.net>
2863
2864         Merge changes from Coreutils.
2865
2866         2003-03-22  Jim Meyering  <jim@meyering.net>
2867
2868         * strftime.c (widen): Cast alloca return value to proper type.
2869
2870         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
2871
2872         From GNU libc.
2873         * strftime.c (my_strftime): Handle very large width
2874         specifications for numeric values correctly.  Improve checks for
2875         overflow.
2876
2877         2003-01-19  Jim Meyering  <jim@meyering.net>
2878
2879         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
2880         (nl_get_alt_digit) [! defined my_strftime]: Define.
2881         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
2882         _nl_get_alt_digit and _nl_get_walt_digit.
2883
2884         * strftime.c (my_strftime): Merge in locale-related changes from libc.
2885         These changes have no effect outside of _LIBC.
2886
2887 2003-04-10  Bruno Haible  <bruno@clisp.org>
2888
2889         * findprog.h: New file, from GNU gettext.
2890         * findprog.c: New file, from GNU gettext.
2891
2892 2003-04-05  Jim Meyering  <jim@meyering.net>
2893
2894         Merge changes from Coreutils.
2895
2896         * exclude.h (PARAMS): Remove definition and uses.
2897         * exclude.c: Remove uses of `PARAMS'.
2898
2899         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
2900         Add test-cases for DOS filenames. Declare program_name.
2901         (main): Set up program_name.  Patch by Rich Dawe.
2902
2903         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2904         error from mntctl.
2905         Use mntctl's return value to drive the entry-processing loop, since
2906         we can't rely on the value of the vmt_length member in the last
2907         entry.  On some systems doing so could result in exhausting
2908         virtual memory.  Based in part on a patch from Mike Jetzer.
2909
2910 2003-04-04  Bruno Haible  <bruno@clisp.org>
2911
2912         * linebreak.h: New file, from GNU gettext.
2913         * linebreak.c: New file, from GNU gettext with slight modifications.
2914         * lbrkprop.h: New file, from GNU gettext.
2915
2916 2003-04-03  Bruno Haible  <bruno@clisp.org>
2917
2918         * utf8-ucs4.h: New file, from GNU gettext.
2919         * utf16-ucs4.h: New file, from GNU gettext.
2920         * ucs4-utf8.h: New file, from GNU gettext.
2921         * ucs4-utf16.h: New file, from GNU gettext.
2922
2923 2003-04-02  Bruno Haible  <bruno@clisp.org>
2924
2925         * binary-io.h: New file, from GNU gettext.
2926
2927 2003-04-01  Bruno Haible  <bruno@clisp.org>
2928
2929         * pathname.h: New file, from GNU gettext.
2930         * concatpath.c: New file, from GNU gettext.
2931
2932 2003-03-30  Bruno Haible  <bruno@clisp.org>
2933
2934         * copy-file.c (copy_file_preserving): Don't set owner if the function
2935         chown() doesn't exist.
2936
2937 2003-03-28  Bruno Haible  <bruno@clisp.org>
2938
2939         * copy-file.h: New file, from GNU gettext.
2940         * copy-file.c: New file, from GNU gettext.
2941
2942 2003-03-18  Jim Meyering  <jim@meyering.net>
2943
2944         * quote.c (quote_n): Fix typo in comment.
2945
2946 2003-03-14  Jim Meyering  <jim@meyering.net>
2947
2948         Merge changes from Coreutils.
2949         * obstack.h (obstack_object_size): Declare temporary, __o,
2950         to be const, in order to avoid warnings.
2951         (obstack_room): Likewise.
2952         (obstack_empty_p): Likewise.
2953
2954 2003-03-13  Paul Eggert  <eggert@twinsun.com>
2955
2956         Merge changes from Bison.
2957         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
2958         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
2959         when compiling Bison 1.875's `bitset bset = obstack_alloc
2960         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
2961         * hash.c: Include <stdbool.h> unconditionally.
2962
2963 2003-03-09  Paul Eggert  <eggert@twinsun.com>
2964
2965         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
2966         Reported by Bruce Becker; see:
2967         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
2968
2969 2003-03-03  Paul Eggert  <eggert@twinsun.com>
2970             Bruno Haible  <bruno@clisp.org>
2971
2972         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
2973         Reported by John Hughes, see
2974         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
2975
2976 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
2977
2978         * poll_.h: New file.
2979         * poll.c: New file.
2980
2981 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
2982
2983         * mathl.h: New file.
2984         * acosl.c: New file.
2985         * asinl.c: New file.
2986         * atanl.c: New file.
2987         * ceill.c: New file.
2988         * cosl.c: New file.
2989         * expl.c: New file.
2990         * floorl.c: New file.
2991         * frexpl.c: New file.
2992         * ldexpl.c: New file.
2993         * logl.c: New file.
2994         * sincosl.c: New file.
2995         * sinl.c: New file.
2996         * sqrtl.c: New file.
2997         * tanl.c: New file.
2998         * trigl.c: New file.
2999         * trigl.h: New file.
3000
3001 2003-02-17  Bruno Haible  <bruno@clisp.org>
3002
3003         * mkdtemp.h: New file, from GNU gettext.
3004         * mkdtemp.c: New file, from GNU gettext.
3005
3006 2003-01-31  Bruno Haible  <bruno@clisp.org>
3007
3008         * rename.c: #undef rename before defining rpl_rename.
3009         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
3010
3011 2003-01-30  Bruno Haible  <bruno@clisp.org>
3012
3013         * printf-args.h: New file, from GNU gettext.
3014         * printf-args.c: New file, from GNU gettext.
3015         * printf-parse.h: New file, from GNU gettext.
3016         * printf-parse.c: New file, from GNU gettext.
3017         * vasnprintf.h: New file, from GNU gettext.
3018         * vasnprintf.c: New file, from GNU gettext.
3019         * asnprintf.c: New file, from GNU gettext.
3020         * vasprintf.h: New file, from GNU gettext with modifications.
3021         * vasprintf.c: New file, from GNU gettext.
3022         * asprintf.c: New file, from GNU gettext.
3023
3024 2003-01-29  Bruno Haible  <bruno@clisp.org>
3025
3026         * stpncpy.h: New file, from GNU gettext with modifications.
3027         * stpncpy.c: New file, from GNU gettext with modifications.
3028
3029 2003-01-28  Bruno Haible  <bruno@clisp.org>
3030
3031         * c-ctype.h: New file, from GNU gettext, with changes suggested by
3032         Paul Eggert.
3033         * c-ctype.c: New file, from GNU gettext, with changes suggested by
3034         Paul Eggert.
3035
3036 2003-01-27  Bruno Haible  <bruno@clisp.org>
3037
3038         * xsetenv.h: New file, from GNU gettext.
3039         * xsetenv.c: New file, from GNU gettext.
3040
3041 2003-01-23  Bruno Haible  <bruno@clisp.org>
3042
3043         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
3044
3045 2003-01-22  Bruno Haible  <bruno@clisp.org>
3046
3047         * exit.h: New file, from GNU gettext.
3048
3049 2003-01-11  Bruno Haible  <bruno@clisp.org>
3050
3051         * stpcpy.h (stpcpy): Use ANSI C function declarations.
3052         * strcase.h (strcasecmp, strncasecmp): Likewise.
3053
3054 2003-01-14  Jim Meyering  <jim@meyering.net>
3055
3056         * same.c (same_name): Tweak a comment.
3057
3058 2003-01-11  Bruno Haible  <bruno@clisp.org>
3059
3060         * same.c (same_name): Reorder tests so as to avoid calling stat()
3061         when a string comparison is sufficient.
3062
3063 2003-01-11  Bruno Haible  <bruno@clisp.org>
3064
3065         * readtokens.c (readtoken): Cast character to 'unsigned char', not
3066         'unsigned int'.
3067
3068 2003-01-11  Bruno Haible  <bruno@clisp.org>
3069
3070         * hash-pjw.c: Add comment about low quality of this function.
3071
3072 2003-01-12  Paul Eggert  <eggert@twinsun.com>
3073
3074         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
3075         to avoid collisions with libcurses and libreadline.
3076
3077         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
3078         * getstr.h, getstr.c: Remove.
3079         * getline.c: Include "getline.h", to check interface.
3080         Move body of old getstr.c here: this defines MIN_CHUNK and
3081         declares getdelim2, which is renamed from getstr.
3082         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
3083
3084         * linebuffer.c (readlinebuffer): Renamed from readline.
3085         All uses changed.
3086         * linebuffer.h: Likewise.
3087         (readline): Remove backward-compatibility macro.
3088
3089 2003-01-12  Jim Meyering  <jim@meyering.net>
3090
3091         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
3092
3093 2003-01-10  Bruno Haible  <bruno@clisp.org>
3094
3095         * alloca_.h: New file.
3096         * getdate.y: Unconditionally include alloca.h.
3097         * makepath.c: Likewise.
3098         * setenv.c: Likewise.
3099         * userspec.c: Likewise.
3100
3101 2003-01-09  Bruno Haible  <bruno@clisp.org>
3102
3103         * stdbool.h.in: New file.
3104
3105 2003-01-08  Bruno Haible  <bruno@clisp.org>
3106
3107         * safe-read.c: Include specification header first, to ensure its
3108         selfcontainedness.
3109         * full-write.c: Likewise.
3110
3111 2003-01-08  Jim Meyering  <jim@meyering.net>
3112
3113         * full-write.c: Undefine and define-away `const' after inclusion
3114         of errno.h, not before.  Suggestion from Bruno Haible.
3115
3116 2003-01-07  Jim Meyering  <jim@meyering.net>
3117
3118         * full-write.c: Rework so that it may serve to define full_read, too.
3119         * full-read.c: Simply #define FULL_READ and include full-write.c.
3120
3121 2003-01-06  Jim Meyering  <jim@meyering.net>
3122
3123         * version-etc.c: Update year in translatable copyright string.
3124
3125 2002-12-25  Bruno Haible  <bruno@clisp.org>
3126
3127         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
3128         * xstrtol.h: Likewise.
3129         * xstrtoimax.c: Likewise.
3130         * xstrtoumax.c: Likewise.
3131         * human.h: Likewise.
3132
3133         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
3134         on systems that have <inttypes.h> but not <stdint.h>.
3135
3136 2002-12-31  Paul Eggert  <eggert@twinsun.com>
3137
3138         * memcoll.c (memcoll): Fall back on a simple algorithm using
3139         memcmp if strcoll doesn't work.
3140
3141 2002-12-23  Bruno Haible  <bruno@clisp.org>
3142
3143         * localcharset.h: New file.
3144         * localcharset.c: Include it.
3145         * unicodeio.c: Likewise.
3146
3147 2002-12-22  Bruno Haible  <bruno@clisp.org>
3148
3149         * utime.c (utime_null): No need to call ftruncate if the file was
3150         nonempty.
3151
3152 2002-12-23  Bruno Haible  <bruno@clisp.org>
3153
3154         * memcoll.c (STRCOLL): New macro.
3155         (memcoll): Use it.
3156
3157 2002-12-22  Bruno Haible  <bruno@clisp.org>
3158
3159         * getstr.h (getstr): Define, to avoid clash with libcurses.
3160         * linebuffer.h (readline): Define, to avoid clash with libreadline.
3161
3162 2002-12-22  Bruno Haible  <bruno@clisp.org>
3163
3164         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
3165
3166 2002-12-23  Bruno Haible  <bruno@clisp.org>
3167
3168         * getline.h: Include <stddef.h>, for size_t.
3169
3170         * unicodeio.h: Include <stddef.h>, for size_t.
3171         * unicodeio.c: Don't include <stddef.h>.
3172
3173 2002-12-17  Bruno Haible  <bruno@clisp.org>
3174
3175         * canon-host.c (strdup): Remove unused declaration.
3176
3177         * fsusage.c: Include full_read.h.
3178         (get_fs_usage): Use full_read instead of safe_read.
3179
3180         * utime.c (utime_null): Use SAFE_READ_ERROR.
3181
3182 2002-12-11  Bruno Haible  <bruno@clisp.org>
3183
3184         * setenv.h: Rewritten to cope with systems that have setenv() but not
3185         unsetenv().
3186         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
3187         modifications:
3188
3189         2002-12-11  Bruno Haible  <bruno@clisp.org>
3190
3191                 * setenv.c (alloca): Fall back to malloc.
3192                 (freea): New macro.
3193                 (setenv): Use freea() to free memory allocated with alloca().
3194
3195         2002-11-13  Bruno Haible  <bruno@clisp.org>
3196
3197                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
3198                 function declarations.
3199                 * unsetenv.c (unsetenv): Likewise.
3200
3201         2002-03-04  Bruno Haible  <bruno@clisp.org>
3202
3203                 Portability to AIX 4.3.3.
3204                 * unsetenv.c: New file, extracted from setenv.c.
3205                 * setenv.c: Move the unsetenv() function to unsetenv.c.
3206
3207         2001-12-20  Bruno Haible  <bruno@clisp.org>
3208
3209                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
3210                 use malloc instead. For SunOS 4.
3211
3212         2001-12-11  Bruno Haible  <bruno@clisp.org>
3213
3214                 * setenv.c: Declare alloca.
3215                 (compar_fn_t): New typedef.
3216                 (KNOWN_VALUE, STORE_VALUE): Use it.
3217
3218         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
3219         setenv.h.
3220
3221 2002-12-10  Paul Eggert  <eggert@twinsun.com>
3222
3223         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
3224         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
3225         Choose values that are less likely to collide with system fnmatch
3226         options.
3227         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
3228         defined (e.g., a pure POSIX system).
3229         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
3230         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
3231
3232 2002-12-06  Jim Meyering  <jim@meyering.net>
3233
3234         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
3235
3236         Merge in changes from libc's misc/error.c, in preparation
3237         for the merge of gnulib's changes back into libc.
3238
3239         * error.c (_): Define only if not already defined.
3240         Move definition to follow all #include directives.
3241         Include unlocked-io.h only if !_LIBC.
3242         [_LIBC]: Include <libio/libioP.h>.
3243         [USE_IN_LIBIO]: Include <libio/iolibio.h>
3244         (fflush): Tweak definition to use INTUSE.
3245         (putc): Define.
3246
3247 2002-12-05  Paul Eggert  <eggert@twinsun.com>
3248
3249         * alloca.c [defined emacs]: Include "lisp.h".
3250         (xalloc_die) [defined emacs]: New macro.
3251         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
3252         [! defined emacs]: Include <xalloc.h>.
3253         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
3254         (pointer): Typedef to POINTER_TYPE *.
3255         (malloc): Remove decl; we now always use xmalloc.
3256         (alloca): Use old-style definition, since Emacs needs this.
3257         Check for arithmetic overflow when computing combined size.
3258
3259 2002-12-04  Paul Eggert  <eggert@twinsun.com>
3260
3261         Do not generate unlocked-io.h automatically, since it's easier to
3262         maintain it by hand.
3263
3264         * unlocked-io.h: New file, from GNU diffutils,
3265         but with proper copyright notice and attribution.
3266         * gen-uio: Remove.
3267         * Makefile.am: Add copyright notice.
3268         (libfetish_a_SOURCES): Add unlocked-io.h.
3269         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
3270         (DISTCLEANFILES, io_functions): Remove macros.
3271         (EXTRA_DIST): Remove gen_uio.
3272         (unlocked-io.h): Remove rule.
3273
3274 2002-12-04  Jim Meyering  <jim@meyering.net>
3275
3276         Reflect the fact that stat.c and lstat.c are no longer generated.
3277         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
3278         (DISTCLEANFILES): Likewise.
3279         (EXTRA_DIST): Likewise.
3280         (all_local): Don't depend on stat.c or lstat.c.
3281         (stat.c, lstat.c): Remove rules.
3282         (EXTRA_DIST): Remove xstat.in.
3283
3284         * xstat.in: Remove file.  Contents moved into stat.c.
3285         * stat.c: New file.  Contents mostly from xstat.in.
3286         * stat.c: Rework so that it may serve to define rpl_lstat, too.
3287         * lstat.c: New file. Simply #define LSTAT and include stat.c.
3288
3289         * safe-read.c: Rework so that it may serve to define safe_write, too.
3290         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
3291
3292 2002-12-03  Jim Meyering  <jim@meyering.net>
3293
3294         * safe-read.c, safe-write.c: Change variable names and comments, but
3295         not semantics, to minimize the differences between these two files.
3296         (safe_read): Change comment to mention SAFE_READ_ERROR.
3297
3298         * safe-read.c (IS_EINTR): Define.
3299         (safe_read): Use IS_EINTR in place of in-function cpp directives.
3300
3301 2002-12-02  Bruno Haible  <bruno@clisp.org>
3302
3303         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
3304         Define, taken from safe-read.c.
3305         (INT_MAX): Provide fallback.
3306         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
3307         * safe-write.h (SAFE_WRITE_ERROR): Define.
3308
3309         * safe-read.c (EINTR): Remove definition.
3310         (safe_read): Don't use EINTR if it is absent.
3311
3312 2002-12-02  Jim Meyering  <jim@meyering.net>
3313
3314         * safe-read.c (EINTR): Define.
3315         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
3316         (INT_MAX): Provide fallback.
3317         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
3318
3319         * safe-read.h (SAFE_READ_ERROR): Define.
3320
3321 2002-12-01  Jim Meyering  <jim@meyering.net>
3322
3323         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
3324         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
3325
3326 2002-11-27  Paul Eggert  <eggert@twinsun.com>
3327
3328         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
3329         hash_rehash): Replace `if (limit <= value) abort ();' with
3330         `if (! (value < limit)) abort ();', for readability.
3331
3332 2002-11-26    <karl@gnu.org>
3333
3334         * strdup.c: copy from libc again, with jim's ok.
3335         * .cppi-disable: re-add strdup.c
3336
3337 2002-11-25    <karl@gnu.org>
3338
3339         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
3340         instead of "strtol.c".
3341
3342 2002-11-25  Jim Meyering  <jim@meyering.net>
3343
3344         * mktime.c: Sync from libc, now that it has the latest fix.
3345
3346 2002-11-24    <karl@gnu.org>
3347
3348         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
3349         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
3350
3351 2002-11-24  Jim Meyering  <jim@meyering.net>
3352
3353         Update from coreutils:
3354
3355         * mktime.c: Merge in changes from libc.
3356
3357         Avoid a link-time failure on some Linux systems.
3358         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
3359         (__mon_yday): Declare with the STATIC attribute.
3360         (__mktime_internal): Likewise.
3361         Based on a report from Greg Schafer.
3362
3363 2002-11-23  Jim Meyering  <jim@meyering.net>
3364
3365         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
3366         Use `unsigned', not `int', as type of index.
3367
3368         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
3369
3370         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
3371
3372 2002-11-22  Paul Eggert  <eggert@twinsun.com>
3373
3374         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
3375         hint that one should use `if (! x) abort ();' rather than `assert
3376         (x);', and anyway it's one less thing to worry about configuring.
3377         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
3378         hash_rehash, hash_insert): Use abort rather than assert.
3379
3380 2002-11-22  Paul Eggert  <eggert@twinsun.com>
3381
3382         * quotearg.h: Allow multiple inclusion by surrounding with
3383         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
3384         so that we can be included first.
3385         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
3386         * quotearg.c: Include quotearg.h immediately after config.h.
3387         No need to include stddef.h or sys/types.h any more.
3388         Surround local include files with "", not "<>".
3389         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
3390         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
3391         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
3392         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
3393         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
3394         (ISPRINT): Remove; no longer needed now that we assume C89.
3395
3396         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
3397         Preserve errno.
3398
3399         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
3400         quotearg_char): Use SIZE_MAX rather than
3401         (size_t) -1 when we are talking about "infinity".
3402
3403         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
3404
3405 2002-11-22  Bruno Haible  <bruno@clisp.org>
3406
3407         * safe-read.h: Assume C89. Add comments.
3408         (safe_read): Change return type to size_t.
3409         * safe-read.c (safe_read): Change return type to size_t. Handle byte
3410         counts > SSIZE_MAX correctly.
3411         * safe-write.h: New file.
3412         * safe-write.c: New file.
3413         * full-read.h: New file.
3414         * full-read.c: New file.
3415         * full-write.h: Assume C89. Add comments.
3416         * full-write.c: Include safe-write.h.
3417         (full_write): Rewritten to use safe_write.
3418         Suggested by Jim Meyering and Paul Eggert.
3419
3420 2002-11-21  Bruno Haible  <bruno@clisp.org>
3421
3422         Remove case insensitive option matching.
3423         * argmatch.h (argcasematch): Remove declaration.
3424         (ARGCASEMATCH): Remove macro.
3425         (__xargmatch_internal): Remove case_sensitive argument.
3426         (XARGMATCH): Update.
3427         (XARGCASEMATCH): Remove macro.
3428         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
3429         case_sensitive argument.
3430         (argcasematch): Remove function.
3431         (__xargmatch_internal): Remove case_sensitive argument.
3432         (main): Use XARGMATCH instead of XARGCASEMATCH.
3433
3434         * xmalloc.c: Change compile-time error message. Add comment about
3435         required autoconf version.
3436
3437 2002-11-21  Jim Meyering  <jim@meyering.net>
3438
3439         * strdup.c (strdup): Tweak comment and initial #if/#include.
3440
3441         Merge in changes from the coreutils.
3442
3443         2002-09-25  Paul Eggert  <eggert@twinsun.com>
3444         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
3445         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
3446         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
3447         int.  Work more efficiently if X is the same width as uintmax_t.
3448         Do not compare X to -1, to avoid bogus compiler warning.
3449         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
3450         Don't assume that f_frsize and f_bsize are the same type.
3451
3452         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
3453         on FreeBSD.
3454
3455         * makepath.c (make_path): Restore umask *before* creating the final
3456         component.
3457         (make_path): Minor reformatting.
3458
3459         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
3460         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
3461
3462         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
3463         ones.  At least on GNU/Linux systems, `auto' means something else.
3464         From Michael Stone.
3465
3466 2002-11-20  Paul Eggert  <eggert@twinsun.com>
3467
3468         Merge argmatch cleanups from Bison.  Assume C89.
3469
3470         * argmatch.c: Include config.h here, not in argmatch.h.
3471         Include stdlib.h, for EXIT_FAILURE.
3472         Always include <string.h>, since we assume C89.
3473         (EXIT_FAILURE): Remove pre-C89 bug workaround.
3474         * argmatch.h: Do not include <config.h> or <sys/types.h>.
3475         Include <stddef.h> instead, since it's all we need for size_t.
3476         (PARAMS): Remove.  All uses removed.
3477         (ARRAY_CARDINALITY): Do not bother to #undef.
3478         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
3479         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3480         Remove unnecessary parentheses.
3481         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3482         Insert necessary parentheses.
3483         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
3484         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
3485
3486 2002-11-19  Bruno Haible  <bruno@clisp.org>
3487
3488         * mbswidth.c: Include mbswidth.h right at the beginning.
3489         * mbswidth.h: Include <stddef.h>, for size_t.
3490
3491         * mbswidth.h (PARAMS): Remove macro.
3492         (mbswidth, mbsnwidth): Use ANSI C function declarations.
3493         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
3494
3495         * gcd.h (PARAMS): Remove macro.
3496         (gcd): Use ANSI C function declarations.
3497         * gcd.c (gcd): Likewise.
3498
3499 2002-11-15  Bruno Haible  <bruno@clisp.org>
3500
3501         * strcspn.c: Include <stddef.h>.
3502         (strcspn): Use ANSI C function declaration. Change return type to
3503         size_t. Use NULL.
3504         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
3505         (strpbrk): Use NULL.
3506         * strpbrk.h (PARAMS): Remove macro.
3507         (strpbrk): Use ANSI C function declaration.
3508         * strstr.c: Don't include <sys/types.h>.
3509         * strstr.h (PARAMS): Remove macro.
3510         (strstr): Use ANSI C function declarations.
3511
3512 2002-11-06  Bruno Haible  <bruno@clisp.org>
3513
3514         * gcd.h (gcd): Change argument type to 'unsigned long'.
3515         * gcd.c (gcd): Likewise.
3516
3517 2002-11-05  Bruno Haible  <bruno@clisp.org>
3518
3519         * gcd.h: New file, from gettext-0.11.5.
3520         * gcd.c: New file, from gettext-0.11.5.
3521
3522 2002-11-05  Bruno Haible  <bruno@clisp.org>
3523
3524         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3525         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3526         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3527         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3528
3529         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3530         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3531
3532         * closeout.c: Include gettext.h instead of <libintl.h>.
3533         * human.c: Include gettext.h instead of <libintl.h>.
3534         * quotearg.c: Include gettext.h instead of <libintl.h>.
3535         * rpmatch.c: Include gettext.h instead of <libintl.h>.
3536         * unicodeio.c: Include gettext.h instead of <libintl.h>.
3537         * userspec.c: Include gettext.h instead of <libintl.h>.
3538         * version-etc.c: Include gettext.h instead of <libintl.h>.
3539         * xmalloc.c: Include gettext.h instead of <libintl.h>.
3540         (textdomain): Remove definition.
3541         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
3542
3543         * long-options.c: Remove include of <libintl.h> and definition of _.
3544         * same.c: Remove include of <libintl.h> and definition of _.
3545
3546 2002-11-04  Bruno Haible  <bruno@clisp.org>
3547
3548         * stpcpy.h: New file, from GNU gettext-0.11.5.
3549         * strcase.h: New file, from GNU gettext-0.11.5.
3550         * strpbrk.h: New file, from GNU gettext-0.11.5.
3551         * strstr.h: New file, from GNU gettext-0.11.5.
3552         * xgetcwd.h: New file, from GNU gettext-0.11.5.
3553
3554 2002-05-09  Bruno Haible  <bruno@clisp.org>
3555
3556         * config.charset: Update for newest glibc. Add canonical names
3557         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
3558
3559 2002-05-09  Bruno Haible  <bruno@clisp.org>
3560
3561         * localcharset.c (get_charset_aliases): Add more Windows specific
3562         aliases.
3563
3564 2002-05-08  Owen Taylor  <otaylor@redhat.com>
3565
3566         * config.charset: A few additions for Solaris.
3567
3568 2001-12-05  Bruno Haible  <bruno@clisp.org>
3569
3570         * localcharset.c (locale_charset): Don't return an empty string.
3571
3572 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
3573
3574         * config.charset: msdos in uk_UA uses CP1125.
3575
3576 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
3577
3578         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
3579         * localcharset.c (locale_charset): Declare as extern "C".
3580
3581 2002-02-15  Bruno Haible  <bruno@clisp.org>
3582
3583         * config.charset [msdosdjgpp]: For Russian, use CP866.
3584
3585 2002-02-11  Bruno Haible  <bruno@clisp.org>
3586
3587         * config.charset: Add support for NetBSD.
3588
3589 2002-09-25    <karl@gnu.org>
3590
3591         * strdup.c: copy from libc/string (via ../config/srclist*).
3592         * getopt*: copy from libc/posix.
3593         * gettext.h: copy from gettext.
3594         * .cppi-disable: add strdup.c, gettext.h.
3595
3596 2002-07-01  Jim Meyering  <meyering@lucent.com>
3597
3598         * c-stack.c: Include sys/time.h.
3599         From Volker Borchert.
3600
3601 2002-06-11  Paul Eggert  <eggert@twinsun.com>
3602
3603         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
3604         New macro.  Use it uniformly instead of
3605         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
3606         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
3607         reported by Vin Shelton.
3608
3609 2002-06-22  Jim Meyering  <meyering@lucent.com>
3610
3611         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
3612         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
3613
3614 2002-06-22  Paul Eggert  <eggert@twinsun.com>
3615
3616         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
3617         Do not assume SA_SIGINFO behavior.
3618         Bug reported by Jim Meyering on NetBSD 1.5.2.
3619
3620 2002-06-22  Jim Meyering  <meyering@lucent.com>
3621
3622         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
3623
3624         * exitfail.c, exitfail.h: Likewise.
3625         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
3626
3627         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
3628         of fnmatch.h.
3629         (EXTRA_DIST): Add fnmatch_loop.c.
3630         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
3631
3632         * fnmatch_loop.c: New file, from diffutils-2.8.2.
3633         * fnmatch.c: Update from diffutils-2.8.2.
3634         * fnmatch_.h: New file.  From diffutils-2.8.2.
3635         * fnmatch.h: Remove file.
3636
3637 2002-06-18  Paul Eggert  <eggert@twinsun.com>
3638
3639         * file-type.h: Report an error if neither S_ISREG nor
3640         S_IFREG is defined, instead of using a test specific to glibc
3641         2.2.  This should be safe, since POSIX requires S_ISREG and
3642         Unix Version 7 had S_IFREG.  We don't need to check for
3643         <sys/types.h> since we don't use any symbols that it defines.
3644
3645 2002-06-15  Jim Meyering  <meyering@lucent.com>
3646
3647         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
3648         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
3649         have been included before this file.
3650
3651 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
3652
3653         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
3654         so that each temporary file name is unique and valid in the first
3655         8 characters, for operation under DOS.
3656
3657 2002-06-15  Jim Meyering  <meyering@lucent.com>
3658
3659         Work even with DJGPP 2.03, which lacks support for symlinks.
3660         From Richard Dawe.
3661         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
3662         is defined.
3663         * lchown.c (S_ISLNK): Likewise.
3664
3665 2002-06-14  Jim Meyering  <meyering@lucent.com>
3666
3667         * file-type.h: Use the version from diffutils-2.8.2.
3668         * file-type.c: Likewise.
3669
3670 2002-05-27  Jim Meyering  <meyering@lucent.com>
3671
3672         Fix a problem seen only on nonconforming systems whereby ls.c's
3673         use of localtime, and then of gettimeofday would cause trouble:
3674         the localtime call used to initialize rpl_gettimeofday's save
3675         mechanism would clobber ls's current local time information so
3676         that in any long listing the first file would always be listed
3677         with date 1970-01-01.  Analysis by Volker Borchert.
3678
3679         * gettimeofday.c (localtime): Undefine.
3680         (rpl_localtime): New function.
3681
3682 2002-05-22  Jim Meyering  <meyering@lucent.com>
3683
3684         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
3685         * file-type.h: New file.
3686         * file-type.c (file_type): New file/function.  Extracted from diffutils.
3687
3688 2002-04-29  Paul Eggert  <eggert@twinsun.com>
3689
3690         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
3691
3692 2002-04-28  Paul Eggert  <eggert@twinsun.com>
3693
3694         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
3695         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
3696         of 127, since 64 is the largest conceivable number for ancient
3697         nonstandard hosts.
3698         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
3699
3700 2002-04-28  Jim Meyering  <meyering@lucent.com>
3701
3702         * sig2str.c (WTERMSIG): Remove definition (unused).
3703
3704 2002-04-28  Paul Eggert  <eggert@twinsun.com>
3705
3706         * sig2str.h, sig2str.c: New files.
3707         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
3708
3709 2002-04-24  Jim Meyering  <meyering@lucent.com>
3710
3711         * gettext.h: New file, from Gettext.
3712         * Makefile.am (INCLUDES): Remove -I../intl.
3713         (libfetish_a_SOURCES): Add gettext.h.
3714
3715 2002-04-16  Jim Meyering  <meyering@lucent.com>
3716
3717         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
3718         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
3719         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
3720
3721 2002-04-12  Jim Meyering  <meyering@lucent.com>
3722
3723         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
3724
3725 2002-03-10  Jim Meyering  <meyering@lucent.com>
3726
3727         * makepath.c (make_path): Remove a comma from a diagnostic.
3728         Suggestion from Santiago Vila.
3729
3730 2002-03-08  Jim Meyering  <meyering@lucent.com>
3731
3732         * rename.c: Mention that this wrapper is needed also on
3733         mips-dec-ultrix4.4 systems.
3734
3735 2002-03-02  Jim Meyering  <meyering@lucent.com>
3736
3737         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
3738         not HAVE_CLOCK_SETTIME.
3739
3740 2002-02-27  Paul Eggert  <eggert@twinsun.com>
3741
3742         * nanosleep.h: Rename to....
3743         * timespec.h: New name for nanosleep.h.  All uses changed.
3744
3745         * gettime.c: New file.
3746         * settime.c: New file.
3747         * stime.c: Remove.
3748
3749         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
3750         timespec.h.  Remove nanosleep.h.
3751
3752 2002-02-25  Paul Eggert  <eggert@twinsun.com>
3753
3754         * acl.c, acl.h: New files.
3755         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
3756
3757 2002-02-24  Jim Meyering  <meyering@lucent.com>
3758
3759         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
3760         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
3761         cause trouble.  Reported by Nelson Beebe.
3762
3763 2002-02-23  Paul Eggert  <eggert@twinsun.com>
3764
3765         * path-concat.c (xpath_concat): Reorder code to pacify
3766         compilers that don't know that xalloc_die never returns.
3767
3768 2002-02-20  Jim Meyering  <meyering@lucent.com>
3769
3770         * getdate.c: Regenerate using bison-1.33.
3771
3772 2002-02-15  Paul Eggert  <eggert@twinsun.com>
3773
3774         * posixver.c, posixver.h: New files.
3775         * Makefile.am (libfetish_a_SOURCES): Add them.
3776
3777 2002-02-02  Paul Eggert  <eggert@twinsun.com>
3778             Bruno Haible  <bruno@clisp.org>
3779
3780         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
3781         (fwrite_success_callback): New declaration.
3782         * unicodeio.c (unicode_to_mb): New function, extracted from
3783         print_unicode_char. Call failure callback instead of error.
3784         (fwrite_success_callback): New function.
3785         (exit_failure_callback): New function.
3786         (fallback_failure_callback): New function.
3787         (print_unicode_char): Call unicode_to_mb.
3788
3789 2002-01-26  Jim Meyering  <meyering@lucent.com>
3790
3791         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
3792
3793 2002-01-22  Jim Meyering  <meyering@lucent.com>
3794
3795         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
3796         Otherwise, some versions of automake would omit the rule that makes
3797         Makefile from Makefile.in.
3798
3799 2001-01-21  Paul Eggert  <eggert@twinsun.com>
3800
3801         * xmemcoll.h, xmemcoll.c: New files.
3802         * Makefile.am (libfetish_a_SOURCES): Add them.
3803         * memcoll.c: Include errno.h, and declare errno if not defined.
3804         (memcoll): Set errno to zero if there is no error.
3805
3806         * quotearg.c (quotearg_buffer_restyled):
3807         Fix bug with quoting buffers containing NUL when backslashing escapes.
3808         This bug was exposed by the other changes in this patch.
3809         (quotearg_n_options): New arg ARGSIZE.
3810         All callers changed.
3811         (quoting_options_from_style): New function.
3812         (quotearg_n_style): Use it.
3813         (quotearg_n_style_mem): New function.
3814
3815         * quotearg.h (quotearg_n_style_mem): New function.
3816
3817 2002-01-16  Jim Meyering  <meyering@lucent.com>
3818
3819         * getdate.y: Add three semicolons, each just before a closing brace.
3820         Bison (as of version 1.31) no longer papers over that mistake.
3821
3822 2002-02-14  Paul Eggert  <eggert@twinsun.com>
3823
3824         * backupfile.c (ISDIGIT): Comment fix.
3825         * getdate.y (ISDIGIT): Likewise.
3826         * posixtm.c (ISDIGIT, year): Likewise.
3827         * strverscmp.c (ISDIGIT): Likewise.
3828         * userspec.c (ISDIGIT): Likewise.
3829
3830 2002-01-05  Jim Meyering  <meyering@lucent.com>
3831
3832         * version-etc.c (version_etc_copyright): Update copyright year.
3833
3834 2001-01-19  Paul Eggert  <eggert@twinsun.com>
3835
3836         * closeout.c (close_stdout_status): If ferror (stdout), do
3837         not silently exit merely because the output buffer happens to
3838         have nothing pending.
3839
3840 2001-12-18  Paul Eggert  <eggert@twinsun.com>
3841
3842         See the big note in ../ChangeLog.
3843         * human.c (suffixes): Prefer K to k for 1024.
3844         (generate_suffix_backwards): New function.
3845         (human_readable_inexact): Use it.
3846         * xstrtol.c (__xstrtol): If there is no number but there
3847         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
3848         Accept 'K' as well as 'k'.
3849
3850 2001-12-15  Jim Meyering  <meyering@lucent.com>
3851
3852         * regex.h (__restrict_arr): Update from libc.
3853
3854         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
3855         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
3856         (STREQ): Define.
3857
3858 2001-12-10  Jim Meyering  <meyering@lucent.com>
3859
3860         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
3861         Instead, include "xalloc.h".
3862         (initbuffer): Don't cast xmalloc return value to char*.
3863         (readline): Reword comment.
3864         Don't cast xrealloc return value to char*
3865         Return NULL, not 0.
3866
3867 2001-12-09  Jim Meyering  <meyering@lucent.com>
3868
3869         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
3870         `signed and unsigned type in conditional expression'.
3871         * posixtm.c (posix_time_parse): Likewise.
3872
3873         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
3874
3875         * readtokens.c (readtoken): Declare an index to be of type unsigned
3876         to avoid a pedantic warning.
3877
3878         * getstr.c: Don't include assert.h.
3879         (getstr): Remove warning-evoking assertions.
3880         Return -1 if offset parameter is out of bounds.
3881         Change the type of a local from int to size_t.
3882
3883         * strftime.c (my_strftime_localtime_r): Include this function
3884         definition in the `#if ! HAVE_TM_GMTOFF' block.
3885
3886         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
3887         Include xalloc.h instead.
3888
3889 2001-12-02  Jim Meyering  <meyering@lucent.com>
3890
3891         * tempname.c: Don't declare getenv, thus reverting the change of
3892         2001-11-18.  It's no longer necessary, now that stdlib.h is always
3893         included.
3894
3895         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
3896         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
3897
3898 2001-11-30  Akim Demaille  <akim@epita.fr>
3899
3900         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
3901         before being defined.
3902
3903 2001-11-27  Paul Eggert  <eggert@twinsun.com>
3904
3905         * quotearg.h (quotearg_n, quotearg_n_style):
3906         First arg is int, not unsigned.
3907         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
3908         (SIZE_MAX, UINT_MAX): New macros.
3909         (quotearg_n_options): Abort if N is negative.
3910         Avoid overflow check on hosts where size_t is 64 bits and int
3911         is 32 bits, as overflow is impossible there.
3912         Fix off-by-one typo that caused unnecessary reallocation.
3913
3914 2001-11-27  Jim Meyering  <meyering@lucent.com>
3915
3916         * tempname.c: Merge with version from libc.
3917         * regex.c: Likewise.
3918
3919         * tempname.c: Include stdlib.h unconditionally.  On some old systems
3920         for which STDC_HEADERS is 0, it was not included, resulting in a
3921         warning about an integer-to-pointer conversion problem with getenv.
3922         Reported by Volker Borchert.
3923
3924 2001-11-26  Jim Meyering  <meyering@lucent.com>
3925
3926         * gtod.h: Remove file.
3927         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
3928         * gettimeofday.c: Don't include gtod.h.
3929         (GTOD_init): Remove function.
3930         (rpl_gettimeofday): Do its job here instead, rather than aborting.
3931         Suggestion from Volker Borchert.
3932
3933 2001-11-23  Jim Meyering  <meyering@lucent.com>
3934
3935         * hash.h (struct hash_table): Don't define here.  Merely declare it.
3936         * hash.c (struct hash_table): Define it here instead.
3937
3938 2001-11-22  Jim Meyering  <meyering@lucent.com>
3939
3940         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
3941
3942 2001-11-18  Paul Eggert  <eggert@twinsun.com>
3943
3944         * tempname.c (TMP_MAX): Remove; no longer needed.
3945         (TEMPORARIES): New macro.
3946         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
3947         removes an artificial limitation (e.g. HP-UX 10.20, where
3948         TMP_MAX is 17576).
3949
3950 2001-11-18  Jim Meyering  <meyering@lucent.com>
3951
3952         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
3953         on SunOS 4.
3954
3955         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
3956         files will be created before anything else.
3957
3958 2001-11-17  Jim Meyering  <meyering@lucent.com>
3959
3960         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
3961         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
3962         rather than group writable.  Patch by Juan F. Codagnone.
3963
3964         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
3965         Instead, include "xalloc.h".
3966
3967         * mountlist.c: Include unlocked-io.h after all system headers.
3968         Remove explicit declarations of xmalloc, xrealloc,
3969         and xstrdup.  Instead, include "xalloc.h".
3970
3971         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
3972         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
3973         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
3974
3975         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
3976         Reported by Padraig Brady.
3977
3978         * mkstemp.c: #undef mkstemp.
3979         Include config.h.
3980         (rpl_mkstemp): Rename from mkstemp.
3981         Protoize.
3982
3983 2001-11-16  Jim Meyering  <meyering@lucent.com>
3984
3985         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
3986         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
3987         determine the amount of total physical memory, use pstat_getstatic.
3988         HPUX-11 doesn't define _SC_PHYS_PAGES.
3989         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
3990         If sysconf couldn't be used to determine the amount of available
3991         physical memory, use both pstat_getstatic and pstat_getdynamic.
3992         Based on a patch from Bob Proulx.
3993
3994 2001-11-05  Jim Meyering  <meyering@lucent.com>
3995
3996         * xstat.in (slash_aware_lstat): Correct a misleading comment.
3997
3998 2001-11-03  Jim Meyering  <meyering@lucent.com>
3999
4000         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
4001         in argmatch_to_argument call.
4002
4003         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
4004         argument.
4005
4006         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
4007         e.g., a fault due to an attempt to free a NULL pointer.
4008
4009 2001-11-01  Jim Meyering  <meyering@lucent.com>
4010
4011         * dirfd.c, dirfd.h: New files.
4012         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
4013
4014         * hash.c (hash_print) [TESTING]: Clean up.
4015
4016 2001-10-22  Paul Eggert  <eggert@twinsun.com>
4017
4018         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
4019         to avoid a warning if -Wall.
4020
4021 2001-10-21  Paul Eggert  <eggert@twinsun.com>
4022
4023         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
4024
4025 2001-10-21  Jim Meyering  <meyering@lucent.com>
4026
4027         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
4028         this code would end up calling gettext even in packages built
4029         with --disable-nls.
4030         * getopt.c (_): Likewise.
4031         * regex.c (_): Likewise.
4032
4033 2001-10-20  Paul Eggert  <eggert@twinsun.com>
4034
4035         * error.c (strerror_r): Do not declare unless !_LIBC.
4036         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
4037         Use strerror_r that is only a macro, even if it is not a function.
4038         (strerror): Check for HAVE_DECL_STRERROR before declaring.
4039         (private_strerror): Use prototypes, not old-style function definition.
4040         (print_errno_message): New function.
4041         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
4042         char*-flavored one.
4043         (error_tail, error, error_at_line): Use it.
4044
4045 2001-10-11  Jim Meyering  <meyering@lucent.com>
4046
4047         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
4048         and quote_n (1, ... to avoid clobbering a buffer.
4049
4050 2001-10-05  Jim Meyering  <meyering@lucent.com>
4051
4052         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
4053         * hash-pjw.c: New file (factored out of fileutils' remove.c).
4054         * hash-pjw.h: New file.
4055
4056 2001-09-30  Jim Meyering  <meyering@lucent.com>
4057
4058         * mountlist.c [MOUNTED_GETFSSTAT]:
4059         Include <sys/ucred.h>, for Apple Darwin.
4060         Include sys/mount.h and sys/fs_types.h only if available.
4061         (FS_TYPE): Define.
4062         (read_filesystem_list): Use FS_TYPE.
4063
4064 2001-09-29  Paul Eggert  <eggert@twinsun.com>
4065
4066         * exclude.c (excluded_filename): 0 -> false, since it's
4067         a boolean context.
4068
4069 2001-09-28  Paul Eggert  <eggert@twinsun.com>
4070
4071         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
4072         #defines strtoimax.  Also treat the other strto* functions
4073         like strtoimax.
4074
4075         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
4076         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
4077         (strtoimax, strtoumax): Do not declare if already defined as a macro.
4078
4079 2001-09-26  Jim Meyering  <meyering@lucent.com>
4080
4081         Most macros in unlocked-io.h had the wrong number of arguments.
4082         * gen-uio: New script.
4083         (USE_UNLOCKED_IO): Define to 1 if not already defined.
4084         * unlocked-io.hin: Remove file.
4085         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
4086         rather than trying to embed it here.
4087         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
4088         Reported by Padraig Brady.
4089
4090 2001-09-25  Volker Borchert  <bt@teknon.de>
4091
4092         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
4093
4094 2001-09-23  Jim Meyering  <meyering@lucent.com>
4095
4096         * mountlist.c: Remove useless parentheses in #if directives.
4097         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
4098         the deprecated MOUNTED symbol is no longer defined in mntent.h.
4099
4100 2001-09-22  Jim Meyering  <meyering@lucent.com>
4101
4102         * localcharset.c: Update from latest gettext.
4103         * config.charset: Likewise.
4104
4105 2001-09-20  Jim Meyering  <meyering@lucent.com>
4106
4107         * xstrtol.c (strtoimax): Guard declaration with
4108         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
4109         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
4110         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
4111         (strtoumax): Likewise, for completeness (it wasn't necessary).
4112
4113 2001-09-06  Paul Eggert  <eggert@twinsun.com>
4114
4115         * strtoimax.c (HAVE_LONG_LONG):
4116         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
4117         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
4118         to work around bug in IBM C compiler.
4119
4120 2001-09-16  Jim Meyering  <meyering@lucent.com>
4121
4122         * mkdir.c: New file.
4123
4124 2001-09-04  Paul Eggert  <eggert@twinsun.com>
4125
4126         * xgetcwd.c: Revert some of the previous change; intead,
4127         fix the HAVE_GETCWD_NULL code to behave more like the
4128         !HAVE_GETCWD_NULL code used to.
4129
4130         Include "xalloc.h".
4131         (xgetcwd): Do not return NULL when memory is exhausted; instead,
4132         invoke xalloc_die.
4133
4134 2001-09-04  Paul Eggert  <eggert@twinsun.com>
4135
4136         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
4137         Use ssize_t, not int, to store result of readlink.
4138         Check for ssize_t overflow as well as size_t overflow,
4139         as POSIX says the result of readlink is implementation-defined
4140         when ssize_t overflows.
4141         Remove unnecessary cast to char*.
4142         Use free+malloc instead of realloc, as the storage doesn't need
4143         to be preserved and it's clearer and can be more efficient that way.
4144         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
4145         * xreadlink.h (xreadlink): Update prototype.
4146
4147 2001-09-03  Paul Eggert  <eggert@twinsun.com>
4148
4149         * exclude.c (fnmatch_no_wildcards): Fix confusion between
4150         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
4151         spotted by Jim Meyering.
4152
4153 2001-09-03  Jim Meyering  <meyering@lucent.com>
4154
4155         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
4156
4157 2001-09-03  Paul Eggert  <eggert@twinsun.com>
4158
4159         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
4160         like the HAVE_GETCWD_NULL code.
4161         Include pathmax.h if not HAVE_GETCWD.
4162         Do not include xalloc.h.
4163         (INITIAL_BUFFER_SIZE): New symbol.
4164         Do not use xmalloc / xrealloc, since the caller is responsible for
4165         handling errors.  Preserve errno around `free' during failure.
4166         Do not overrun buffer when using getwd.
4167
4168 2001-09-03  Paul Eggert  <eggert@twinsun.com>
4169
4170         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
4171         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
4172
4173 2001-09-02  Jim Meyering  <meyering@lucent.com>
4174
4175         * error.c: Update from GNU libc.
4176
4177 2001-09-01  Jim Meyering  <meyering@lucent.com>
4178
4179         * xreadlink.c: New file.
4180         * xreadlink.h: New file.
4181         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
4182
4183         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
4184         doesn't conflict with sparc Solaris 7's definition in
4185         /usr/include/sys/int_types.h.
4186
4187         * exclude.c: Use `""', not `<>' to #include non-system header files.
4188         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
4189         and strncasecmp as r-values.  Unixware didn't have declarations.
4190
4191 2001-08-31  Jim Meyering  <meyering@lucent.com>
4192
4193         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
4194         Use an initial, malloc'd, buffer of length 128 rather than
4195         a statically allocated one of length 1024.
4196
4197 2001-08-30  Paul Eggert  <eggert@twinsun.com>
4198
4199         * xgetcwd.c: Don't include pathmax.h.
4200         Include stdlib.h and unistd.h if available.
4201         Include xalloc.h.
4202         (xmalloc, xstrdup, free): Remove decls.
4203         (xgetcwd): Don't assume sizes fit in unsigned.
4204         Check for overflow when computing sizes.
4205         Simplify reallocation code.
4206
4207 2001-08-28  Paul Eggert  <eggert@twinsun.com>
4208
4209         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
4210
4211         * strtoimax.c: Renamed from strtoxmax.c, removing the
4212         old strtoimax.c.
4213
4214         Also, make the following further changes to make this file's
4215         configuration more similar to that of strtol.c:
4216         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
4217         (strtoumax, uintmax_t, strtoull, strtol): Remove.
4218         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
4219         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
4220         changed to signed values.
4221
4222         And make the following changes as well:
4223         Fix copyright notice, as 1999 was missing.
4224         (verify): New macro.
4225         (strtoimax): Check sizes at compile-time, not run-time.
4226         Prefer strtol to strtoll if both work.
4227         (main): Remove; it was not that useful and was a pain to maintain.
4228
4229         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
4230
4231 2001-08-30  Paul Eggert  <eggert@twinsun.com>
4232
4233         * savedir.c (savedir): Remove size parameter, as POSIX says that
4234         a directory's st_size can have an arbitrary value, so the old
4235         usage could waste an arbitrary amount of memory.  All uses
4236         changed.
4237         * savedir.h: Update prototype.
4238
4239 2001-08-30  Paul Eggert  <eggert@twinsun.com>
4240
4241         * xstrtol.c (strtoimax): New decl.
4242
4243 2001-08-28  Paul Eggert  <eggert@twinsun.com>
4244
4245         * xstrtol.h: Add copyright notice.
4246         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
4247         LONGINT_INVALID_SUFFIX_CHAR.
4248
4249 2001-08-30  Paul Eggert  <eggert@twinsun.com>
4250
4251         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
4252         tm to be declared.
4253
4254 2001-08-30  Paul Eggert  <eggert@twinsun.com>
4255
4256         * hash.c: Remove '2001' from copyright notice.
4257
4258 2001-08-30  Paul Eggert  <eggert@twinsun.com>
4259
4260         * full-write.h: New file.
4261         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
4262         * full-write.c: Correct credits, as cccp.c no longer
4263         exists and anyway it was so heavily changed from the old cccp
4264         code as to be unrecognizable.  Include full-write.h.
4265         (full_write) Return size_t, with short writes meaning failure.
4266         All callers changed.  This fixes a bug with large buffers
4267         on 64-bit hosts.
4268         * utime.c: Include full-write.h.
4269
4270 2001-08-30  Paul Eggert  <eggert@twinsun.com>
4271
4272         Merge 'exclude' changes from tar 1.13.22.
4273         This fixes one or two unlikely storage allocation overflow bugs,
4274         but doesn't change user-visible behavior otherwise.
4275
4276 2001-08-30  Paul Eggert  <eggert@twinsun.com>
4277
4278         * exclude.c (bool): Declare, perhaps by including stdbool.h.
4279         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
4280         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
4281         Include if available.
4282         (<xalloc.h>): Include
4283         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
4284         (verify): New macro.  Use it to verify that EXCLUDE macros do not
4285         collide with FNM macros.
4286         (struct patopts): New struct.
4287         (struct exclude): Use it, as exclude patterns now come with options.
4288         (new_exclude): Support above changes.
4289         (new_exclude, add_exclude_file):
4290         Initial size must now be a power of two to simplify overflow checking.
4291         (free_exclude, fnmatch_no_wildcards): New function.
4292         (excluded_filename): No longer requires options arg, as the options
4293         are determined by add_exclude.  Now returns bool, not int.
4294         (excluded_filename, add_exclude):
4295         Add support for the fancy new exclusion options.
4296         (add_exclude, add_exclude_file): Now takes int options arg.
4297         Check for arithmetic overflow when computing sizes.
4298         (add_exclude_file): xrealloc might modify errno, so don't
4299         realloc until after errno might be used.
4300
4301         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
4302         New macros.
4303         (free_exclude): New decl.
4304         (add_exclude, add_exclude_file): Now takes int options arg.
4305         (excluded_filename): No longer requires options arg, as the options
4306         are determined by add_exclude.  Now returns bool, not int.
4307
4308 2001-08-30  Paul Eggert  <eggert@twinsun.com>
4309
4310         * alloca.c (alloca): Arg is of type size_t, not unsigned.
4311
4312 2001-08-27  Jim Meyering  <meyering@lucent.com>
4313
4314         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
4315
4316         * version-etc.c (N_): Remove definition.
4317         Revert most of last change.
4318         Instead, simply don't mark the `Copyright...' string for translation.
4319         Based on advice from Paul Eggert.
4320
4321         * strtoxmax.c: Tweak comment.
4322
4323 2001-08-26  Jim Meyering  <meyering@lucent.com>
4324
4325         * version-etc.c (version_etc_copyright_fmt): Replace literal year
4326         of copyright with `%s' so translators don't get an untranslated
4327         message in 2002.
4328         (COPYRIGHT_YEAR): Define.
4329         (version_etc): Use fprintf rather than fputs.
4330         Suggestion from Ulrich Drepper.
4331
4332         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
4333
4334         * strtoll.c: New file, from GNU libc.
4335         * xstrtoimax.c: New file.
4336
4337         * xstrtol.h: Add xstrtoimax.
4338         * strtoumax.c: New file.  Simply include "strtoumax.c".
4339         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
4340
4341         * strtoumax.c: Factor to work both for unsigned and signed types, ...
4342         * strtoxmax.c: ... then renamed to this.
4343
4344 2001-08-13  Paul Eggert  <eggert@twinsun.com>
4345
4346         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
4347         Port to Solaris 8, where 'sed' requires a space after the 'r'
4348         command, and where sh dislikes "$/".  Clean up the spacing a bit.
4349         Redirect output to $tmp just once.
4350
4351 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
4352
4353         * addext.c (<errno.h>): Include.
4354         (errno): Declare if not defined.
4355         (addext): Work correctly when pathconf returns -1 and leaves
4356         errno alone because there is no limit.  Also, work even if
4357         pathconf returns a value greater than SIZE_MAX.
4358
4359 2001-08-12  Jim Meyering  <meyering@lucent.com>
4360
4361         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
4362         Simply `return getcwd (NULL, 0);'.
4363         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
4364         Use 1300 as initial value for length, not PATH_MAX.
4365
4366         * pathmax.h: Clean up cpp syntax.
4367
4368 2001-08-12  Jim Meyering  <meyering@lucent.com>
4369
4370         * gettimeofday.c: New file.
4371         * gtod.h: New file.
4372         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
4373
4374 2001-08-04  Jim Meyering  <meyering@lucent.com>
4375
4376         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
4377         to get in sync with glibc.
4378
4379 2001-08-03  Paul Eggert  <eggert@twinsun.com>
4380
4381         The following changes are from gettext 0.10.39 as maintained by
4382         Bruno Haible.
4383
4384         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
4385         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
4386         with inverted sense.  All uses changed.
4387
4388         * mbswidth.c: Don't include <limits.h>.
4389         Include <stdlib.h> and <string.h> unconditionally.
4390         (iswcntrl, mbsinit, ISCNTRL): New macros.
4391         (mbsnwidth): Use K&R style function declarations.
4392         Don't bother checking for MB_LEN_MAX == 1, since the compiler
4393         can optimize it when MB_CUR_MAX == 1.
4394         The width of control characters is zero, not 1.
4395
4396 2001-07-15  Jim Meyering  <meyering@lucent.com>
4397
4398         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
4399         (BUILT_SOURCES): Add unlocked-io.h.
4400         (io_functions): Define.
4401         (unlocked-io.h): New rule.
4402         (DISTCLEANFILES): Add unlocked-io.h.
4403         (all-local): Depend on unlocked-io.h, to ensure it is created.
4404
4405         * unlocked-io.hin: New file
4406
4407         * regex.c: Update from glibc.
4408
4409 2001-07-05  Jim Meyering  <meyering@lucent.com>
4410
4411         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
4412         recommendation.
4413         (libfetish_a_SOURCES): Put all .h files here instead.
4414         Remove a thus-exposed (better checks in automake) duplicate and
4415         two unnecessary .h files.
4416
4417 2001-06-11  Jim Meyering  <meyering@lucent.com>
4418
4419         * regex.c: Update from GNU libc.
4420
4421 2001-05-27  Jim Meyering  <meyering@lucent.com>
4422
4423         * readutmp.h (UT_TYPE): Define.
4424
4425 2001-05-24  Jim Meyering  <meyering@lucent.com>
4426
4427         * argmatch.c: Include "quote.h".
4428         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
4429         quote function.  Reported by Göran Uddeborg.
4430
4431 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
4432
4433         * dirname.c (dir_name): Compute append_dot using path, not newpath
4434         which is not yet declared.
4435
4436 2001-05-11  Paul Eggert  <eggert@twinsun.com>
4437
4438         * Makefile.am (libfetish_a_SOURCES):
4439         Add strftime.c, since we now compile it on all hosts.
4440
4441         * strftime.c (my_strftime):
4442         Define to nstrftime if emacs, but only if my_strftime is not defined.
4443         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
4444         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
4445         Add one more extra argument: a nanoseconds value.
4446         All uses changed.
4447         (ns): New macro.
4448         (my_strftime function): Add %N format.
4449         (emacs_strftimeu): Renamed from emacs_strftime,
4450         with extra ut argument.
4451
4452 2001-05-11  Paul Eggert  <eggert@twinsun.com>
4453
4454         dirname code cleanup.  base_name now behaves more compatibly
4455         with POSIX basename when given file names that have trailing
4456         slashes, and similarly for dir_name.  Add new primitives
4457         base_len and dir_len.  Put the directory-name-related decls
4458         into dirname.h.
4459
4460         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
4461         * backupfile.c (base_name): Likewise.
4462         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
4463         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
4464         * makepath.c (strip_trailing_slashes): Likewise.
4465         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
4466         Likewise.
4467         * rename.c (strip_trailing_slashes): Likewise.
4468         * same.c (base_name): Likewise.
4469         * stripslash.c (ISSLASH): Likewise.
4470
4471         * addext.c: Include <dirname.h> after size_t is defined.
4472         * backupfile.c: Likewise.
4473
4474         * addext.c (addext): Use base_len to trim redundant
4475         trailing slashes instead of doing it ourselves.
4476         But do not trim the last slash if it is not redundant.
4477
4478         * backupfile.c (find_backup_file_name,
4479         max_backup_version): Use base_len instead of rolling it ourselves.
4480         Handle the case of "" and (on DOS) "C:" correctly.
4481
4482         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
4483         Include <string.h>, <dirname.h>.
4484         (base_name): Allow file names ending in slashes, other than names
4485         that are all slashes.  In this case, return the basename followed
4486         by the slashes.  This is more general, and can be used in places
4487         where the original base_name purposely had an assertion failure.
4488         (base_len): New function.
4489
4490         * dirname.c: Include <string.h> instead of <stdlib.h>.
4491         Do not include <assert.h>; no longer needed.
4492         Include xalloc.h.
4493         (memrchr): Remove decl.
4494         (dir_name_r): Remove.
4495         (dir_len): Renamed from dirlen.  All callers changed.
4496         Rewrite in terms of base_name, for simplicity and consistency.
4497         (dir_name): Never return NULL.  All callers changed.
4498         Do not include <stdlib.h> in test program; no longer needed.
4499         return 0; is fine for test program.
4500
4501         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
4502         New macros.
4503         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
4504
4505         * path-concat.c (path_concat): Use base_len to compute
4506         base length, not strlen; this means we cannot rely on memcpy
4507         to null-terminate.
4508
4509         * same.c (STREQ): Remove.
4510         (same_name): Handle the case where the basename ends in trailing '/'.
4511
4512         * stripslash.c (strip_trailing_slashes): Return nonzero if
4513         a slash was stripped.  Do not strip the last slash after a
4514         file system prefix.
4515
4516 2001-04-08  Jim Meyering  <meyering@lucent.com>
4517
4518         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
4519         recomputed; that's necessary when the offset spans a DST transition.
4520         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
4521
4522 2001-04-02  Jim Meyering  <meyering@lucent.com>
4523
4524         * regex.h, regex.c: Update from GNU libc.
4525
4526 2001-03-19  Paul Eggert  <eggert@twinsun.com>
4527
4528         * version-etc.c (version_etc_copyright): Update to 2001.
4529
4530 2001-03-16  Paul Eggert  <eggert@twinsun.com>
4531
4532         * tempname.c (uint64_t): Define to uintmax_t if
4533         not defined, and if UINT64_MAX is not defined.
4534         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
4535         Reported by John David Anglin.
4536
4537 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
4538
4539         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
4540         alias if codeset is empty.
4541         * config.charset (BeOS): Use wildcard syntax.
4542
4543 2001-03-13  Jim Meyering  <meyering@lucent.com>
4544
4545         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
4546         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
4547         From Bruno Haible.
4548
4549 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
4550
4551         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
4552         Don't return NULL.
4553         * unicodeio.c (print_unicode_char): Simplify accordingly.
4554
4555 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
4556
4557         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
4558         support for DOS/DJGPP.
4559
4560 2001-02-28  Paul Eggert  <eggert@twinsun.com>
4561
4562         * Makefile.am (libfetish_a_SOURCES):
4563         Add dup-safer.c, fopen-safer.c.
4564         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
4565
4566         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
4567
4568 2001-02-25  Paul Eggert  <eggert@twinsun.com>
4569
4570         The mkstemp replacement is taken from glibc 2.2.2, with some
4571         portability fixes for use outside glibc, as follows:
4572
4573         * tempname.c (struct_stat64): New macro.
4574         (direxists, __gen_tempname): Use it.
4575         This avoids a portability problem with Solaris 8.
4576
4577         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
4578         (<stddef.h>, <stdint.h>, <string.h>):
4579         Include only if STDC_HEADERS || _LIBC.
4580         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
4581         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
4582         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
4583         (__set_errno): Define this macro if <errno.h> doesn't.
4584         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
4585         Define these macros if <stdio.h> doesn't.
4586         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
4587         Define these macros if <sys/stat.h>
4588         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
4589         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
4590         __xstat64): Define if not _LIBC.
4591         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
4592         (__gen_tempname): Invoke gettimeofday only if
4593         HAVE_GETTIMEOFDAY || _LIBC;
4594         otherwise, fall back on plain "time".
4595         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
4596
4597         * mkstemp.c (__GT_FILE): Define to zero if not defined.
4598
4599         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
4600
4601 2001-02-17  Jim Meyering  <meyering@lucent.com>
4602
4603         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
4604         around included file name.
4605
4606         * strnlen.c (__strnlen): Merge in a change from GNU libc.
4607
4608         * strftime.c: Update from GNU libc (the only changes were to comments).
4609
4610 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
4611
4612         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
4613
4614 2001-02-17  Paul Eggert  <eggert@twinsun.com>
4615
4616         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
4617         Remove workaround macros for hosts that have mbrtowc but not
4618         mbstate_t, as we now insist on proper declarations for both
4619         before using mbrtowc.
4620
4621 2001-02-17  Jim Meyering  <meyering@lucent.com>
4622
4623         * regex.c: Update from libc.
4624
4625 2001-02-16  Paul Eggert  <eggert@twinsun.com>
4626
4627         * alloca.c (malloc): Undef before defining, since stdlib.h
4628         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
4629         Reported by Mark Hounschell via Paul Eggert.
4630
4631 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
4632
4633         * config.charset: Update for FreeBSD 4.2.
4634
4635 2001-01-26  Jim Meyering  <meyering@lucent.com>
4636
4637         * quotearg.c: Include stddef.h.
4638         * quote.c: Include stddef.h.
4639         Reported by Axel Kittenberger.
4640
4641         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
4642         line in double quotes so that it evokes a better diagnostic.
4643         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
4644         Reported by Axel Kittenberger.
4645
4646 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
4647
4648         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
4649         to avoid a warning.  Add back 'const' to inptr.
4650
4651 2001-01-16  Jim Meyering  <meyering@lucent.com>
4652
4653         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
4654         From Bruno Haible.
4655
4656 2001-01-14  Jim Meyering  <meyering@lucent.com>
4657
4658         * rename.c: New file.  From Volker Borchert.
4659         Include stdlib.h, string.h or strings.h, and xalloc.h.
4660         Use strip_trailing_slashes rather than open-coding it.
4661
4662 2001-01-03  Paul Eggert  <eggert@twinsun.com>
4663
4664         * strftime.c: Sync with glibc time/strftime.c 1.81.
4665
4666 2001-01-03  Jim Meyering  <meyering@lucent.com>
4667
4668         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
4669         local `inptr' to avoid warning with some system declarations of iconv.
4670
4671 2000-12-29  Paul Eggert  <eggert@twinsun.com>
4672
4673         * modechange.c: Do not assume that mode_t uses the
4674         traditional octal encoding.  E.g. "chmod 1 FOO" should set
4675         the other-execute bit of FOO even if S_IXOTH != 1.
4676
4677         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
4678         WOTH, XOTH, ALLM): New macros.
4679         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
4680          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
4681         Use them.
4682         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
4683         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
4684         (mode_compile):
4685         No need to use uintmax_t; unsigned long is long enough.
4686         Don't bother to get suffix since we don't use it.
4687
4688 2000-12-24  Jim Meyering  <meyering@lucent.com>
4689
4690         * hash.c (is_prime): Return explicit boolean values.
4691         (hash_get_first): Return NULL to appease Irix5.6's 89.
4692         Reported by Nelson Beebe.
4693
4694 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
4695
4696         * localcharset.c (locale_charset): Add support for Win32.
4697
4698 2000-12-18  Paul Eggert  <eggert@twinsun.com>
4699
4700         * physmem.h, physmem.c: New files.
4701
4702         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
4703         (noinst_HEADERS): Add physmem.h.
4704
4705         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
4706         't' for compatibility with Solaris 8 sort.
4707
4708 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
4709
4710         * config.charset: Add support for BeOS.
4711
4712 2000-12-16  Jim Meyering  <meyering@lucent.com>
4713
4714         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
4715         SHELLS_FILE to a file name that's useful on djgpp systems.
4716         Include stdlib.h.
4717         (ADDITIONAL_DEFAULT_SHELLS): Define.
4718         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
4719         Based mostly on a patch from Prashant TR.
4720
4721 2000-12-16  Jim Meyering  <meyering@lucent.com>
4722
4723         This bug had a serious impact on chown: `chown N:M FILE' (for integer
4724         N and M) would have treated it like `chown N:N FILE'.
4725
4726         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
4727
4728 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
4729
4730         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
4731         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
4732         to the list of canonical encodings. Rename EUC-CN to GB2312.
4733
4734 2000-12-08  Andreas Schwab  <schwab@suse.de>
4735
4736         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
4737         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
4738
4739 2000-12-07  Jim Meyering  <meyering@lucent.com>
4740
4741         * stripslash.c (ISSLASH): Define.
4742         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
4743         From Prashant TR.
4744
4745         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
4746         (dir_name_r): Declare this function as static.
4747         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
4748         manifest itself on a name containing a mix of slashes and
4749         backslashes.
4750         Make this function work with names starting with a DOS-style
4751         drive letter and colon prefix.
4752         (dir_name): Append `.' if necessary.
4753         Based mostly on patches from Prashant TR and Eli Zaretskii.
4754
4755         * dirname.h (dir_name_r): Remove prototype.
4756
4757 2000-12-05  Jim Meyering  <meyering@lucent.com>
4758
4759         * dirname.c (dir_name_r): Add `const' in a few local declarations.
4760
4761 2000-12-04  Jim Meyering  <meyering@lucent.com>
4762
4763         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
4764         Also include memory.h, stdlib.h, unistd.h if appropriate.
4765         Reported by Andreas Jaeger (conflicting declaration of malloc).
4766
4767 2000-12-02  Jim Meyering  <meyering@lucent.com>
4768
4769         * closeout.h: Make idempotent, to avoid some obscure warnings.
4770
4771 2000-12-01  Paul Eggert  <eggert@twinsun.com>
4772
4773         * memrchr.c: Include <config.h> before any system include file.
4774
4775 2000-11-29  Paul Eggert  <eggert@twinsun.com>
4776
4777         * dirname.c (dir_name_r): Fix typo: int -> size_t.
4778
4779 2000-11-26  Jim Meyering  <meyering@lucent.com>
4780
4781         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
4782
4783 2000-11-22  Paul Eggert  <eggert@twinsun.com>
4784
4785         * strftime.c (my_strftime): Do not invoke mbrlen with a
4786         size of (size_t) -1; it's not portable.
4787
4788 2000-11-17  Akim Demaille  <akim@epita.fr>
4789
4790         * obstack.h: Formatting changes.
4791         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
4792         prevent type checking.
4793         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
4794         cast the value to (void *): assigning a `foo *' to a `void *'
4795         variable is valid.
4796         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
4797
4798 2000-11-17  Jim Meyering  <meyering@lucent.com>
4799
4800         * strstr.c: Update from GNU libc.
4801
4802 2000-11-16  Jim Meyering  <meyering@lucent.com>
4803
4804         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
4805
4806 2000-11-11  Jim Meyering  <meyering@lucent.com>
4807
4808         * error.c: Add a couple #includes, merging from GNU libc version.
4809
4810 2000-11-10  Jim Meyering  <meyering@lucent.com>
4811
4812         * obstack.h: Update from GNU libc.
4813         * obstack.c: Likewise.
4814
4815 2000-11-06  Paul Eggert  <eggert@twinsun.com>
4816
4817         * getusershell.c (setusershell): Use rewind rather than
4818         fseek/fseeko, to avoid configuration hassles with fseeko.
4819         Don't bother opening SHELLS_FILE if shellstream is NULL;
4820         it's not necessary.
4821
4822 2000-11-05  Jim Meyering  <meyering@lucent.com>
4823
4824         * makepath.h (make_dir): Declare.
4825         * makepath.c (make_dir): Remove `static' attribute.
4826         Tweak a comment.
4827
4828 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
4829
4830         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
4831         last one in a bucket, advance to the next bucket.
4832
4833 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
4834
4835         * fnmatch.c: Do not comment out all the code if we are using
4836         the GNU C library, because in some cases we are replacing buggy
4837         code in the GNU C library itself.
4838
4839 2000-10-30  Paul Eggert  <eggert@twinsun.com>
4840
4841         * error.h, getline.h, modechange.h:
4842         Remove "2000" from Copyright line, as the file hasn't been
4843         changed this year other than in the copyright notice.
4844
4845         * xalloc.h: Add "2000" to Copyright line, as this file
4846         was changed this year.
4847
4848 2000-10-30  Paul Eggert  <eggert@twinsun.com>
4849
4850         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
4851         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
4852         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
4853
4854 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
4855
4856         * regex.h (__restrict_arr): Move definition out of #ifndef block.
4857         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
4858         doesn't define __restrict_arr.
4859
4860 2000-10-29  Jim Meyering  <meyering@lucent.com>
4861
4862         * xstat.in: Fix grammar in comment.
4863
4864 2000-10-28  Jim Meyering  <meyering@lucent.com>
4865
4866         * memchr.c: Update from libc.
4867         Adjust for portability:
4868         [HAVE_STDLIB_H]: Include stdlib.h.
4869         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
4870         Undef __memchr, too.
4871         [!weak_alias]: Define __memchr to memchr.
4872
4873         * regex.c: Update from libc.
4874         * regex.h: Likewise.
4875         * getopt1.c: Likewise.
4876         * memcmp.c: Likewise.
4877
4878         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
4879         Avoid using fseek, when possible -- it's broken by design.
4880         Patch by Ulrich Drepper.
4881
4882 2000-10-26  Jim Meyering  <meyering@lucent.com>
4883
4884         * strftime.c: Update from libc.
4885
4886 2000-10-25  Jim Meyering  <meyering@lucent.com>
4887
4888         * obstack.c: Update from libc.
4889
4890 2000-10-23  Jim Meyering  <meyering@lucent.com>
4891
4892         * hard-locale.c (hard_locale): Revert last change -- it was simply
4893         wrong.  That set_locale call must not have any side effects.
4894         From Paul Eggert.
4895
4896 2000-10-22  Jim Meyering  <meyering@lucent.com>
4897
4898         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
4899         [CYCLIC]: Remove now-unused definition.
4900
4901         * save-cwd.c (O_DIRECTORY): Define, if needed.
4902         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
4903         Suggestion from Ulrich Drepper.
4904
4905 2000-10-21  Jim Meyering  <meyering@lucent.com>
4906
4907         * dirname.c (dir_name_r): New function, factored out of dir_name.
4908         (dir_name): Use dir_name_r.
4909         * dirname.h (dir_name_r): Declare it.
4910
4911 2000-10-21  Jim Meyering  <meyering@lucent.com>
4912
4913         * dirname.c (memrchr): Declare if necessary.
4914         (dir_name): Remove the restriction that there be no
4915         trailing slashes.  Now, this code skips past them, effectively
4916         ignoring them.
4917         [TEST_DIRNAME] (main): New unit tests.
4918
4919         * memrchr.c: New file from GNU libc.
4920         Undef __memrchr, too.
4921         [!weak_alias]: Define __memrchr to memrchr.
4922         Guard weak_alias use with `#ifdef weak_alias'.
4923
4924 2000-10-17  Jim Meyering  <meyering@lucent.com>
4925
4926         * quote.h (PARAMS): Define and use.
4927         Reported by Akim Demaille.
4928
4929         * getopt.c: Update from libc.
4930
4931 2000-10-16  Jim Meyering  <meyering@lucent.com>
4932
4933         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
4934         From Jan Fedak.
4935
4936 2000-09-25  Jim Meyering  <meyering@lucent.com>
4937
4938         * md5.h (rol): Define (from GnuPG).
4939
4940         * sha.c: Give credit (GnuPG) where due.
4941         (M): Use rol rather than open-coding it.
4942         Add a FIXME comment.
4943
4944 2000-09-21  Jim Meyering  <meyering@lucent.com>
4945
4946         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
4947         Reported by Michael Stone.
4948
4949 2000-09-20  Jim Meyering  <meyering@lucent.com>
4950
4951         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
4952         (noinst_HEADERS): Add sha.h.
4953         Based on code from Scott G. Miller and from GnuPG.
4954
4955 2000-09-15  Jim Meyering  <meyering@lucent.com>
4956
4957         * regex.c: Update from libc.
4958
4959 2000-09-10  Jim Meyering  <meyering@lucent.com>
4960
4961         * getopt.c (_getopt_internal): Update from glibc.
4962
4963 2000-09-09  Jim Meyering  <meyering@lucent.com>
4964
4965         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
4966         think it should be used as a general replacement for isascii.
4967         * fnmatch.c: Likewise.
4968         * mbswidth.c: Likewise
4969         * regex.c: Likewise.
4970
4971         Don't use atoi.
4972         * userspec.c: Include sys/param.h and limits.h.
4973         Include xstrtol.h.
4974         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4975         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
4976         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
4977         UID, GID.  Check range.
4978
4979 2000-09-06  Jim Meyering  <meyering@lucent.com>
4980
4981         * getopt.c (_getopt_internal): Update from glibc.
4982
4983 2000-08-30  Jim Meyering  <meyering@lucent.com>
4984
4985         * strftime.c: Merge in changes from GNU libc.
4986
4987 2000-08-26  Jim Meyering  <meyering@lucent.com>
4988
4989         * closeout.c: Include "__fpending.h".
4990         (close_stdout_status): Return right away if there's nothing to flush.
4991
4992         * Makefile.am (noinst_HEADERS): Add __fpending.h.
4993         * __fpending.c: New file.
4994         * __fpending.h: New file.
4995
4996 2000-08-07  Paul Eggert  <eggert@twinsun.com>
4997
4998         Standardize on "memory exhausted" instead of "Memory exhausted"
4999         or "virtual memory exhausted".
5000         * obstack.c (print_and_abort): Use "memory exhausted", not
5001         "virtual memory exhausted".
5002         * same.c (same_name): Invoke xalloc_die instead of printing
5003         our own message.
5004         * userspec.c (parse_user_spec): Likewise.
5005         * bumpalloc.h: comment fix
5006         * same.c, userspec.c: Include xalloc.h.
5007
5008         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
5009         not char *const and pointing to a constant array.
5010         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
5011         (xrealloc): Comment fix.
5012
5013         * userspec.c (parse_user_spec):
5014         Don't translate a message until just before returning,
5015         to avoid unnecessary translation.
5016
5017 2000-08-07  Jim Meyering  <meyering@lucent.com>
5018
5019         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
5020         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
5021         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
5022         getgroups.c, gethostname.c, getopt.h, group-member.c,
5023         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
5024         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
5025         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
5026         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
5027         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
5028         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
5029         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
5030         yesno.c: Back out Copyright date changes for each file with no change
5031         this year.  This eases coordination with other programs using the same
5032         source code modules.  From Paul Eggert.
5033
5034 2000-08-03  Greg McGary  <greg@mcgary.org>
5035
5036         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
5037         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
5038         (EXTEND_BUFFER): Use them.
5039
5040 2000-08-01  Jim Meyering  <meyering@lucent.com>
5041
5042         * dirname.c (ISSLASH): Define.
5043         (BACKSLASH_IS_PATH_SEPARATOR): Define.
5044         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
5045         both `\' and `/' may be use as path separators.
5046         Based on a patch from Prashant TR.
5047
5048 2000-07-31  Paul Eggert  <eggert@twinsun.com>
5049
5050         * quotearg.c (quotearg_n_options): Don't make the initial
5051         slot vector a constant, since it might get modified.
5052
5053 2000-07-31  Jim Meyering  <meyering@lucent.com>
5054
5055         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
5056         * obstack.c (print_and_abort): Likewise.
5057
5058 2000-07-30  Paul Eggert  <eggert@twinsun.com>
5059
5060         * quotearg.c (quotearg_n_options): Preallocate a slot 0
5061         buffer, so that the caller can always quote one small
5062         component of a "memory exhausted" message in slot 0.
5063         From a suggestion by Jim Meyering.
5064
5065 2000-07-30  Jim Meyering  <meyering@lucent.com>
5066
5067         * makepath.c (make_path): Quote the other instance, too.
5068
5069         * quotearg.c (N_STATIC_SLOTVECS): Define.
5070         (STATIC_BUF_SIZE): Define.
5071         (quotearg_n_options): Use only statically allocated storage when
5072         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
5073         than STATIC_BUF_SIZE.
5074
5075 2000-07-29  Jim Meyering  <meyering@lucent.com>
5076
5077         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
5078         * dirname.c (dir_name): Likewise.
5079
5080         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
5081
5082         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
5083         (dir_name): Assert that there are no trailing slashes.
5084
5085 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
5086
5087         * mbswidth.h (mbswidth): Add a flags argument.
5088         (mbswidth): New declaration.
5089         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
5090         * mbswidth.c (mbswidth): Add a flags argument.
5091         (mbsnwidth): New function.
5092
5093 2000-07-24  Jim Meyering  <meyering@lucent.com>
5094
5095         * mbswidth.c: Remove useless #else.  From Bruno Haible.
5096
5097 2000-07-23  Paul Eggert  <eggert@twinsun.com>
5098
5099         * mbswidth.c (_XOPEN_SOURCE):
5100         Don't define; this causes problems on Solaris 7.
5101         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
5102
5103 2000-07-23  Paul Eggert  <eggert@twinsun.com>
5104
5105         * quotearg.c:
5106         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
5107         so that mbstate_t is always defined.
5108
5109         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
5110         be 1 in at least one GCC installation, and this configuration
5111         error is likely to be common.  Ignoring MB_LEN_MAX hurts
5112         performance on hosts that have mbrtowc but have only unibyte
5113         locales, but I assume these hosts are rare.
5114
5115 2000-07-23  Paul Eggert  <eggert@twinsun.com>
5116
5117         * quotearg.c: Streamline by invoking multibyte code only if needed.
5118         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
5119         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
5120         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
5121         invoke multibyte primitives.
5122
5123 2000-07-23  Jim Meyering  <meyering@lucent.com>
5124
5125         * basename.c (base_name): Add an assertion.
5126
5127 2000-07-15  Bruno Haible  <clisp.cons.org>
5128
5129         * quotearg.c: When the system forces us to redefine mbstate_t,
5130         shadow its mbsinit function.
5131
5132 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
5133
5134         * mbswidth.h: New file.
5135         * mbswidth.c: New file.
5136         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
5137         (noinst_HEADERS): Add mbswidth.h.
5138
5139 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
5140
5141         * config.charset: Add support for FreeBSD. Improve support for HP-UX
5142         and IRIX 6.
5143
5144 2000-07-15  Jim Meyering  <meyering@lucent.com>
5145
5146         * makepath.c: Include quote.h.
5147         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
5148         corresponding argument in a `quote (...)' call.
5149         Give better diagnostics.
5150
5151         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
5152         (noinst_HEADERS): Add quote.h.
5153
5154         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
5155         from tar's src/misc.c.
5156         * quote.h: New file.  Prototypes for same.
5157
5158 2000-07-10  Paul Eggert  <eggert@twinsun.com>
5159
5160         From a suggestion by Bruno Haible.
5161         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
5162         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
5163         to decide whether to define the BeOS workaround macro;
5164         this adjusts to the change to AC_MBSTATE_T.
5165
5166 2000-07-13  Paul Eggert  <eggert@twinsun.com>
5167
5168         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
5169
5170         * quotearg.c (quoting_style_args, quoting_style_vals,
5171         quotearg_buffer_restyled): Add support for
5172         clocale_quoting_style.  Undo previous change to
5173         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
5174         and "{RIGHT QUOTATION MARK}" msgids.
5175
5176 2000-07-05  Paul Eggert  <eggert@twinsun.com>
5177
5178         The old behavior of quoting `like this' doesn't look good with
5179         newer, ISO-style fonts.  See:
5180         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
5181
5182         Instead, quote "like this" by default.  Let the translator
5183         tailor the locale-specific quoting behavior by providing
5184         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
5185
5186         * quotearg.c (N_): New macro.
5187         (gettext_default): New function.
5188         (quotearg_buffer_restyled): Use
5189         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
5190         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
5191
5192 2000-07-09  Jim Meyering  <meyering@lucent.com>
5193
5194         * Most files: Update copyright dates to include 2000.
5195
5196 2000-07-08  Jim Meyering  <meyering@lucent.com>
5197
5198         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
5199         if not defined.
5200         (xgethostname): Remove now-unnecessary #ifdef.
5201         Move declaration of `err' into loop where it's used.
5202
5203 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
5204
5205         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
5206         by allocating a larger buffer. Test the gethostname return value for
5207         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
5208         returns an error and ENAMETOOLONG isn't defined.
5209
5210 2000-07-05  Paul Eggert  <eggert@twinsun.com>
5211         and Bruno Haible  <haible@clisp.cons.org>
5212
5213         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
5214
5215 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
5216
5217         * quotearg.c (struct quoting_options): Simplify quote_these_too
5218         dimension.
5219
5220 2000-07-03  Jim Meyering  <meyering@lucent.com>
5221
5222         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
5223         Reported by Bruno Haible.
5224
5225 2000-07-04  Jim Meyering  <meyering@lucent.com>
5226
5227         * quotearg.c: Make inclusion of <wchar.h> independent of whether
5228         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
5229         lacks mbrtowc.
5230
5231 2000-07-03  Paul Eggert  <eggert@twinsun.com>
5232         and Bruno Haible  <haible@clisp.cons.org>
5233
5234         * quotearg.c (mbrtowc):
5235         Assign to *pwc, and return 1 only if result is nonzero.
5236         (iswprint): Use ISPRINT when substituting our own mbrtowc.
5237
5238 2000-07-03  Jim Meyering  <meyering@lucent.com>
5239
5240         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
5241         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
5242         From Bob Proulx.
5243
5244 2000-07-02  Jim Meyering  <meyering@lucent.com>
5245
5246         * quotearg.c (mbstate_t): Don't define here.
5247
5248 2000-07-02  Jim Meyering  <meyering@lucent.com>
5249
5250         * nanosleep.c (SIGCONT): Define if not already defined.
5251
5252 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
5253
5254         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
5255         per change in ../m4/ls-mntd-fs.m4.
5256         (read_filesystem_list): Ignore symbolic links.
5257
5258 2000-06-29  Jim Meyering  <meyering@lucent.com>
5259
5260         * same.c: Include <string.h> or <strings.h>, as appropriate,
5261         for declaration of strcmp.
5262
5263         * long-options.c: Include <stdlib.h>, for declaration of exit.
5264
5265         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
5266         Avoid warning by casting result to `char *' to remove `const'.
5267
5268 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
5269
5270         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
5271
5272 2000-06-26  Paul Eggert  <eggert@twinsun.com>
5273
5274         savedir now sets errno on failure and invokes xmalloc to get memory.
5275         Fix a couple of other minor bugs while we're at it.
5276
5277         * savedir.c (<unistd.h>): Do not include; there's no need.
5278         (NAMLEN): Remove macro.
5279         (malloc, realloc): Remove decls.
5280         (stpcpy): Likewise.
5281         ("xalloc.h"): Include.
5282         (NAME_SIZE_DEFAULT): New macro.
5283         (savedir): Use xmalloc / xrealloc to allocate memory.
5284         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
5285         Skip "" directory entries.
5286         Use strlen to calculate directory entry length, since the old method
5287         is rarely used these days and isn't worth supporting.
5288         Don't use a pointer after freeing it.
5289         Check for integer overflow when calculating allocation size.
5290         Use memcpy to copy entries, instead of stpcpy.
5291         Set errno properly when returning NULL.
5292         Check for readdir error.
5293
5294 2000-06-26  Jim Meyering  <meyering@lucent.com>
5295
5296         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
5297
5298 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
5299
5300         * getusershell.c (xmalloc, xrealloc): Remove functions.
5301         Include xalloc.h.
5302         Don't include <stdlib.h>.  Don't declare malloc, realloc.
5303
5304 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
5305
5306         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
5307
5308 2000-06-24  Jim Meyering  <meyering@lucent.com>
5309
5310         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
5311
5312 2000-06-21  Jim Meyering  <meyering@lucent.com>
5313
5314         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
5315
5316 2000-06-19  Paul Eggert  <eggert@twinsun.com>
5317
5318         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
5319         (mbrtowc, mbstate_t): Define substitutes if
5320         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
5321         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
5322         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
5323
5324 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
5325
5326         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
5327         than 1024, return a memory chunk of least possible size, instead
5328         of size PATH_MAX + 2. In the loop, increment the size proportionally.
5329         Use free/xmalloc instead of xrealloc to avoid copying for very long
5330         paths.
5331
5332 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
5333
5334         * canon-host.c (canon_host): Use malloc and memcpy to copy an
5335         address, not strdup.  Include <stdlib.h> and don't declare free().
5336
5337 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
5338
5339         * path-concat.c (path_concat): Don't access dir[-1] if dir is
5340         the empty string.
5341
5342 2000-06-21  Jim Meyering  <meyering@lucent.com>
5343
5344         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
5345         (noinst_HEADERS): Add getstr.h.
5346
5347         * getline.c (getstr): Move into a separate file.
5348         * getstr.c (getstr): New file, extracted from getline.c, with
5349         the following changes: new parameter, delim2; both delim[12]
5350         parameters have type `int', not `char'.  The latter would lose
5351         with 8-bit delimiters.
5352         * getstr.h: New file.
5353
5354 2000-06-19  Jim Meyering  <meyering@lucent.com>
5355
5356         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
5357
5358 2000-06-18  Jim Meyering  <meyering@lucent.com>
5359
5360         * mkdir.c: Remove file, due mainly to copyright incompatibility.
5361         Besides, these days every porting target provides a mkdir function.
5362
5363         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
5364         (this snippet comes from src/system.h).
5365
5366 2000-06-15  Paul Eggert  <eggert@twinsun.com>
5367
5368         * human.c (adjust_value): New function.
5369         (human_readable_inexact): Apply rounding style even when
5370         printing approximate values.
5371
5372 2000-06-14  Paul Eggert  <eggert@twinsun.com>
5373
5374         * human.c (human_readable_inexact): Allow an input block
5375         size that is not a multiple of the output block size, and vice versa.
5376         Reported by Piergiorgio Sartor.
5377
5378 2000-06-14  Paul Eggert  <eggert@twinsun.com>
5379
5380         * getdate.y (get_date): Apply relative times after time
5381         zone indicator, not before.  Reported by Todd A. Jacobs.
5382
5383 2000-06-13  Jim Meyering  <meyering@lucent.com>
5384
5385         * Makefile.am (all-local): Depend on lstat.c and stat.c.
5386
5387         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
5388
5389 2000-06-12  Paul Eggert  <eggert@twinsun.com>
5390
5391         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
5392
5393 2000-06-04  Paul Eggert  <eggert@twinsun.com>
5394
5395         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
5396
5397 2000-06-04  Jim Meyering  <meyering@lucent.com>
5398
5399         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
5400         SunOS 4.1.4 for which gid_t is an unsigned type.
5401
5402 2000-06-03  Jim Meyering  <meyering@lucent.com>
5403
5404         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
5405
5406 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
5407
5408         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
5409         newer, don't install charset.alias.
5410         * config.charset: Change the Linux/glibc rules so they become empty
5411         on glibc-2.1 or newer.
5412
5413 2000-06-02  Jim Meyering  <meyering@lucent.com>
5414
5415         * mountlist.c: Back out last change.  Instead, do this...
5416         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
5417         member using the same `ignore'-testing code.
5418         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
5419         fs_type strings.
5420         From Mark D. Roth.
5421
5422 2000-05-29  Jim Meyering  <meyering@lucent.com>
5423
5424         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
5425         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
5426
5427 2000-05-22  Jim Meyering  <meyering@lucent.com>
5428
5429         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
5430
5431 2000-05-18  Jim Meyering  <meyering@lucent.com>
5432
5433         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
5434         back, too, since it may have been modified by allocate_entry.
5435         (hash_delete): Rewrite to use neither the assignment operator
5436         nor the comma operator in an if-expression.
5437
5438 2000-05-15  Paul Eggert  <eggert@twinsun.com>
5439
5440         * closeout.c:
5441         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
5442         Remove; no longer needed.
5443         "quotearg.h": Add include.
5444         (file_name): Do not bother to explicitly initialize to NULL; it's less
5445         efficient on some hosts.
5446         (close_stdout_status): Remove test as to whether stdout was already
5447         closed; it breaks for the case "echo x | sort >&-".
5448         Quote file name colons.
5449         Do not assume that _("write error") lacks format strings.
5450
5451 2000-05-15  Jim Meyering  <meyering@lucent.com>
5452
5453         * version-etc.c (version_etc_copyright): Update the copyright string
5454         used in all --version output.
5455
5456 2000-05-14  Jim Meyering  <meyering@lucent.com>
5457
5458         * closeout.c (close_stdout_set_file_name): New function.
5459         (close_stdout_status): Use new file-scoped global.
5460         Return right away if fstat says the stdout file descriptor is invalid.
5461         * closeout.h (close_stdout_set_file_name): Declare.
5462
5463 2000-05-10  Jim Meyering  <meyering@lucent.com>
5464
5465         * closeout.c [default_exit_status]: New file-scoped variable.
5466         (close_stdout_set_status): New function.
5467         * closeout.h (close_stdout_set_status): Declare.
5468
5469 2000-05-08  Jim Meyering  <meyering@lucent.com>
5470
5471         * long-options.c: Don't include closeout.h.
5472         (parse_long_options): Don't call close_stdout for --version.
5473
5474 2000-05-06  Jim Meyering  <meyering@lucent.com>
5475
5476         * strnlen.c: Undefine __strnlen and strnlen.
5477         [!weak_alias]: Define __strnlen to strnlen.
5478
5479         * atexit.c: New file, from libiberty.
5480
5481 2000-05-06  Jim Meyering  <meyering@lucent.com>
5482
5483         * closeout.c (close_stdout_status): Also check for errors on the
5484         stderr stream.
5485
5486 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
5487
5488         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
5489         instead of xmalloc, xrealloc, path_concat.
5490         (locale_charset): Treat empty environment variables as absent.
5491         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
5492
5493 2000-05-04  Jim Meyering  <meyering@lucent.com>
5494
5495         * getopt.c: Update from glibc.
5496         * obstack.c: Likewise.
5497         * obstack.h: Likewise.
5498         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
5499
5500         * regex.h: Likewise.
5501         * strndup.c: Likewise.
5502         * strnlen.c: New file, from glibc.
5503
5504 2000-05-01  Jim Meyering  <meyering@lucent.com>
5505
5506         * full-write.c (full_write): Remove `FIXME' part of comment.
5507
5508 2000-04-29  Jim Meyering  <meyering@lucent.com>
5509
5510         * path-concat.c: Declare strdup only if it's not defined.
5511         * canon-host.c: Likewise.
5512
5513 2000-04-28  Jim Meyering  <meyering@lucent.com>
5514
5515         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
5516         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
5517         included first, then limits.h is included by locale.h by libintl.h.
5518         From John David Anglin.
5519
5520 2000-04-25  Jim Meyering  <meyering@lucent.com>
5521
5522         * makepath.c (S_IRWXUGO): Define.
5523         (make_path): Always perform explicit chmod if MODE specifies any
5524         of the `special' permission bits.  Prompted by a bug report against
5525         install from Mate Wierdl and Joost van Baal.
5526
5527 2000-04-18  Jim Meyering  <meyering@lucent.com>
5528
5529         * README: New file.
5530
5531         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
5532         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
5533
5534 2000-04-17  Jim Meyering  <meyering@lucent.com>
5535
5536         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
5537         the definition of it to rpl_strftime also defined-away the system's
5538         declaration.
5539
5540 2000-04-15  Jim Meyering  <meyering@lucent.com>
5541
5542         Use `C' to denote so-called `contiguous' files, the same way
5543         that tar does.
5544         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
5545         (ftypelet): Use S_ISCTG.
5546         From Michael Deutschmann.
5547
5548 2000-04-14  Jim Meyering  <meyering@lucent.com>
5549
5550         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
5551
5552 2000-04-08  Jim Meyering  <meyering@lucent.com>
5553
5554         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
5555         names don't conflict.  Reported by Eli Zaretskii.
5556
5557 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
5558
5559         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
5560         bug.  Deal with the different error behavior of Irix iconv.
5561
5562 2000-04-07  Jim Meyering  <meyering@lucent.com>
5563
5564         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
5565         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
5566
5567 2000-04-05  Jim Meyering  <meyering@lucent.com>
5568
5569         Portability tweaks required for ultrix4.3.
5570         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
5571         * readutmp.c: Include sys/types.h before sys/stat.h.
5572         * canon-host.c: Declare strdup.
5573         * path-concat.c: Likewise.
5574         From John David Anglin.
5575
5576 2000-04-04  Jim Meyering  <meyering@lucent.com>
5577
5578         Be more DOS 8.3-friendly.
5579         * ref-add.sin: Renamed from ref-add.sed.in.
5580         * ref-del.sin: Renamed from ref-del.sed.in.
5581         * Makefile.am: Reflect renaming.
5582         Reported by Eli Zaretskii.
5583
5584         Use a temporary file name that won't clash with `charset.alias'
5585         in the DOS 8.3 name space.
5586         * Makefile.am (charset_tmp): Define.
5587         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
5588         (uninstall-local): Likewise.
5589         Reported by Eli Zaretskii.
5590
5591 2000-03-29  Paul Eggert  <eggert@twinsun.com>
5592
5593         * time/strftime.c (my_strftime): Make sure we call the system
5594         strftime, not ourselves, when invoking the underlying strftime.
5595
5596 2000-03-24  Jim Meyering  <meyering@lucent.com>
5597
5598         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
5599         (charset_alias): Define.
5600         (install-exec-local): Factor out common code.
5601         (uninstall-local): Split lines longer than 80.
5602         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
5603         (SUFFIXES): Define.
5604         (.sed.in.sed): New rule.  Don't redirect directly to $@.
5605         (CLEANFILES): Add ref-add.sed and ref-del.sed.
5606
5607 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
5608
5609         * config.charset: Output a line containing "Packages using this file".
5610         * ref-add.sed.in, ref-del.sed.in: New files.
5611         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
5612         ref-del.sed): New rules.
5613
5614 2000-03-17  Jim Meyering  <meyering@lucent.com>
5615
5616         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
5617         Otherwise, include <strings.h>
5618
5619 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
5620
5621         * unicodeio.c (utf8_wctomb): New function.
5622         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
5623         format instead of in UCS-4 with platform dependent endianness.
5624
5625 2000-03-07  Paul Eggert  <eggert@twinsun.com>
5626
5627         * savedir.c (savedir): Work even if directory size is
5628         negative; this can happen with some screwy NFS configurations.
5629
5630 2000-03-06  Jim Meyering  <meyering@lucent.com>
5631
5632         * localcharset.c (get_charset_aliases): Don't try to free file_name
5633         if it's NULL (because we ran out of memory).  From Bruno Haible.
5634
5635 2000-03-05  Jim Meyering  <meyering@lucent.com>
5636
5637         * localcharset.c ("path-concat.h"): Include.
5638         (get_charset_aliases): Use path_concat instead of ANSI string
5639         concatenation.
5640
5641         * unicodeio.h (PARAMS): Define.
5642         Use it to guard prototype.
5643
5644 2000-03-04  Jim Meyering  <meyering@lucent.com>
5645
5646         * Makefile.am (install-exec-local): Create $(libdir) before installing
5647         into it.
5648         (uninstall-local): Uncomment this rule so `make distcheck' works
5649         once again.
5650
5651         * unicodeio.c (<errno.h>): Include it.
5652         (errno): Declare if not defined.
5653
5654         * localcharset.c: Add Bruno's comment justifying use of volatile.
5655
5656         * config.charset: New version, incorporating remarks from a linux
5657         i18n mailing list.  From Bruno Haible.
5658
5659 2000-03-02  Jim Meyering  <meyering@lucent.com>
5660
5661         * Makefile.am (EXTRA_DIST): Add config.charset.
5662
5663 2000-03-01  Jim Meyering  <meyering@lucent.com>
5664
5665         * localcharset.c: Guard some #includes with `#if HAVE_...'.
5666         * unicodeio.c: Likewise.
5667
5668 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
5669
5670         * config.charset: New file.
5671         * localcharset.c: New file.
5672         * unicodeio.h, unicodeio.c: New files.
5673         * Makefile.am (DEFS): Add -DLIBDIR=...
5674         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
5675         (noinst_HEADERS): Add unicodeio.h.
5676         (all-local, install-exec-local, charset.alias): New targets.
5677
5678 2000-02-28  Paul Eggert  <eggert@twinsun.com>
5679
5680         * quotearg.c (ALERT_CHAR): New macro.
5681         (quotearg_buffer_restyled): Use it.
5682
5683 2000-02-27  Jim Meyering  <meyering@lucent.com>
5684
5685         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
5686         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
5687
5688         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
5689         not `#if STDC_HEADERS'.
5690         Declare malloc if needed.
5691
5692         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
5693         now that autoconf always defines the HAVE_DECL_ symbols.
5694         * human.c: Likewise.
5695         * same.c: Likewise.
5696         * strtoumax.c: Likewise.
5697
5698         * backupfile.c: Arrange for cpp to fail if the configure-time
5699         declaration check was not run.
5700         * hash.c: Likewise.
5701         * human.c: Likewise.
5702         * same.c: Likewise.
5703         * strtoumax.c: Likewise.
5704
5705         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
5706         then first look up the entire `.'-containing string as a login name.
5707
5708 2000-02-18  Paul Eggert  <eggert@twinsun.com>
5709
5710         * getdate.y: Handle two-digit years with leading zeros correctly.
5711         (textint): New typedef.
5712         (parser_control): Member year changed from int to textint.
5713         All uses changed.
5714         (YYSTYPE): Removed; replaced by %union with int and textint members.
5715         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
5716         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
5717         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
5718         (tSNUMBER, tUNUMBER): Now of type <textintval>.
5719         (date, number, to_year): Use width of number in digits, not its value,
5720         to determine whether it's a 2-digit year, or a 2-digit time.
5721         (yylex): Store number of digits of numeric tokens.
5722         Reported by John Kendall.
5723
5724         (parser_control): Changed from struct parser_control to typedef (for
5725         consistency).  All uses changed.
5726
5727         (tID): Removed; not used.
5728         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
5729
5730 2000-02-14  Paul Eggert  <eggert@twinsun.com>
5731
5732         * getpagesize.h (getpagesize): Port to VMS for Alpha;
5733         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
5734
5735 2000-02-12  Jim Meyering  <meyering@lucent.com>
5736
5737         * userspec.c (ISDIGIT): Define it.
5738         (isdigit): Remove definition.
5739         (is_number): Use ISDIGIT, not isdigit.
5740         <libintl.h>: Include.
5741         (_ and N_): Define.
5742         (parse_user_spec): Mark translatable strings.
5743
5744 2000-02-10  Jim Meyering  <meyering@lucent.com>
5745
5746         With these changes, nanosleep.[ch] are finally enough like the other
5747         lib/* replacement files to compile on a few more losing systems.
5748
5749         * nanosleep.h: Don't include config.h.
5750         Remove prototype from declaration of nanosleep.
5751         (PARAMS): Remove now-unneeded definition.
5752         * nanosleep.c: #undef nanosleep.
5753         (rpl_nanosleep): Rename from nanosleep.
5754
5755 2000-02-03  Jim Meyering  <meyering@lucent.com>
5756
5757         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
5758         rather than with `#if HAVE_UTMPNAME'.
5759
5760 2000-02-01  Jim Meyering  <meyering@lucent.com>
5761
5762         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
5763
5764 2000-01-31  Jim Meyering  <meyering@lucent.com>
5765
5766         * nanosleep.h (nanosleep): Guard declaration with
5767         `#if ! HAVE_DECL_NANOSLEEP'.
5768         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
5769         the declaration in that vendor's sys/timers.h.
5770         Reported by Christian Krackowizer.
5771
5772         * quotearg.c (ISASCII): Add #undef and move definition to follow
5773         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
5774         (ISPRINT): Likewise.
5775         Reported by Tom Tromey.
5776
5777 2000-01-30  Jim Meyering  <meyering@lucent.com>
5778
5779         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
5780         uses of ->ut_name.  The latter doesn't work with new Linux header files
5781         where only utmpx.ut_user is declared.
5782
5783         * readutmp.h (UT_USER): Define.
5784
5785 2000-01-23  Jim Meyering  <meyering@lucent.com>
5786
5787         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
5788         obstack.c.
5789
5790 2000-01-22  Jim Meyering  <meyering@lucent.com>
5791
5792         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
5793         [! HAVE_DECL_STRTOULL]: Declare strtoull.
5794         Required for some AIX systems.  Reported by Christian Krackowizer.
5795         [TESTING] (main): New function.
5796
5797         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
5798         * dirname.c (dir_name): Support for DOS-style file names with drive
5799         letters.
5800
5801         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
5802
5803         * strverscmp.c (ISDIGIT): Define.
5804         (strverscmp): Use ISDIGIT, not isdigit.
5805
5806 2000-01-17  Paul Eggert  <eggert@twinsun.com>
5807
5808         * nanosleep.c (nanosleep):
5809         Don't use SA_INTERRUPT to decide whether to call sigaction, as
5810         POSIX.1 doesn't require SA_INTERRUPT and some systems
5811         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
5812         it's been part of POSIX.1 since day 1 (in 1988).
5813
5814 2000-01-17  Jim Meyering  <meyering@lucent.com>
5815
5816         * interlock: Remove unused file.  Reported by François Pinard.
5817
5818 2000-01-16  Paul Eggert  <eggert@twinsun.com>
5819
5820         * quotearg.c (quotearg_buffer_restyled): Do not quote
5821         alert, backslash, formfeed, and vertical tab unnecessarily in
5822         shell quoting style.
5823
5824
5825 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
5826   Free Software Foundation, Inc.
5827 Copying and distribution of this file, with or without modification,
5828 are permitted provided the copyright notice and this notice are preserved.