Assume ANSI C.
[pspp] / lib / ChangeLog
1 2003-09-10  Bruno Haible  <bruno@clisp.org>
2
3         * strcspn.c: Include <string.h> unconditionally.
4         * strpbrk.c: Include <string.h> unconditionally.
5         * strstr.c: Include <string.h> unconditionally.
6         * unicodeio.c: Include <string.h> unconditionally.
7         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
8         * unsetenv.c: Likewise.
9         * xreadlink.c: Include <stdlib.h> unconditionally.
10         * yesno.c: Include <stdlib.h> unconditionally.
11         (rpmatch): Add prototype.
12
13 2003-09-10  Jim Meyering  <jim@meyering.net>
14
15         * error.c: Correct indentation of cpp directives.
16
17 2003-09-09  Paul Eggert  <eggert@twinsun.com>
18
19         More K&R removal.
20
21         * acosl.c (main): Use a prototype.
22         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
23         tanl.c: Likewise.
24
25         * getloadavg.c (getloadavg, main): Define via prototypes.
26
27         * getopt.h (struct option.name): Assume C89, and use 'const'.
28         (getopt, etopt_long, getopt_long_only, _getopt_internal)
29         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
30         with a prototype.
31         * getopt.c (const): Remove macro.
32         Include <string.h> unconditionally.
33         (my_index): Remove; all uses changed to strchr.
34         (strlen): Remove decl.
35         (exchange): Remove forward decl; no longer needed.
36         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
37         Define with prototype.
38         * getopt1.c (const): Remove macro.
39         (getopt_long, getopt_long_only, main): Define with prototype.
40
41         * getugroups.c: Include <string.h> unconditionally.
42
43         * getusershell.c: Include <stdlib.h> unconditionally.
44         (getusershell, setusershell, endusershell, readname, main):
45         Define with prototypes.
46
47         * group-member.c: Include group-member.h first.
48         Include <stdlib.h> unconditionally.
49
50         * hard-locale.c: Include hard-locale.h first.
51         Include <stdlib.h>, <string.h> unconditionally.
52
53         * hash.c (free, malloc): Remove decls.
54         Include <stdlib.h> unconditionally.
55
56         * human.c: Include <stdlib.h>, <string.h> unconditionally.
57         (getenv): Do not declare.
58
59         * idcache.c: Include <string.h> unconditionally.
60
61         * long-options.c: Include long-options.h first, to test interface.
62         Include <stdlib.h> unconditionally.
63
64         * makepath.c: Include makepath.h first, to test interface.
65         Include <stdlib.h> and <string.h> unconditionally.
66
67         * linebuffer.c: Include <stdlib.h>.
68         (free): Remove decl.
69
70         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
71         rpl_malloc returns void *, not char *.
72         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
73
74         * md5.h: Include <limits.h> unconditionally.
75         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
76         (__P): Remove; all uses removed.
77         * md5.c: Include "md5.h" first.
78         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
79         md5_buffer, md5_process_bytes, md5_process_block):
80         Define with prototypes.
81         * sha.h (__P): Remove all uses.  (It wasn't defined??)
82         * sha.c: Include "sha.h" first.
83         Include <stdlib.h>, <string.h> unconditionally.
84
85         * memchr.c (__ptr_t): Remove; all uses changed to void *.
86         * memcmp.c (__ptr_t): Likewise.
87         * memrchr.c (__ptr_t): Likewise.
88         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
89         Include <string.h> unconditionally.
90         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
91         * memchr.c: Include <stdlib.h> unconditionally.
92         * memchr.c (LONG_MAX): Remove.
93         * memrchr.c (LONG_MAX): Likewise.
94         * memchr.c (__memchr): Define via a prototype.
95         * memrchr.c (__memrchr): Likewise.
96         * memcmp.c (__P): Remove, and remove all uses.
97         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
98         Remove forward decls; no longer needed.
99         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
100         Use types required by C89 in prototype.
101
102         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
103         * savedir.c: Likewise.
104         * mkdir.c (free): Remove decl.
105         * rmdir.c (rmdir): Define with a prototype.
106         * savedir.c: Include savedir.h first, to test interface.
107
108         * mktime.c (STDC_HEADERS): Remove.
109         Include <stdlib.h>, <string.h> unconditionally.
110
111         * modechange.c: Include <stdlib.h> unconditionally.
112         (malloc): Remove decl.
113
114         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
115         (free): Remove decl.
116
117         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
118         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
119         (This type really should be intptr_t, but that's a C99ism.)
120         (_obstack_memcpy): Remove: all uses changed to memcpy.
121         Include <string.h> unconditionally.
122         (struct obstack): Assume __STDC__ for types of members
123         chunkfun, freefun, extra_arg.
124         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
125         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
126         obstack_begin, obstack_specify_allocation,
127         obstack_specify_allocation_with_arg, obstack_chunkfun,
128         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
129         Remove unprototyped decls and the macros that use them.
130         * obstack.c (POINTER): Remove.  All uses changed to void *.
131         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
132         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
133         (defined __STDC__ && __STDC__)]:
134         Remove nonprototyped code.
135         Include <stdlib.h> unconditionally.
136         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
137         _obstack_allocated_p, _obstack_free, obstack_free,
138         _obstack_memory_used, print_and_abort):
139         Define using prototypes.
140         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
141         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
142         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
143         obstack_next_free, obstack_object_size, obstack_room) [0]:
144         Remove unused, unprototyped code.
145
146         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
147
148         * physmem.c (physmem_total, physmem_available, main): Define
149         with prototypes.
150
151         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
152         (main): Define with a prototype.
153
154         * posixver.c (getenv): Remove decl.
155
156         * putenv.c (malloc): Returns void *, not char *.
157         Include <string.h> unconditionally.
158         (strchr, memcpy, NULL): Do not define.
159
160         * readtokens.c: Include readtokens.h first, to test interface.
161         Include <stdlib.h>, <string.h> unconditionally.
162         (init_tokenbuffer): Define with a prototype.
163
164         * regex.c (PARAMS): Remove.  All uses removed.
165         All uses of _RE_ARGS removed, too.
166         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
167         unconditionally.
168         (bzero): Assume memset exists.
169         (memcmp, memcpy, NULL): Remove.
170         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
171         char, or assignments to local vars of type signed char.
172         (init_syntax_once, PREFIX(extract_number_and_incr),
173         PREFIX(print_partial_compiled_pattern),
174         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
175         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
176         PREFIX(regex_grow_registers), PREFIX(regex_compile),
177         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
178         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
179         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
180         wcs_compile_range, byte_compile_range, truncate_wchar,
181         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
182         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
183         count_mbs_length, wcs_re_match_2_internal,
184         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
185         PREFIX(alt_match_null_string_p),
186         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
187         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
188         regfree, PREFIX(extract_number)): Define with prototype.  Remove
189         now-unnecessary declaration, if any.
190         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
191         regcomp, regexec):
192         Remove now-unnecessary casts among pointer types.
193         * regex.h (_RE_ARGS): Remove.  All uses removed.
194
195         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
196         (free): Remove decl.
197
198         * rpmatch.c: Include <stdlib.h> unconditionally.
199
200         * same.c: Include <stdlib.h>, <string.h> unconditionally.
201         (free): Remove decl.
202
203         * save-cwd.c: Include <stdlib.h> unconditionally.
204         * xgetcwd.c: Likewise.
205
206         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
207         (free): Remove decl.
208
209         * strchrnul.c (strchrnul): Define with a prototype.
210         Fix bug: c_in was not converted to char before searching.
211
212         The following changes are not K&R related:
213
214         * group-member.h: Include <sys/types.h>, so that this file is
215         self-contained.
216         * makepath.h: Likewise.
217
218         * getusershell.c (readname, default_index, line_size, readname):
219         Use size_t, not int, for sizes.
220         (readname): If the size overflows, report an error instead of
221         looping forever.
222
223 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
224
225         * getndelim2.c: Assume stdlib.h per the C89 spec.
226
227 2003-09-08  Paul Eggert  <eggert@twinsun.com>
228
229         Assume C89 or better; remove K&R cruft.
230         A few of these changes were first proposed by Derek Robert Price
231         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
232
233         * addext.c: Include <string.h> unconditionally.
234         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
235         Don't declare getenv or malloc.
236
237         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
238         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
239         (NULL): Remove.
240         (find_stack_direction, alloca): Use prototypes.
241
242         * atexit.c (atexit): Define using a prototype.
243
244         * basename.c, dirname.c, stripslash.c:
245         Include <string.h> unconditionally.
246
247         * bcopy.c: Include <stddef.h>.
248         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
249
250         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
251
252         * error.h (error, error_at_line, error_print_progname)
253         [! (defined (__STDC__) && __STDC__)]: Remove decls.
254         * error.c: Include error.h first, to check interface.
255         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
256         (VA_START): Remove; all uses changeed to va_start.
257         (exit, strerror): Remove decls.
258         (error_print_progname): Prototype uncondionally.
259         Don't include <errno.h>; no longer needed.
260         (private_strerror): Remove.
261         (error_tail): Always define.
262         (error, error_at_line): Assume C89 or better; always use prototypes.
263         * fatal.c: Include "fatal.h" first, to test interface.
264         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
265         (VA_START): Remove; all uses changed to va_start.
266         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
267         this case.
268         (exit): Remove decl.
269         (fatal): Prototype unconditionally.  Assume va_start works.
270         Abort at end, to pacify gcc.
271
272         * euidaccess.c (main): Define with a prototype.
273
274         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
275
276         * exitfail.c: Include <stdlib.h> unconditionally.
277
278         * fnmatch_.h (__P): Remove.  All uses changed to assume
279         prototypes.
280         * fnmatch.c: Include fnmatch.h first, to test interface.
281         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
282         (getenv): Remove decl.
283         (fnmatch): Define using a prototype.
284         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
285         (FCT): Define using a prototype.
286
287         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
288
289         * gethostname.c: Include <stddef.h>.
290         (gethostname): Define with prototype.  Length is size_t, not int.
291
292 2003-09-08  Paul Eggert  <eggert@twinsun.com>
293
294         * getversion.c: Remove; was migrated to backupfile.c in 1997.
295         getversion.c should have been removed then, but was accidentally
296         preserved.
297
298         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
299         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
300
301 2003-09-07  Paul Eggert  <eggert@twinsun.com>
302
303         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
304         copy_tm_result.  Bug reported by Simon Josefsson in
305         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
306
307 2003-09-06  Paul Eggert  <eggert@twinsun.com>
308
309         * time_r.c, time_r.h: New files.
310
311         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
312         __localtime_r.
313         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
314         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
315
316         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
317         __gmtime_r.
318         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
319         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
320         Include <time_r.h>.
321
322         * timegm.c: Switch to glibc implementation, with the following changes:
323         [defined HAVE_CONFIG_H]: Include <config.h>.
324         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
325         (__mktime_internal) [!defined _LIBC]: New decl.
326         (__gmtime_r) [!defined _LIBC]: New macro and function.
327         (timegm): Use a prototype, since gnulib assumes C89.
328         Do not bother declaring tmp to be const, as it's not really usefu.
329         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
330         (timegm): Declare only if HAVE_DECL_TIMEGM.
331
332 2003-09-03  Paul Eggert  <eggert@twinsun.com>
333
334         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
335         Bug reported by Lute Kamstra in
336         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
337
338         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
339         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
340         course with correspondingly smaller numbers for tomorrow and
341         yesterday.  From Tadayoshi Funaba.  Originally installed into
342         sh-utils on 1999-08-07, but the patch got lost (I guess during the
343         coreutils merge?).
344
345 2003-08-31  Simon Josefsson  <jas@extundo.com>
346
347         * timegm.h: New file.
348         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
349
350 2003-08-31  Karl Berry  <karl@gnu.org>
351
352         * argp.h: update from libc.
353
354 2003-08-28  Bruno Haible  <bruno@clisp.org>
355
356         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
357         warning on QNX, which defines O_BINARY to 000000.
358
359 2003-08-24  Bruno Haible  <bruno@clisp.org>
360
361         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
362         MSVC7 <stdio.h> is included later.
363
364 2003-08-20  Bruno Haible  <bruno@clisp.org>
365
366         * progname.h: New file, from GNU gettext.
367         * progname.c: New file, from GNU gettext.
368         * progreloc.c: New file, from GNU gettext.
369
370 2003-08-19  Bruno Haible  <bruno@clisp.org>
371
372         * xstrdup.c: Assume <string.h> exists.
373
374 2003-08-18  Jim Meyering  <jim@meyering.net>
375
376         * setenv.h: Indent nested cpp directive.
377         * vasnprintf.c: Remove trailing blanks.
378
379 2003-08-17  Simon Josefsson  <jas@extundo.com>
380             Bruno Haible  <bruno@clisp.org>
381
382         * xstrndup.h: New file.
383         * xstrndup.c: New file.
384
385 2003-08-17  Bruno Haible  <bruno@clisp.org>
386
387         * strndup.h: New file.
388
389 2003-08-16  Paul Eggert  <eggert@twinsun.com>
390
391         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
392         space, undoing this 2003-08-12 change:
393         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
394
395 2003-08-16  Jim Meyering  <jim@meyering.net>
396
397         Merge from coreutils.
398         * xstrtoimax.c: #else #if -> #elif.
399         * xstrtoumax.c: Likewise.
400
401 2003-08-15  Paul Eggert  <eggert@twinsun.com>
402
403         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
404         rather than tab, after '#' in shell-script copyright notices.
405         Suggested by Bruno Haible.
406
407 2003-08-15  Jim Meyering  <jim@meyering.net>
408         and Paul Eggert  <eggert@twinsun.com>
409
410         Merge from coreutils.
411         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
412         member but strut utmpx does not.  Needed for AIX 4.3.3.
413         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
414
415 2003-08-15  Jim Meyering  <jim@meyering.net>
416
417         Merge from coreutils.
418         * xgethostname.c: Include <stdlib.h>.
419         (xghostname): Don't exit for anything other than memory-related
420         failure; just return NULL.
421         * userspec.c: Include "posixver.h".
422         (parse_user_spec): Accept `.' as a separator only
423         in pre-POSIX-200112 mode.
424         * strtoimax.c: Use #elif rather than #else #if.
425         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
426         Remove function, now that we can rely on a working tzset function.
427         [!_LIBC]: Ensure that the required autoconf test has been run.
428         [!defined _NL_CURRENT && HAVE_STRFTIME]:
429         Use underlying_strftime for %r.
430         * sha.c: Merge in some clean-up and optimization changes from glibc.
431         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
432         Ensure that it is a multiple of 64.
433         Rearrange loop exit tests so as to avoid performing an
434         additional fread after encountering an error or EOF.
435         * realloc.c: Update copyright date.
436
437 2003-08-14  Jim Meyering  <jim@meyering.net>
438
439         Merge from coreutils.
440         * obstack.h: Whitespace changes.
441         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
442         and xcalloc return values.
443         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
444         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
445         hang on OSF/1 5.1 for DIR on both local and remote file systems.
446         Reported by (and fix confirmed by) Nelson H. F. Beebe.
447         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
448         error from mntctl.
449         Use mntctl's return value to drive the entry-processing loop, since
450         we can't rely on the value of the vmt_length member in the last
451         entry.  On some systems doing so could result in exhausting
452         virtual memory.  Based in part on a patch from Mike Jetzer.
453
454 2003-08-14  Jim Meyering  <jim@meyering.net>
455         and Paul Eggert  <eggert@twinsun.com>
456
457         Merges from coreutils, plus other fixes.
458         * physmem.c: Merge in portability changes from gcc/libiberty
459         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
460         for credits and details.  Thanks to Kaveh Ghazi for helping
461         to keep these files in sync.
462         (ARRAY_SIZE): Define it.
463         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
464         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
465         (memcasecmp): Don't assume size_t fits in unsigned int.
466         Remove casts and duplicate code.
467         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
468         (memcpy): Remove definition.
469         Merge in some clean-up and optimization changes from glibc.
470         [BLOCKSIZE]: Move definition to top of file.
471         Ensure that it is a multiple of 64.
472         Rearrange loop exit tests so as to avoid performing an
473         additional fread after encountering an error or EOF.
474         * md5.h (md5_uintptr): Define.
475         * makepath.c (CLEANUP_CWD): Report an error if we failed to
476         return to the initial working directory.  Preserve errno
477         for caller.
478         * idcache.c: Include "xalloc.h".
479         (xmalloc, xrealloc): Remove decls.
480         (getuser): Remove casts no longer required in C89.
481         * human.c: Include stdio.h, for sprintf.
482         * group-member.c: Include "xalloc.h".
483         (xmalloc, xrealloc): Remove decls.
484         (get_group_info): Remove casts no longer required in C89.
485         * getusershell.c (readname): Remove casts no longer required in C89.
486         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
487         * getline.c: Whitespace fix, from coreutils.
488
489 2003-08-13  Paul Eggert  <eggert@twinsun.com>
490
491         * exclude.c: Include <ctype.h>
492         (IN_CTYPE_DOMAIN): New macro.
493         (is_space): New fn.
494         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
495         and empty lines.
496
497         * argp-help.c, argp-parse.c, config.charset, getopt.h:
498         Undo previous (whitespace-only) change.
499
500 2003-08-12  Paul Eggert  <eggert@twinsun.com>
501
502         * argp-help.c, argp-parse.c, config.charset, getopt.h:
503         Normalize leading white space and remove trailing white space.
504         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
505         notice, as per ../config/srclist-update.
506
507         Merge from coreutils.
508         * euidaccess.h: New file.
509         * euidaccess.c: Include it.
510         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
511         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
512         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
513
514 2003-08-11  Bruno Haible  <bruno@clisp.org>
515
516         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
517         (vasnprintf): Use it instead of wcslen.
518
519 2003-08-11  Bruno Haible  <bruno@clisp.org>
520
521         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
522         value to ensure that _Bool promotes to int. Use #define for _Bool when
523         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
524
525 2003-08-10  Karl Berry  <karl@gnu.org>
526
527         * regex.h: update from libc (whitespace fix).
528
529 2003-08-09  Paul Eggert  <eggert@twinsun.com>
530
531         Merge some files from coreutils.  These changes were
532         originally made by Jim Meyering.
533         * lib/acl.c: Include <sys/types.h> before <sys/stat.h>;
534         many older Unixes require this.
535         * lib/alloca.c (alloca): Remove cast to argument of free;
536         no longer needed in C89.
537         * lib/alloca_.h, lib/regex.h: Fix white space to match
538         what GNU indent does.
539
540 2003-08-05  Paul Eggert  <eggert@twinsun.com>
541
542         * bumpalloc.h: Remove.
543
544 2003-08-04  Paul Eggert  <eggert@twinsun.com>
545
546         * getloadavg.c: Change copyright notice and spacing to conform to
547         GNU coding style.
548
549         Merge from coreutils.
550         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
551         From glibc.
552         * getdate.y (date): Also accept dates like May-23-2003; suggestion
553         from Karl Berry, implemented by Jim Meyering.
554         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
555         from Dmitry V. Levin.
556         Remove anachronistic cast of xrealloc.
557         * fnmatch_.h (__const): Remove.  Use 'const'.
558         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
559         type. Otherwise, it wouldn't compile with at least /bin/cc on
560         ymp-cray-unicos9.0.2.X.
561         Combine two mostly-identical uses of alloca into one.
562         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
563
564 2003-08-04  Dave Love <d.love@dl.ac.uk>
565
566         [From Emacs.]
567
568         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
569         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
570         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
571         obsolete NLIST_NAME_UNION.
572         [__GNU__]: Undef BSD and FSCALE.
573         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
574
575 2003-08-03  Paul Eggert  <eggert@twinsun.com>
576
577         * stdbool_.h (_Bool): Make it signed char, instead of
578         an enum type, so that it's guaranteed to promote to int.  See:
579         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
580
581 2003-07-31  Paul Eggert  <eggert@twinsun.com>
582
583         * strerror.c: Include config.h, limits.h.  Declare sprintf.
584         (strerror): Don't assume that a printable int fits in 14 bytes.
585
586 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
587             Bruno Haible  <bruno@clisp.org>
588
589         * getline.h (getline, getdelim): Change return type to ssize_t.
590         * getline.c (getline, getdelim): Likewise.
591         Remove _GNU_SOURCE define; now it's defined in config.h through
592         m4/getline.m4.
593
594 2003-07-22  Paul Eggert  <eggert@twinsun.com>
595
596         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
597         over-parenthesization in macros.
598
599         Sync with coreutils.
600
601         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
602         required by C99.
603
604         Use `exit_failure' for xalloc and xmemcoll instead of their own
605         private exit-failure variables.
606         * xalloc.h (xalloc_exit_failure): Remove.
607         * xmalloc.c: Likewise.  Include exitfail.h.
608         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
609         * xmemcoll.h (xmemcoll_exit_failure): Remove.
610         * xmemcoll.c: Likewise.  Include exitfail.h.
611         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
612
613 2003-07-18  Paul Eggert  <eggert@twinsun.com>
614
615         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
616         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
617         to test that it can stand by itself.  Include "exitfail.h".
618         Clients should set exit_failure instead.
619         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
620
621 2003-07-18  Andreas Schwab  <schwab@suse.de>
622
623         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
624
625 2003-07-18  Bruno Haible  <bruno@clisp.org>
626
627         * getndelim2.h: New file.
628         * getndelim2.c: Make into a module of its own. Include config.h,
629         getndelim2.h.
630         (getndelim2): Make non-static. Change return type to ssize_t.
631         * getline.h: Change argument names.
632         * getline.c: Include getndelim2.h instead of getndelim2.c.
633         * getnline.c: Include getndelim2.h.
634
635 2003-07-17  Bruno Haible  <bruno@clisp.org>
636
637         * Makefile.am: Remove file.
638         * Makefile.in: Remove file.
639
640 2003-07-17  Bruno Haible  <bruno@clisp.org>
641
642         * getnline.h: New file.
643         * getnline.c: New file.
644         * getndelim2.c: New file, extracted from getline.c.
645         (getndelim2): Renamed from getdelim2, with added nmax argument.
646         * getline.c: Include getndelim2.c.
647         (getdelim2): Moved out to getndelim2.c.
648         (getline, getdelim): Update.
649
650 2003-07-15    <karl@gnu.org>
651
652         * vasnprintf.c: update from gettext.
653
654 2003-07-15  Jim Meyering  <jim@meyering.net>
655
656         * makepath.c (make_path): Enclose diagnostic in _(...).
657
658 2003-07-14  Paul Eggert  <eggert@twinsun.com>
659
660         * asnprintf.c, asprintf.c, config.charset, gettext.h,
661         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
662         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
663         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
664         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
665         updated automatically by ../config/srclist-update.  This changes
666         their license from LPGL to GPL.
667
668 2003-07-14  Jim Meyering  <jim@meyering.net>
669
670         Don't emit diagnostics.  Let callers do that.
671         * save-cwd.c: Don't include "error.h".
672         (save_cwd): Don't call error.  Ensure that errno is valid
673         when returning nonzero.
674
675         * save-cwd.h (restore_cwd): Update prototype.
676         * save-cwd.c (restore_cwd): Remove two parameters.
677         Simplify.  Don't call error upon failure.  Let callers do that.
678         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
679         when auditing is enabled.  But don't bother updating the #if.
680
681 2003-07-14  Simon Josefsson  <jas@extundo.com>
682
683         * mempcpy.h: New file.
684         * mempcpy.c: New file.
685
686 2003-07-14  Paul Eggert  <eggert@twinsun.com>
687
688         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
689         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
690         unicodeio.c, unicodeio.h, unlocked-io.h:
691         Switch from LGPL to GPL.
692
693 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
694
695         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
696         it breaks C++ compilation.
697         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
698
699 2003-07-10  Jim Meyering  <jim@meyering.net>
700
701         * vasnprintf.c: Remove trailing blanks.
702         Make cpp indentation consistent.
703
704 2003-07-09  Paul Eggert  <eggert@twinsun.com>
705
706         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
707         posixver.c, strftime.c, strnlen.c, strverscmp.c:
708         Switch from LGPL to GPL.
709
710 2003-07-07  Paul Eggert  <eggert@twinsun.com>
711
712         * mktime.c: Fix some boundary cases and remove need for floating point.
713
714         Issue a compile-time diagnostic if time_t is floating point, or if
715         two's complement arithmetic is not in effect, or if arithmetic
716         right shift does not propagate the sign.  These assumptions were
717         all in the original code but they weren't checked.
718
719         (TIME_T_MIDPOINT, verify): New macros.
720         (__isleap): Remove; it has integer overflow problems.
721         (leapyear): New function, without those problems.
722         (ydhms_tm_diff): Remove; splitting into two parts.
723         (ydhms_diff): New function, containing the arithmetic part of
724         the old ydhms_tm_diff function.  Issue a compile-time
725         diagnostic if we are not using C99 integer division.
726         Avoid casts when possible.
727         (guess_time_tm): New function, containing the checking part of
728         the old ydhms_tm_diff function.  Return the new value, rather than
729         the difference between it and the old.  Accept a new argument T
730         so that *T specifies the old value.  Check for overflow in the result.
731
732         (__mktime_internal): Use a time_t offset, not a long int offset.
733         This undoes the 2003-06-04 change, which is no longer needed now
734         that we have better overflow checking.
735         (localtime_offset): Likewise.
736
737         (__mktime_internal): Avoid harmful overflow on hosts where time_t
738         and long are 64-bit but int is only 32-bit.
739         (ydhms_diff): Use long int to store year1 and yday1.
740         Issue a compile-time diagnostic if long int is not wide enough.
741
742         (__mktime_internal): Use long int to store adjusted year and yday.
743         Use plain C rather than preprocessor commands, if that doesn't
744         affect efficiency.
745         Check for overflow (and try to repair) after each probe
746         rather than checking only at the very end.  This avoids some bugs
747         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
748         does not equal GMT offset at maximum time).
749         Use integer to check for overflow rather than floating point; this
750         is more portable to non-IEEE hosts, and is a tad faster.
751         When we detect that we are oscillating between two values,
752         don't check whether tm_isdst has the requested value, since
753         we already know the answer.  When tm_isdst has the wrong value,
754         use a different heuristic to find the right one, based on the
755         extreme values actually observed in practice in tz2003a,
756         rather than the (overly optimistic) "previous 3 calendar quarters".
757
758         (not_equal_tm, print_tm, check_result): Use "const T" rather than
759         "T const" to accommodate glibc style.
760         (check_result): Use less-confusing report format.  "long" -> "long int.
761         (main): Likewise.
762         Don't loop if the iteration overflows time_t.
763         Allow a negative step in the iteration.
764
765 2003-07-01  Paul Eggert  <eggert@twinsun.com>
766
767         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
768         having it depend on HAVE_SYS_TYPES_H.
769
770 2003-06-25  Bruno Haible  <bruno@clisp.org>
771
772         * readlink.c: New file.
773
774 2003-06-20  Bruno Haible  <bruno@clisp.org>
775
776         Assume C89, so PARAMS isn't needed.
777         * unicodeio.h (PARAMS): Remove.
778         * unicodeio.c: Don't use PARAMS.
779
780 2003-06-18  Jim Meyering  <jim@meyering.net>
781
782         Merge changes from coreutils.
783         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
784         Remove explicit declarations of xmalloc and realloc.
785         Include xalloc.h.
786         (read_utmp): Remove anachronistic cast of xmalloc.
787
788 2003-06-17  Paul Eggert  <eggert@twinsun.com>
789
790         Assume C89, so PARAMS isn't needed.
791         * backupfile.h (PARAMS): Remove.  All uses removed.
792         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
793         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
794         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
795         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
796         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
797         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
798         xstrtol.h: Likewise.
799         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
800         same.h, strverscmp.h: Do not include config.h; no longer needed.
801         Anyway, config.h should always be included before any other file.
802
803 2003-06-11  Simon Josefsson  <jas@extundo.com>
804
805         * sysexit_.h: New file.
806
807 2003-05-20  Derek Price  <derek@ximbiot.com>
808
809         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
810
811 2003-06-10  Simon Josefsson  <jas@extundo.com>
812
813         * strchrnul.h: New file.
814         * strchrnul.c: New file.
815
816 2003-06-10  Simon Josefsson <jas@extundo.com>
817
818         * argp.h: New file, from glibc.
819         * argp-ba.c: New file, from glibc.
820         * argp-eexst.c: New file, from glibc.
821         * argp-fmtstream.c: New file, from glibc.
822         * argp-fmtstream.h: New file, from glibc.
823         * argp-fs-xinl.c: New file, from glibc.
824         * argp-help.c: New file, from glibc.
825         * argp-namefrob.h: New file, from glibc.
826         * argp-parse.c: New file, from glibc.
827         * argp-pv.c: New file, from glibc.
828         * argp-pvh.c: New file, from glibc.
829         * argp-xinl.c: New file, from glibc.
830
831 2003-06-07  Jim Meyering  <jim@meyering.net>
832
833         * readtokens.h: Put `Free Software Foundation, Inc.'
834         in place of my name in the copyright comment.
835         Remove definition and uses of __P.
836
837         From coreutils.
838         * stat.c: Don't declare xmalloc explicitly.
839         Instead, include "xalloc.h".
840         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
841         xrealloc, and xcalloc return values.
842         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
843         Improve comment.
844         * xgetcwd.h: Remove definition/uses of PARAMS.
845
846 2003-06-06  Jim Meyering  <jim@meyering.net>
847
848         * stdbool_.h: Renamed from stdbool.h.in.
849
850 2003-06-06  Jim Meyering  <jim@meyering.net>
851
852         Merge from coreutils.
853         * same.c: (same_name): Declare *_basename locals to be `const'.
854         Consolidate declarations and initializations of *_base* locals.
855
856         Merge from coreutils.
857         This avoids a core dump on systems without GNU putenv,
858         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
859         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
860         (unsetenv): New static function, from GNU libc.
861         (rpl_putenv): Use it.
862
863         * modechange.c: Remove trailing blanks.
864
865         Merge from coreutils.
866         * fsusage.c: Remove declaration of statfs.
867         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
868
869         * posixtm.c: Include <stdbool.h> unconditionally.
870
871 2003-06-05  Paul Eggert  <eggert@twinsun.com>
872
873         * mktime.c (__mktime_internal): When resolving a tm_isdst
874         mismatch, look in future quarters as well as past.  This fixes a
875         bug when processing fall-backwards gaps immediately after a long
876         period of daylight-saving time.
877
878         * mktime.c: Assume freestanding C89 or better.
879         (HAVE_LIMITS_H): Remove.  Assume it's 1.
880         (__P): Remove; not used.
881         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
882         (mktime, not_equal_tm, print_tm, check_result,
883         main): Use prototypes.  Use const * where appropriate.
884         (main): Fix typo in testing code that uncovered by above changes.
885         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
886
887 2003-06-04  Paul Eggert  <eggert@twinsun.com>
888
889         * mktime.c: Fix Debian bug 177940
890         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
891         (localtime_offset): Now long int, not time_t, because we want it
892         to be guaranteed to be signed.  All uses changed.
893         (__mktime_internal): If overflow would occur when adding offset,
894         don't add it.
895
896         Merge 'human' changes from coreutils.  Rewrite to support
897         locale-specific notations like thousands separators.
898         * human.c: Simplify authorship notice.
899         Include human.h immediately after config.h.
900         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
901         <limits.h>: Do not include, since human.h does.
902         (SIZE_MAX, UINTMAX_MAX): New macros.
903         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
904         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
905         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
906         (power_letter): Renamed from suffixes.
907         (generate_suffix_backwards): Remove.
908         (adjust_value): Now takes int style (because of human.h changes)
909         and long double value (for greater precision on some platforms).
910         (group_number): New function.
911         (human_readable): Use it.  Use integer options, not enum.
912         Put the options before the sizes in the arg list.
913         Support all the new options.
914         The old human_readable function has been removed;
915         use inttostr.h instead.
916         (human_readable, default_block_size, humblock):
917         Use uintmax_t, not int, for block sizes.
918         (human_readable_inexact, block_size_types): Remove.
919         (block_size_opts): New constant.
920         (human_options): Renamed from human_block_size, with new signature
921         that allows block sizes up to UINTMAX_MAX.  All callers changed.
922         * human.h: Add copyright and authorship notice.
923         Include <limits.h> and <stdbool.h> unconditionally.
924         (PARAMS): Remove.  All uses removed.
925         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
926         (enum human_inexact_style): Remove tag; now a nameless enum.
927         (human_floor, human_ceiling, human_round_to_even): Now have
928         values 2, 0, 1 rather than -1, 1, 0.
929         (human_group_digits, human_suppress_point_zero, human_autoscale,
930         human_base_1024, human_SI, human_B): New constants.
931         (human_readable_inexact, human_block_size): Remove.
932         (human_readable): Size args are now uintmax_t, not int.
933         (human_options): New decl.
934
935         * exclude.c: (new_exclude, add_exclude): Remove casts that are
936         unnecessary now that we assume C89 or better.  This change
937         imported from coreutils.
938
939         * mktime.c (__mktime_internal): Do not reject negative timestamps
940         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
941         in the 2003-05-30 sync from glibc.
942
943         .h files should stand alone, but we shouldn't include <sys/types.h>
944         if we can get away with just <stddef.h>.
945
946         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
947         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
948         rather than <sys/types.h>, as we merely need size_t.
949         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
950         to get size_t.
951         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
952         Include <stdio.h>, to get FILE.
953         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
954         memcasecmp.h has included <stddef.h> and all we need is size_t.
955         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
956         our interface, instead of including <sys/types.h>
957
958 2003-06-02  Paul Eggert  <eggert@twinsun.com>
959
960         [from coreutils]
961         Fix some minor time-related bugs with POSIX time arguments.
962         Some valid time stamps were being rejected (notably -1, and
963         time stamps before 1900 on 64-bit hosts).  And some invalid
964         time stamps were being accepted, e.g. September 31.
965
966         * posixtm.h (posixtime): Return bool instead of time_t, so
967         that we can return (time_t) -1 successfully.
968         * posixtm.c: Likewise.
969         [HAVE_STDBOOL_H]: Include <stdbool.h>.
970         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
971         (t): Remove static var.
972         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
973         of static var.  All uses changed.
974         (year): Do not reject years before 1900; they can occur with
975         64-bit time_t.
976         (posix_time_parse): Do not check for out-of-range components;
977         that is now the caller's responsibility, since our checks were
978         only approximations.
979         (posixtime): Use mktime to check for out-of-range components,
980         since it knows them exactly.
981         If mktime returns (time_t) -1, check whether an error actually occurred
982         by invoking localtime on -1.
983         (main) [TEST_POSIXTIME]: Check for input data errors, and report
984         posixtime failures better.
985         Improve the test data (in comments only).
986
987 2003-05-30    <karl@gnu.org>
988
989         * mktime.c: update from libc.
990
991 2003-05-30  Bruno Haible  <bruno@clisp.org>
992
993         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
994         * localcharset.h: Likewise.
995         * localcharset.c: Likewise.
996
997 2003-05-28  Paul Eggert  <eggert@twinsun.com>
998
999         Assume the headers required for C89 freestanding compilers.
1000         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
1001         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
1002         without checking for HAVE_LIMITS_H.
1003         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
1004         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
1005         to do that.
1006         * fatal.c: Include <stdarg.h> without checking for __STDC__.
1007         * exclude.c: Include <stdbool.h> unconditionally.
1008         * tempname.c: Include <stddef.h> unconditionally.
1009         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
1010         * modechange.c, rpmatch.c (NULL): Don't define, since
1011         <stddef.h> does that.
1012         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
1013         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
1014         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
1015         * xstrtol.c: Likewise.
1016         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
1017         * savedir.c: Include <stddef.h> instead of defining NULL.
1018
1019         * addext.c (addext): Use assignment rather than cast, to avoid
1020         warnings on some platforms.
1021
1022         * mktime.c (__mktime_internal): Do not reject negative timestamps
1023         arbitrarily.
1024
1025 2003-05-10  Bruno Haible  <bruno@clisp.org>
1026
1027         * linebreak.c (iconv_string_length): Don't return -1 just because the
1028         string is longer than 4 KB.
1029
1030 2003-05-12  Jim Meyering  <jim@meyering.net>
1031
1032         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
1033         the space-padded-by-default conversion specifiers, %e, %k, %l.
1034
1035 2003-05-03  Bruno Haible  <bruno@clisp.org>
1036
1037         Upgrade to Unicode-4.0.
1038         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
1039         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
1040         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
1041         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
1042         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
1043         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
1044         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
1045         Change width of U+E0100..U+E01EF from 1 to 0.
1046
1047 2003-04-25  Bruno Haible  <bruno@clisp.org>
1048
1049         * copy-file.c: Include <stddef.h>, for size_t.
1050
1051 2003-04-25  Jim Meyering  <jim@meyering.net>
1052
1053         * copy-file.c (copy_file_preserving): Declare buf_size to be
1054         of type size_t, not int.
1055
1056 2003-04-11  Jim Meyering  <jim@meyering.net>
1057
1058         Merge changes from Coreutils.
1059
1060         2003-03-22  Jim Meyering  <jim@meyering.net>
1061
1062         * strftime.c (widen): Cast alloca return value to proper type.
1063
1064         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
1065
1066         From GNU libc.
1067         * strftime.c (my_strftime): Handle very large width
1068         specifications for numeric values correctly.  Improve checks for
1069         overflow.
1070
1071         2003-01-19  Jim Meyering  <jim@meyering.net>
1072
1073         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
1074         (nl_get_alt_digit) [! defined my_strftime]: Define.
1075         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
1076         _nl_get_alt_digit and _nl_get_walt_digit.
1077
1078         * strftime.c (my_strftime): Merge in locale-related changes from libc.
1079         These changes have no effect outside of _LIBC.
1080
1081 2003-04-10  Bruno Haible  <bruno@clisp.org>
1082
1083         * findprog.h: New file, from GNU gettext.
1084         * findprog.c: New file, from GNU gettext.
1085
1086 2003-04-05  Jim Meyering  <jim@meyering.net>
1087
1088         Merge changes from Coreutils.
1089
1090         * exclude.h (PARAMS): Remove definition and uses.
1091         * exclude.c: Remove uses of `PARAMS'.
1092
1093         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
1094         Add test-cases for DOS filenames. Declare program_name.
1095         (main): Set up program_name.  Patch by Rich Dawe.
1096
1097         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
1098         error from mntctl.
1099         Use mntctl's return value to drive the entry-processing loop, since
1100         we can't rely on the value of the vmt_length member in the last
1101         entry.  On some systems doing so could result in exhausting
1102         virtual memory.  Based in part on a patch from Mike Jetzer.
1103
1104 2003-04-04  Bruno Haible  <bruno@clisp.org>
1105
1106         * linebreak.h: New file, from GNU gettext.
1107         * linebreak.c: New file, from GNU gettext with slight modifications.
1108         * lbrkprop.h: New file, from GNU gettext.
1109
1110 2003-04-03  Bruno Haible  <bruno@clisp.org>
1111
1112         * utf8-ucs4.h: New file, from GNU gettext.
1113         * utf16-ucs4.h: New file, from GNU gettext.
1114         * ucs4-utf8.h: New file, from GNU gettext.
1115         * ucs4-utf16.h: New file, from GNU gettext.
1116
1117 2003-04-02  Bruno Haible  <bruno@clisp.org>
1118
1119         * binary-io.h: New file, from GNU gettext.
1120
1121 2003-04-01  Bruno Haible  <bruno@clisp.org>
1122
1123         * pathname.h: New file, from GNU gettext.
1124         * concatpath.c: New file, from GNU gettext.
1125
1126 2003-03-30  Bruno Haible  <bruno@clisp.org>
1127
1128         * copy-file.c (copy_file_preserving): Don't set owner if the function
1129         chown() doesn't exist.
1130
1131 2003-03-28  Bruno Haible  <bruno@clisp.org>
1132
1133         * copy-file.h: New file, from GNU gettext.
1134         * copy-file.c: New file, from GNU gettext.
1135
1136 2003-03-18  Jim Meyering  <jim@meyering.net>
1137
1138         * quote.c (quote_n): Fix typo in comment.
1139
1140 2003-03-14  Jim Meyering  <jim@meyering.net>
1141
1142         Merge changes from Coreutils.
1143         * obstack.h (obstack_object_size): Declare temporary, __o,
1144         to be const, in order to avoid warnings.
1145         (obstack_room): Likewise.
1146         (obstack_empty_p): Likewise.
1147
1148 2003-03-13  Paul Eggert  <eggert@twinsun.com>
1149
1150         Merge changes from Bison.
1151         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
1152         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1153         when compiling Bison 1.875's `bitset bset = obstack_alloc
1154         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
1155         * hash.c: Include <stdbool.h> unconditionally.
1156
1157 2003-03-09  Paul Eggert  <eggert@twinsun.com>
1158
1159         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
1160         Reported by Bruce Becker; see:
1161         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
1162
1163 2003-03-03  Paul Eggert  <eggert@twinsun.com>
1164             Bruno Haible  <bruno@clisp.org>
1165
1166         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
1167         Reported by John Hughes, see
1168         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
1169
1170 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
1171
1172         * poll_.h: New file.
1173         * poll.c: New file.
1174
1175 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
1176
1177         * mathl.h: New file.
1178         * acosl.c: New file.
1179         * asinl.c: New file.
1180         * atanl.c: New file.
1181         * ceill.c: New file.
1182         * cosl.c: New file.
1183         * expl.c: New file.
1184         * floorl.c: New file.
1185         * frexpl.c: New file.
1186         * ldexpl.c: New file.
1187         * logl.c: New file.
1188         * sincosl.c: New file.
1189         * sinl.c: New file.
1190         * sqrtl.c: New file.
1191         * tanl.c: New file.
1192         * trigl.c: New file.
1193         * trigl.h: New file.
1194
1195 2003-02-17  Bruno Haible  <bruno@clisp.org>
1196
1197         * mkdtemp.h: New file, from GNU gettext.
1198         * mkdtemp.c: New file, from GNU gettext.
1199
1200 2003-01-31  Bruno Haible  <bruno@clisp.org>
1201
1202         * rename.c: #undef rename before defining rpl_rename.
1203         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
1204
1205 2003-01-30  Bruno Haible  <bruno@clisp.org>
1206
1207         * printf-args.h: New file, from GNU gettext.
1208         * printf-args.c: New file, from GNU gettext.
1209         * printf-parse.h: New file, from GNU gettext.
1210         * printf-parse.c: New file, from GNU gettext.
1211         * vasnprintf.h: New file, from GNU gettext.
1212         * vasnprintf.c: New file, from GNU gettext.
1213         * asnprintf.c: New file, from GNU gettext.
1214         * vasprintf.h: New file, from GNU gettext with modifications.
1215         * vasprintf.c: New file, from GNU gettext.
1216         * asprintf.c: New file, from GNU gettext.
1217
1218 2003-01-29  Bruno Haible  <bruno@clisp.org>
1219
1220         * stpncpy.h: New file, from GNU gettext with modifications.
1221         * stpncpy.c: New file, from GNU gettext with modifications.
1222
1223 2003-01-28  Bruno Haible  <bruno@clisp.org>
1224
1225         * c-ctype.h: New file, from GNU gettext, with changes suggested by
1226         Paul Eggert.
1227         * c-ctype.c: New file, from GNU gettext, with changes suggested by
1228         Paul Eggert.
1229
1230 2003-01-27  Bruno Haible  <bruno@clisp.org>
1231
1232         * xsetenv.h: New file, from GNU gettext.
1233         * xsetenv.c: New file, from GNU gettext.
1234
1235 2003-01-23  Bruno Haible  <bruno@clisp.org>
1236
1237         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
1238
1239 2003-01-22  Bruno Haible  <bruno@clisp.org>
1240
1241         * exit.h: New file, from GNU gettext.
1242
1243 2003-01-11  Bruno Haible  <bruno@clisp.org>
1244
1245         * stpcpy.h (stpcpy): Use ANSI C function declarations.
1246         * strcase.h (strcasecmp, strncasecmp): Likewise.
1247
1248 2003-01-14  Jim Meyering  <jim@meyering.net>
1249
1250         * same.c (same_name): Tweak a comment.
1251
1252 2003-01-11  Bruno Haible  <bruno@clisp.org>
1253
1254         * same.c (same_name): Reorder tests so as to avoid calling stat()
1255         when a string comparison is sufficient.
1256
1257 2003-01-11  Bruno Haible  <bruno@clisp.org>
1258
1259         * readtokens.c (readtoken): Cast character to 'unsigned char', not
1260         'unsigned int'.
1261
1262 2003-01-11  Bruno Haible  <bruno@clisp.org>
1263
1264         * hash-pjw.c: Add comment about low quality of this function.
1265
1266 2003-01-12  Paul Eggert  <eggert@twinsun.com>
1267
1268         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
1269         to avoid collisions with libcurses and libreadline.
1270
1271         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
1272         * getstr.h, getstr.c: Remove.
1273         * getline.c: Include "getline.h", to check interface.
1274         Move body of old getstr.c here: this defines MIN_CHUNK and
1275         declares getdelim2, which is renamed from getstr.
1276         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
1277
1278         * linebuffer.c (readlinebuffer): Renamed from readline.
1279         All uses changed.
1280         * linebuffer.h: Likewise.
1281         (readline): Remove backward-compatibility macro.
1282
1283 2003-01-12  Jim Meyering  <jim@meyering.net>
1284
1285         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
1286
1287 2003-01-10  Bruno Haible  <bruno@clisp.org>
1288
1289         * alloca_.h: New file.
1290         * getdate.y: Unconditionally include alloca.h.
1291         * makepath.c: Likewise.
1292         * setenv.c: Likewise.
1293         * userspec.c: Likewise.
1294
1295 2003-01-09  Bruno Haible  <bruno@clisp.org>
1296
1297         * stdbool.h.in: New file.
1298
1299 2003-01-08  Bruno Haible  <bruno@clisp.org>
1300
1301         * safe-read.c: Include specification header first, to ensure its
1302         selfcontainedness.
1303         * full-write.c: Likewise.
1304
1305 2003-01-08  Jim Meyering  <jim@meyering.net>
1306
1307         * full-write.c: Undefine and define-away `const' after inclusion
1308         of errno.h, not before.  Suggestion from Bruno Haible.
1309
1310 2003-01-07  Jim Meyering  <jim@meyering.net>
1311
1312         * full-write.c: Rework so that it may serve to define full_read, too.
1313         * full-read.c: Simply #define FULL_READ and include full-write.c.
1314
1315 2003-01-06  Jim Meyering  <jim@meyering.net>
1316
1317         * version-etc.c: Update year in translatable copyright string.
1318
1319 2002-12-25  Bruno Haible  <bruno@clisp.org>
1320
1321         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
1322         * xstrtol.h: Likewise.
1323         * xstrtoimax.c: Likewise.
1324         * xstrtoumax.c: Likewise.
1325         * human.h: Likewise.
1326
1327         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
1328         on systems that have <inttypes.h> but not <stdint.h>.
1329
1330 2002-12-31  Paul Eggert  <eggert@twinsun.com>
1331
1332         * memcoll.c (memcoll): Fall back on a simple algorithm using
1333         memcmp if strcoll doesn't work.
1334
1335 2002-12-23  Bruno Haible  <bruno@clisp.org>
1336
1337         * localcharset.h: New file.
1338         * localcharset.c: Include it.
1339         * unicodeio.c: Likewise.
1340
1341 2002-12-22  Bruno Haible  <bruno@clisp.org>
1342
1343         * utime.c (utime_null): No need to call ftruncate if the file was
1344         nonempty.
1345
1346 2002-12-23  Bruno Haible  <bruno@clisp.org>
1347
1348         * memcoll.c (STRCOLL): New macro.
1349         (memcoll): Use it.
1350
1351 2002-12-22  Bruno Haible  <bruno@clisp.org>
1352
1353         * getstr.h (getstr): Define, to avoid clash with libcurses.
1354         * linebuffer.h (readline): Define, to avoid clash with libreadline.
1355
1356 2002-12-22  Bruno Haible  <bruno@clisp.org>
1357
1358         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
1359
1360 2002-12-23  Bruno Haible  <bruno@clisp.org>
1361
1362         * getline.h: Include <stddef.h>, for size_t.
1363
1364         * unicodeio.h: Include <stddef.h>, for size_t.
1365         * unicodeio.c: Don't include <stddef.h>.
1366
1367 2002-12-17  Bruno Haible  <bruno@clisp.org>
1368
1369         * canon-host.c (strdup): Remove unused declaration.
1370
1371         * fsusage.c: Include full_read.h.
1372         (get_fs_usage): Use full_read instead of safe_read.
1373
1374         * utime.c (utime_null): Use SAFE_READ_ERROR.
1375
1376 2002-12-11  Bruno Haible  <bruno@clisp.org>
1377
1378         * setenv.h: Rewritten to cope with systems that have setenv() but not
1379         unsetenv().
1380         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
1381         modifications:
1382
1383         2002-12-11  Bruno Haible  <bruno@clisp.org>
1384
1385                 * setenv.c (alloca): Fall back to malloc.
1386                 (freea): New macro.
1387                 (setenv): Use freea() to free memory allocated with alloca().
1388
1389         2002-11-13  Bruno Haible  <bruno@clisp.org>
1390
1391                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
1392                 function declarations.
1393                 * unsetenv.c (unsetenv): Likewise.
1394
1395         2002-03-04  Bruno Haible  <bruno@clisp.org>
1396
1397                 Portability to AIX 4.3.3.
1398                 * unsetenv.c: New file, extracted from setenv.c.
1399                 * setenv.c: Move the unsetenv() function to unsetenv.c.
1400
1401         2001-12-20  Bruno Haible  <bruno@clisp.org>
1402
1403                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
1404                 use malloc instead. For SunOS 4.
1405
1406         2001-12-11  Bruno Haible  <bruno@clisp.org>
1407
1408                 * setenv.c: Declare alloca.
1409                 (compar_fn_t): New typedef.
1410                 (KNOWN_VALUE, STORE_VALUE): Use it.
1411
1412         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
1413         setenv.h.
1414
1415 2002-12-10  Paul Eggert  <eggert@twinsun.com>
1416
1417         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
1418         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
1419         Choose values that are less likely to collide with system fnmatch
1420         options.
1421         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
1422         defined (e.g., a pure POSIX system).
1423         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
1424         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
1425
1426 2002-12-06  Jim Meyering  <jim@meyering.net>
1427
1428         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
1429
1430         Merge in changes from libc's misc/error.c, in preparation
1431         for the merge of gnulib's changes back into libc.
1432
1433         * error.c (_): Define only if not already defined.
1434         Move definition to follow all #include directives.
1435         Include unlocked-io.h only if !_LIBC.
1436         [_LIBC]: Include <libio/libioP.h>.
1437         [USE_IN_LIBIO]: Include <libio/iolibio.h>
1438         (fflush): Tweak definition to use INTUSE.
1439         (putc): Define.
1440
1441 2002-12-05  Paul Eggert  <eggert@twinsun.com>
1442
1443         * alloca.c [defined emacs]: Include "lisp.h".
1444         (xalloc_die) [defined emacs]: New macro.
1445         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
1446         [! defined emacs]: Include <xalloc.h>.
1447         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
1448         (pointer): Typedef to POINTER_TYPE *.
1449         (malloc): Remove decl; we now always use xmalloc.
1450         (alloca): Use old-style definition, since Emacs needs this.
1451         Check for arithmetic overflow when computing combined size.
1452
1453 2002-12-04  Paul Eggert  <eggert@twinsun.com>
1454
1455         Do not generate unlocked-io.h automatically, since it's easier to
1456         maintain it by hand.
1457
1458         * unlocked-io.h: New file, from GNU diffutils,
1459         but with proper copyright notice and attribution.
1460         * gen-uio: Remove.
1461         * Makefile.am: Add copyright notice.
1462         (libfetish_a_SOURCES): Add unlocked-io.h.
1463         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
1464         (DISTCLEANFILES, io_functions): Remove macros.
1465         (EXTRA_DIST): Remove gen_uio.
1466         (unlocked-io.h): Remove rule.
1467
1468 2002-12-04  Jim Meyering  <jim@meyering.net>
1469
1470         Reflect the fact that stat.c and lstat.c are no longer generated.
1471         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
1472         (DISTCLEANFILES): Likewise.
1473         (EXTRA_DIST): Likewise.
1474         (all_local): Don't depend on stat.c or lstat.c.
1475         (stat.c, lstat.c): Remove rules.
1476         (EXTRA_DIST): Remove xstat.in.
1477
1478         * xstat.in: Remove file.  Contents moved into stat.c.
1479         * stat.c: New file.  Contents mostly from xstat.in.
1480         * stat.c: Rework so that it may serve to define rpl_lstat, too.
1481         * lstat.c: New file. Simply #define LSTAT and include stat.c.
1482
1483         * safe-read.c: Rework so that it may serve to define safe_write, too.
1484         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
1485
1486 2002-12-03  Jim Meyering  <jim@meyering.net>
1487
1488         * safe-read.c, safe-write.c: Change variable names and comments, but
1489         not semantics, to minimize the differences between these two files.
1490         (safe_read): Change comment to mention SAFE_READ_ERROR.
1491
1492         * safe-read.c (IS_EINTR): Define.
1493         (safe_read): Use IS_EINTR in place of in-function cpp directives.
1494
1495 2002-12-02  Bruno Haible  <bruno@clisp.org>
1496
1497         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
1498         Define, taken from safe-read.c.
1499         (INT_MAX): Provide fallback.
1500         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
1501         * safe-write.h (SAFE_WRITE_ERROR): Define.
1502
1503         * safe-read.c (EINTR): Remove definition.
1504         (safe_read): Don't use EINTR if it is absent.
1505
1506 2002-12-02  Jim Meyering  <jim@meyering.net>
1507
1508         * safe-read.c (EINTR): Define.
1509         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
1510         (INT_MAX): Provide fallback.
1511         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
1512
1513         * safe-read.h (SAFE_READ_ERROR): Define.
1514
1515 2002-12-01  Jim Meyering  <jim@meyering.net>
1516
1517         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
1518         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
1519
1520 2002-11-27  Paul Eggert  <eggert@twinsun.com>
1521
1522         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
1523         hash_rehash): Replace `if (limit <= value) abort ();' with
1524         `if (! (value < limit)) abort ();', for readability.
1525
1526 2002-11-26    <karl@gnu.org>
1527
1528         * strdup.c: copy from libc again, with jim's ok.
1529         * .cppi-disable: re-add strdup.c
1530
1531 2002-11-25    <karl@gnu.org>
1532
1533         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
1534         instead of "strtol.c".
1535
1536 2002-11-25  Jim Meyering  <jim@meyering.net>
1537
1538         * mktime.c: Sync from libc, now that it has the latest fix.
1539
1540 2002-11-24    <karl@gnu.org>
1541
1542         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
1543         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
1544
1545 2002-11-24  Jim Meyering  <jim@meyering.net>
1546
1547         Update from coreutils:
1548
1549         * mktime.c: Merge in changes from libc.
1550
1551         Avoid a link-time failure on some Linux systems.
1552         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
1553         (__mon_yday): Declare with the STATIC attribute.
1554         (__mktime_internal): Likewise.
1555         Based on a report from Greg Schafer.
1556
1557 2002-11-23  Jim Meyering  <jim@meyering.net>
1558
1559         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
1560         Use `unsigned', not `int', as type of index.
1561
1562         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
1563
1564         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
1565
1566 2002-11-22  Paul Eggert  <eggert@twinsun.com>
1567
1568         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
1569         hint that one should use `if (! x) abort ();' rather than `assert
1570         (x);', and anyway it's one less thing to worry about configuring.
1571         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
1572         hash_rehash, hash_insert): Use abort rather than assert.
1573
1574 2002-11-22  Paul Eggert  <eggert@twinsun.com>
1575
1576         * quotearg.h: Allow multiple inclusion by surrounding with
1577         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
1578         so that we can be included first.
1579         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
1580         * quotearg.c: Include quotearg.h immediately after config.h.
1581         No need to include stddef.h or sys/types.h any more.
1582         Surround local include files with "", not "<>".
1583         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
1584         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
1585         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
1586         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
1587         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
1588         (ISPRINT): Remove; no longer needed now that we assume C89.
1589
1590         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
1591         Preserve errno.
1592
1593         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
1594         quotearg_char): Use SIZE_MAX rather than
1595         (size_t) -1 when we are talking about "infinity".
1596
1597         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
1598
1599 2002-11-22  Bruno Haible  <bruno@clisp.org>
1600
1601         * safe-read.h: Assume C89. Add comments.
1602         (safe_read): Change return type to size_t.
1603         * safe-read.c (safe_read): Change return type to size_t. Handle byte
1604         counts > SSIZE_MAX correctly.
1605         * safe-write.h: New file.
1606         * safe-write.c: New file.
1607         * full-read.h: New file.
1608         * full-read.c: New file.
1609         * full-write.h: Assume C89. Add comments.
1610         * full-write.c: Include safe-write.h.
1611         (full_write): Rewritten to use safe_write.
1612         Suggested by Jim Meyering and Paul Eggert.
1613
1614 2002-11-21  Bruno Haible  <bruno@clisp.org>
1615
1616         Remove case insensitive option matching.
1617         * argmatch.h (argcasematch): Remove declaration.
1618         (ARGCASEMATCH): Remove macro.
1619         (__xargmatch_internal): Remove case_sensitive argument.
1620         (XARGMATCH): Update.
1621         (XARGCASEMATCH): Remove macro.
1622         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
1623         case_sensitive argument.
1624         (argcasematch): Remove function.
1625         (__xargmatch_internal): Remove case_sensitive argument.
1626         (main): Use XARGMATCH instead of XARGCASEMATCH.
1627
1628         * xmalloc.c: Change compile-time error message. Add comment about
1629         required autoconf version.
1630
1631 2002-11-21  Jim Meyering  <jim@meyering.net>
1632
1633         * strdup.c (strdup): Tweak comment and initial #if/#include.
1634
1635         Merge in changes from the coreutils.
1636
1637         2002-09-25  Paul Eggert  <eggert@twinsun.com>
1638         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
1639         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
1640         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
1641         int.  Work more efficiently if X is the same width as uintmax_t.
1642         Do not compare X to -1, to avoid bogus compiler warning.
1643         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
1644         Don't assume that f_frsize and f_bsize are the same type.
1645
1646         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
1647         on FreeBSD.
1648
1649         * makepath.c (make_path): Restore umask *before* creating the final
1650         component.
1651         (make_path): Minor reformatting.
1652
1653         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
1654         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
1655
1656         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
1657         ones.  At least on GNU/Linux systems, `auto' means something else.
1658         From Michael Stone.
1659
1660 2002-11-20  Paul Eggert  <eggert@twinsun.com>
1661
1662         Merge argmatch cleanups from Bison.  Assume C89.
1663
1664         * argmatch.c: Include config.h here, not in argmatch.h.
1665         Include stdlib.h, for EXIT_FAILURE.
1666         Always include <string.h>, since we assume C89.
1667         (EXIT_FAILURE): Remove pre-C89 bug workaround.
1668         * argmatch.h: Do not include <config.h> or <sys/types.h>.
1669         Include <stddef.h> instead, since it's all we need for size_t.
1670         (PARAMS): Remove.  All uses removed.
1671         (ARRAY_CARDINALITY): Do not bother to #undef.
1672         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
1673         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
1674         Remove unnecessary parentheses.
1675         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
1676         Insert necessary parentheses.
1677         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
1678         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
1679
1680 2002-11-19  Bruno Haible  <bruno@clisp.org>
1681
1682         * mbswidth.c: Include mbswidth.h right at the beginning.
1683         * mbswidth.h: Include <stddef.h>, for size_t.
1684
1685         * mbswidth.h (PARAMS): Remove macro.
1686         (mbswidth, mbsnwidth): Use ANSI C function declarations.
1687         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
1688
1689         * gcd.h (PARAMS): Remove macro.
1690         (gcd): Use ANSI C function declarations.
1691         * gcd.c (gcd): Likewise.
1692
1693 2002-11-15  Bruno Haible  <bruno@clisp.org>
1694
1695         * strcspn.c: Include <stddef.h>.
1696         (strcspn): Use ANSI C function declaration. Change return type to
1697         size_t. Use NULL.
1698         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
1699         (strpbrk): Use NULL.
1700         * strpbrk.h (PARAMS): Remove macro.
1701         (strpbrk): Use ANSI C function declaration.
1702         * strstr.c: Don't include <sys/types.h>.
1703         * strstr.h (PARAMS): Remove macro.
1704         (strstr): Use ANSI C function declarations.
1705
1706 2002-11-06  Bruno Haible  <bruno@clisp.org>
1707
1708         * gcd.h (gcd): Change argument type to 'unsigned long'.
1709         * gcd.c (gcd): Likewise.
1710
1711 2002-11-05  Bruno Haible  <bruno@clisp.org>
1712
1713         * gcd.h: New file, from gettext-0.11.5.
1714         * gcd.c: New file, from gettext-0.11.5.
1715
1716 2002-11-05  Bruno Haible  <bruno@clisp.org>
1717
1718         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1719         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1720         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1721         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1722
1723         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
1724         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
1725
1726         * closeout.c: Include gettext.h instead of <libintl.h>.
1727         * human.c: Include gettext.h instead of <libintl.h>.
1728         * quotearg.c: Include gettext.h instead of <libintl.h>.
1729         * rpmatch.c: Include gettext.h instead of <libintl.h>.
1730         * unicodeio.c: Include gettext.h instead of <libintl.h>.
1731         * userspec.c: Include gettext.h instead of <libintl.h>.
1732         * version-etc.c: Include gettext.h instead of <libintl.h>.
1733         * xmalloc.c: Include gettext.h instead of <libintl.h>.
1734         (textdomain): Remove definition.
1735         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
1736
1737         * long-options.c: Remove include of <libintl.h> and definition of _.
1738         * same.c: Remove include of <libintl.h> and definition of _.
1739
1740 2002-11-04  Bruno Haible  <bruno@clisp.org>
1741
1742         * stpcpy.h: New file, from GNU gettext-0.11.5.
1743         * strcase.h: New file, from GNU gettext-0.11.5.
1744         * strpbrk.h: New file, from GNU gettext-0.11.5.
1745         * strstr.h: New file, from GNU gettext-0.11.5.
1746         * xgetcwd.h: New file, from GNU gettext-0.11.5.
1747
1748 2002-05-09  Bruno Haible  <bruno@clisp.org>
1749
1750         * config.charset: Update for newest glibc. Add canonical names
1751         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
1752
1753 2002-05-09  Bruno Haible  <bruno@clisp.org>
1754
1755         * localcharset.c (get_charset_aliases): Add more Windows specific
1756         aliases.
1757
1758 2002-05-08  Owen Taylor  <otaylor@redhat.com>
1759
1760         * config.charset: A few additions for Solaris.
1761
1762 2001-12-05  Bruno Haible  <bruno@clisp.org>
1763
1764         * localcharset.c (locale_charset): Don't return an empty string.
1765
1766 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
1767
1768         * config.charset: msdos in uk_UA uses CP1125.
1769
1770 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
1771
1772         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
1773         * localcharset.c (locale_charset): Declare as extern "C".
1774
1775 2002-02-15  Bruno Haible  <bruno@clisp.org>
1776
1777         * config.charset [msdosdjgpp]: For Russian, use CP866.
1778
1779 2002-02-11  Bruno Haible  <bruno@clisp.org>
1780
1781         * config.charset: Add support for NetBSD.
1782
1783 2002-09-25    <karl@gnu.org>
1784
1785         * strdup.c: copy from libc/string (via ../config/srclist*).
1786         * getopt*: copy from libc/posix.
1787         * gettext.h: copy from gettext.
1788         * .cppi-disable: add strdup.c, gettext.h.
1789
1790 2002-07-01  Jim Meyering  <meyering@lucent.com>
1791
1792         * c-stack.c: Include sys/time.h.
1793         From Volker Borchert.
1794
1795 2002-06-11  Paul Eggert  <eggert@twinsun.com>
1796
1797         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
1798         New macro.  Use it uniformly instead of
1799         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
1800         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
1801         reported by Vin Shelton.
1802
1803 2002-06-22  Jim Meyering  <meyering@lucent.com>
1804
1805         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
1806         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
1807
1808 2002-06-22  Paul Eggert  <eggert@twinsun.com>
1809
1810         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
1811         Do not assume SA_SIGINFO behavior.
1812         Bug reported by Jim Meyering on NetBSD 1.5.2.
1813
1814 2002-06-22  Jim Meyering  <meyering@lucent.com>
1815
1816         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
1817
1818         * exitfail.c, exitfail.h: Likewise.
1819         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
1820
1821         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
1822         of fnmatch.h.
1823         (EXTRA_DIST): Add fnmatch_loop.c.
1824         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
1825
1826         * fnmatch_loop.c: New file, from diffutils-2.8.2.
1827         * fnmatch.c: Update from diffutils-2.8.2.
1828         * fnmatch_.h: New file.  From diffutils-2.8.2.
1829         * fnmatch.h: Remove file.
1830
1831 2002-06-18  Paul Eggert  <eggert@twinsun.com>
1832
1833         * file-type.h: Report an error if neither S_ISREG nor
1834         S_IFREG is defined, instead of using a test specific to glibc
1835         2.2.  This should be safe, since POSIX requires S_ISREG and
1836         Unix Version 7 had S_IFREG.  We don't need to check for
1837         <sys/types.h> since we don't use any symbols that it defines.
1838
1839 2002-06-15  Jim Meyering  <meyering@lucent.com>
1840
1841         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
1842         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
1843         have been included before this file.
1844
1845 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
1846
1847         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
1848         so that each temporary file name is unique and valid in the first
1849         8 characters, for operation under DOS.
1850
1851 2002-06-15  Jim Meyering  <meyering@lucent.com>
1852
1853         Work even with DJGPP 2.03, which lacks support for symlinks.
1854         From Richard Dawe.
1855         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
1856         is defined.
1857         * lchown.c (S_ISLNK): Likewise.
1858
1859 2002-06-14  Jim Meyering  <meyering@lucent.com>
1860
1861         * file-type.h: Use the version from diffutils-2.8.2.
1862         * file-type.c: Likewise.
1863
1864 2002-05-27  Jim Meyering  <meyering@lucent.com>
1865
1866         Fix a problem seen only on nonconforming systems whereby ls.c's
1867         use of localtime, and then of gettimeofday would cause trouble:
1868         the localtime call used to initialize rpl_gettimeofday's save
1869         mechanism would clobber ls's current local time information so
1870         that in any long listing the first file would always be listed
1871         with date 1970-01-01.  Analysis by Volker Borchert.
1872
1873         * gettimeofday.c (localtime): Undefine.
1874         (rpl_localtime): New function.
1875
1876 2002-05-22  Jim Meyering  <meyering@lucent.com>
1877
1878         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
1879         * file-type.h: New file.
1880         * file-type.c (file_type): New file/function.  Extracted from diffutils.
1881
1882 2002-04-29  Paul Eggert  <eggert@twinsun.com>
1883
1884         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
1885
1886 2002-04-28  Paul Eggert  <eggert@twinsun.com>
1887
1888         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
1889         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
1890         of 127, since 64 is the largest conceivable number for ancient
1891         nonstandard hosts.
1892         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
1893
1894 2002-04-28  Jim Meyering  <meyering@lucent.com>
1895
1896         * sig2str.c (WTERMSIG): Remove definition (unused).
1897
1898 2002-04-28  Paul Eggert  <eggert@twinsun.com>
1899
1900         * sig2str.h, sig2str.c: New files.
1901         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
1902
1903 2002-04-24  Jim Meyering  <meyering@lucent.com>
1904
1905         * gettext.h: New file, from Gettext.
1906         * Makefile.am (INCLUDES): Remove -I../intl.
1907         (libfetish_a_SOURCES): Add gettext.h.
1908
1909 2002-04-16  Jim Meyering  <meyering@lucent.com>
1910
1911         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
1912         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
1913         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
1914
1915 2002-04-12  Jim Meyering  <meyering@lucent.com>
1916
1917         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
1918
1919 2002-03-10  Jim Meyering  <meyering@lucent.com>
1920
1921         * makepath.c (make_path): Remove a comma from a diagnostic.
1922         Suggestion from Santiago Vila.
1923
1924 2002-03-08  Jim Meyering  <meyering@lucent.com>
1925
1926         * rename.c: Mention that this wrapper is needed also on
1927         mips-dec-ultrix4.4 systems.
1928
1929 2002-03-02  Jim Meyering  <meyering@lucent.com>
1930
1931         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
1932         not HAVE_CLOCK_SETTIME.
1933
1934 2002-02-27  Paul Eggert  <eggert@twinsun.com>
1935
1936         * nanosleep.h: Rename to....
1937         * timespec.h: New name for nanosleep.h.  All uses changed.
1938
1939         * gettime.c: New file.
1940         * settime.c: New file.
1941         * stime.c: Remove.
1942
1943         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
1944         timespec.h.  Remove nanosleep.h.
1945
1946 2002-02-25  Paul Eggert  <eggert@twinsun.com>
1947
1948         * acl.c, acl.h: New files.
1949         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
1950
1951 2002-02-24  Jim Meyering  <meyering@lucent.com>
1952
1953         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
1954         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
1955         cause trouble.  Reported by Nelson Beebe.
1956
1957 2002-02-23  Paul Eggert  <eggert@twinsun.com>
1958
1959         * path-concat.c (xpath_concat): Reorder code to pacify
1960         compilers that don't know that xalloc_die never returns.
1961
1962 2002-02-20  Jim Meyering  <meyering@lucent.com>
1963
1964         * getdate.c: Regenerate using bison-1.33.
1965
1966 2002-02-15  Paul Eggert  <eggert@twinsun.com>
1967
1968         * posixver.c, posixver.h: New files.
1969         * Makefile.am (libfetish_a_SOURCES): Add them.
1970
1971 2002-02-02  Paul Eggert  <eggert@twinsun.com>
1972             Bruno Haible  <bruno@clisp.org>
1973
1974         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
1975         (fwrite_success_callback): New declaration.
1976         * unicodeio.c (unicode_to_mb): New function, extracted from
1977         print_unicode_char. Call failure callback instead of error.
1978         (fwrite_success_callback): New function.
1979         (exit_failure_callback): New function.
1980         (fallback_failure_callback): New function.
1981         (print_unicode_char): Call unicode_to_mb.
1982
1983 2002-01-26  Jim Meyering  <meyering@lucent.com>
1984
1985         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
1986
1987 2002-01-22  Jim Meyering  <meyering@lucent.com>
1988
1989         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
1990         Otherwise, some versions of automake would omit the rule that makes
1991         Makefile from Makefile.in.
1992
1993 2001-01-21  Paul Eggert  <eggert@twinsun.com>
1994
1995         * xmemcoll.h, xmemcoll.c: New files.
1996         * Makefile.am (libfetish_a_SOURCES): Add them.
1997         * memcoll.c: Include errno.h, and declare errno if not defined.
1998         (memcoll): Set errno to zero if there is no error.
1999
2000         * quotearg.c (quotearg_buffer_restyled):
2001         Fix bug with quoting buffers containing NUL when backslashing escapes.
2002         This bug was exposed by the other changes in this patch.
2003         (quotearg_n_options): New arg ARGSIZE.
2004         All callers changed.
2005         (quoting_options_from_style): New function.
2006         (quotearg_n_style): Use it.
2007         (quotearg_n_style_mem): New function.
2008
2009         * quotearg.h (quotearg_n_style_mem): New function.
2010
2011 2002-01-16  Jim Meyering  <meyering@lucent.com>
2012
2013         * getdate.y: Add three semicolons, each just before a closing brace.
2014         Bison (as of version 1.31) no longer papers over that mistake.
2015
2016 2002-02-14  Paul Eggert  <eggert@twinsun.com>
2017
2018         * backupfile.c (ISDIGIT): Comment fix.
2019         * getdate.y (ISDIGIT): Likewise.
2020         * posixtm.c (ISDIGIT, year): Likewise.
2021         * strverscmp.c (ISDIGIT): Likewise.
2022         * userspec.c (ISDIGIT): Likewise.
2023
2024 2002-01-05  Jim Meyering  <meyering@lucent.com>
2025
2026         * version-etc.c (version_etc_copyright): Update copyright year.
2027
2028 2001-01-19  Paul Eggert  <eggert@twinsun.com>
2029
2030         * closeout.c (close_stdout_status): If ferror (stdout), do
2031         not silently exit merely because the output buffer happens to
2032         have nothing pending.
2033
2034 2001-12-18  Paul Eggert  <eggert@twinsun.com>
2035
2036         See the big note in ../ChangeLog.
2037         * human.c (suffixes): Prefer K to k for 1024.
2038         (generate_suffix_backwards): New function.
2039         (human_readable_inexact): Use it.
2040         * xstrtol.c (__xstrtol): If there is no number but there
2041         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
2042         Accept 'K' as well as 'k'.
2043
2044 2001-12-15  Jim Meyering  <meyering@lucent.com>
2045
2046         * regex.h (__restrict_arr): Update from libc.
2047
2048         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
2049         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
2050         (STREQ): Define.
2051
2052 2001-12-10  Jim Meyering  <meyering@lucent.com>
2053
2054         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
2055         Instead, include "xalloc.h".
2056         (initbuffer): Don't cast xmalloc return value to char*.
2057         (readline): Reword comment.
2058         Don't cast xrealloc return value to char*
2059         Return NULL, not 0.
2060
2061 2001-12-09  Jim Meyering  <meyering@lucent.com>
2062
2063         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
2064         `signed and unsigned type in conditional expression'.
2065         * posixtm.c (posix_time_parse): Likewise.
2066
2067         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
2068
2069         * readtokens.c (readtoken): Declare an index to be of type unsigned
2070         to avoid a pedantic warning.
2071
2072         * getstr.c: Don't include assert.h.
2073         (getstr): Remove warning-evoking assertions.
2074         Return -1 if offset parameter is out of bounds.
2075         Change the type of a local from int to size_t.
2076
2077         * strftime.c (my_strftime_localtime_r): Include this function
2078         definition in the `#if ! HAVE_TM_GMTOFF' block.
2079
2080         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
2081         Include xalloc.h instead.
2082
2083 2001-12-02  Jim Meyering  <meyering@lucent.com>
2084
2085         * tempname.c: Don't declare getenv, thus reverting the change of
2086         2001-11-18.  It's no longer necessary, now that stdlib.h is always
2087         included.
2088
2089         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
2090         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
2091
2092 2001-11-30  Akim Demaille  <akim@epita.fr>
2093
2094         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
2095         before being defined.
2096
2097 2001-11-27  Paul Eggert  <eggert@twinsun.com>
2098
2099         * quotearg.h (quotearg_n, quotearg_n_style):
2100         First arg is int, not unsigned.
2101         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
2102         (SIZE_MAX, UINT_MAX): New macros.
2103         (quotearg_n_options): Abort if N is negative.
2104         Avoid overflow check on hosts where size_t is 64 bits and int
2105         is 32 bits, as overflow is impossible there.
2106         Fix off-by-one typo that caused unnecessary reallocation.
2107
2108 2001-11-27  Jim Meyering  <meyering@lucent.com>
2109
2110         * tempname.c: Merge with version from libc.
2111         * regex.c: Likewise.
2112
2113         * tempname.c: Include stdlib.h unconditionally.  On some old systems
2114         for which STDC_HEADERS is 0, it was not included, resulting in a
2115         warning about an integer-to-pointer conversion problem with getenv.
2116         Reported by Volker Borchert.
2117
2118 2001-11-26  Jim Meyering  <meyering@lucent.com>
2119
2120         * gtod.h: Remove file.
2121         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
2122         * gettimeofday.c: Don't include gtod.h.
2123         (GTOD_init): Remove function.
2124         (rpl_gettimeofday): Do its job here instead, rather than aborting.
2125         Suggestion from Volker Borchert.
2126
2127 2001-11-23  Jim Meyering  <meyering@lucent.com>
2128
2129         * hash.h (struct hash_table): Don't define here.  Merely declare it.
2130         * hash.c (struct hash_table): Define it here instead.
2131
2132 2001-11-22  Jim Meyering  <meyering@lucent.com>
2133
2134         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
2135
2136 2001-11-18  Paul Eggert  <eggert@twinsun.com>
2137
2138         * tempname.c (TMP_MAX): Remove; no longer needed.
2139         (TEMPORARIES): New macro.
2140         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
2141         removes an artificial limitation (e.g. HP-UX 10.20, where
2142         TMP_MAX is 17576).
2143
2144 2001-11-18  Jim Meyering  <meyering@lucent.com>
2145
2146         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
2147         on SunOS 4.
2148
2149         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
2150         files will be created before anything else.
2151
2152 2001-11-17  Jim Meyering  <meyering@lucent.com>
2153
2154         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
2155         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
2156         rather than group writable.  Patch by Juan F. Codagnone.
2157
2158         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
2159         Instead, include "xalloc.h".
2160
2161         * mountlist.c: Include unlocked-io.h after all system headers.
2162         Remove explicit declarations of xmalloc, xrealloc,
2163         and xstrdup.  Instead, include "xalloc.h".
2164
2165         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
2166         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
2167         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
2168
2169         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
2170         Reported by Padraig Brady.
2171
2172         * mkstemp.c: #undef mkstemp.
2173         Include config.h.
2174         (rpl_mkstemp): Rename from mkstemp.
2175         Protoize.
2176
2177 2001-11-16  Jim Meyering  <meyering@lucent.com>
2178
2179         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
2180         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
2181         determine the amount of total physical memory, use pstat_getstatic.
2182         HPUX-11 doesn't define _SC_PHYS_PAGES.
2183         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
2184         If sysconf couldn't be used to determine the amount of available
2185         physical memory, use both pstat_getstatic and pstat_getdynamic.
2186         Based on a patch from Bob Proulx.
2187
2188 2001-11-05  Jim Meyering  <meyering@lucent.com>
2189
2190         * xstat.in (slash_aware_lstat): Correct a misleading comment.
2191
2192 2001-11-03  Jim Meyering  <meyering@lucent.com>
2193
2194         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
2195         in argmatch_to_argument call.
2196
2197         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
2198         argument.
2199
2200         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
2201         e.g., a fault due to an attempt to free a NULL pointer.
2202
2203 2001-11-01  Jim Meyering  <meyering@lucent.com>
2204
2205         * dirfd.c, dirfd.h: New files.
2206         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
2207
2208         * hash.c (hash_print) [TESTING]: Clean up.
2209
2210 2001-10-22  Paul Eggert  <eggert@twinsun.com>
2211
2212         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
2213         to avoid a warning if -Wall.
2214
2215 2001-10-21  Paul Eggert  <eggert@twinsun.com>
2216
2217         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
2218
2219 2001-10-21  Jim Meyering  <meyering@lucent.com>
2220
2221         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
2222         this code would end up calling gettext even in packages built
2223         with --disable-nls.
2224         * getopt.c (_): Likewise.
2225         * regex.c (_): Likewise.
2226
2227 2001-10-20  Paul Eggert  <eggert@twinsun.com>
2228
2229         * error.c (strerror_r): Do not declare unless !_LIBC.
2230         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
2231         Use strerror_r that is only a macro, even if it is not a function.
2232         (strerror): Check for HAVE_DECL_STRERROR before declaring.
2233         (private_strerror): Use prototypes, not old-style function definition.
2234         (print_errno_message): New function.
2235         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
2236         char*-flavored one.
2237         (error_tail, error, error_at_line): Use it.
2238
2239 2001-10-11  Jim Meyering  <meyering@lucent.com>
2240
2241         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
2242         and quote_n (1, ... to avoid clobbering a buffer.
2243
2244 2001-10-05  Jim Meyering  <meyering@lucent.com>
2245
2246         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
2247         * hash-pjw.c: New file (factored out of fileutils' remove.c).
2248         * hash-pjw.h: New file.
2249
2250 2001-09-30  Jim Meyering  <meyering@lucent.com>
2251
2252         * mountlist.c [MOUNTED_GETFSSTAT]:
2253         Include <sys/ucred.h>, for Apple Darwin.
2254         Include sys/mount.h and sys/fs_types.h only if available.
2255         (FS_TYPE): Define.
2256         (read_filesystem_list): Use FS_TYPE.
2257
2258 2001-09-29  Paul Eggert  <eggert@twinsun.com>
2259
2260         * exclude.c (excluded_filename): 0 -> false, since it's
2261         a boolean context.
2262
2263 2001-09-28  Paul Eggert  <eggert@twinsun.com>
2264
2265         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
2266         #defines strtoimax.  Also treat the other strto* functions
2267         like strtoimax.
2268
2269         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
2270         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
2271         (strtoimax, strtoumax): Do not declare if already defined as a macro.
2272
2273 2001-09-26  Jim Meyering  <meyering@lucent.com>
2274
2275         Most macros in unlocked-io.h had the wrong number of arguments.
2276         * gen-uio: New script.
2277         (USE_UNLOCKED_IO): Define to 1 if not already defined.
2278         * unlocked-io.hin: Remove file.
2279         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
2280         rather than trying to embed it here.
2281         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
2282         Reported by Padraig Brady.
2283
2284 2001-09-25  Volker Borchert  <bt@teknon.de>
2285
2286         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
2287
2288 2001-09-23  Jim Meyering  <meyering@lucent.com>
2289
2290         * mountlist.c: Remove useless parentheses in #if directives.
2291         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
2292         the deprecated MOUNTED symbol is no longer defined in mntent.h.
2293
2294 2001-09-22  Jim Meyering  <meyering@lucent.com>
2295
2296         * localcharset.c: Update from latest gettext.
2297         * config.charset: Likewise.
2298
2299 2001-09-20  Jim Meyering  <meyering@lucent.com>
2300
2301         * xstrtol.c (strtoimax): Guard declaration with
2302         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
2303         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
2304         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
2305         (strtoumax): Likewise, for completeness (it wasn't necessary).
2306
2307 2001-09-06  Paul Eggert  <eggert@twinsun.com>
2308
2309         * strtoimax.c (HAVE_LONG_LONG):
2310         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
2311         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
2312         to work around bug in IBM C compiler.
2313
2314 2001-09-16  Jim Meyering  <meyering@lucent.com>
2315
2316         * mkdir.c: New file.
2317
2318 2001-09-04  Paul Eggert  <eggert@twinsun.com>
2319
2320         * xgetcwd.c: Revert some of the previous change; intead,
2321         fix the HAVE_GETCWD_NULL code to behave more like the
2322         !HAVE_GETCWD_NULL code used to.
2323
2324         Include "xalloc.h".
2325         (xgetcwd): Do not return NULL when memory is exhausted; instead,
2326         invoke xalloc_die.
2327
2328 2001-09-04  Paul Eggert  <eggert@twinsun.com>
2329
2330         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
2331         Use ssize_t, not int, to store result of readlink.
2332         Check for ssize_t overflow as well as size_t overflow,
2333         as POSIX says the result of readlink is implementation-defined
2334         when ssize_t overflows.
2335         Remove unnecessary cast to char*.
2336         Use free+malloc instead of realloc, as the storage doesn't need
2337         to be preserved and it's clearer and can be more efficient that way.
2338         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
2339         * xreadlink.h (xreadlink): Update prototype.
2340
2341 2001-09-03  Paul Eggert  <eggert@twinsun.com>
2342
2343         * exclude.c (fnmatch_no_wildcards): Fix confusion between
2344         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
2345         spotted by Jim Meyering.
2346
2347 2001-09-03  Jim Meyering  <meyering@lucent.com>
2348
2349         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
2350
2351 2001-09-03  Paul Eggert  <eggert@twinsun.com>
2352
2353         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
2354         like the HAVE_GETCWD_NULL code.
2355         Include pathmax.h if not HAVE_GETCWD.
2356         Do not include xalloc.h.
2357         (INITIAL_BUFFER_SIZE): New symbol.
2358         Do not use xmalloc / xrealloc, since the caller is responsible for
2359         handling errors.  Preserve errno around `free' during failure.
2360         Do not overrun buffer when using getwd.
2361
2362 2001-09-03  Paul Eggert  <eggert@twinsun.com>
2363
2364         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
2365         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
2366
2367 2001-09-02  Jim Meyering  <meyering@lucent.com>
2368
2369         * error.c: Update from GNU libc.
2370
2371 2001-09-01  Jim Meyering  <meyering@lucent.com>
2372
2373         * xreadlink.c: New file.
2374         * xreadlink.h: New file.
2375         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
2376
2377         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
2378         doesn't conflict with sparc Solaris 7's definition in
2379         /usr/include/sys/int_types.h.
2380
2381         * exclude.c: Use `""', not `<>' to #include non-system header files.
2382         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
2383         and strncasecmp as r-values.  Unixware didn't have declarations.
2384
2385 2001-08-31  Jim Meyering  <meyering@lucent.com>
2386
2387         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
2388         Use an initial, malloc'd, buffer of length 128 rather than
2389         a statically allocated one of length 1024.
2390
2391 2001-08-30  Paul Eggert  <eggert@twinsun.com>
2392
2393         * xgetcwd.c: Don't include pathmax.h.
2394         Include stdlib.h and unistd.h if available.
2395         Include xalloc.h.
2396         (xmalloc, xstrdup, free): Remove decls.
2397         (xgetcwd): Don't assume sizes fit in unsigned.
2398         Check for overflow when computing sizes.
2399         Simplify reallocation code.
2400
2401 2001-08-28  Paul Eggert  <eggert@twinsun.com>
2402
2403         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
2404
2405         * strtoimax.c: Renamed from strtoxmax.c, removing the
2406         old strtoimax.c.
2407
2408         Also, make the following further changes to make this file's
2409         configuration more similar to that of strtol.c:
2410         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
2411         (strtoumax, uintmax_t, strtoull, strtol): Remove.
2412         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
2413         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
2414         changed to signed values.
2415
2416         And make the following changes as well:
2417         Fix copyright notice, as 1999 was missing.
2418         (verify): New macro.
2419         (strtoimax): Check sizes at compile-time, not run-time.
2420         Prefer strtol to strtoll if both work.
2421         (main): Remove; it was not that useful and was a pain to maintain.
2422
2423         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
2424
2425 2001-08-30  Paul Eggert  <eggert@twinsun.com>
2426
2427         * savedir.c (savedir): Remove size parameter, as POSIX says that
2428         a directory's st_size can have an arbitrary value, so the old
2429         usage could waste an arbitrary amount of memory.  All uses
2430         changed.
2431         * savedir.h: Update prototype.
2432
2433 2001-08-30  Paul Eggert  <eggert@twinsun.com>
2434
2435         * xstrtol.c (strtoimax): New decl.
2436
2437 2001-08-28  Paul Eggert  <eggert@twinsun.com>
2438
2439         * xstrtol.h: Add copyright notice.
2440         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
2441         LONGINT_INVALID_SUFFIX_CHAR.
2442
2443 2001-08-30  Paul Eggert  <eggert@twinsun.com>
2444
2445         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
2446         tm to be declared.
2447
2448 2001-08-30  Paul Eggert  <eggert@twinsun.com>
2449
2450         * hash.c: Remove '2001' from copyright notice.
2451
2452 2001-08-30  Paul Eggert  <eggert@twinsun.com>
2453
2454         * full-write.h: New file.
2455         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
2456         * full-write.c: Correct credits, as cccp.c no longer
2457         exists and anyway it was so heavily changed from the old cccp
2458         code as to be unrecognizable.  Include full-write.h.
2459         (full_write) Return size_t, with short writes meaning failure.
2460         All callers changed.  This fixes a bug with large buffers
2461         on 64-bit hosts.
2462         * utime.c: Include full-write.h.
2463
2464 2001-08-30  Paul Eggert  <eggert@twinsun.com>
2465
2466         Merge 'exclude' changes from tar 1.13.22.
2467         This fixes one or two unlikely storage allocation overflow bugs,
2468         but doesn't change user-visible behavior otherwise.
2469
2470 2001-08-30  Paul Eggert  <eggert@twinsun.com>
2471
2472         * exclude.c (bool): Declare, perhaps by including stdbool.h.
2473         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
2474         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
2475         Include if available.
2476         (<xalloc.h>): Include
2477         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
2478         (verify): New macro.  Use it to verify that EXCLUDE macros do not
2479         collide with FNM macros.
2480         (struct patopts): New struct.
2481         (struct exclude): Use it, as exclude patterns now come with options.
2482         (new_exclude): Support above changes.
2483         (new_exclude, add_exclude_file):
2484         Initial size must now be a power of two to simplify overflow checking.
2485         (free_exclude, fnmatch_no_wildcards): New function.
2486         (excluded_filename): No longer requires options arg, as the options
2487         are determined by add_exclude.  Now returns bool, not int.
2488         (excluded_filename, add_exclude):
2489         Add support for the fancy new exclusion options.
2490         (add_exclude, add_exclude_file): Now takes int options arg.
2491         Check for arithmetic overflow when computing sizes.
2492         (add_exclude_file): xrealloc might modify errno, so don't
2493         realloc until after errno might be used.
2494
2495         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
2496         New macros.
2497         (free_exclude): New decl.
2498         (add_exclude, add_exclude_file): Now takes int options arg.
2499         (excluded_filename): No longer requires options arg, as the options
2500         are determined by add_exclude.  Now returns bool, not int.
2501
2502 2001-08-30  Paul Eggert  <eggert@twinsun.com>
2503
2504         * alloca.c (alloca): Arg is of type size_t, not unsigned.
2505
2506 2001-08-27  Jim Meyering  <meyering@lucent.com>
2507
2508         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
2509
2510         * version-etc.c (N_): Remove definition.
2511         Revert most of last change.
2512         Instead, simply don't mark the `Copyright...' string for translation.
2513         Based on advice from Paul Eggert.
2514
2515         * strtoxmax.c: Tweak comment.
2516
2517 2001-08-26  Jim Meyering  <meyering@lucent.com>
2518
2519         * version-etc.c (version_etc_copyright_fmt): Replace literal year
2520         of copyright with `%s' so translators don't get an untranslated
2521         message in 2002.
2522         (COPYRIGHT_YEAR): Define.
2523         (version_etc): Use fprintf rather than fputs.
2524         Suggestion from Ulrich Drepper.
2525
2526         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
2527
2528         * strtoll.c: New file, from GNU libc.
2529         * xstrtoimax.c: New file.
2530
2531         * xstrtol.h: Add xstrtoimax.
2532         * strtoumax.c: New file.  Simply include "strtoumax.c".
2533         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
2534
2535         * strtoumax.c: Factor to work both for unsigned and signed types, ...
2536         * strtoxmax.c: ... then renamed to this.
2537
2538 2001-08-13  Paul Eggert  <eggert@twinsun.com>
2539
2540         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
2541         Port to Solaris 8, where 'sed' requires a space after the 'r'
2542         command, and where sh dislikes "$/".  Clean up the spacing a bit.
2543         Redirect output to $tmp just once.
2544
2545 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
2546
2547         * addext.c (<errno.h>): Include.
2548         (errno): Declare if not defined.
2549         (addext): Work correctly when pathconf returns -1 and leaves
2550         errno alone because there is no limit.  Also, work even if
2551         pathconf returns a value greater than SIZE_MAX.
2552
2553 2001-08-12  Jim Meyering  <meyering@lucent.com>
2554
2555         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
2556         Simply `return getcwd (NULL, 0);'.
2557         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
2558         Use 1300 as initial value for length, not PATH_MAX.
2559
2560         * pathmax.h: Clean up cpp syntax.
2561
2562 2001-08-12  Jim Meyering  <meyering@lucent.com>
2563
2564         * gettimeofday.c: New file.
2565         * gtod.h: New file.
2566         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
2567
2568 2001-08-04  Jim Meyering  <meyering@lucent.com>
2569
2570         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
2571         to get in sync with glibc.
2572
2573 2001-08-03  Paul Eggert  <eggert@twinsun.com>
2574
2575         The following changes are from gettext 0.10.39 as maintained by
2576         Bruno Haible.
2577
2578         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
2579         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
2580         with inverted sense.  All uses changed.
2581
2582         * mbswidth.c: Don't include <limits.h>.
2583         Include <stdlib.h> and <string.h> unconditionally.
2584         (iswcntrl, mbsinit, ISCNTRL): New macros.
2585         (mbsnwidth): Use K&R style function declarations.
2586         Don't bother checking for MB_LEN_MAX == 1, since the compiler
2587         can optimize it when MB_CUR_MAX == 1.
2588         The width of control characters is zero, not 1.
2589
2590 2001-07-15  Jim Meyering  <meyering@lucent.com>
2591
2592         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
2593         (BUILT_SOURCES): Add unlocked-io.h.
2594         (io_functions): Define.
2595         (unlocked-io.h): New rule.
2596         (DISTCLEANFILES): Add unlocked-io.h.
2597         (all-local): Depend on unlocked-io.h, to ensure it is created.
2598
2599         * unlocked-io.hin: New file
2600
2601         * regex.c: Update from glibc.
2602
2603 2001-07-05  Jim Meyering  <meyering@lucent.com>
2604
2605         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
2606         recommendation.
2607         (libfetish_a_SOURCES): Put all .h files here instead.
2608         Remove a thus-exposed (better checks in automake) duplicate and
2609         two unnecessary .h files.
2610
2611 2001-06-11  Jim Meyering  <meyering@lucent.com>
2612
2613         * regex.c: Update from GNU libc.
2614
2615 2001-05-27  Jim Meyering  <meyering@lucent.com>
2616
2617         * readutmp.h (UT_TYPE): Define.
2618
2619 2001-05-24  Jim Meyering  <meyering@lucent.com>
2620
2621         * argmatch.c: Include "quote.h".
2622         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
2623         quote function.  Reported by Göran Uddeborg.
2624
2625 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
2626
2627         * dirname.c (dir_name): Compute append_dot using path, not newpath
2628         which is not yet declared.
2629
2630 2001-05-11  Paul Eggert  <eggert@twinsun.com>
2631
2632         * Makefile.am (libfetish_a_SOURCES):
2633         Add strftime.c, since we now compile it on all hosts.
2634
2635         * strftime.c (my_strftime):
2636         Define to nstrftime if emacs, but only if my_strftime is not defined.
2637         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
2638         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
2639         Add one more extra argument: a nanoseconds value.
2640         All uses changed.
2641         (ns): New macro.
2642         (my_strftime function): Add %N format.
2643         (emacs_strftimeu): Renamed from emacs_strftime,
2644         with extra ut argument.
2645
2646 2001-05-11  Paul Eggert  <eggert@twinsun.com>
2647
2648         dirname code cleanup.  base_name now behaves more compatibly
2649         with POSIX basename when given file names that have trailing
2650         slashes, and similarly for dir_name.  Add new primitives
2651         base_len and dir_len.  Put the directory-name-related decls
2652         into dirname.h.
2653
2654         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
2655         * backupfile.c (base_name): Likewise.
2656         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
2657         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
2658         * makepath.c (strip_trailing_slashes): Likewise.
2659         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
2660         Likewise.
2661         * rename.c (strip_trailing_slashes): Likewise.
2662         * same.c (base_name): Likewise.
2663         * stripslash.c (ISSLASH): Likewise.
2664
2665         * addext.c: Include <dirname.h> after size_t is defined.
2666         * backupfile.c: Likewise.
2667
2668         * addext.c (addext): Use base_len to trim redundant
2669         trailing slashes instead of doing it ourselves.
2670         But do not trim the last slash if it is not redundant.
2671
2672         * backupfile.c (find_backup_file_name,
2673         max_backup_version): Use base_len instead of rolling it ourselves.
2674         Handle the case of "" and (on DOS) "C:" correctly.
2675
2676         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
2677         Include <string.h>, <dirname.h>.
2678         (base_name): Allow file names ending in slashes, other than names
2679         that are all slashes.  In this case, return the basename followed
2680         by the slashes.  This is more general, and can be used in places
2681         where the original base_name purposely had an assertion failure.
2682         (base_len): New function.
2683
2684         * dirname.c: Include <string.h> instead of <stdlib.h>.
2685         Do not include <assert.h>; no longer needed.
2686         Include xalloc.h.
2687         (memrchr): Remove decl.
2688         (dir_name_r): Remove.
2689         (dir_len): Renamed from dirlen.  All callers changed.
2690         Rewrite in terms of base_name, for simplicity and consistency.
2691         (dir_name): Never return NULL.  All callers changed.
2692         Do not include <stdlib.h> in test program; no longer needed.
2693         return 0; is fine for test program.
2694
2695         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
2696         New macros.
2697         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
2698
2699         * path-concat.c (path_concat): Use base_len to compute
2700         base length, not strlen; this means we cannot rely on memcpy
2701         to null-terminate.
2702
2703         * same.c (STREQ): Remove.
2704         (same_name): Handle the case where the basename ends in trailing '/'.
2705
2706         * stripslash.c (strip_trailing_slashes): Return nonzero if
2707         a slash was stripped.  Do not strip the last slash after a
2708         file system prefix.
2709
2710 2001-04-08  Jim Meyering  <meyering@lucent.com>
2711
2712         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
2713         recomputed; that's necessary when the offset spans a DST transition.
2714         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
2715
2716 2001-04-02  Jim Meyering  <meyering@lucent.com>
2717
2718         * regex.h, regex.c: Update from GNU libc.
2719
2720 2001-03-19  Paul Eggert  <eggert@twinsun.com>
2721
2722         * version-etc.c (version_etc_copyright): Update to 2001.
2723
2724 2001-03-16  Paul Eggert  <eggert@twinsun.com>
2725
2726         * tempname.c (uint64_t): Define to uintmax_t if
2727         not defined, and if UINT64_MAX is not defined.
2728         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
2729         Reported by John David Anglin.
2730
2731 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
2732
2733         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
2734         alias if codeset is empty.
2735         * config.charset (BeOS): Use wildcard syntax.
2736
2737 2001-03-13  Jim Meyering  <meyering@lucent.com>
2738
2739         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
2740         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
2741         From Bruno Haible.
2742
2743 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
2744
2745         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
2746         Don't return NULL.
2747         * unicodeio.c (print_unicode_char): Simplify accordingly.
2748
2749 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
2750
2751         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
2752         support for DOS/DJGPP.
2753
2754 2001-02-28  Paul Eggert  <eggert@twinsun.com>
2755
2756         * Makefile.am (libfetish_a_SOURCES):
2757         Add dup-safer.c, fopen-safer.c.
2758         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
2759
2760         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
2761
2762 2001-02-25  Paul Eggert  <eggert@twinsun.com>
2763
2764         The mkstemp replacement is taken from glibc 2.2.2, with some
2765         portability fixes for use outside glibc, as follows:
2766
2767         * tempname.c (struct_stat64): New macro.
2768         (direxists, __gen_tempname): Use it.
2769         This avoids a portability problem with Solaris 8.
2770
2771         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
2772         (<stddef.h>, <stdint.h>, <string.h>):
2773         Include only if STDC_HEADERS || _LIBC.
2774         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
2775         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
2776         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
2777         (__set_errno): Define this macro if <errno.h> doesn't.
2778         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
2779         Define these macros if <stdio.h> doesn't.
2780         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
2781         Define these macros if <sys/stat.h>
2782         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
2783         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
2784         __xstat64): Define if not _LIBC.
2785         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
2786         (__gen_tempname): Invoke gettimeofday only if
2787         HAVE_GETTIMEOFDAY || _LIBC;
2788         otherwise, fall back on plain "time".
2789         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
2790
2791         * mkstemp.c (__GT_FILE): Define to zero if not defined.
2792
2793         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
2794
2795 2001-02-17  Jim Meyering  <meyering@lucent.com>
2796
2797         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
2798         around included file name.
2799
2800         * strnlen.c (__strnlen): Merge in a change from GNU libc.
2801
2802         * strftime.c: Update from GNU libc (the only changes were to comments).
2803
2804 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
2805
2806         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
2807
2808 2001-02-17  Paul Eggert  <eggert@twinsun.com>
2809
2810         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
2811         Remove workaround macros for hosts that have mbrtowc but not
2812         mbstate_t, as we now insist on proper declarations for both
2813         before using mbrtowc.
2814
2815 2001-02-17  Jim Meyering  <meyering@lucent.com>
2816
2817         * regex.c: Update from libc.
2818
2819 2001-02-16  Paul Eggert  <eggert@twinsun.com>
2820
2821         * alloca.c (malloc): Undef before defining, since stdlib.h
2822         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
2823         Reported by Mark Hounschell via Paul Eggert.
2824
2825 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
2826
2827         * config.charset: Update for FreeBSD 4.2.
2828
2829 2001-01-26  Jim Meyering  <meyering@lucent.com>
2830
2831         * quotearg.c: Include stddef.h.
2832         * quote.c: Include stddef.h.
2833         Reported by Axel Kittenberger.
2834
2835         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
2836         line in double quotes so that it evokes a better diagnostic.
2837         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
2838         Reported by Axel Kittenberger.
2839
2840 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
2841
2842         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
2843         to avoid a warning.  Add back 'const' to inptr.
2844
2845 2001-01-16  Jim Meyering  <meyering@lucent.com>
2846
2847         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
2848         From Bruno Haible.
2849
2850 2001-01-14  Jim Meyering  <meyering@lucent.com>
2851
2852         * rename.c: New file.  From Volker Borchert.
2853         Include stdlib.h, string.h or strings.h, and xalloc.h.
2854         Use strip_trailing_slashes rather than open-coding it.
2855
2856 2001-01-03  Paul Eggert  <eggert@twinsun.com>
2857
2858         * strftime.c: Sync with glibc time/strftime.c 1.81.
2859
2860 2001-01-03  Jim Meyering  <meyering@lucent.com>
2861
2862         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
2863         local `inptr' to avoid warning with some system declarations of iconv.
2864
2865 2000-12-29  Paul Eggert  <eggert@twinsun.com>
2866
2867         * modechange.c: Do not assume that mode_t uses the
2868         traditional octal encoding.  E.g. "chmod 1 FOO" should set
2869         the other-execute bit of FOO even if S_IXOTH != 1.
2870
2871         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
2872         WOTH, XOTH, ALLM): New macros.
2873         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
2874          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
2875         Use them.
2876         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
2877         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
2878         (mode_compile):
2879         No need to use uintmax_t; unsigned long is long enough.
2880         Don't bother to get suffix since we don't use it.
2881
2882 2000-12-24  Jim Meyering  <meyering@lucent.com>
2883
2884         * hash.c (is_prime): Return explicit boolean values.
2885         (hash_get_first): Return NULL to appease Irix5.6's 89.
2886         Reported by Nelson Beebe.
2887
2888 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
2889
2890         * localcharset.c (locale_charset): Add support for Win32.
2891
2892 2000-12-18  Paul Eggert  <eggert@twinsun.com>
2893
2894         * physmem.h, physmem.c: New files.
2895
2896         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
2897         (noinst_HEADERS): Add physmem.h.
2898
2899         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
2900         't' for compatibility with Solaris 8 sort.
2901
2902 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
2903
2904         * config.charset: Add support for BeOS.
2905
2906 2000-12-16  Jim Meyering  <meyering@lucent.com>
2907
2908         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
2909         SHELLS_FILE to a file name that's useful on djgpp systems.
2910         Include stdlib.h.
2911         (ADDITIONAL_DEFAULT_SHELLS): Define.
2912         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
2913         Based mostly on a patch from Prashant TR.
2914
2915 2000-12-16  Jim Meyering  <meyering@lucent.com>
2916
2917         This bug had a serious impact on chown: `chown N:M FILE' (for integer
2918         N and M) would have treated it like `chown N:N FILE'.
2919
2920         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
2921
2922 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
2923
2924         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
2925         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
2926         to the list of canonical encodings. Rename EUC-CN to GB2312.
2927
2928 2000-12-08  Andreas Schwab  <schwab@suse.de>
2929
2930         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
2931         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
2932
2933 2000-12-07  Jim Meyering  <meyering@lucent.com>
2934
2935         * stripslash.c (ISSLASH): Define.
2936         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
2937         From Prashant TR.
2938
2939         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
2940         (dir_name_r): Declare this function as static.
2941         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
2942         manifest itself on a name containing a mix of slashes and
2943         backslashes.
2944         Make this function work with names starting with a DOS-style
2945         drive letter and colon prefix.
2946         (dir_name): Append `.' if necessary.
2947         Based mostly on patches from Prashant TR and Eli Zaretskii.
2948
2949         * dirname.h (dir_name_r): Remove prototype.
2950
2951 2000-12-05  Jim Meyering  <meyering@lucent.com>
2952
2953         * dirname.c (dir_name_r): Add `const' in a few local declarations.
2954
2955 2000-12-04  Jim Meyering  <meyering@lucent.com>
2956
2957         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
2958         Also include memory.h, stdlib.h, unistd.h if appropriate.
2959         Reported by Andreas Jaeger (conflicting declaration of malloc).
2960
2961 2000-12-02  Jim Meyering  <meyering@lucent.com>
2962
2963         * closeout.h: Make idempotent, to avoid some obscure warnings.
2964
2965 2000-12-01  Paul Eggert  <eggert@twinsun.com>
2966
2967         * memrchr.c: Include <config.h> before any system include file.
2968
2969 2000-11-29  Paul Eggert  <eggert@twinsun.com>
2970
2971         * dirname.c (dir_name_r): Fix typo: int -> size_t.
2972
2973 2000-11-26  Jim Meyering  <meyering@lucent.com>
2974
2975         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
2976
2977 2000-11-22  Paul Eggert  <eggert@twinsun.com>
2978
2979         * strftime.c (my_strftime): Do not invoke mbrlen with a
2980         size of (size_t) -1; it's not portable.
2981
2982 2000-11-17  Akim Demaille  <akim@epita.fr>
2983
2984         * obstack.h: Formatting changes.
2985         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
2986         prevent type checking.
2987         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
2988         cast the value to (void *): assigning a `foo *' to a `void *'
2989         variable is valid.
2990         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
2991
2992 2000-11-17  Jim Meyering  <meyering@lucent.com>
2993
2994         * strstr.c: Update from GNU libc.
2995
2996 2000-11-16  Jim Meyering  <meyering@lucent.com>
2997
2998         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
2999
3000 2000-11-11  Jim Meyering  <meyering@lucent.com>
3001
3002         * error.c: Add a couple #includes, merging from GNU libc version.
3003
3004 2000-11-10  Jim Meyering  <meyering@lucent.com>
3005
3006         * obstack.h: Update from GNU libc.
3007         * obstack.c: Likewise.
3008
3009 2000-11-06  Paul Eggert  <eggert@twinsun.com>
3010
3011         * getusershell.c (setusershell): Use rewind rather than
3012         fseek/fseeko, to avoid configuration hassles with fseeko.
3013         Don't bother opening SHELLS_FILE if shellstream is NULL;
3014         it's not necessary.
3015
3016 2000-11-05  Jim Meyering  <meyering@lucent.com>
3017
3018         * makepath.h (make_dir): Declare.
3019         * makepath.c (make_dir): Remove `static' attribute.
3020         Tweak a comment.
3021
3022 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
3023
3024         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
3025         last one in a bucket, advance to the next bucket.
3026
3027 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
3028
3029         * fnmatch.c: Do not comment out all the code if we are using
3030         the GNU C library, because in some cases we are replacing buggy
3031         code in the GNU C library itself.
3032
3033 2000-10-30  Paul Eggert  <eggert@twinsun.com>
3034
3035         * error.h, getline.h, modechange.h:
3036         Remove "2000" from Copyright line, as the file hasn't been
3037         changed this year other than in the copyright notice.
3038
3039         * xalloc.h: Add "2000" to Copyright line, as this file
3040         was changed this year.
3041
3042 2000-10-30  Paul Eggert  <eggert@twinsun.com>
3043
3044         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
3045         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
3046         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
3047
3048 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
3049
3050         * regex.h (__restrict_arr): Move definition out of #ifndef block.
3051         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
3052         doesn't define __restrict_arr.
3053
3054 2000-10-29  Jim Meyering  <meyering@lucent.com>
3055
3056         * xstat.in: Fix grammar in comment.
3057
3058 2000-10-28  Jim Meyering  <meyering@lucent.com>
3059
3060         * memchr.c: Update from libc.
3061         Adjust for portability:
3062         [HAVE_STDLIB_H]: Include stdlib.h.
3063         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
3064         Undef __memchr, too.
3065         [!weak_alias]: Define __memchr to memchr.
3066
3067         * regex.c: Update from libc.
3068         * regex.h: Likewise.
3069         * getopt1.c: Likewise.
3070         * memcmp.c: Likewise.
3071
3072         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
3073         Avoid using fseek, when possible -- it's broken by design.
3074         Patch by Ulrich Drepper.
3075
3076 2000-10-26  Jim Meyering  <meyering@lucent.com>
3077
3078         * strftime.c: Update from libc.
3079
3080 2000-10-25  Jim Meyering  <meyering@lucent.com>
3081
3082         * obstack.c: Update from libc.
3083
3084 2000-10-23  Jim Meyering  <meyering@lucent.com>
3085
3086         * hard-locale.c (hard_locale): Revert last change -- it was simply
3087         wrong.  That set_locale call must not have any side effects.
3088         From Paul Eggert.
3089
3090 2000-10-22  Jim Meyering  <meyering@lucent.com>
3091
3092         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
3093         [CYCLIC]: Remove now-unused definition.
3094
3095         * save-cwd.c (O_DIRECTORY): Define, if needed.
3096         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
3097         Suggestion from Ulrich Drepper.
3098
3099 2000-10-21  Jim Meyering  <meyering@lucent.com>
3100
3101         * dirname.c (dir_name_r): New function, factored out of dir_name.
3102         (dir_name): Use dir_name_r.
3103         * dirname.h (dir_name_r): Declare it.
3104
3105 2000-10-21  Jim Meyering  <meyering@lucent.com>
3106
3107         * dirname.c (memrchr): Declare if necessary.
3108         (dir_name): Remove the restriction that there be no
3109         trailing slashes.  Now, this code skips past them, effectively
3110         ignoring them.
3111         [TEST_DIRNAME] (main): New unit tests.
3112
3113         * memrchr.c: New file from GNU libc.
3114         Undef __memrchr, too.
3115         [!weak_alias]: Define __memrchr to memrchr.
3116         Guard weak_alias use with `#ifdef weak_alias'.
3117
3118 2000-10-17  Jim Meyering  <meyering@lucent.com>
3119
3120         * quote.h (PARAMS): Define and use.
3121         Reported by Akim Demaille.
3122
3123         * getopt.c: Update from libc.
3124
3125 2000-10-16  Jim Meyering  <meyering@lucent.com>
3126
3127         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
3128         From Jan Fedak.
3129
3130 2000-09-25  Jim Meyering  <meyering@lucent.com>
3131
3132         * md5.h (rol): Define (from GnuPG).
3133
3134         * sha.c: Give credit (GnuPG) where due.
3135         (M): Use rol rather than open-coding it.
3136         Add a FIXME comment.
3137
3138 2000-09-21  Jim Meyering  <meyering@lucent.com>
3139
3140         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
3141         Reported by Michael Stone.
3142
3143 2000-09-20  Jim Meyering  <meyering@lucent.com>
3144
3145         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
3146         (noinst_HEADERS): Add sha.h.
3147         Based on code from Scott G. Miller and from GnuPG.
3148
3149 2000-09-15  Jim Meyering  <meyering@lucent.com>
3150
3151         * regex.c: Update from libc.
3152
3153 2000-09-10  Jim Meyering  <meyering@lucent.com>
3154
3155         * getopt.c (_getopt_internal): Update from glibc.
3156
3157 2000-09-09  Jim Meyering  <meyering@lucent.com>
3158
3159         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
3160         think it should be used as a general replacement for isascii.
3161         * fnmatch.c: Likewise.
3162         * mbswidth.c: Likewise
3163         * regex.c: Likewise.
3164
3165         Don't use atoi.
3166         * userspec.c: Include sys/param.h and limits.h.
3167         Include xstrtol.h.
3168         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
3169         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
3170         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
3171         UID, GID.  Check range.
3172
3173 2000-09-06  Jim Meyering  <meyering@lucent.com>
3174
3175         * getopt.c (_getopt_internal): Update from glibc.
3176
3177 2000-08-30  Jim Meyering  <meyering@lucent.com>
3178
3179         * strftime.c: Merge in changes from GNU libc.
3180
3181 2000-08-26  Jim Meyering  <meyering@lucent.com>
3182
3183         * closeout.c: Include "__fpending.h".
3184         (close_stdout_status): Return right away if there's nothing to flush.
3185
3186         * Makefile.am (noinst_HEADERS): Add __fpending.h.
3187         * __fpending.c: New file.
3188         * __fpending.h: New file.
3189
3190 2000-08-07  Paul Eggert  <eggert@twinsun.com>
3191
3192         Standardize on "memory exhausted" instead of "Memory exhausted"
3193         or "virtual memory exhausted".
3194         * obstack.c (print_and_abort): Use "memory exhausted", not
3195         "virtual memory exhausted".
3196         * same.c (same_name): Invoke xalloc_die instead of printing
3197         our own message.
3198         * userspec.c (parse_user_spec): Likewise.
3199         * bumpalloc.h: comment fix
3200         * same.c, userspec.c: Include xalloc.h.
3201
3202         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
3203         not char *const and pointing to a constant array.
3204         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
3205         (xrealloc): Comment fix.
3206
3207         * userspec.c (parse_user_spec):
3208         Don't translate a message until just before returning,
3209         to avoid unnecessary translation.
3210
3211 2000-08-07  Jim Meyering  <meyering@lucent.com>
3212
3213         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
3214         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
3215         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
3216         getgroups.c, gethostname.c, getopt.h, group-member.c,
3217         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
3218         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
3219         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
3220         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
3221         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
3222         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
3223         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
3224         yesno.c: Back out Copyright date changes for each file with no change
3225         this year.  This eases coordination with other programs using the same
3226         source code modules.  From Paul Eggert.
3227
3228 2000-08-03  Greg McGary  <greg@mcgary.org>
3229
3230         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
3231         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
3232         (EXTEND_BUFFER): Use them.
3233
3234 2000-08-01  Jim Meyering  <meyering@lucent.com>
3235
3236         * dirname.c (ISSLASH): Define.
3237         (BACKSLASH_IS_PATH_SEPARATOR): Define.
3238         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
3239         both `\' and `/' may be use as path separators.
3240         Based on a patch from Prashant TR.
3241
3242 2000-07-31  Paul Eggert  <eggert@twinsun.com>
3243
3244         * quotearg.c (quotearg_n_options): Don't make the initial
3245         slot vector a constant, since it might get modified.
3246
3247 2000-07-31  Jim Meyering  <meyering@lucent.com>
3248
3249         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
3250         * obstack.c (print_and_abort): Likewise.
3251
3252 2000-07-30  Paul Eggert  <eggert@twinsun.com>
3253
3254         * quotearg.c (quotearg_n_options): Preallocate a slot 0
3255         buffer, so that the caller can always quote one small
3256         component of a "memory exhausted" message in slot 0.
3257         From a suggestion by Jim Meyering.
3258
3259 2000-07-30  Jim Meyering  <meyering@lucent.com>
3260
3261         * makepath.c (make_path): Quote the other instance, too.
3262
3263         * quotearg.c (N_STATIC_SLOTVECS): Define.
3264         (STATIC_BUF_SIZE): Define.
3265         (quotearg_n_options): Use only statically allocated storage when
3266         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
3267         than STATIC_BUF_SIZE.
3268
3269 2000-07-29  Jim Meyering  <meyering@lucent.com>
3270
3271         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
3272         * dirname.c (dir_name): Likewise.
3273
3274         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
3275
3276         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
3277         (dir_name): Assert that there are no trailing slashes.
3278
3279 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
3280
3281         * mbswidth.h (mbswidth): Add a flags argument.
3282         (mbswidth): New declaration.
3283         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
3284         * mbswidth.c (mbswidth): Add a flags argument.
3285         (mbsnwidth): New function.
3286
3287 2000-07-24  Jim Meyering  <meyering@lucent.com>
3288
3289         * mbswidth.c: Remove useless #else.  From Bruno Haible.
3290
3291 2000-07-23  Paul Eggert  <eggert@twinsun.com>
3292
3293         * mbswidth.c (_XOPEN_SOURCE):
3294         Don't define; this causes problems on Solaris 7.
3295         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
3296
3297 2000-07-23  Paul Eggert  <eggert@twinsun.com>
3298
3299         * quotearg.c:
3300         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
3301         so that mbstate_t is always defined.
3302
3303         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
3304         be 1 in at least one GCC installation, and this configuration
3305         error is likely to be common.  Ignoring MB_LEN_MAX hurts
3306         performance on hosts that have mbrtowc but have only unibyte
3307         locales, but I assume these hosts are rare.
3308
3309 2000-07-23  Paul Eggert  <eggert@twinsun.com>
3310
3311         * quotearg.c: Streamline by invoking multibyte code only if needed.
3312         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
3313         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
3314         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
3315         invoke multibyte primitives.
3316
3317 2000-07-23  Jim Meyering  <meyering@lucent.com>
3318
3319         * basename.c (base_name): Add an assertion.
3320
3321 2000-07-15  Bruno Haible  <clisp.cons.org>
3322
3323         * quotearg.c: When the system forces us to redefine mbstate_t,
3324         shadow its mbsinit function.
3325
3326 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
3327
3328         * mbswidth.h: New file.
3329         * mbswidth.c: New file.
3330         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
3331         (noinst_HEADERS): Add mbswidth.h.
3332
3333 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
3334
3335         * config.charset: Add support for FreeBSD. Improve support for HP-UX
3336         and IRIX 6.
3337
3338 2000-07-15  Jim Meyering  <meyering@lucent.com>
3339
3340         * makepath.c: Include quote.h.
3341         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
3342         corresponding argument in a `quote (...)' call.
3343         Give better diagnostics.
3344
3345         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
3346         (noinst_HEADERS): Add quote.h.
3347
3348         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
3349         from tar's src/misc.c.
3350         * quote.h: New file.  Prototypes for same.
3351
3352 2000-07-10  Paul Eggert  <eggert@twinsun.com>
3353
3354         From a suggestion by Bruno Haible.
3355         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
3356         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
3357         to decide whether to define the BeOS workaround macro;
3358         this adjusts to the change to AC_MBSTATE_T.
3359
3360 2000-07-13  Paul Eggert  <eggert@twinsun.com>
3361
3362         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
3363
3364         * quotearg.c (quoting_style_args, quoting_style_vals,
3365         quotearg_buffer_restyled): Add support for
3366         clocale_quoting_style.  Undo previous change to
3367         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
3368         and "{RIGHT QUOTATION MARK}" msgids.
3369
3370 2000-07-05  Paul Eggert  <eggert@twinsun.com>
3371
3372         The old behavior of quoting `like this' doesn't look good with
3373         newer, ISO-style fonts.  See:
3374         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
3375
3376         Instead, quote "like this" by default.  Let the translator
3377         tailor the locale-specific quoting behavior by providing
3378         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
3379
3380         * quotearg.c (N_): New macro.
3381         (gettext_default): New function.
3382         (quotearg_buffer_restyled): Use
3383         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
3384         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
3385
3386 2000-07-09  Jim Meyering  <meyering@lucent.com>
3387
3388         * Most files: Update copyright dates to include 2000.
3389
3390 2000-07-08  Jim Meyering  <meyering@lucent.com>
3391
3392         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
3393         if not defined.
3394         (xgethostname): Remove now-unnecessary #ifdef.
3395         Move declaration of `err' into loop where it's used.
3396
3397 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
3398
3399         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
3400         by allocating a larger buffer. Test the gethostname return value for
3401         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
3402         returns an error and ENAMETOOLONG isn't defined.
3403
3404 2000-07-05  Paul Eggert  <eggert@twinsun.com>
3405         and Bruno Haible  <haible@clisp.cons.org>
3406
3407         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
3408
3409 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
3410
3411         * quotearg.c (struct quoting_options): Simplify quote_these_too
3412         dimension.
3413
3414 2000-07-03  Jim Meyering  <meyering@lucent.com>
3415
3416         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
3417         Reported by Bruno Haible.
3418
3419 2000-07-04  Jim Meyering  <meyering@lucent.com>
3420
3421         * quotearg.c: Make inclusion of <wchar.h> independent of whether
3422         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
3423         lacks mbrtowc.
3424
3425 2000-07-03  Paul Eggert  <eggert@twinsun.com>
3426         and Bruno Haible  <haible@clisp.cons.org>
3427
3428         * quotearg.c (mbrtowc):
3429         Assign to *pwc, and return 1 only if result is nonzero.
3430         (iswprint): Use ISPRINT when substituting our own mbrtowc.
3431
3432 2000-07-03  Jim Meyering  <meyering@lucent.com>
3433
3434         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
3435         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
3436         From Bob Proulx.
3437
3438 2000-07-02  Jim Meyering  <meyering@lucent.com>
3439
3440         * quotearg.c (mbstate_t): Don't define here.
3441
3442 2000-07-02  Jim Meyering  <meyering@lucent.com>
3443
3444         * nanosleep.c (SIGCONT): Define if not already defined.
3445
3446 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
3447
3448         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
3449         per change in ../m4/ls-mntd-fs.m4.
3450         (read_filesystem_list): Ignore symbolic links.
3451
3452 2000-06-29  Jim Meyering  <meyering@lucent.com>
3453
3454         * same.c: Include <string.h> or <strings.h>, as appropriate,
3455         for declaration of strcmp.
3456
3457         * long-options.c: Include <stdlib.h>, for declaration of exit.
3458
3459         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
3460         Avoid warning by casting result to `char *' to remove `const'.
3461
3462 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
3463
3464         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
3465
3466 2000-06-26  Paul Eggert  <eggert@twinsun.com>
3467
3468         savedir now sets errno on failure and invokes xmalloc to get memory.
3469         Fix a couple of other minor bugs while we're at it.
3470
3471         * savedir.c (<unistd.h>): Do not include; there's no need.
3472         (NAMLEN): Remove macro.
3473         (malloc, realloc): Remove decls.
3474         (stpcpy): Likewise.
3475         ("xalloc.h"): Include.
3476         (NAME_SIZE_DEFAULT): New macro.
3477         (savedir): Use xmalloc / xrealloc to allocate memory.
3478         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
3479         Skip "" directory entries.
3480         Use strlen to calculate directory entry length, since the old method
3481         is rarely used these days and isn't worth supporting.
3482         Don't use a pointer after freeing it.
3483         Check for integer overflow when calculating allocation size.
3484         Use memcpy to copy entries, instead of stpcpy.
3485         Set errno properly when returning NULL.
3486         Check for readdir error.
3487
3488 2000-06-26  Jim Meyering  <meyering@lucent.com>
3489
3490         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
3491
3492 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
3493
3494         * getusershell.c (xmalloc, xrealloc): Remove functions.
3495         Include xalloc.h.
3496         Don't include <stdlib.h>.  Don't declare malloc, realloc.
3497
3498 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
3499
3500         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
3501
3502 2000-06-24  Jim Meyering  <meyering@lucent.com>
3503
3504         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
3505
3506 2000-06-21  Jim Meyering  <meyering@lucent.com>
3507
3508         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
3509
3510 2000-06-19  Paul Eggert  <eggert@twinsun.com>
3511
3512         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
3513         (mbrtowc, mbstate_t): Define substitutes if
3514         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
3515         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
3516         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
3517
3518 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
3519
3520         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
3521         than 1024, return a memory chunk of least possible size, instead
3522         of size PATH_MAX + 2. In the loop, increment the size proportionally.
3523         Use free/xmalloc instead of xrealloc to avoid copying for very long
3524         paths.
3525
3526 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
3527
3528         * canon-host.c (canon_host): Use malloc and memcpy to copy an
3529         address, not strdup.  Include <stdlib.h> and don't declare free().
3530
3531 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
3532
3533         * path-concat.c (path_concat): Don't access dir[-1] if dir is
3534         the empty string.
3535
3536 2000-06-21  Jim Meyering  <meyering@lucent.com>
3537
3538         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
3539         (noinst_HEADERS): Add getstr.h.
3540
3541         * getline.c (getstr): Move into a separate file.
3542         * getstr.c (getstr): New file, extracted from getline.c, with
3543         the following changes: new parameter, delim2; both delim[12]
3544         parameters have type `int', not `char'.  The latter would lose
3545         with 8-bit delimiters.
3546         * getstr.h: New file.
3547
3548 2000-06-19  Jim Meyering  <meyering@lucent.com>
3549
3550         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
3551
3552 2000-06-18  Jim Meyering  <meyering@lucent.com>
3553
3554         * mkdir.c: Remove file, due mainly to copyright incompatibility.
3555         Besides, these days every porting target provides a mkdir function.
3556
3557         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
3558         (this snippet comes from src/system.h).
3559
3560 2000-06-15  Paul Eggert  <eggert@twinsun.com>
3561
3562         * human.c (adjust_value): New function.
3563         (human_readable_inexact): Apply rounding style even when
3564         printing approximate values.
3565
3566 2000-06-14  Paul Eggert  <eggert@twinsun.com>
3567
3568         * human.c (human_readable_inexact): Allow an input block
3569         size that is not a multiple of the output block size, and vice versa.
3570         Reported by Piergiorgio Sartor.
3571
3572 2000-06-14  Paul Eggert  <eggert@twinsun.com>
3573
3574         * getdate.y (get_date): Apply relative times after time
3575         zone indicator, not before.  Reported by Todd A. Jacobs.
3576
3577 2000-06-13  Jim Meyering  <meyering@lucent.com>
3578
3579         * Makefile.am (all-local): Depend on lstat.c and stat.c.
3580
3581         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
3582
3583 2000-06-12  Paul Eggert  <eggert@twinsun.com>
3584
3585         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
3586
3587 2000-06-04  Paul Eggert  <eggert@twinsun.com>
3588
3589         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
3590
3591 2000-06-04  Jim Meyering  <meyering@lucent.com>
3592
3593         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
3594         SunOS 4.1.4 for which gid_t is an unsigned type.
3595
3596 2000-06-03  Jim Meyering  <meyering@lucent.com>
3597
3598         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
3599
3600 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
3601
3602         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
3603         newer, don't install charset.alias.
3604         * config.charset: Change the Linux/glibc rules so they become empty
3605         on glibc-2.1 or newer.
3606
3607 2000-06-02  Jim Meyering  <meyering@lucent.com>
3608
3609         * mountlist.c: Back out last change.  Instead, do this...
3610         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
3611         member using the same `ignore'-testing code.
3612         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
3613         fs_type strings.
3614         From Mark D. Roth.
3615
3616 2000-05-29  Jim Meyering  <meyering@lucent.com>
3617
3618         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
3619         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
3620
3621 2000-05-22  Jim Meyering  <meyering@lucent.com>
3622
3623         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
3624
3625 2000-05-18  Jim Meyering  <meyering@lucent.com>
3626
3627         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
3628         back, too, since it may have been modified by allocate_entry.
3629         (hash_delete): Rewrite to use neither the assignment operator
3630         nor the comma operator in an if-expression.
3631
3632 2000-05-15  Paul Eggert  <eggert@twinsun.com>
3633
3634         * closeout.c:
3635         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
3636         Remove; no longer needed.
3637         "quotearg.h": Add include.
3638         (file_name): Do not bother to explicitly initialize to NULL; it's less
3639         efficient on some hosts.
3640         (close_stdout_status): Remove test as to whether stdout was already
3641         closed; it breaks for the case "echo x | sort >&-".
3642         Quote file name colons.
3643         Do not assume that _("write error") lacks format strings.
3644
3645 2000-05-15  Jim Meyering  <meyering@lucent.com>
3646
3647         * version-etc.c (version_etc_copyright): Update the copyright string
3648         used in all --version output.
3649
3650 2000-05-14  Jim Meyering  <meyering@lucent.com>
3651
3652         * closeout.c (close_stdout_set_file_name): New function.
3653         (close_stdout_status): Use new file-scoped global.
3654         Return right away if fstat says the stdout file descriptor is invalid.
3655         * closeout.h (close_stdout_set_file_name): Declare.
3656
3657 2000-05-10  Jim Meyering  <meyering@lucent.com>
3658
3659         * closeout.c [default_exit_status]: New file-scoped variable.
3660         (close_stdout_set_status): New function.
3661         * closeout.h (close_stdout_set_status): Declare.
3662
3663 2000-05-08  Jim Meyering  <meyering@lucent.com>
3664
3665         * long-options.c: Don't include closeout.h.
3666         (parse_long_options): Don't call close_stdout for --version.
3667
3668 2000-05-06  Jim Meyering  <meyering@lucent.com>
3669
3670         * strnlen.c: Undefine __strnlen and strnlen.
3671         [!weak_alias]: Define __strnlen to strnlen.
3672
3673         * atexit.c: New file, from libiberty.
3674
3675 2000-05-06  Jim Meyering  <meyering@lucent.com>
3676
3677         * closeout.c (close_stdout_status): Also check for errors on the
3678         stderr stream.
3679
3680 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
3681
3682         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
3683         instead of xmalloc, xrealloc, path_concat.
3684         (locale_charset): Treat empty environment variables as absent.
3685         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
3686
3687 2000-05-04  Jim Meyering  <meyering@lucent.com>
3688
3689         * getopt.c: Update from glibc.
3690         * obstack.c: Likewise.
3691         * obstack.h: Likewise.
3692         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
3693
3694         * regex.h: Likewise.
3695         * strndup.c: Likewise.
3696         * strnlen.c: New file, from glibc.
3697
3698 2000-05-01  Jim Meyering  <meyering@lucent.com>
3699
3700         * full-write.c (full_write): Remove `FIXME' part of comment.
3701
3702 2000-04-29  Jim Meyering  <meyering@lucent.com>
3703
3704         * path-concat.c: Declare strdup only if it's not defined.
3705         * canon-host.c: Likewise.
3706
3707 2000-04-28  Jim Meyering  <meyering@lucent.com>
3708
3709         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
3710         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
3711         included first, then limits.h is included by locale.h by libintl.h.
3712         From John David Anglin.
3713
3714 2000-04-25  Jim Meyering  <meyering@lucent.com>
3715
3716         * makepath.c (S_IRWXUGO): Define.
3717         (make_path): Always perform explicit chmod if MODE specifies any
3718         of the `special' permission bits.  Prompted by a bug report against
3719         install from Mate Wierdl and Joost van Baal.
3720
3721 2000-04-18  Jim Meyering  <meyering@lucent.com>
3722
3723         * README: New file.
3724
3725         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
3726         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
3727
3728 2000-04-17  Jim Meyering  <meyering@lucent.com>
3729
3730         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
3731         the definition of it to rpl_strftime also defined-away the system's
3732         declaration.
3733
3734 2000-04-15  Jim Meyering  <meyering@lucent.com>
3735
3736         Use `C' to denote so-called `contiguous' files, the same way
3737         that tar does.
3738         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
3739         (ftypelet): Use S_ISCTG.
3740         From Michael Deutschmann.
3741
3742 2000-04-14  Jim Meyering  <meyering@lucent.com>
3743
3744         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
3745
3746 2000-04-08  Jim Meyering  <meyering@lucent.com>
3747
3748         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
3749         names don't conflict.  Reported by Eli Zaretskii.
3750
3751 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
3752
3753         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
3754         bug.  Deal with the different error behavior of Irix iconv.
3755
3756 2000-04-07  Jim Meyering  <meyering@lucent.com>
3757
3758         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
3759         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
3760
3761 2000-04-05  Jim Meyering  <meyering@lucent.com>
3762
3763         Portability tweaks required for ultrix4.3.
3764         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
3765         * readutmp.c: Include sys/types.h before sys/stat.h.
3766         * canon-host.c: Declare strdup.
3767         * path-concat.c: Likewise.
3768         From John David Anglin.
3769
3770 2000-04-04  Jim Meyering  <meyering@lucent.com>
3771
3772         Be more DOS 8.3-friendly.
3773         * ref-add.sin: Renamed from ref-add.sed.in.
3774         * ref-del.sin: Renamed from ref-del.sed.in.
3775         * Makefile.am: Reflect renaming.
3776         Reported by Eli Zaretskii.
3777
3778         Use a temporary file name that won't clash with `charset.alias'
3779         in the DOS 8.3 name space.
3780         * Makefile.am (charset_tmp): Define.
3781         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
3782         (uninstall-local): Likewise.
3783         Reported by Eli Zaretskii.
3784
3785 2000-03-29  Paul Eggert  <eggert@twinsun.com>
3786
3787         * time/strftime.c (my_strftime): Make sure we call the system
3788         strftime, not ourselves, when invoking the underlying strftime.
3789
3790 2000-03-24  Jim Meyering  <meyering@lucent.com>
3791
3792         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
3793         (charset_alias): Define.
3794         (install-exec-local): Factor out common code.
3795         (uninstall-local): Split lines longer than 80.
3796         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
3797         (SUFFIXES): Define.
3798         (.sed.in.sed): New rule.  Don't redirect directly to $@.
3799         (CLEANFILES): Add ref-add.sed and ref-del.sed.
3800
3801 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
3802
3803         * config.charset: Output a line containing "Packages using this file".
3804         * ref-add.sed.in, ref-del.sed.in: New files.
3805         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
3806         ref-del.sed): New rules.
3807
3808 2000-03-17  Jim Meyering  <meyering@lucent.com>
3809
3810         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
3811         Otherwise, include <strings.h>
3812
3813 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
3814
3815         * unicodeio.c (utf8_wctomb): New function.
3816         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
3817         format instead of in UCS-4 with platform dependent endianness.
3818
3819 2000-03-07  Paul Eggert  <eggert@twinsun.com>
3820
3821         * savedir.c (savedir): Work even if directory size is
3822         negative; this can happen with some screwy NFS configurations.
3823
3824 2000-03-06  Jim Meyering  <meyering@lucent.com>
3825
3826         * localcharset.c (get_charset_aliases): Don't try to free file_name
3827         if it's NULL (because we ran out of memory).  From Bruno Haible.
3828
3829 2000-03-05  Jim Meyering  <meyering@lucent.com>
3830
3831         * localcharset.c ("path-concat.h"): Include.
3832         (get_charset_aliases): Use path_concat instead of ANSI string
3833         concatenation.
3834
3835         * unicodeio.h (PARAMS): Define.
3836         Use it to guard prototype.
3837
3838 2000-03-04  Jim Meyering  <meyering@lucent.com>
3839
3840         * Makefile.am (install-exec-local): Create $(libdir) before installing
3841         into it.
3842         (uninstall-local): Uncomment this rule so `make distcheck' works
3843         once again.
3844
3845         * unicodeio.c (<errno.h>): Include it.
3846         (errno): Declare if not defined.
3847
3848         * localcharset.c: Add Bruno's comment justifying use of volatile.
3849
3850         * config.charset: New version, incorporating remarks from a linux
3851         i18n mailing list.  From Bruno Haible.
3852
3853 2000-03-02  Jim Meyering  <meyering@lucent.com>
3854
3855         * Makefile.am (EXTRA_DIST): Add config.charset.
3856
3857 2000-03-01  Jim Meyering  <meyering@lucent.com>
3858
3859         * localcharset.c: Guard some #includes with `#if HAVE_...'.
3860         * unicodeio.c: Likewise.
3861
3862 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
3863
3864         * config.charset: New file.
3865         * localcharset.c: New file.
3866         * unicodeio.h, unicodeio.c: New files.
3867         * Makefile.am (DEFS): Add -DLIBDIR=...
3868         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
3869         (noinst_HEADERS): Add unicodeio.h.
3870         (all-local, install-exec-local, charset.alias): New targets.
3871
3872 2000-02-28  Paul Eggert  <eggert@twinsun.com>
3873
3874         * quotearg.c (ALERT_CHAR): New macro.
3875         (quotearg_buffer_restyled): Use it.
3876
3877 2000-02-27  Jim Meyering  <meyering@lucent.com>
3878
3879         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
3880         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
3881
3882         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
3883         not `#if STDC_HEADERS'.
3884         Declare malloc if needed.
3885
3886         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
3887         now that autoconf always defines the HAVE_DECL_ symbols.
3888         * human.c: Likewise.
3889         * same.c: Likewise.
3890         * strtoumax.c: Likewise.
3891
3892         * backupfile.c: Arrange for cpp to fail if the configure-time
3893         declaration check was not run.
3894         * hash.c: Likewise.
3895         * human.c: Likewise.
3896         * same.c: Likewise.
3897         * strtoumax.c: Likewise.
3898
3899         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
3900         then first look up the entire `.'-containing string as a login name.
3901
3902 2000-02-18  Paul Eggert  <eggert@twinsun.com>
3903
3904         * getdate.y: Handle two-digit years with leading zeros correctly.
3905         (textint): New typedef.
3906         (parser_control): Member year changed from int to textint.
3907         All uses changed.
3908         (YYSTYPE): Removed; replaced by %union with int and textint members.
3909         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
3910         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
3911         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
3912         (tSNUMBER, tUNUMBER): Now of type <textintval>.
3913         (date, number, to_year): Use width of number in digits, not its value,
3914         to determine whether it's a 2-digit year, or a 2-digit time.
3915         (yylex): Store number of digits of numeric tokens.
3916         Reported by John Kendall.
3917
3918         (parser_control): Changed from struct parser_control to typedef (for
3919         consistency).  All uses changed.
3920
3921         (tID): Removed; not used.
3922         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
3923
3924 2000-02-14  Paul Eggert  <eggert@twinsun.com>
3925
3926         * getpagesize.h (getpagesize): Port to VMS for Alpha;
3927         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
3928
3929 2000-02-12  Jim Meyering  <meyering@lucent.com>
3930
3931         * userspec.c (ISDIGIT): Define it.
3932         (isdigit): Remove definition.
3933         (is_number): Use ISDIGIT, not isdigit.
3934         <libintl.h>: Include.
3935         (_ and N_): Define.
3936         (parse_user_spec): Mark translatable strings.
3937
3938 2000-02-10  Jim Meyering  <meyering@lucent.com>
3939
3940         With these changes, nanosleep.[ch] are finally enough like the other
3941         lib/* replacement files to compile on a few more losing systems.
3942
3943         * nanosleep.h: Don't include config.h.
3944         Remove prototype from declaration of nanosleep.
3945         (PARAMS): Remove now-unneeded definition.
3946         * nanosleep.c: #undef nanosleep.
3947         (rpl_nanosleep): Rename from nanosleep.
3948
3949 2000-02-03  Jim Meyering  <meyering@lucent.com>
3950
3951         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
3952         rather than with `#if HAVE_UTMPNAME'.
3953
3954 2000-02-01  Jim Meyering  <meyering@lucent.com>
3955
3956         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
3957
3958 2000-01-31  Jim Meyering  <meyering@lucent.com>
3959
3960         * nanosleep.h (nanosleep): Guard declaration with
3961         `#if ! HAVE_DECL_NANOSLEEP'.
3962         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
3963         the declaration in that vendor's sys/timers.h.
3964         Reported by Christian Krackowizer.
3965
3966         * quotearg.c (ISASCII): Add #undef and move definition to follow
3967         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
3968         (ISPRINT): Likewise.
3969         Reported by Tom Tromey.
3970
3971 2000-01-30  Jim Meyering  <meyering@lucent.com>
3972
3973         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
3974         uses of ->ut_name.  The latter doesn't work with new Linux header files
3975         where only utmpx.ut_user is declared.
3976
3977         * readutmp.h (UT_USER): Define.
3978
3979 2000-01-23  Jim Meyering  <meyering@lucent.com>
3980
3981         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
3982         obstack.c.
3983
3984 2000-01-22  Jim Meyering  <meyering@lucent.com>
3985
3986         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
3987         [! HAVE_DECL_STRTOULL]: Declare strtoull.
3988         Required for some AIX systems.  Reported by Christian Krackowizer.
3989         [TESTING] (main): New function.
3990
3991         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
3992         * dirname.c (dir_name): Support for DOS-style file names with drive
3993         letters.
3994
3995         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
3996
3997         * strverscmp.c (ISDIGIT): Define.
3998         (strverscmp): Use ISDIGIT, not isdigit.
3999
4000 2000-01-17  Paul Eggert  <eggert@twinsun.com>
4001
4002         * nanosleep.c (nanosleep):
4003         Don't use SA_INTERRUPT to decide whether to call sigaction, as
4004         POSIX.1 doesn't require SA_INTERRUPT and some systems
4005         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
4006         it's been part of POSIX.1 since day 1 (in 1988).
4007
4008 2000-01-17  Jim Meyering  <meyering@lucent.com>
4009
4010         * interlock: Remove unused file.  Reported by François Pinard.
4011
4012 2000-01-16  Paul Eggert  <eggert@twinsun.com>
4013
4014         * quotearg.c (quotearg_buffer_restyled): Do not quote
4015         alert, backslash, formfeed, and vertical tab unnecessarily in
4016         shell quoting style.
4017
4018 Local Variables:
4019 version-control: never
4020 End: