1 2003-09-09 Paul Eggert <eggert@twinsun.com>
5 * acosl.c (main): Use a prototype.
6 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
9 * getloadavg.c (getloadavg, main): Define via prototypes.
11 * getopt.h (struct option.name): Assume C89, and use 'const'.
12 (getopt, etopt_long, getopt_long_only, _getopt_internal)
13 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
15 * getopt.c (const): Remove macro.
16 Include <string.h> unconditionally.
17 (my_index): Remove; all uses changed to strchr.
18 (strlen): Remove decl.
19 (exchange): Remove forward decl; no longer needed.
20 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
21 Define with prototype.
22 * getopt1.c (const): Remove macro.
23 (getopt_long, getopt_long_only, main): Define with prototype.
25 * getugroups.c: Include <string.h> unconditionally.
27 * getusershell.c: Include <stdlib.h> unconditionally.
28 (getusershell, setusershell, endusershell, readname, main):
29 Define with prototypes.
31 * group-member.c: Include group-member.h first.
32 Include <stdlib.h> unconditionally.
34 * hard-locale.c: Include hard-locale.h first.
35 Include <stdlib.h>, <string.h> unconditionally.
37 * hash.c (free, malloc): Remove decls.
38 Include <stdlib.h> unconditionally.
40 * human.c: Include <stdlib.h>, <string.h> unconditionally.
41 (getenv): Do not declare.
43 * idcache.c: Include <string.h> unconditionally.
45 * long-options.c: Include long-options.h first, to test interface.
46 Include <stdlib.h> unconditionally.
48 * makepath.c: Include makepath.h first, to test interface.
49 Include <stdlib.h> and <string.h> unconditionally.
51 * linebuffer.c: Include <stdlib.h>.
54 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
55 rpl_malloc returns void *, not char *.
56 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
58 * md5.h: Include <limits.h> unconditionally.
59 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
60 (__P): Remove; all uses removed.
61 * md5.c: Include "md5.h" first.
62 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
63 md5_buffer, md5_process_bytes, md5_process_block):
64 Define with prototypes.
65 * sha.h (__P): Remove all uses. (It wasn't defined??)
66 * sha.c: Include "sha.h" first.
67 Include <stdlib.h>, <string.h> unconditionally.
69 * memchr.c (__ptr_t): Remove; all uses changed to void *.
70 * memcmp.c (__ptr_t): Likewise.
71 * memrchr.c (__ptr_t): Likewise.
72 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
73 Include <string.h> unconditionally.
74 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
75 * memchr.c: Include <stdlib.h> unconditionally.
76 * memchr.c (LONG_MAX): Remove.
77 * memrchr.c (LONG_MAX): Likewise.
78 * memchr.c (__memchr): Define via a prototype.
79 * memrchr.c (__memrchr): Likewise.
80 * memcmp.c (__P): Remove, and remove all uses.
81 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
82 Remove forward decls; no longer needed.
83 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
84 Use types required by C89 in prototype.
86 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
87 * savedir.c: Likewise.
88 * mkdir.c (free): Remove decl.
89 * rmdir.c (rmdir): Define with a prototype.
90 * savedir.c: Include savedir.h first, to test interface.
92 * mktime.c (STDC_HEADERS): Remove.
93 Include <stdlib.h>, <string.h> unconditionally.
95 * modechange.c: Include <stdlib.h> unconditionally.
96 (malloc): Remove decl.
98 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
101 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
102 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
103 (This type really should be intptr_t, but that's a C99ism.)
104 (_obstack_memcpy): Remove: all uses changed to memcpy.
105 Include <string.h> unconditionally.
106 (struct obstack): Assume __STDC__ for types of members
107 chunkfun, freefun, extra_arg.
108 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
109 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
110 obstack_begin, obstack_specify_allocation,
111 obstack_specify_allocation_with_arg, obstack_chunkfun,
112 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
113 Remove unprototyped decls and the macros that use them.
114 * obstack.c (POINTER): Remove. All uses changed to void *.
115 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
116 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
117 (defined __STDC__ && __STDC__)]:
118 Remove nonprototyped code.
119 Include <stdlib.h> unconditionally.
120 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
121 _obstack_allocated_p, _obstack_free, obstack_free,
122 _obstack_memory_used, print_and_abort):
123 Define using prototypes.
124 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
125 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
126 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
127 obstack_next_free, obstack_object_size, obstack_room) [0]:
128 Remove unused, unprototyped code.
130 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
132 * physmem.c (physmem_total, physmem_available, main): Define
135 The following changes are not K&R related:
137 * group-member.h: Include <sys/types.h>, so that this file is
139 * makepath.h: Likewise.
141 * getusershell.c (readname, default_index, line_size, readname):
142 Use size_t, not int, for sizes.
143 (readname): If the size overflows, report an error instead of
146 2003-09-09 Derek Robert Price <derek@ximbiot.com>
148 * getndelim2.c: Assume stdlib.h per the C89 spec.
150 2003-09-08 Paul Eggert <eggert@twinsun.com>
152 Assume C89 or better; remove K&R cruft.
153 A few of these changes were first proposed by Derek Robert Price
154 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
156 * addext.c: Include <string.h> unconditionally.
157 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
158 Don't declare getenv or malloc.
160 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
161 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
163 (find_stack_direction, alloca): Use prototypes.
165 * atexit.c (atexit): Define using a prototype.
167 * basename.c, dirname.c, stripslash.c:
168 Include <string.h> unconditionally.
170 * bcopy.c: Include <stddef.h>.
171 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
173 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
175 * error.h (error, error_at_line, error_print_progname)
176 [! (defined (__STDC__) && __STDC__)]: Remove decls.
177 * error.c: Include error.h first, to check interface.
178 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
179 (VA_START): Remove; all uses changeed to va_start.
180 (exit, strerror): Remove decls.
181 (error_print_progname): Prototype uncondionally.
182 Don't include <errno.h>; no longer needed.
183 (private_strerror): Remove.
184 (error_tail): Always define.
185 (error, error_at_line): Assume C89 or better; always use prototypes.
186 * fatal.c: Include "fatal.h" first, to test interface.
187 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
188 (VA_START): Remove; all uses changed to va_start.
189 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
192 (fatal): Prototype unconditionally. Assume va_start works.
193 Abort at end, to pacify gcc.
195 * euidaccess.c (main): Define with a prototype.
197 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
199 * exitfail.c: Include <stdlib.h> unconditionally.
201 * fnmatch.h (__P): Remove. All uses changed to assume
203 * fnmatch.c: Include fnmatch.h first, to test interface.
204 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
205 (getenv): Remove decl.
206 (fnmatch): Define using a prototype.
207 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
208 (FCT): Define using a prototype.
210 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
212 * gethostname.c: Include <stddef.h>.
213 (gethostname): Define with prototype. Length is size_t, not int.
215 2003-09-08 Paul Eggert <eggert@twinsun.com>
217 * getversion.c: Remove; was migrated to backupfile.c in 1997.
218 getversion.c should have been removed then, but was accidentally
221 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
222 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
224 2003-09-07 Paul Eggert <eggert@twinsun.com>
226 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
227 copy_tm_result. Bug reported by Simon Josefsson in
228 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
230 2003-09-06 Paul Eggert <eggert@twinsun.com>
232 * time_r.c, time_r.h: New files.
234 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
236 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
237 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
239 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
241 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
242 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
245 * timegm.c: Switch to glibc implementation, with the following changes:
246 [defined HAVE_CONFIG_H]: Include <config.h>.
247 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
248 (__mktime_internal) [!defined _LIBC]: New decl.
249 (__gmtime_r) [!defined _LIBC]: New macro and function.
250 (timegm): Use a prototype, since gnulib assumes C89.
251 Do not bother declaring tmp to be const, as it's not really usefu.
252 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
253 (timegm): Declare only if HAVE_DECL_TIMEGM.
255 2003-09-03 Paul Eggert <eggert@twinsun.com>
257 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
258 Bug reported by Lute Kamstra in
259 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
261 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
262 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
263 course with correspondingly smaller numbers for tomorrow and
264 yesterday. From Tadayoshi Funaba. Originally installed into
265 sh-utils on 1999-08-07, but the patch got lost (I guess during the
268 2003-08-31 Simon Josefsson <jas@extundo.com>
270 * timegm.h: New file.
271 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
273 2003-08-31 Karl Berry <karl@gnu.org>
275 * argp.h: update from libc.
277 2003-08-28 Bruno Haible <bruno@clisp.org>
279 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
280 warning on QNX, which defines O_BINARY to 000000.
282 2003-08-24 Bruno Haible <bruno@clisp.org>
284 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
285 MSVC7 <stdio.h> is included later.
287 2003-08-20 Bruno Haible <bruno@clisp.org>
289 * progname.h: New file, from GNU gettext.
290 * progname.c: New file, from GNU gettext.
291 * progreloc.c: New file, from GNU gettext.
293 2003-08-19 Bruno Haible <bruno@clisp.org>
295 * xstrdup.c: Assume <string.h> exists.
297 2003-08-18 Jim Meyering <jim@meyering.net>
299 * setenv.h: Indent nested cpp directive.
300 * vasnprintf.c: Remove trailing blanks.
302 2003-08-17 Simon Josefsson <jas@extundo.com>
303 Bruno Haible <bruno@clisp.org>
305 * xstrndup.h: New file.
306 * xstrndup.c: New file.
308 2003-08-17 Bruno Haible <bruno@clisp.org>
310 * strndup.h: New file.
312 2003-08-16 Paul Eggert <eggert@twinsun.com>
314 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
315 space, undoing this 2003-08-12 change:
316 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
318 2003-08-16 Jim Meyering <jim@meyering.net>
320 Merge from coreutils.
321 * xstrtoimax.c: #else #if -> #elif.
322 * xstrtoumax.c: Likewise.
324 2003-08-15 Paul Eggert <eggert@twinsun.com>
326 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
327 rather than tab, after '#' in shell-script copyright notices.
328 Suggested by Bruno Haible.
330 2003-08-15 Jim Meyering <jim@meyering.net>
331 and Paul Eggert <eggert@twinsun.com>
333 Merge from coreutils.
334 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
335 member but strut utmpx does not. Needed for AIX 4.3.3.
336 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
338 2003-08-15 Jim Meyering <jim@meyering.net>
340 Merge from coreutils.
341 * xgethostname.c: Include <stdlib.h>.
342 (xghostname): Don't exit for anything other than memory-related
343 failure; just return NULL.
344 * userspec.c: Include "posixver.h".
345 (parse_user_spec): Accept `.' as a separator only
346 in pre-POSIX-200112 mode.
347 * strtoimax.c: Use #elif rather than #else #if.
348 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
349 Remove function, now that we can rely on a working tzset function.
350 [!_LIBC]: Ensure that the required autoconf test has been run.
351 [!defined _NL_CURRENT && HAVE_STRFTIME]:
352 Use underlying_strftime for %r.
353 * sha.c: Merge in some clean-up and optimization changes from glibc.
354 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
355 Ensure that it is a multiple of 64.
356 Rearrange loop exit tests so as to avoid performing an
357 additional fread after encountering an error or EOF.
358 * realloc.c: Update copyright date.
360 2003-08-14 Jim Meyering <jim@meyering.net>
362 Merge from coreutils.
363 * obstack.h: Whitespace changes.
364 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
365 and xcalloc return values.
366 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
367 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
368 hang on OSF/1 5.1 for DIR on both local and remote file systems.
369 Reported by (and fix confirmed by) Nelson H. F. Beebe.
370 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
372 Use mntctl's return value to drive the entry-processing loop, since
373 we can't rely on the value of the vmt_length member in the last
374 entry. On some systems doing so could result in exhausting
375 virtual memory. Based in part on a patch from Mike Jetzer.
377 2003-08-14 Jim Meyering <jim@meyering.net>
378 and Paul Eggert <eggert@twinsun.com>
380 Merges from coreutils, plus other fixes.
381 * physmem.c: Merge in portability changes from gcc/libiberty
382 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
383 for credits and details. Thanks to Kaveh Ghazi for helping
384 to keep these files in sync.
385 (ARRAY_SIZE): Define it.
386 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
387 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
388 (memcasecmp): Don't assume size_t fits in unsigned int.
389 Remove casts and duplicate code.
390 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
391 (memcpy): Remove definition.
392 Merge in some clean-up and optimization changes from glibc.
393 [BLOCKSIZE]: Move definition to top of file.
394 Ensure that it is a multiple of 64.
395 Rearrange loop exit tests so as to avoid performing an
396 additional fread after encountering an error or EOF.
397 * md5.h (md5_uintptr): Define.
398 * makepath.c (CLEANUP_CWD): Report an error if we failed to
399 return to the initial working directory. Preserve errno
401 * idcache.c: Include "xalloc.h".
402 (xmalloc, xrealloc): Remove decls.
403 (getuser): Remove casts no longer required in C89.
404 * human.c: Include stdio.h, for sprintf.
405 * group-member.c: Include "xalloc.h".
406 (xmalloc, xrealloc): Remove decls.
407 (get_group_info): Remove casts no longer required in C89.
408 * getusershell.c (readname): Remove casts no longer required in C89.
409 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
410 * getline.c: Whitespace fix, from coreutils.
412 2003-08-13 Paul Eggert <eggert@twinsun.com>
414 * exclude.c: Include <ctype.h>
415 (IN_CTYPE_DOMAIN): New macro.
417 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
420 * argp-help.c, argp-parse.c, config.charset, getopt.h:
421 Undo previous (whitespace-only) change.
423 2003-08-12 Paul Eggert <eggert@twinsun.com>
425 * argp-help.c, argp-parse.c, config.charset, getopt.h:
426 Normalize leading white space and remove trailing white space.
427 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
428 notice, as per ../config/srclist-update.
430 Merge from coreutils.
431 * euidaccess.h: New file.
432 * euidaccess.c: Include it.
433 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
434 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
435 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
437 2003-08-11 Bruno Haible <bruno@clisp.org>
439 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
440 (vasnprintf): Use it instead of wcslen.
442 2003-08-11 Bruno Haible <bruno@clisp.org>
444 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
445 value to ensure that _Bool promotes to int. Use #define for _Bool when
446 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
448 2003-08-10 Karl Berry <karl@gnu.org>
450 * regex.h: update from libc (whitespace fix).
452 2003-08-09 Paul Eggert <eggert@twinsun.com>
454 Merge some files from coreutils. These changes were
455 originally made by Jim Meyering.
456 * lib/acl.c: Include <sys/types.h> before <sys/stat.h>;
457 many older Unixes require this.
458 * lib/alloca.c (alloca): Remove cast to argument of free;
459 no longer needed in C89.
460 * lib/alloca_.h, lib/regex.h: Fix white space to match
461 what GNU indent does.
463 2003-08-05 Paul Eggert <eggert@twinsun.com>
465 * bumpalloc.h: Remove.
467 2003-08-04 Paul Eggert <eggert@twinsun.com>
469 * getloadavg.c: Change copyright notice and spacing to conform to
472 Merge from coreutils.
473 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
475 * getdate.y (date): Also accept dates like May-23-2003; suggestion
476 from Karl Berry, implemented by Jim Meyering.
477 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
478 from Dmitry V. Levin.
479 Remove anachronistic cast of xrealloc.
480 * fnmatch_.h (__const): Remove. Use 'const'.
481 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
482 type. Otherwise, it wouldn't compile with at least /bin/cc on
483 ymp-cray-unicos9.0.2.X.
484 Combine two mostly-identical uses of alloca into one.
485 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
487 2003-08-04 Dave Love <d.love@dl.ac.uk>
491 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
492 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
493 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
494 obsolete NLIST_NAME_UNION.
495 [__GNU__]: Undef BSD and FSCALE.
496 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
498 2003-08-03 Paul Eggert <eggert@twinsun.com>
500 * stdbool_.h (_Bool): Make it signed char, instead of
501 an enum type, so that it's guaranteed to promote to int. See:
502 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
504 2003-07-31 Paul Eggert <eggert@twinsun.com>
506 * strerror.c: Include config.h, limits.h. Declare sprintf.
507 (strerror): Don't assume that a printable int fits in 14 bytes.
509 2003-07-24 Derek Robert Price <derek@ximbiot.com>
510 Bruno Haible <bruno@clisp.org>
512 * getline.h (getline, getdelim): Change return type to ssize_t.
513 * getline.c (getline, getdelim): Likewise.
514 Remove _GNU_SOURCE define; now it's defined in config.h through
517 2003-07-22 Paul Eggert <eggert@twinsun.com>
519 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
520 over-parenthesization in macros.
524 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
527 Use `exit_failure' for xalloc and xmemcoll instead of their own
528 private exit-failure variables.
529 * xalloc.h (xalloc_exit_failure): Remove.
530 * xmalloc.c: Likewise. Include exitfail.h.
531 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
532 * xmemcoll.h (xmemcoll_exit_failure): Remove.
533 * xmemcoll.c: Likewise. Include exitfail.h.
534 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
536 2003-07-18 Paul Eggert <eggert@twinsun.com>
538 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
539 * closeout.c: Likewise. Include "closeout.h" right after config.h,
540 to test that it can stand by itself. Include "exitfail.h".
541 Clients should set exit_failure instead.
542 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
544 2003-07-18 Andreas Schwab <schwab@suse.de>
546 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
548 2003-07-18 Bruno Haible <bruno@clisp.org>
550 * getndelim2.h: New file.
551 * getndelim2.c: Make into a module of its own. Include config.h,
553 (getndelim2): Make non-static. Change return type to ssize_t.
554 * getline.h: Change argument names.
555 * getline.c: Include getndelim2.h instead of getndelim2.c.
556 * getnline.c: Include getndelim2.h.
558 2003-07-17 Bruno Haible <bruno@clisp.org>
560 * Makefile.am: Remove file.
561 * Makefile.in: Remove file.
563 2003-07-17 Bruno Haible <bruno@clisp.org>
565 * getnline.h: New file.
566 * getnline.c: New file.
567 * getndelim2.c: New file, extracted from getline.c.
568 (getndelim2): Renamed from getdelim2, with added nmax argument.
569 * getline.c: Include getndelim2.c.
570 (getdelim2): Moved out to getndelim2.c.
571 (getline, getdelim): Update.
573 2003-07-15 <karl@gnu.org>
575 * vasnprintf.c: update from gettext.
577 2003-07-15 Jim Meyering <jim@meyering.net>
579 * makepath.c (make_path): Enclose diagnostic in _(...).
581 2003-07-14 Paul Eggert <eggert@twinsun.com>
583 * asnprintf.c, asprintf.c, config.charset, gettext.h,
584 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
585 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
586 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
587 vasprintf.c, vasprintf.h: Regenerate. These files are now being
588 updated automatically by ../config/srclist-update. This changes
589 their license from LPGL to GPL.
591 2003-07-14 Jim Meyering <jim@meyering.net>
593 Don't emit diagnostics. Let callers do that.
594 * save-cwd.c: Don't include "error.h".
595 (save_cwd): Don't call error. Ensure that errno is valid
596 when returning nonzero.
598 * save-cwd.h (restore_cwd): Update prototype.
599 * save-cwd.c (restore_cwd): Remove two parameters.
600 Simplify. Don't call error upon failure. Let callers do that.
601 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
602 when auditing is enabled. But don't bother updating the #if.
604 2003-07-14 Simon Josefsson <jas@extundo.com>
606 * mempcpy.h: New file.
607 * mempcpy.c: New file.
609 2003-07-14 Paul Eggert <eggert@twinsun.com>
611 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
612 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
613 unicodeio.c, unicodeio.h, unlocked-io.h:
614 Switch from LGPL to GPL.
616 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
618 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
619 it breaks C++ compilation.
620 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
622 2003-07-10 Jim Meyering <jim@meyering.net>
624 * vasnprintf.c: Remove trailing blanks.
625 Make cpp indentation consistent.
627 2003-07-09 Paul Eggert <eggert@twinsun.com>
629 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
630 posixver.c, strftime.c, strnlen.c, strverscmp.c:
631 Switch from LGPL to GPL.
633 2003-07-07 Paul Eggert <eggert@twinsun.com>
635 * mktime.c: Fix some boundary cases and remove need for floating point.
637 Issue a compile-time diagnostic if time_t is floating point, or if
638 two's complement arithmetic is not in effect, or if arithmetic
639 right shift does not propagate the sign. These assumptions were
640 all in the original code but they weren't checked.
642 (TIME_T_MIDPOINT, verify): New macros.
643 (__isleap): Remove; it has integer overflow problems.
644 (leapyear): New function, without those problems.
645 (ydhms_tm_diff): Remove; splitting into two parts.
646 (ydhms_diff): New function, containing the arithmetic part of
647 the old ydhms_tm_diff function. Issue a compile-time
648 diagnostic if we are not using C99 integer division.
649 Avoid casts when possible.
650 (guess_time_tm): New function, containing the checking part of
651 the old ydhms_tm_diff function. Return the new value, rather than
652 the difference between it and the old. Accept a new argument T
653 so that *T specifies the old value. Check for overflow in the result.
655 (__mktime_internal): Use a time_t offset, not a long int offset.
656 This undoes the 2003-06-04 change, which is no longer needed now
657 that we have better overflow checking.
658 (localtime_offset): Likewise.
660 (__mktime_internal): Avoid harmful overflow on hosts where time_t
661 and long are 64-bit but int is only 32-bit.
662 (ydhms_diff): Use long int to store year1 and yday1.
663 Issue a compile-time diagnostic if long int is not wide enough.
665 (__mktime_internal): Use long int to store adjusted year and yday.
666 Use plain C rather than preprocessor commands, if that doesn't
668 Check for overflow (and try to repair) after each probe
669 rather than checking only at the very end. This avoids some bugs
670 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
671 does not equal GMT offset at maximum time).
672 Use integer to check for overflow rather than floating point; this
673 is more portable to non-IEEE hosts, and is a tad faster.
674 When we detect that we are oscillating between two values,
675 don't check whether tm_isdst has the requested value, since
676 we already know the answer. When tm_isdst has the wrong value,
677 use a different heuristic to find the right one, based on the
678 extreme values actually observed in practice in tz2003a,
679 rather than the (overly optimistic) "previous 3 calendar quarters".
681 (not_equal_tm, print_tm, check_result): Use "const T" rather than
682 "T const" to accommodate glibc style.
683 (check_result): Use less-confusing report format. "long" -> "long int.
685 Don't loop if the iteration overflows time_t.
686 Allow a negative step in the iteration.
688 2003-07-01 Paul Eggert <eggert@twinsun.com>
690 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
691 having it depend on HAVE_SYS_TYPES_H.
693 2003-06-25 Bruno Haible <bruno@clisp.org>
695 * readlink.c: New file.
697 2003-06-20 Bruno Haible <bruno@clisp.org>
699 Assume C89, so PARAMS isn't needed.
700 * unicodeio.h (PARAMS): Remove.
701 * unicodeio.c: Don't use PARAMS.
703 2003-06-18 Jim Meyering <jim@meyering.net>
705 Merge changes from coreutils.
706 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
707 Remove explicit declarations of xmalloc and realloc.
709 (read_utmp): Remove anachronistic cast of xmalloc.
711 2003-06-17 Paul Eggert <eggert@twinsun.com>
713 Assume C89, so PARAMS isn't needed.
714 * backupfile.h (PARAMS): Remove. All uses removed.
715 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
716 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
717 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
718 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
719 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
720 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
722 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
723 same.h, strverscmp.h: Do not include config.h; no longer needed.
724 Anyway, config.h should always be included before any other file.
726 2003-06-11 Simon Josefsson <jas@extundo.com>
728 * sysexit_.h: New file.
730 2003-05-20 Derek Price <derek@ximbiot.com>
732 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
734 2003-06-10 Simon Josefsson <jas@extundo.com>
736 * strchrnul.h: New file.
737 * strchrnul.c: New file.
739 2003-06-10 Simon Josefsson <jas@extundo.com>
741 * argp.h: New file, from glibc.
742 * argp-ba.c: New file, from glibc.
743 * argp-eexst.c: New file, from glibc.
744 * argp-fmtstream.c: New file, from glibc.
745 * argp-fmtstream.h: New file, from glibc.
746 * argp-fs-xinl.c: New file, from glibc.
747 * argp-help.c: New file, from glibc.
748 * argp-namefrob.h: New file, from glibc.
749 * argp-parse.c: New file, from glibc.
750 * argp-pv.c: New file, from glibc.
751 * argp-pvh.c: New file, from glibc.
752 * argp-xinl.c: New file, from glibc.
754 2003-06-07 Jim Meyering <jim@meyering.net>
756 * readtokens.h: Put `Free Software Foundation, Inc.'
757 in place of my name in the copyright comment.
758 Remove definition and uses of __P.
761 * stat.c: Don't declare xmalloc explicitly.
762 Instead, include "xalloc.h".
763 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
764 xrealloc, and xcalloc return values.
765 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
767 * xgetcwd.h: Remove definition/uses of PARAMS.
769 2003-06-06 Jim Meyering <jim@meyering.net>
771 * stdbool_.h: Renamed from stdbool.h.in.
773 2003-06-06 Jim Meyering <jim@meyering.net>
775 Merge from coreutils.
776 * same.c: (same_name): Declare *_basename locals to be `const'.
777 Consolidate declarations and initializations of *_base* locals.
779 Merge from coreutils.
780 This avoids a core dump on systems without GNU putenv,
781 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
782 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
783 (unsetenv): New static function, from GNU libc.
784 (rpl_putenv): Use it.
786 * modechange.c: Remove trailing blanks.
788 Merge from coreutils.
789 * fsusage.c: Remove declaration of statfs.
790 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
792 * posixtm.c: Include <stdbool.h> unconditionally.
794 2003-06-05 Paul Eggert <eggert@twinsun.com>
796 * mktime.c (__mktime_internal): When resolving a tm_isdst
797 mismatch, look in future quarters as well as past. This fixes a
798 bug when processing fall-backwards gaps immediately after a long
799 period of daylight-saving time.
801 * mktime.c: Assume freestanding C89 or better.
802 (HAVE_LIMITS_H): Remove. Assume it's 1.
803 (__P): Remove; not used.
804 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
805 (mktime, not_equal_tm, print_tm, check_result,
806 main): Use prototypes. Use const * where appropriate.
807 (main): Fix typo in testing code that uncovered by above changes.
808 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
810 2003-06-04 Paul Eggert <eggert@twinsun.com>
812 * mktime.c: Fix Debian bug 177940
813 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
814 (localtime_offset): Now long int, not time_t, because we want it
815 to be guaranteed to be signed. All uses changed.
816 (__mktime_internal): If overflow would occur when adding offset,
819 Merge 'human' changes from coreutils. Rewrite to support
820 locale-specific notations like thousands separators.
821 * human.c: Simplify authorship notice.
822 Include human.h immediately after config.h.
823 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
824 <limits.h>: Do not include, since human.h does.
825 (SIZE_MAX, UINTMAX_MAX): New macros.
826 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
827 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
828 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
829 (power_letter): Renamed from suffixes.
830 (generate_suffix_backwards): Remove.
831 (adjust_value): Now takes int style (because of human.h changes)
832 and long double value (for greater precision on some platforms).
833 (group_number): New function.
834 (human_readable): Use it. Use integer options, not enum.
835 Put the options before the sizes in the arg list.
836 Support all the new options.
837 The old human_readable function has been removed;
838 use inttostr.h instead.
839 (human_readable, default_block_size, humblock):
840 Use uintmax_t, not int, for block sizes.
841 (human_readable_inexact, block_size_types): Remove.
842 (block_size_opts): New constant.
843 (human_options): Renamed from human_block_size, with new signature
844 that allows block sizes up to UINTMAX_MAX. All callers changed.
845 * human.h: Add copyright and authorship notice.
846 Include <limits.h> and <stdbool.h> unconditionally.
847 (PARAMS): Remove. All uses removed.
848 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
849 (enum human_inexact_style): Remove tag; now a nameless enum.
850 (human_floor, human_ceiling, human_round_to_even): Now have
851 values 2, 0, 1 rather than -1, 1, 0.
852 (human_group_digits, human_suppress_point_zero, human_autoscale,
853 human_base_1024, human_SI, human_B): New constants.
854 (human_readable_inexact, human_block_size): Remove.
855 (human_readable): Size args are now uintmax_t, not int.
856 (human_options): New decl.
858 * exclude.c: (new_exclude, add_exclude): Remove casts that are
859 unnecessary now that we assume C89 or better. This change
860 imported from coreutils.
862 * mktime.c (__mktime_internal): Do not reject negative timestamps
863 arbitrarily. This is the same patch as 2003-05-28, but it got lost
864 in the 2003-05-30 sync from glibc.
866 .h files should stand alone, but we shouldn't include <sys/types.h>
867 if we can get away with just <stddef.h>.
869 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
870 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
871 rather than <sys/types.h>, as we merely need size_t.
872 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
874 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
875 Include <stdio.h>, to get FILE.
876 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
877 memcasecmp.h has included <stddef.h> and all we need is size_t.
878 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
879 our interface, instead of including <sys/types.h>
881 2003-06-02 Paul Eggert <eggert@twinsun.com>
884 Fix some minor time-related bugs with POSIX time arguments.
885 Some valid time stamps were being rejected (notably -1, and
886 time stamps before 1900 on 64-bit hosts). And some invalid
887 time stamps were being accepted, e.g. September 31.
889 * posixtm.h (posixtime): Return bool instead of time_t, so
890 that we can return (time_t) -1 successfully.
891 * posixtm.c: Likewise.
892 [HAVE_STDBOOL_H]: Include <stdbool.h>.
893 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
894 (t): Remove static var.
895 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
896 of static var. All uses changed.
897 (year): Do not reject years before 1900; they can occur with
899 (posix_time_parse): Do not check for out-of-range components;
900 that is now the caller's responsibility, since our checks were
902 (posixtime): Use mktime to check for out-of-range components,
903 since it knows them exactly.
904 If mktime returns (time_t) -1, check whether an error actually occurred
905 by invoking localtime on -1.
906 (main) [TEST_POSIXTIME]: Check for input data errors, and report
907 posixtime failures better.
908 Improve the test data (in comments only).
910 2003-05-30 <karl@gnu.org>
912 * mktime.c: update from libc.
914 2003-05-30 Bruno Haible <bruno@clisp.org>
916 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
917 * localcharset.h: Likewise.
918 * localcharset.c: Likewise.
920 2003-05-28 Paul Eggert <eggert@twinsun.com>
922 Assume the headers required for C89 freestanding compilers.
923 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
924 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
925 without checking for HAVE_LIMITS_H.
926 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
927 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
929 * fatal.c: Include <stdarg.h> without checking for __STDC__.
930 * exclude.c: Include <stdbool.h> unconditionally.
931 * tempname.c: Include <stddef.h> unconditionally.
932 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
933 * modechange.c, rpmatch.c (NULL): Don't define, since
934 <stddef.h> does that.
935 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
936 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
937 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
938 * xstrtol.c: Likewise.
939 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
940 * savedir.c: Include <stddef.h> instead of defining NULL.
942 * addext.c (addext): Use assignment rather than cast, to avoid
943 warnings on some platforms.
945 * mktime.c (__mktime_internal): Do not reject negative timestamps
948 2003-05-10 Bruno Haible <bruno@clisp.org>
950 * linebreak.c (iconv_string_length): Don't return -1 just because the
951 string is longer than 4 KB.
953 2003-05-12 Jim Meyering <jim@meyering.net>
955 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
956 the space-padded-by-default conversion specifiers, %e, %k, %l.
958 2003-05-03 Bruno Haible <bruno@clisp.org>
960 Upgrade to Unicode-4.0.
961 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
962 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
963 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
964 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
965 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
966 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
967 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
968 Change width of U+E0100..U+E01EF from 1 to 0.
970 2003-04-25 Bruno Haible <bruno@clisp.org>
972 * copy-file.c: Include <stddef.h>, for size_t.
974 2003-04-25 Jim Meyering <jim@meyering.net>
976 * copy-file.c (copy_file_preserving): Declare buf_size to be
977 of type size_t, not int.
979 2003-04-11 Jim Meyering <jim@meyering.net>
981 Merge changes from Coreutils.
983 2003-03-22 Jim Meyering <jim@meyering.net>
985 * strftime.c (widen): Cast alloca return value to proper type.
987 2003-01-19 Ulrich Drepper <drepper@redhat.com>
990 * strftime.c (my_strftime): Handle very large width
991 specifications for numeric values correctly. Improve checks for
994 2003-01-19 Jim Meyering <jim@meyering.net>
996 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
997 (nl_get_alt_digit) [! defined my_strftime]: Define.
998 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
999 _nl_get_alt_digit and _nl_get_walt_digit.
1001 * strftime.c (my_strftime): Merge in locale-related changes from libc.
1002 These changes have no effect outside of _LIBC.
1004 2003-04-10 Bruno Haible <bruno@clisp.org>
1006 * findprog.h: New file, from GNU gettext.
1007 * findprog.c: New file, from GNU gettext.
1009 2003-04-05 Jim Meyering <jim@meyering.net>
1011 Merge changes from Coreutils.
1013 * exclude.h (PARAMS): Remove definition and uses.
1014 * exclude.c: Remove uses of `PARAMS'.
1016 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
1017 Add test-cases for DOS filenames. Declare program_name.
1018 (main): Set up program_name. Patch by Rich Dawe.
1020 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
1022 Use mntctl's return value to drive the entry-processing loop, since
1023 we can't rely on the value of the vmt_length member in the last
1024 entry. On some systems doing so could result in exhausting
1025 virtual memory. Based in part on a patch from Mike Jetzer.
1027 2003-04-04 Bruno Haible <bruno@clisp.org>
1029 * linebreak.h: New file, from GNU gettext.
1030 * linebreak.c: New file, from GNU gettext with slight modifications.
1031 * lbrkprop.h: New file, from GNU gettext.
1033 2003-04-03 Bruno Haible <bruno@clisp.org>
1035 * utf8-ucs4.h: New file, from GNU gettext.
1036 * utf16-ucs4.h: New file, from GNU gettext.
1037 * ucs4-utf8.h: New file, from GNU gettext.
1038 * ucs4-utf16.h: New file, from GNU gettext.
1040 2003-04-02 Bruno Haible <bruno@clisp.org>
1042 * binary-io.h: New file, from GNU gettext.
1044 2003-04-01 Bruno Haible <bruno@clisp.org>
1046 * pathname.h: New file, from GNU gettext.
1047 * concatpath.c: New file, from GNU gettext.
1049 2003-03-30 Bruno Haible <bruno@clisp.org>
1051 * copy-file.c (copy_file_preserving): Don't set owner if the function
1052 chown() doesn't exist.
1054 2003-03-28 Bruno Haible <bruno@clisp.org>
1056 * copy-file.h: New file, from GNU gettext.
1057 * copy-file.c: New file, from GNU gettext.
1059 2003-03-18 Jim Meyering <jim@meyering.net>
1061 * quote.c (quote_n): Fix typo in comment.
1063 2003-03-14 Jim Meyering <jim@meyering.net>
1065 Merge changes from Coreutils.
1066 * obstack.h (obstack_object_size): Declare temporary, __o,
1067 to be const, in order to avoid warnings.
1068 (obstack_room): Likewise.
1069 (obstack_empty_p): Likewise.
1071 2003-03-13 Paul Eggert <eggert@twinsun.com>
1073 Merge changes from Bison.
1074 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
1075 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1076 when compiling Bison 1.875's `bitset bset = obstack_alloc
1077 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
1078 * hash.c: Include <stdbool.h> unconditionally.
1080 2003-03-09 Paul Eggert <eggert@twinsun.com>
1082 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
1083 Reported by Bruce Becker; see:
1084 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
1086 2003-03-03 Paul Eggert <eggert@twinsun.com>
1087 Bruno Haible <bruno@clisp.org>
1089 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
1090 Reported by John Hughes, see
1091 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
1093 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
1095 * poll_.h: New file.
1098 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
1100 * mathl.h: New file.
1101 * acosl.c: New file.
1102 * asinl.c: New file.
1103 * atanl.c: New file.
1104 * ceill.c: New file.
1107 * floorl.c: New file.
1108 * frexpl.c: New file.
1109 * ldexpl.c: New file.
1111 * sincosl.c: New file.
1113 * sqrtl.c: New file.
1115 * trigl.c: New file.
1116 * trigl.h: New file.
1118 2003-02-17 Bruno Haible <bruno@clisp.org>
1120 * mkdtemp.h: New file, from GNU gettext.
1121 * mkdtemp.c: New file, from GNU gettext.
1123 2003-01-31 Bruno Haible <bruno@clisp.org>
1125 * rename.c: #undef rename before defining rpl_rename.
1126 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
1128 2003-01-30 Bruno Haible <bruno@clisp.org>
1130 * printf-args.h: New file, from GNU gettext.
1131 * printf-args.c: New file, from GNU gettext.
1132 * printf-parse.h: New file, from GNU gettext.
1133 * printf-parse.c: New file, from GNU gettext.
1134 * vasnprintf.h: New file, from GNU gettext.
1135 * vasnprintf.c: New file, from GNU gettext.
1136 * asnprintf.c: New file, from GNU gettext.
1137 * vasprintf.h: New file, from GNU gettext with modifications.
1138 * vasprintf.c: New file, from GNU gettext.
1139 * asprintf.c: New file, from GNU gettext.
1141 2003-01-29 Bruno Haible <bruno@clisp.org>
1143 * stpncpy.h: New file, from GNU gettext with modifications.
1144 * stpncpy.c: New file, from GNU gettext with modifications.
1146 2003-01-28 Bruno Haible <bruno@clisp.org>
1148 * c-ctype.h: New file, from GNU gettext, with changes suggested by
1150 * c-ctype.c: New file, from GNU gettext, with changes suggested by
1153 2003-01-27 Bruno Haible <bruno@clisp.org>
1155 * xsetenv.h: New file, from GNU gettext.
1156 * xsetenv.c: New file, from GNU gettext.
1158 2003-01-23 Bruno Haible <bruno@clisp.org>
1160 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
1162 2003-01-22 Bruno Haible <bruno@clisp.org>
1164 * exit.h: New file, from GNU gettext.
1166 2003-01-11 Bruno Haible <bruno@clisp.org>
1168 * stpcpy.h (stpcpy): Use ANSI C function declarations.
1169 * strcase.h (strcasecmp, strncasecmp): Likewise.
1171 2003-01-14 Jim Meyering <jim@meyering.net>
1173 * same.c (same_name): Tweak a comment.
1175 2003-01-11 Bruno Haible <bruno@clisp.org>
1177 * same.c (same_name): Reorder tests so as to avoid calling stat()
1178 when a string comparison is sufficient.
1180 2003-01-11 Bruno Haible <bruno@clisp.org>
1182 * readtokens.c (readtoken): Cast character to 'unsigned char', not
1185 2003-01-11 Bruno Haible <bruno@clisp.org>
1187 * hash-pjw.c: Add comment about low quality of this function.
1189 2003-01-12 Paul Eggert <eggert@twinsun.com>
1191 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
1192 to avoid collisions with libcurses and libreadline.
1194 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
1195 * getstr.h, getstr.c: Remove.
1196 * getline.c: Include "getline.h", to check interface.
1197 Move body of old getstr.c here: this defines MIN_CHUNK and
1198 declares getdelim2, which is renamed from getstr.
1199 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
1201 * linebuffer.c (readlinebuffer): Renamed from readline.
1203 * linebuffer.h: Likewise.
1204 (readline): Remove backward-compatibility macro.
1206 2003-01-12 Jim Meyering <jim@meyering.net>
1208 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
1210 2003-01-10 Bruno Haible <bruno@clisp.org>
1212 * alloca_.h: New file.
1213 * getdate.y: Unconditionally include alloca.h.
1214 * makepath.c: Likewise.
1215 * setenv.c: Likewise.
1216 * userspec.c: Likewise.
1218 2003-01-09 Bruno Haible <bruno@clisp.org>
1220 * stdbool.h.in: New file.
1222 2003-01-08 Bruno Haible <bruno@clisp.org>
1224 * safe-read.c: Include specification header first, to ensure its
1226 * full-write.c: Likewise.
1228 2003-01-08 Jim Meyering <jim@meyering.net>
1230 * full-write.c: Undefine and define-away `const' after inclusion
1231 of errno.h, not before. Suggestion from Bruno Haible.
1233 2003-01-07 Jim Meyering <jim@meyering.net>
1235 * full-write.c: Rework so that it may serve to define full_read, too.
1236 * full-read.c: Simply #define FULL_READ and include full-write.c.
1238 2003-01-06 Jim Meyering <jim@meyering.net>
1240 * version-etc.c: Update year in translatable copyright string.
1242 2002-12-25 Bruno Haible <bruno@clisp.org>
1244 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
1245 * xstrtol.h: Likewise.
1246 * xstrtoimax.c: Likewise.
1247 * xstrtoumax.c: Likewise.
1248 * human.h: Likewise.
1250 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
1251 on systems that have <inttypes.h> but not <stdint.h>.
1253 2002-12-31 Paul Eggert <eggert@twinsun.com>
1255 * memcoll.c (memcoll): Fall back on a simple algorithm using
1256 memcmp if strcoll doesn't work.
1258 2002-12-23 Bruno Haible <bruno@clisp.org>
1260 * localcharset.h: New file.
1261 * localcharset.c: Include it.
1262 * unicodeio.c: Likewise.
1264 2002-12-22 Bruno Haible <bruno@clisp.org>
1266 * utime.c (utime_null): No need to call ftruncate if the file was
1269 2002-12-23 Bruno Haible <bruno@clisp.org>
1271 * memcoll.c (STRCOLL): New macro.
1274 2002-12-22 Bruno Haible <bruno@clisp.org>
1276 * getstr.h (getstr): Define, to avoid clash with libcurses.
1277 * linebuffer.h (readline): Define, to avoid clash with libreadline.
1279 2002-12-22 Bruno Haible <bruno@clisp.org>
1281 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
1283 2002-12-23 Bruno Haible <bruno@clisp.org>
1285 * getline.h: Include <stddef.h>, for size_t.
1287 * unicodeio.h: Include <stddef.h>, for size_t.
1288 * unicodeio.c: Don't include <stddef.h>.
1290 2002-12-17 Bruno Haible <bruno@clisp.org>
1292 * canon-host.c (strdup): Remove unused declaration.
1294 * fsusage.c: Include full_read.h.
1295 (get_fs_usage): Use full_read instead of safe_read.
1297 * utime.c (utime_null): Use SAFE_READ_ERROR.
1299 2002-12-11 Bruno Haible <bruno@clisp.org>
1301 * setenv.h: Rewritten to cope with systems that have setenv() but not
1303 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
1306 2002-12-11 Bruno Haible <bruno@clisp.org>
1308 * setenv.c (alloca): Fall back to malloc.
1310 (setenv): Use freea() to free memory allocated with alloca().
1312 2002-11-13 Bruno Haible <bruno@clisp.org>
1314 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
1315 function declarations.
1316 * unsetenv.c (unsetenv): Likewise.
1318 2002-03-04 Bruno Haible <bruno@clisp.org>
1320 Portability to AIX 4.3.3.
1321 * unsetenv.c: New file, extracted from setenv.c.
1322 * setenv.c: Move the unsetenv() function to unsetenv.c.
1324 2001-12-20 Bruno Haible <bruno@clisp.org>
1326 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
1327 use malloc instead. For SunOS 4.
1329 2001-12-11 Bruno Haible <bruno@clisp.org>
1331 * setenv.c: Declare alloca.
1332 (compar_fn_t): New typedef.
1333 (KNOWN_VALUE, STORE_VALUE): Use it.
1335 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
1338 2002-12-10 Paul Eggert <eggert@twinsun.com>
1340 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
1341 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
1342 Choose values that are less likely to collide with system fnmatch
1344 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
1345 defined (e.g., a pure POSIX system).
1346 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
1347 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
1349 2002-12-06 Jim Meyering <jim@meyering.net>
1351 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
1353 Merge in changes from libc's misc/error.c, in preparation
1354 for the merge of gnulib's changes back into libc.
1356 * error.c (_): Define only if not already defined.
1357 Move definition to follow all #include directives.
1358 Include unlocked-io.h only if !_LIBC.
1359 [_LIBC]: Include <libio/libioP.h>.
1360 [USE_IN_LIBIO]: Include <libio/iolibio.h>
1361 (fflush): Tweak definition to use INTUSE.
1364 2002-12-05 Paul Eggert <eggert@twinsun.com>
1366 * alloca.c [defined emacs]: Include "lisp.h".
1367 (xalloc_die) [defined emacs]: New macro.
1368 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
1369 [! defined emacs]: Include <xalloc.h>.
1370 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
1371 (pointer): Typedef to POINTER_TYPE *.
1372 (malloc): Remove decl; we now always use xmalloc.
1373 (alloca): Use old-style definition, since Emacs needs this.
1374 Check for arithmetic overflow when computing combined size.
1376 2002-12-04 Paul Eggert <eggert@twinsun.com>
1378 Do not generate unlocked-io.h automatically, since it's easier to
1379 maintain it by hand.
1381 * unlocked-io.h: New file, from GNU diffutils,
1382 but with proper copyright notice and attribution.
1384 * Makefile.am: Add copyright notice.
1385 (libfetish_a_SOURCES): Add unlocked-io.h.
1386 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
1387 (DISTCLEANFILES, io_functions): Remove macros.
1388 (EXTRA_DIST): Remove gen_uio.
1389 (unlocked-io.h): Remove rule.
1391 2002-12-04 Jim Meyering <jim@meyering.net>
1393 Reflect the fact that stat.c and lstat.c are no longer generated.
1394 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
1395 (DISTCLEANFILES): Likewise.
1396 (EXTRA_DIST): Likewise.
1397 (all_local): Don't depend on stat.c or lstat.c.
1398 (stat.c, lstat.c): Remove rules.
1399 (EXTRA_DIST): Remove xstat.in.
1401 * xstat.in: Remove file. Contents moved into stat.c.
1402 * stat.c: New file. Contents mostly from xstat.in.
1403 * stat.c: Rework so that it may serve to define rpl_lstat, too.
1404 * lstat.c: New file. Simply #define LSTAT and include stat.c.
1406 * safe-read.c: Rework so that it may serve to define safe_write, too.
1407 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
1409 2002-12-03 Jim Meyering <jim@meyering.net>
1411 * safe-read.c, safe-write.c: Change variable names and comments, but
1412 not semantics, to minimize the differences between these two files.
1413 (safe_read): Change comment to mention SAFE_READ_ERROR.
1415 * safe-read.c (IS_EINTR): Define.
1416 (safe_read): Use IS_EINTR in place of in-function cpp directives.
1418 2002-12-02 Bruno Haible <bruno@clisp.org>
1420 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
1421 Define, taken from safe-read.c.
1422 (INT_MAX): Provide fallback.
1423 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
1424 * safe-write.h (SAFE_WRITE_ERROR): Define.
1426 * safe-read.c (EINTR): Remove definition.
1427 (safe_read): Don't use EINTR if it is absent.
1429 2002-12-02 Jim Meyering <jim@meyering.net>
1431 * safe-read.c (EINTR): Define.
1432 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
1433 (INT_MAX): Provide fallback.
1434 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
1436 * safe-read.h (SAFE_READ_ERROR): Define.
1438 2002-12-01 Jim Meyering <jim@meyering.net>
1440 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
1441 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
1443 2002-11-27 Paul Eggert <eggert@twinsun.com>
1445 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
1446 hash_rehash): Replace `if (limit <= value) abort ();' with
1447 `if (! (value < limit)) abort ();', for readability.
1449 2002-11-26 <karl@gnu.org>
1451 * strdup.c: copy from libc again, with jim's ok.
1452 * .cppi-disable: re-add strdup.c
1454 2002-11-25 <karl@gnu.org>
1456 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
1457 instead of "strtol.c".
1459 2002-11-25 Jim Meyering <jim@meyering.net>
1461 * mktime.c: Sync from libc, now that it has the latest fix.
1463 2002-11-24 <karl@gnu.org>
1465 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
1466 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
1468 2002-11-24 Jim Meyering <jim@meyering.net>
1470 Update from coreutils:
1472 * mktime.c: Merge in changes from libc.
1474 Avoid a link-time failure on some Linux systems.
1475 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
1476 (__mon_yday): Declare with the STATIC attribute.
1477 (__mktime_internal): Likewise.
1478 Based on a report from Greg Schafer.
1480 2002-11-23 Jim Meyering <jim@meyering.net>
1482 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
1483 Use `unsigned', not `int', as type of index.
1485 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
1487 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
1489 2002-11-22 Paul Eggert <eggert@twinsun.com>
1491 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
1492 hint that one should use `if (! x) abort ();' rather than `assert
1493 (x);', and anyway it's one less thing to worry about configuring.
1494 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
1495 hash_rehash, hash_insert): Use abort rather than assert.
1497 2002-11-22 Paul Eggert <eggert@twinsun.com>
1499 * quotearg.h: Allow multiple inclusion by surrounding with
1500 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
1501 so that we can be included first.
1502 (PARAMS): Remove; we now assume C89 or later. All uses removed.
1503 * quotearg.c: Include quotearg.h immediately after config.h.
1504 No need to include stddef.h or sys/types.h any more.
1505 Surround local include files with "", not "<>".
1506 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
1507 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
1508 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
1509 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
1510 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
1511 (ISPRINT): Remove; no longer needed now that we assume C89.
1513 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
1516 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
1517 quotearg_char): Use SIZE_MAX rather than
1518 (size_t) -1 when we are talking about "infinity".
1520 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
1522 2002-11-22 Bruno Haible <bruno@clisp.org>
1524 * safe-read.h: Assume C89. Add comments.
1525 (safe_read): Change return type to size_t.
1526 * safe-read.c (safe_read): Change return type to size_t. Handle byte
1527 counts > SSIZE_MAX correctly.
1528 * safe-write.h: New file.
1529 * safe-write.c: New file.
1530 * full-read.h: New file.
1531 * full-read.c: New file.
1532 * full-write.h: Assume C89. Add comments.
1533 * full-write.c: Include safe-write.h.
1534 (full_write): Rewritten to use safe_write.
1535 Suggested by Jim Meyering and Paul Eggert.
1537 2002-11-21 Bruno Haible <bruno@clisp.org>
1539 Remove case insensitive option matching.
1540 * argmatch.h (argcasematch): Remove declaration.
1541 (ARGCASEMATCH): Remove macro.
1542 (__xargmatch_internal): Remove case_sensitive argument.
1543 (XARGMATCH): Update.
1544 (XARGCASEMATCH): Remove macro.
1545 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
1546 case_sensitive argument.
1547 (argcasematch): Remove function.
1548 (__xargmatch_internal): Remove case_sensitive argument.
1549 (main): Use XARGMATCH instead of XARGCASEMATCH.
1551 * xmalloc.c: Change compile-time error message. Add comment about
1552 required autoconf version.
1554 2002-11-21 Jim Meyering <jim@meyering.net>
1556 * strdup.c (strdup): Tweak comment and initial #if/#include.
1558 Merge in changes from the coreutils.
1560 2002-09-25 Paul Eggert <eggert@twinsun.com>
1561 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
1562 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
1563 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
1564 int. Work more efficiently if X is the same width as uintmax_t.
1565 Do not compare X to -1, to avoid bogus compiler warning.
1566 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
1567 Don't assume that f_frsize and f_bsize are the same type.
1569 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
1572 * makepath.c (make_path): Restore umask *before* creating the final
1574 (make_path): Minor reformatting.
1576 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
1577 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
1579 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
1580 ones. At least on GNU/Linux systems, `auto' means something else.
1583 2002-11-20 Paul Eggert <eggert@twinsun.com>
1585 Merge argmatch cleanups from Bison. Assume C89.
1587 * argmatch.c: Include config.h here, not in argmatch.h.
1588 Include stdlib.h, for EXIT_FAILURE.
1589 Always include <string.h>, since we assume C89.
1590 (EXIT_FAILURE): Remove pre-C89 bug workaround.
1591 * argmatch.h: Do not include <config.h> or <sys/types.h>.
1592 Include <stddef.h> instead, since it's all we need for size_t.
1593 (PARAMS): Remove. All uses removed.
1594 (ARRAY_CARDINALITY): Do not bother to #undef.
1595 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
1596 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
1597 Remove unnecessary parentheses.
1598 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
1599 Insert necessary parentheses.
1600 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
1601 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
1603 2002-11-19 Bruno Haible <bruno@clisp.org>
1605 * mbswidth.c: Include mbswidth.h right at the beginning.
1606 * mbswidth.h: Include <stddef.h>, for size_t.
1608 * mbswidth.h (PARAMS): Remove macro.
1609 (mbswidth, mbsnwidth): Use ANSI C function declarations.
1610 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
1612 * gcd.h (PARAMS): Remove macro.
1613 (gcd): Use ANSI C function declarations.
1614 * gcd.c (gcd): Likewise.
1616 2002-11-15 Bruno Haible <bruno@clisp.org>
1618 * strcspn.c: Include <stddef.h>.
1619 (strcspn): Use ANSI C function declaration. Change return type to
1621 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
1622 (strpbrk): Use NULL.
1623 * strpbrk.h (PARAMS): Remove macro.
1624 (strpbrk): Use ANSI C function declaration.
1625 * strstr.c: Don't include <sys/types.h>.
1626 * strstr.h (PARAMS): Remove macro.
1627 (strstr): Use ANSI C function declarations.
1629 2002-11-06 Bruno Haible <bruno@clisp.org>
1631 * gcd.h (gcd): Change argument type to 'unsigned long'.
1632 * gcd.c (gcd): Likewise.
1634 2002-11-05 Bruno Haible <bruno@clisp.org>
1636 * gcd.h: New file, from gettext-0.11.5.
1637 * gcd.c: New file, from gettext-0.11.5.
1639 2002-11-05 Bruno Haible <bruno@clisp.org>
1641 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1642 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1643 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1644 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1646 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
1647 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
1649 * closeout.c: Include gettext.h instead of <libintl.h>.
1650 * human.c: Include gettext.h instead of <libintl.h>.
1651 * quotearg.c: Include gettext.h instead of <libintl.h>.
1652 * rpmatch.c: Include gettext.h instead of <libintl.h>.
1653 * unicodeio.c: Include gettext.h instead of <libintl.h>.
1654 * userspec.c: Include gettext.h instead of <libintl.h>.
1655 * version-etc.c: Include gettext.h instead of <libintl.h>.
1656 * xmalloc.c: Include gettext.h instead of <libintl.h>.
1657 (textdomain): Remove definition.
1658 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
1660 * long-options.c: Remove include of <libintl.h> and definition of _.
1661 * same.c: Remove include of <libintl.h> and definition of _.
1663 2002-11-04 Bruno Haible <bruno@clisp.org>
1665 * stpcpy.h: New file, from GNU gettext-0.11.5.
1666 * strcase.h: New file, from GNU gettext-0.11.5.
1667 * strpbrk.h: New file, from GNU gettext-0.11.5.
1668 * strstr.h: New file, from GNU gettext-0.11.5.
1669 * xgetcwd.h: New file, from GNU gettext-0.11.5.
1671 2002-05-09 Bruno Haible <bruno@clisp.org>
1673 * config.charset: Update for newest glibc. Add canonical names
1674 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
1676 2002-05-09 Bruno Haible <bruno@clisp.org>
1678 * localcharset.c (get_charset_aliases): Add more Windows specific
1681 2002-05-08 Owen Taylor <otaylor@redhat.com>
1683 * config.charset: A few additions for Solaris.
1685 2001-12-05 Bruno Haible <bruno@clisp.org>
1687 * localcharset.c (locale_charset): Don't return an empty string.
1689 2001-10-23 Bruno Haible <haible@clisp.cons.org>
1691 * config.charset: msdos in uk_UA uses CP1125.
1693 2001-08-05 Bruno Haible <haible@clisp.cons.org>
1695 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
1696 * localcharset.c (locale_charset): Declare as extern "C".
1698 2002-02-15 Bruno Haible <bruno@clisp.org>
1700 * config.charset [msdosdjgpp]: For Russian, use CP866.
1702 2002-02-11 Bruno Haible <bruno@clisp.org>
1704 * config.charset: Add support for NetBSD.
1706 2002-09-25 <karl@gnu.org>
1708 * strdup.c: copy from libc/string (via ../config/srclist*).
1709 * getopt*: copy from libc/posix.
1710 * gettext.h: copy from gettext.
1711 * .cppi-disable: add strdup.c, gettext.h.
1713 2002-07-01 Jim Meyering <meyering@lucent.com>
1715 * c-stack.c: Include sys/time.h.
1716 From Volker Borchert.
1718 2002-06-11 Paul Eggert <eggert@twinsun.com>
1720 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
1721 New macro. Use it uniformly instead of
1722 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
1723 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
1724 reported by Vin Shelton.
1726 2002-06-22 Jim Meyering <meyering@lucent.com>
1728 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
1729 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
1731 2002-06-22 Paul Eggert <eggert@twinsun.com>
1733 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
1734 Do not assume SA_SIGINFO behavior.
1735 Bug reported by Jim Meyering on NetBSD 1.5.2.
1737 2002-06-22 Jim Meyering <meyering@lucent.com>
1739 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
1741 * exitfail.c, exitfail.h: Likewise.
1742 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
1744 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
1746 (EXTRA_DIST): Add fnmatch_loop.c.
1747 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
1749 * fnmatch_loop.c: New file, from diffutils-2.8.2.
1750 * fnmatch.c: Update from diffutils-2.8.2.
1751 * fnmatch_.h: New file. From diffutils-2.8.2.
1752 * fnmatch.h: Remove file.
1754 2002-06-18 Paul Eggert <eggert@twinsun.com>
1756 * file-type.h: Report an error if neither S_ISREG nor
1757 S_IFREG is defined, instead of using a test specific to glibc
1758 2.2. This should be safe, since POSIX requires S_ISREG and
1759 Unix Version 7 had S_IFREG. We don't need to check for
1760 <sys/types.h> since we don't use any symbols that it defines.
1762 2002-06-15 Jim Meyering <meyering@lucent.com>
1764 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
1765 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
1766 have been included before this file.
1768 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
1770 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
1771 so that each temporary file name is unique and valid in the first
1772 8 characters, for operation under DOS.
1774 2002-06-15 Jim Meyering <meyering@lucent.com>
1776 Work even with DJGPP 2.03, which lacks support for symlinks.
1778 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
1780 * lchown.c (S_ISLNK): Likewise.
1782 2002-06-14 Jim Meyering <meyering@lucent.com>
1784 * file-type.h: Use the version from diffutils-2.8.2.
1785 * file-type.c: Likewise.
1787 2002-05-27 Jim Meyering <meyering@lucent.com>
1789 Fix a problem seen only on nonconforming systems whereby ls.c's
1790 use of localtime, and then of gettimeofday would cause trouble:
1791 the localtime call used to initialize rpl_gettimeofday's save
1792 mechanism would clobber ls's current local time information so
1793 that in any long listing the first file would always be listed
1794 with date 1970-01-01. Analysis by Volker Borchert.
1796 * gettimeofday.c (localtime): Undefine.
1797 (rpl_localtime): New function.
1799 2002-05-22 Jim Meyering <meyering@lucent.com>
1801 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
1802 * file-type.h: New file.
1803 * file-type.c (file_type): New file/function. Extracted from diffutils.
1805 2002-04-29 Paul Eggert <eggert@twinsun.com>
1807 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
1809 2002-04-28 Paul Eggert <eggert@twinsun.com>
1811 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
1812 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
1813 of 127, since 64 is the largest conceivable number for ancient
1815 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
1817 2002-04-28 Jim Meyering <meyering@lucent.com>
1819 * sig2str.c (WTERMSIG): Remove definition (unused).
1821 2002-04-28 Paul Eggert <eggert@twinsun.com>
1823 * sig2str.h, sig2str.c: New files.
1824 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
1826 2002-04-24 Jim Meyering <meyering@lucent.com>
1828 * gettext.h: New file, from Gettext.
1829 * Makefile.am (INCLUDES): Remove -I../intl.
1830 (libfetish_a_SOURCES): Add gettext.h.
1832 2002-04-16 Jim Meyering <meyering@lucent.com>
1834 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
1835 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
1836 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
1838 2002-04-12 Jim Meyering <meyering@lucent.com>
1840 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
1842 2002-03-10 Jim Meyering <meyering@lucent.com>
1844 * makepath.c (make_path): Remove a comma from a diagnostic.
1845 Suggestion from Santiago Vila.
1847 2002-03-08 Jim Meyering <meyering@lucent.com>
1849 * rename.c: Mention that this wrapper is needed also on
1850 mips-dec-ultrix4.4 systems.
1852 2002-03-02 Jim Meyering <meyering@lucent.com>
1854 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
1855 not HAVE_CLOCK_SETTIME.
1857 2002-02-27 Paul Eggert <eggert@twinsun.com>
1859 * nanosleep.h: Rename to....
1860 * timespec.h: New name for nanosleep.h. All uses changed.
1862 * gettime.c: New file.
1863 * settime.c: New file.
1866 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
1867 timespec.h. Remove nanosleep.h.
1869 2002-02-25 Paul Eggert <eggert@twinsun.com>
1871 * acl.c, acl.h: New files.
1872 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
1874 2002-02-24 Jim Meyering <meyering@lucent.com>
1876 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
1877 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
1878 cause trouble. Reported by Nelson Beebe.
1880 2002-02-23 Paul Eggert <eggert@twinsun.com>
1882 * path-concat.c (xpath_concat): Reorder code to pacify
1883 compilers that don't know that xalloc_die never returns.
1885 2002-02-20 Jim Meyering <meyering@lucent.com>
1887 * getdate.c: Regenerate using bison-1.33.
1889 2002-02-15 Paul Eggert <eggert@twinsun.com>
1891 * posixver.c, posixver.h: New files.
1892 * Makefile.am (libfetish_a_SOURCES): Add them.
1894 2002-02-02 Paul Eggert <eggert@twinsun.com>
1895 Bruno Haible <bruno@clisp.org>
1897 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
1898 (fwrite_success_callback): New declaration.
1899 * unicodeio.c (unicode_to_mb): New function, extracted from
1900 print_unicode_char. Call failure callback instead of error.
1901 (fwrite_success_callback): New function.
1902 (exit_failure_callback): New function.
1903 (fallback_failure_callback): New function.
1904 (print_unicode_char): Call unicode_to_mb.
1906 2002-01-26 Jim Meyering <meyering@lucent.com>
1908 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
1910 2002-01-22 Jim Meyering <meyering@lucent.com>
1912 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
1913 Otherwise, some versions of automake would omit the rule that makes
1914 Makefile from Makefile.in.
1916 2001-01-21 Paul Eggert <eggert@twinsun.com>
1918 * xmemcoll.h, xmemcoll.c: New files.
1919 * Makefile.am (libfetish_a_SOURCES): Add them.
1920 * memcoll.c: Include errno.h, and declare errno if not defined.
1921 (memcoll): Set errno to zero if there is no error.
1923 * quotearg.c (quotearg_buffer_restyled):
1924 Fix bug with quoting buffers containing NUL when backslashing escapes.
1925 This bug was exposed by the other changes in this patch.
1926 (quotearg_n_options): New arg ARGSIZE.
1927 All callers changed.
1928 (quoting_options_from_style): New function.
1929 (quotearg_n_style): Use it.
1930 (quotearg_n_style_mem): New function.
1932 * quotearg.h (quotearg_n_style_mem): New function.
1934 2002-01-16 Jim Meyering <meyering@lucent.com>
1936 * getdate.y: Add three semicolons, each just before a closing brace.
1937 Bison (as of version 1.31) no longer papers over that mistake.
1939 2002-02-14 Paul Eggert <eggert@twinsun.com>
1941 * backupfile.c (ISDIGIT): Comment fix.
1942 * getdate.y (ISDIGIT): Likewise.
1943 * posixtm.c (ISDIGIT, year): Likewise.
1944 * strverscmp.c (ISDIGIT): Likewise.
1945 * userspec.c (ISDIGIT): Likewise.
1947 2002-01-05 Jim Meyering <meyering@lucent.com>
1949 * version-etc.c (version_etc_copyright): Update copyright year.
1951 2001-01-19 Paul Eggert <eggert@twinsun.com>
1953 * closeout.c (close_stdout_status): If ferror (stdout), do
1954 not silently exit merely because the output buffer happens to
1955 have nothing pending.
1957 2001-12-18 Paul Eggert <eggert@twinsun.com>
1959 See the big note in ../ChangeLog.
1960 * human.c (suffixes): Prefer K to k for 1024.
1961 (generate_suffix_backwards): New function.
1962 (human_readable_inexact): Use it.
1963 * xstrtol.c (__xstrtol): If there is no number but there
1964 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
1965 Accept 'K' as well as 'k'.
1967 2001-12-15 Jim Meyering <meyering@lucent.com>
1969 * regex.h (__restrict_arr): Update from libc.
1971 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
1972 as `remote' if the name starts with `//'. Suggested by Michael Stone.
1975 2001-12-10 Jim Meyering <meyering@lucent.com>
1977 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
1978 Instead, include "xalloc.h".
1979 (initbuffer): Don't cast xmalloc return value to char*.
1980 (readline): Reword comment.
1981 Don't cast xrealloc return value to char*
1984 2001-12-09 Jim Meyering <meyering@lucent.com>
1986 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
1987 `signed and unsigned type in conditional expression'.
1988 * posixtm.c (posix_time_parse): Likewise.
1990 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
1992 * readtokens.c (readtoken): Declare an index to be of type unsigned
1993 to avoid a pedantic warning.
1995 * getstr.c: Don't include assert.h.
1996 (getstr): Remove warning-evoking assertions.
1997 Return -1 if offset parameter is out of bounds.
1998 Change the type of a local from int to size_t.
2000 * strftime.c (my_strftime_localtime_r): Include this function
2001 definition in the `#if ! HAVE_TM_GMTOFF' block.
2003 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
2004 Include xalloc.h instead.
2006 2001-12-02 Jim Meyering <meyering@lucent.com>
2008 * tempname.c: Don't declare getenv, thus reverting the change of
2009 2001-11-18. It's no longer necessary, now that stdlib.h is always
2012 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
2013 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
2015 2001-11-30 Akim Demaille <akim@epita.fr>
2017 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
2018 before being defined.
2020 2001-11-27 Paul Eggert <eggert@twinsun.com>
2022 * quotearg.h (quotearg_n, quotearg_n_style):
2023 First arg is int, not unsigned.
2024 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
2025 (SIZE_MAX, UINT_MAX): New macros.
2026 (quotearg_n_options): Abort if N is negative.
2027 Avoid overflow check on hosts where size_t is 64 bits and int
2028 is 32 bits, as overflow is impossible there.
2029 Fix off-by-one typo that caused unnecessary reallocation.
2031 2001-11-27 Jim Meyering <meyering@lucent.com>
2033 * tempname.c: Merge with version from libc.
2034 * regex.c: Likewise.
2036 * tempname.c: Include stdlib.h unconditionally. On some old systems
2037 for which STDC_HEADERS is 0, it was not included, resulting in a
2038 warning about an integer-to-pointer conversion problem with getenv.
2039 Reported by Volker Borchert.
2041 2001-11-26 Jim Meyering <meyering@lucent.com>
2043 * gtod.h: Remove file.
2044 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
2045 * gettimeofday.c: Don't include gtod.h.
2046 (GTOD_init): Remove function.
2047 (rpl_gettimeofday): Do its job here instead, rather than aborting.
2048 Suggestion from Volker Borchert.
2050 2001-11-23 Jim Meyering <meyering@lucent.com>
2052 * hash.h (struct hash_table): Don't define here. Merely declare it.
2053 * hash.c (struct hash_table): Define it here instead.
2055 2001-11-22 Jim Meyering <meyering@lucent.com>
2057 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
2059 2001-11-18 Paul Eggert <eggert@twinsun.com>
2061 * tempname.c (TMP_MAX): Remove; no longer needed.
2062 (TEMPORARIES): New macro.
2063 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
2064 removes an artificial limitation (e.g. HP-UX 10.20, where
2067 2001-11-18 Jim Meyering <meyering@lucent.com>
2069 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
2072 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
2073 files will be created before anything else.
2075 2001-11-17 Jim Meyering <meyering@lucent.com>
2077 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
2078 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
2079 rather than group writable. Patch by Juan F. Codagnone.
2081 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
2082 Instead, include "xalloc.h".
2084 * mountlist.c: Include unlocked-io.h after all system headers.
2085 Remove explicit declarations of xmalloc, xrealloc,
2086 and xstrdup. Instead, include "xalloc.h".
2088 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
2089 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
2090 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
2092 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
2093 Reported by Padraig Brady.
2095 * mkstemp.c: #undef mkstemp.
2097 (rpl_mkstemp): Rename from mkstemp.
2100 2001-11-16 Jim Meyering <meyering@lucent.com>
2102 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
2103 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
2104 determine the amount of total physical memory, use pstat_getstatic.
2105 HPUX-11 doesn't define _SC_PHYS_PAGES.
2106 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
2107 If sysconf couldn't be used to determine the amount of available
2108 physical memory, use both pstat_getstatic and pstat_getdynamic.
2109 Based on a patch from Bob Proulx.
2111 2001-11-05 Jim Meyering <meyering@lucent.com>
2113 * xstat.in (slash_aware_lstat): Correct a misleading comment.
2115 2001-11-03 Jim Meyering <meyering@lucent.com>
2117 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
2118 in argmatch_to_argument call.
2120 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
2123 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
2124 e.g., a fault due to an attempt to free a NULL pointer.
2126 2001-11-01 Jim Meyering <meyering@lucent.com>
2128 * dirfd.c, dirfd.h: New files.
2129 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
2131 * hash.c (hash_print) [TESTING]: Clean up.
2133 2001-10-22 Paul Eggert <eggert@twinsun.com>
2135 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
2136 to avoid a warning if -Wall.
2138 2001-10-21 Paul Eggert <eggert@twinsun.com>
2140 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
2142 2001-10-21 Jim Meyering <meyering@lucent.com>
2144 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
2145 this code would end up calling gettext even in packages built
2147 * getopt.c (_): Likewise.
2148 * regex.c (_): Likewise.
2150 2001-10-20 Paul Eggert <eggert@twinsun.com>
2152 * error.c (strerror_r): Do not declare unless !_LIBC.
2153 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
2154 Use strerror_r that is only a macro, even if it is not a function.
2155 (strerror): Check for HAVE_DECL_STRERROR before declaring.
2156 (private_strerror): Use prototypes, not old-style function definition.
2157 (print_errno_message): New function.
2158 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
2160 (error_tail, error, error_at_line): Use it.
2162 2001-10-11 Jim Meyering <meyering@lucent.com>
2164 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
2165 and quote_n (1, ... to avoid clobbering a buffer.
2167 2001-10-05 Jim Meyering <meyering@lucent.com>
2169 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
2170 * hash-pjw.c: New file (factored out of fileutils' remove.c).
2171 * hash-pjw.h: New file.
2173 2001-09-30 Jim Meyering <meyering@lucent.com>
2175 * mountlist.c [MOUNTED_GETFSSTAT]:
2176 Include <sys/ucred.h>, for Apple Darwin.
2177 Include sys/mount.h and sys/fs_types.h only if available.
2179 (read_filesystem_list): Use FS_TYPE.
2181 2001-09-29 Paul Eggert <eggert@twinsun.com>
2183 * exclude.c (excluded_filename): 0 -> false, since it's
2186 2001-09-28 Paul Eggert <eggert@twinsun.com>
2188 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
2189 #defines strtoimax. Also treat the other strto* functions
2192 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
2193 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
2194 (strtoimax, strtoumax): Do not declare if already defined as a macro.
2196 2001-09-26 Jim Meyering <meyering@lucent.com>
2198 Most macros in unlocked-io.h had the wrong number of arguments.
2199 * gen-uio: New script.
2200 (USE_UNLOCKED_IO): Define to 1 if not already defined.
2201 * unlocked-io.hin: Remove file.
2202 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
2203 rather than trying to embed it here.
2204 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
2205 Reported by Padraig Brady.
2207 2001-09-25 Volker Borchert <bt@teknon.de>
2209 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
2211 2001-09-23 Jim Meyering <meyering@lucent.com>
2213 * mountlist.c: Remove useless parentheses in #if directives.
2214 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
2215 the deprecated MOUNTED symbol is no longer defined in mntent.h.
2217 2001-09-22 Jim Meyering <meyering@lucent.com>
2219 * localcharset.c: Update from latest gettext.
2220 * config.charset: Likewise.
2222 2001-09-20 Jim Meyering <meyering@lucent.com>
2224 * xstrtol.c (strtoimax): Guard declaration with
2225 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
2226 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
2227 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
2228 (strtoumax): Likewise, for completeness (it wasn't necessary).
2230 2001-09-06 Paul Eggert <eggert@twinsun.com>
2232 * strtoimax.c (HAVE_LONG_LONG):
2233 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
2234 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
2235 to work around bug in IBM C compiler.
2237 2001-09-16 Jim Meyering <meyering@lucent.com>
2239 * mkdir.c: New file.
2241 2001-09-04 Paul Eggert <eggert@twinsun.com>
2243 * xgetcwd.c: Revert some of the previous change; intead,
2244 fix the HAVE_GETCWD_NULL code to behave more like the
2245 !HAVE_GETCWD_NULL code used to.
2248 (xgetcwd): Do not return NULL when memory is exhausted; instead,
2251 2001-09-04 Paul Eggert <eggert@twinsun.com>
2253 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
2254 Use ssize_t, not int, to store result of readlink.
2255 Check for ssize_t overflow as well as size_t overflow,
2256 as POSIX says the result of readlink is implementation-defined
2257 when ssize_t overflows.
2258 Remove unnecessary cast to char*.
2259 Use free+malloc instead of realloc, as the storage doesn't need
2260 to be preserved and it's clearer and can be more efficient that way.
2261 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
2262 * xreadlink.h (xreadlink): Update prototype.
2264 2001-09-03 Paul Eggert <eggert@twinsun.com>
2266 * exclude.c (fnmatch_no_wildcards): Fix confusion between
2267 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
2268 spotted by Jim Meyering.
2270 2001-09-03 Jim Meyering <meyering@lucent.com>
2272 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
2274 2001-09-03 Paul Eggert <eggert@twinsun.com>
2276 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
2277 like the HAVE_GETCWD_NULL code.
2278 Include pathmax.h if not HAVE_GETCWD.
2279 Do not include xalloc.h.
2280 (INITIAL_BUFFER_SIZE): New symbol.
2281 Do not use xmalloc / xrealloc, since the caller is responsible for
2282 handling errors. Preserve errno around `free' during failure.
2283 Do not overrun buffer when using getwd.
2285 2001-09-03 Paul Eggert <eggert@twinsun.com>
2287 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
2288 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
2290 2001-09-02 Jim Meyering <meyering@lucent.com>
2292 * error.c: Update from GNU libc.
2294 2001-09-01 Jim Meyering <meyering@lucent.com>
2296 * xreadlink.c: New file.
2297 * xreadlink.h: New file.
2298 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
2300 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
2301 doesn't conflict with sparc Solaris 7's definition in
2302 /usr/include/sys/int_types.h.
2304 * exclude.c: Use `""', not `<>' to #include non-system header files.
2305 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
2306 and strncasecmp as r-values. Unixware didn't have declarations.
2308 2001-08-31 Jim Meyering <meyering@lucent.com>
2310 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
2311 Use an initial, malloc'd, buffer of length 128 rather than
2312 a statically allocated one of length 1024.
2314 2001-08-30 Paul Eggert <eggert@twinsun.com>
2316 * xgetcwd.c: Don't include pathmax.h.
2317 Include stdlib.h and unistd.h if available.
2319 (xmalloc, xstrdup, free): Remove decls.
2320 (xgetcwd): Don't assume sizes fit in unsigned.
2321 Check for overflow when computing sizes.
2322 Simplify reallocation code.
2324 2001-08-28 Paul Eggert <eggert@twinsun.com>
2326 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
2328 * strtoimax.c: Renamed from strtoxmax.c, removing the
2331 Also, make the following further changes to make this file's
2332 configuration more similar to that of strtol.c:
2333 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
2334 (strtoumax, uintmax_t, strtoull, strtol): Remove.
2335 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
2336 (strtoimax): Renamed from strtoumax. All uses of unsigned values
2337 changed to signed values.
2339 And make the following changes as well:
2340 Fix copyright notice, as 1999 was missing.
2341 (verify): New macro.
2342 (strtoimax): Check sizes at compile-time, not run-time.
2343 Prefer strtol to strtoll if both work.
2344 (main): Remove; it was not that useful and was a pain to maintain.
2346 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
2348 2001-08-30 Paul Eggert <eggert@twinsun.com>
2350 * savedir.c (savedir): Remove size parameter, as POSIX says that
2351 a directory's st_size can have an arbitrary value, so the old
2352 usage could waste an arbitrary amount of memory. All uses
2354 * savedir.h: Update prototype.
2356 2001-08-30 Paul Eggert <eggert@twinsun.com>
2358 * xstrtol.c (strtoimax): New decl.
2360 2001-08-28 Paul Eggert <eggert@twinsun.com>
2362 * xstrtol.h: Add copyright notice.
2363 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
2364 LONGINT_INVALID_SUFFIX_CHAR.
2366 2001-08-30 Paul Eggert <eggert@twinsun.com>
2368 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
2371 2001-08-30 Paul Eggert <eggert@twinsun.com>
2373 * hash.c: Remove '2001' from copyright notice.
2375 2001-08-30 Paul Eggert <eggert@twinsun.com>
2377 * full-write.h: New file.
2378 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
2379 * full-write.c: Correct credits, as cccp.c no longer
2380 exists and anyway it was so heavily changed from the old cccp
2381 code as to be unrecognizable. Include full-write.h.
2382 (full_write) Return size_t, with short writes meaning failure.
2383 All callers changed. This fixes a bug with large buffers
2385 * utime.c: Include full-write.h.
2387 2001-08-30 Paul Eggert <eggert@twinsun.com>
2389 Merge 'exclude' changes from tar 1.13.22.
2390 This fixes one or two unlikely storage allocation overflow bugs,
2391 but doesn't change user-visible behavior otherwise.
2393 2001-08-30 Paul Eggert <eggert@twinsun.com>
2395 * exclude.c (bool): Declare, perhaps by including stdbool.h.
2396 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
2397 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
2398 Include if available.
2399 (<xalloc.h>): Include
2400 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
2401 (verify): New macro. Use it to verify that EXCLUDE macros do not
2402 collide with FNM macros.
2403 (struct patopts): New struct.
2404 (struct exclude): Use it, as exclude patterns now come with options.
2405 (new_exclude): Support above changes.
2406 (new_exclude, add_exclude_file):
2407 Initial size must now be a power of two to simplify overflow checking.
2408 (free_exclude, fnmatch_no_wildcards): New function.
2409 (excluded_filename): No longer requires options arg, as the options
2410 are determined by add_exclude. Now returns bool, not int.
2411 (excluded_filename, add_exclude):
2412 Add support for the fancy new exclusion options.
2413 (add_exclude, add_exclude_file): Now takes int options arg.
2414 Check for arithmetic overflow when computing sizes.
2415 (add_exclude_file): xrealloc might modify errno, so don't
2416 realloc until after errno might be used.
2418 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
2420 (free_exclude): New decl.
2421 (add_exclude, add_exclude_file): Now takes int options arg.
2422 (excluded_filename): No longer requires options arg, as the options
2423 are determined by add_exclude. Now returns bool, not int.
2425 2001-08-30 Paul Eggert <eggert@twinsun.com>
2427 * alloca.c (alloca): Arg is of type size_t, not unsigned.
2429 2001-08-27 Jim Meyering <meyering@lucent.com>
2431 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
2433 * version-etc.c (N_): Remove definition.
2434 Revert most of last change.
2435 Instead, simply don't mark the `Copyright...' string for translation.
2436 Based on advice from Paul Eggert.
2438 * strtoxmax.c: Tweak comment.
2440 2001-08-26 Jim Meyering <meyering@lucent.com>
2442 * version-etc.c (version_etc_copyright_fmt): Replace literal year
2443 of copyright with `%s' so translators don't get an untranslated
2445 (COPYRIGHT_YEAR): Define.
2446 (version_etc): Use fprintf rather than fputs.
2447 Suggestion from Ulrich Drepper.
2449 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
2451 * strtoll.c: New file, from GNU libc.
2452 * xstrtoimax.c: New file.
2454 * xstrtol.h: Add xstrtoimax.
2455 * strtoumax.c: New file. Simply include "strtoumax.c".
2456 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
2458 * strtoumax.c: Factor to work both for unsigned and signed types, ...
2459 * strtoxmax.c: ... then renamed to this.
2461 2001-08-13 Paul Eggert <eggert@twinsun.com>
2463 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
2464 Port to Solaris 8, where 'sed' requires a space after the 'r'
2465 command, and where sh dislikes "$/". Clean up the spacing a bit.
2466 Redirect output to $tmp just once.
2468 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
2470 * addext.c (<errno.h>): Include.
2471 (errno): Declare if not defined.
2472 (addext): Work correctly when pathconf returns -1 and leaves
2473 errno alone because there is no limit. Also, work even if
2474 pathconf returns a value greater than SIZE_MAX.
2476 2001-08-12 Jim Meyering <meyering@lucent.com>
2478 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
2479 Simply `return getcwd (NULL, 0);'.
2480 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
2481 Use 1300 as initial value for length, not PATH_MAX.
2483 * pathmax.h: Clean up cpp syntax.
2485 2001-08-12 Jim Meyering <meyering@lucent.com>
2487 * gettimeofday.c: New file.
2489 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
2491 2001-08-04 Jim Meyering <meyering@lucent.com>
2493 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
2494 to get in sync with glibc.
2496 2001-08-03 Paul Eggert <eggert@twinsun.com>
2498 The following changes are from gettext 0.10.39 as maintained by
2501 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
2502 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
2503 with inverted sense. All uses changed.
2505 * mbswidth.c: Don't include <limits.h>.
2506 Include <stdlib.h> and <string.h> unconditionally.
2507 (iswcntrl, mbsinit, ISCNTRL): New macros.
2508 (mbsnwidth): Use K&R style function declarations.
2509 Don't bother checking for MB_LEN_MAX == 1, since the compiler
2510 can optimize it when MB_CUR_MAX == 1.
2511 The width of control characters is zero, not 1.
2513 2001-07-15 Jim Meyering <meyering@lucent.com>
2515 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
2516 (BUILT_SOURCES): Add unlocked-io.h.
2517 (io_functions): Define.
2518 (unlocked-io.h): New rule.
2519 (DISTCLEANFILES): Add unlocked-io.h.
2520 (all-local): Depend on unlocked-io.h, to ensure it is created.
2522 * unlocked-io.hin: New file
2524 * regex.c: Update from glibc.
2526 2001-07-05 Jim Meyering <meyering@lucent.com>
2528 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
2530 (libfetish_a_SOURCES): Put all .h files here instead.
2531 Remove a thus-exposed (better checks in automake) duplicate and
2532 two unnecessary .h files.
2534 2001-06-11 Jim Meyering <meyering@lucent.com>
2536 * regex.c: Update from GNU libc.
2538 2001-05-27 Jim Meyering <meyering@lucent.com>
2540 * readutmp.h (UT_TYPE): Define.
2542 2001-05-24 Jim Meyering <meyering@lucent.com>
2544 * argmatch.c: Include "quote.h".
2545 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
2546 quote function. Reported by Göran Uddeborg.
2548 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
2550 * dirname.c (dir_name): Compute append_dot using path, not newpath
2551 which is not yet declared.
2553 2001-05-11 Paul Eggert <eggert@twinsun.com>
2555 * Makefile.am (libfetish_a_SOURCES):
2556 Add strftime.c, since we now compile it on all hosts.
2558 * strftime.c (my_strftime):
2559 Define to nstrftime if emacs, but only if my_strftime is not defined.
2560 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
2561 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
2562 Add one more extra argument: a nanoseconds value.
2565 (my_strftime function): Add %N format.
2566 (emacs_strftimeu): Renamed from emacs_strftime,
2567 with extra ut argument.
2569 2001-05-11 Paul Eggert <eggert@twinsun.com>
2571 dirname code cleanup. base_name now behaves more compatibly
2572 with POSIX basename when given file names that have trailing
2573 slashes, and similarly for dir_name. Add new primitives
2574 base_len and dir_len. Put the directory-name-related decls
2577 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
2578 * backupfile.c (base_name): Likewise.
2579 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
2580 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
2581 * makepath.c (strip_trailing_slashes): Likewise.
2582 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
2584 * rename.c (strip_trailing_slashes): Likewise.
2585 * same.c (base_name): Likewise.
2586 * stripslash.c (ISSLASH): Likewise.
2588 * addext.c: Include <dirname.h> after size_t is defined.
2589 * backupfile.c: Likewise.
2591 * addext.c (addext): Use base_len to trim redundant
2592 trailing slashes instead of doing it ourselves.
2593 But do not trim the last slash if it is not redundant.
2595 * backupfile.c (find_backup_file_name,
2596 max_backup_version): Use base_len instead of rolling it ourselves.
2597 Handle the case of "" and (on DOS) "C:" correctly.
2599 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
2600 Include <string.h>, <dirname.h>.
2601 (base_name): Allow file names ending in slashes, other than names
2602 that are all slashes. In this case, return the basename followed
2603 by the slashes. This is more general, and can be used in places
2604 where the original base_name purposely had an assertion failure.
2605 (base_len): New function.
2607 * dirname.c: Include <string.h> instead of <stdlib.h>.
2608 Do not include <assert.h>; no longer needed.
2610 (memrchr): Remove decl.
2611 (dir_name_r): Remove.
2612 (dir_len): Renamed from dirlen. All callers changed.
2613 Rewrite in terms of base_name, for simplicity and consistency.
2614 (dir_name): Never return NULL. All callers changed.
2615 Do not include <stdlib.h> in test program; no longer needed.
2616 return 0; is fine for test program.
2618 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
2620 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
2622 * path-concat.c (path_concat): Use base_len to compute
2623 base length, not strlen; this means we cannot rely on memcpy
2626 * same.c (STREQ): Remove.
2627 (same_name): Handle the case where the basename ends in trailing '/'.
2629 * stripslash.c (strip_trailing_slashes): Return nonzero if
2630 a slash was stripped. Do not strip the last slash after a
2633 2001-04-08 Jim Meyering <meyering@lucent.com>
2635 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
2636 recomputed; that's necessary when the offset spans a DST transition.
2637 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
2639 2001-04-02 Jim Meyering <meyering@lucent.com>
2641 * regex.h, regex.c: Update from GNU libc.
2643 2001-03-19 Paul Eggert <eggert@twinsun.com>
2645 * version-etc.c (version_etc_copyright): Update to 2001.
2647 2001-03-16 Paul Eggert <eggert@twinsun.com>
2649 * tempname.c (uint64_t): Define to uintmax_t if
2650 not defined, and if UINT64_MAX is not defined.
2651 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
2652 Reported by John David Anglin.
2654 2001-03-10 Bruno Haible <haible@clisp.cons.org>
2656 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
2657 alias if codeset is empty.
2658 * config.charset (BeOS): Use wildcard syntax.
2660 2001-03-13 Jim Meyering <meyering@lucent.com>
2662 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
2663 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
2666 2001-03-06 Bruno Haible <haible@clisp.cons.org>
2668 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
2670 * unicodeio.c (print_unicode_char): Simplify accordingly.
2672 2001-03-06 Bruno Haible <haible@clisp.cons.org>
2674 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
2675 support for DOS/DJGPP.
2677 2001-02-28 Paul Eggert <eggert@twinsun.com>
2679 * Makefile.am (libfetish_a_SOURCES):
2680 Add dup-safer.c, fopen-safer.c.
2681 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
2683 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
2685 2001-02-25 Paul Eggert <eggert@twinsun.com>
2687 The mkstemp replacement is taken from glibc 2.2.2, with some
2688 portability fixes for use outside glibc, as follows:
2690 * tempname.c (struct_stat64): New macro.
2691 (direxists, __gen_tempname): Use it.
2692 This avoids a portability problem with Solaris 8.
2694 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
2695 (<stddef.h>, <stdint.h>, <string.h>):
2696 Include only if STDC_HEADERS || _LIBC.
2697 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
2698 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
2699 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
2700 (__set_errno): Define this macro if <errno.h> doesn't.
2701 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
2702 Define these macros if <stdio.h> doesn't.
2703 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
2704 Define these macros if <sys/stat.h>
2705 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
2706 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
2707 __xstat64): Define if not _LIBC.
2708 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
2709 (__gen_tempname): Invoke gettimeofday only if
2710 HAVE_GETTIMEOFDAY || _LIBC;
2711 otherwise, fall back on plain "time".
2712 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
2714 * mkstemp.c (__GT_FILE): Define to zero if not defined.
2716 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
2718 2001-02-17 Jim Meyering <meyering@lucent.com>
2720 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
2721 around included file name.
2723 * strnlen.c (__strnlen): Merge in a change from GNU libc.
2725 * strftime.c: Update from GNU libc (the only changes were to comments).
2727 2001-02-13 Bruno Haible <haible@clisp.cons.org>
2729 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
2731 2001-02-17 Paul Eggert <eggert@twinsun.com>
2733 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
2734 Remove workaround macros for hosts that have mbrtowc but not
2735 mbstate_t, as we now insist on proper declarations for both
2736 before using mbrtowc.
2738 2001-02-17 Jim Meyering <meyering@lucent.com>
2740 * regex.c: Update from libc.
2742 2001-02-16 Paul Eggert <eggert@twinsun.com>
2744 * alloca.c (malloc): Undef before defining, since stdlib.h
2745 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
2746 Reported by Mark Hounschell via Paul Eggert.
2748 2001-01-30 Bruno Haible <haible@clisp.cons.org>
2750 * config.charset: Update for FreeBSD 4.2.
2752 2001-01-26 Jim Meyering <meyering@lucent.com>
2754 * quotearg.c: Include stddef.h.
2755 * quote.c: Include stddef.h.
2756 Reported by Axel Kittenberger.
2758 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
2759 line in double quotes so that it evokes a better diagnostic.
2760 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
2761 Reported by Axel Kittenberger.
2763 2001-01-15 Bruno Haible <haible@clisp.cons.org>
2765 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
2766 to avoid a warning. Add back 'const' to inptr.
2768 2001-01-16 Jim Meyering <meyering@lucent.com>
2770 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
2773 2001-01-14 Jim Meyering <meyering@lucent.com>
2775 * rename.c: New file. From Volker Borchert.
2776 Include stdlib.h, string.h or strings.h, and xalloc.h.
2777 Use strip_trailing_slashes rather than open-coding it.
2779 2001-01-03 Paul Eggert <eggert@twinsun.com>
2781 * strftime.c: Sync with glibc time/strftime.c 1.81.
2783 2001-01-03 Jim Meyering <meyering@lucent.com>
2785 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
2786 local `inptr' to avoid warning with some system declarations of iconv.
2788 2000-12-29 Paul Eggert <eggert@twinsun.com>
2790 * modechange.c: Do not assume that mode_t uses the
2791 traditional octal encoding. E.g. "chmod 1 FOO" should set
2792 the other-execute bit of FOO even if S_IXOTH != 1.
2794 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
2795 WOTH, XOTH, ALLM): New macros.
2796 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
2797 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
2799 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
2800 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
2802 No need to use uintmax_t; unsigned long is long enough.
2803 Don't bother to get suffix since we don't use it.
2805 2000-12-24 Jim Meyering <meyering@lucent.com>
2807 * hash.c (is_prime): Return explicit boolean values.
2808 (hash_get_first): Return NULL to appease Irix5.6's 89.
2809 Reported by Nelson Beebe.
2811 2000-10-31 Bruno Haible <haible@clisp.cons.org>
2813 * localcharset.c (locale_charset): Add support for Win32.
2815 2000-12-18 Paul Eggert <eggert@twinsun.com>
2817 * physmem.h, physmem.c: New files.
2819 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
2820 (noinst_HEADERS): Add physmem.h.
2822 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
2823 't' for compatibility with Solaris 8 sort.
2825 2000-12-18 Bruno Haible <haible@clisp.cons.org>
2827 * config.charset: Add support for BeOS.
2829 2000-12-16 Jim Meyering <meyering@lucent.com>
2831 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
2832 SHELLS_FILE to a file name that's useful on djgpp systems.
2834 (ADDITIONAL_DEFAULT_SHELLS): Define.
2835 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
2836 Based mostly on a patch from Prashant TR.
2838 2000-12-16 Jim Meyering <meyering@lucent.com>
2840 This bug had a serious impact on chown: `chown N:M FILE' (for integer
2841 N and M) would have treated it like `chown N:N FILE'.
2843 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
2845 2000-10-31 Bruno Haible <haible@clisp.cons.org>
2847 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
2848 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
2849 to the list of canonical encodings. Rename EUC-CN to GB2312.
2851 2000-12-08 Andreas Schwab <schwab@suse.de>
2853 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
2854 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
2856 2000-12-07 Jim Meyering <meyering@lucent.com>
2858 * stripslash.c (ISSLASH): Define.
2859 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
2862 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
2863 (dir_name_r): Declare this function as static.
2864 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
2865 manifest itself on a name containing a mix of slashes and
2867 Make this function work with names starting with a DOS-style
2868 drive letter and colon prefix.
2869 (dir_name): Append `.' if necessary.
2870 Based mostly on patches from Prashant TR and Eli Zaretskii.
2872 * dirname.h (dir_name_r): Remove prototype.
2874 2000-12-05 Jim Meyering <meyering@lucent.com>
2876 * dirname.c (dir_name_r): Add `const' in a few local declarations.
2878 2000-12-04 Jim Meyering <meyering@lucent.com>
2880 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
2881 Also include memory.h, stdlib.h, unistd.h if appropriate.
2882 Reported by Andreas Jaeger (conflicting declaration of malloc).
2884 2000-12-02 Jim Meyering <meyering@lucent.com>
2886 * closeout.h: Make idempotent, to avoid some obscure warnings.
2888 2000-12-01 Paul Eggert <eggert@twinsun.com>
2890 * memrchr.c: Include <config.h> before any system include file.
2892 2000-11-29 Paul Eggert <eggert@twinsun.com>
2894 * dirname.c (dir_name_r): Fix typo: int -> size_t.
2896 2000-11-26 Jim Meyering <meyering@lucent.com>
2898 * memcoll.c: Include sys/types.h. From Werner Almesberger.
2900 2000-11-22 Paul Eggert <eggert@twinsun.com>
2902 * strftime.c (my_strftime): Do not invoke mbrlen with a
2903 size of (size_t) -1; it's not portable.
2905 2000-11-17 Akim Demaille <akim@epita.fr>
2907 * obstack.h: Formatting changes.
2908 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
2909 prevent type checking.
2910 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
2911 cast the value to (void *): assigning a `foo *' to a `void *'
2913 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
2915 2000-11-17 Jim Meyering <meyering@lucent.com>
2917 * strstr.c: Update from GNU libc.
2919 2000-11-16 Jim Meyering <meyering@lucent.com>
2921 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
2923 2000-11-11 Jim Meyering <meyering@lucent.com>
2925 * error.c: Add a couple #includes, merging from GNU libc version.
2927 2000-11-10 Jim Meyering <meyering@lucent.com>
2929 * obstack.h: Update from GNU libc.
2930 * obstack.c: Likewise.
2932 2000-11-06 Paul Eggert <eggert@twinsun.com>
2934 * getusershell.c (setusershell): Use rewind rather than
2935 fseek/fseeko, to avoid configuration hassles with fseeko.
2936 Don't bother opening SHELLS_FILE if shellstream is NULL;
2939 2000-11-05 Jim Meyering <meyering@lucent.com>
2941 * makepath.h (make_dir): Declare.
2942 * makepath.c (make_dir): Remove `static' attribute.
2945 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
2947 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
2948 last one in a bucket, advance to the next bucket.
2950 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
2952 * fnmatch.c: Do not comment out all the code if we are using
2953 the GNU C library, because in some cases we are replacing buggy
2954 code in the GNU C library itself.
2956 2000-10-30 Paul Eggert <eggert@twinsun.com>
2958 * error.h, getline.h, modechange.h:
2959 Remove "2000" from Copyright line, as the file hasn't been
2960 changed this year other than in the copyright notice.
2962 * xalloc.h: Add "2000" to Copyright line, as this file
2963 was changed this year.
2965 2000-10-30 Paul Eggert <eggert@twinsun.com>
2967 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
2968 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
2969 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
2971 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
2973 * regex.h (__restrict_arr): Move definition out of #ifndef block.
2974 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
2975 doesn't define __restrict_arr.
2977 2000-10-29 Jim Meyering <meyering@lucent.com>
2979 * xstat.in: Fix grammar in comment.
2981 2000-10-28 Jim Meyering <meyering@lucent.com>
2983 * memchr.c: Update from libc.
2984 Adjust for portability:
2985 [HAVE_STDLIB_H]: Include stdlib.h.
2986 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
2987 Undef __memchr, too.
2988 [!weak_alias]: Define __memchr to memchr.
2990 * regex.c: Update from libc.
2991 * regex.h: Likewise.
2992 * getopt1.c: Likewise.
2993 * memcmp.c: Likewise.
2995 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
2996 Avoid using fseek, when possible -- it's broken by design.
2997 Patch by Ulrich Drepper.
2999 2000-10-26 Jim Meyering <meyering@lucent.com>
3001 * strftime.c: Update from libc.
3003 2000-10-25 Jim Meyering <meyering@lucent.com>
3005 * obstack.c: Update from libc.
3007 2000-10-23 Jim Meyering <meyering@lucent.com>
3009 * hard-locale.c (hard_locale): Revert last change -- it was simply
3010 wrong. That set_locale call must not have any side effects.
3013 2000-10-22 Jim Meyering <meyering@lucent.com>
3015 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
3016 [CYCLIC]: Remove now-unused definition.
3018 * save-cwd.c (O_DIRECTORY): Define, if needed.
3019 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
3020 Suggestion from Ulrich Drepper.
3022 2000-10-21 Jim Meyering <meyering@lucent.com>
3024 * dirname.c (dir_name_r): New function, factored out of dir_name.
3025 (dir_name): Use dir_name_r.
3026 * dirname.h (dir_name_r): Declare it.
3028 2000-10-21 Jim Meyering <meyering@lucent.com>
3030 * dirname.c (memrchr): Declare if necessary.
3031 (dir_name): Remove the restriction that there be no
3032 trailing slashes. Now, this code skips past them, effectively
3034 [TEST_DIRNAME] (main): New unit tests.
3036 * memrchr.c: New file from GNU libc.
3037 Undef __memrchr, too.
3038 [!weak_alias]: Define __memrchr to memrchr.
3039 Guard weak_alias use with `#ifdef weak_alias'.
3041 2000-10-17 Jim Meyering <meyering@lucent.com>
3043 * quote.h (PARAMS): Define and use.
3044 Reported by Akim Demaille.
3046 * getopt.c: Update from libc.
3048 2000-10-16 Jim Meyering <meyering@lucent.com>
3050 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
3053 2000-09-25 Jim Meyering <meyering@lucent.com>
3055 * md5.h (rol): Define (from GnuPG).
3057 * sha.c: Give credit (GnuPG) where due.
3058 (M): Use rol rather than open-coding it.
3059 Add a FIXME comment.
3061 2000-09-21 Jim Meyering <meyering@lucent.com>
3063 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
3064 Reported by Michael Stone.
3066 2000-09-20 Jim Meyering <meyering@lucent.com>
3068 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
3069 (noinst_HEADERS): Add sha.h.
3070 Based on code from Scott G. Miller and from GnuPG.
3072 2000-09-15 Jim Meyering <meyering@lucent.com>
3074 * regex.c: Update from libc.
3076 2000-09-10 Jim Meyering <meyering@lucent.com>
3078 * getopt.c (_getopt_internal): Update from glibc.
3080 2000-09-09 Jim Meyering <meyering@lucent.com>
3082 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
3083 think it should be used as a general replacement for isascii.
3084 * fnmatch.c: Likewise.
3085 * mbswidth.c: Likewise
3086 * regex.c: Likewise.
3089 * userspec.c: Include sys/param.h and limits.h.
3091 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
3092 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
3093 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
3094 UID, GID. Check range.
3096 2000-09-06 Jim Meyering <meyering@lucent.com>
3098 * getopt.c (_getopt_internal): Update from glibc.
3100 2000-08-30 Jim Meyering <meyering@lucent.com>
3102 * strftime.c: Merge in changes from GNU libc.
3104 2000-08-26 Jim Meyering <meyering@lucent.com>
3106 * closeout.c: Include "__fpending.h".
3107 (close_stdout_status): Return right away if there's nothing to flush.
3109 * Makefile.am (noinst_HEADERS): Add __fpending.h.
3110 * __fpending.c: New file.
3111 * __fpending.h: New file.
3113 2000-08-07 Paul Eggert <eggert@twinsun.com>
3115 Standardize on "memory exhausted" instead of "Memory exhausted"
3116 or "virtual memory exhausted".
3117 * obstack.c (print_and_abort): Use "memory exhausted", not
3118 "virtual memory exhausted".
3119 * same.c (same_name): Invoke xalloc_die instead of printing
3121 * userspec.c (parse_user_spec): Likewise.
3122 * bumpalloc.h: comment fix
3123 * same.c, userspec.c: Include xalloc.h.
3125 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
3126 not char *const and pointing to a constant array.
3127 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
3128 (xrealloc): Comment fix.
3130 * userspec.c (parse_user_spec):
3131 Don't translate a message until just before returning,
3132 to avoid unnecessary translation.
3134 2000-08-07 Jim Meyering <meyering@lucent.com>
3136 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
3137 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
3138 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
3139 getgroups.c, gethostname.c, getopt.h, group-member.c,
3140 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
3141 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
3142 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
3143 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
3144 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
3145 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
3146 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
3147 yesno.c: Back out Copyright date changes for each file with no change
3148 this year. This eases coordination with other programs using the same
3149 source code modules. From Paul Eggert.
3151 2000-08-03 Greg McGary <greg@mcgary.org>
3153 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
3154 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
3155 (EXTEND_BUFFER): Use them.
3157 2000-08-01 Jim Meyering <meyering@lucent.com>
3159 * dirname.c (ISSLASH): Define.
3160 (BACKSLASH_IS_PATH_SEPARATOR): Define.
3161 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
3162 both `\' and `/' may be use as path separators.
3163 Based on a patch from Prashant TR.
3165 2000-07-31 Paul Eggert <eggert@twinsun.com>
3167 * quotearg.c (quotearg_n_options): Don't make the initial
3168 slot vector a constant, since it might get modified.
3170 2000-07-31 Jim Meyering <meyering@lucent.com>
3172 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
3173 * obstack.c (print_and_abort): Likewise.
3175 2000-07-30 Paul Eggert <eggert@twinsun.com>
3177 * quotearg.c (quotearg_n_options): Preallocate a slot 0
3178 buffer, so that the caller can always quote one small
3179 component of a "memory exhausted" message in slot 0.
3180 From a suggestion by Jim Meyering.
3182 2000-07-30 Jim Meyering <meyering@lucent.com>
3184 * makepath.c (make_path): Quote the other instance, too.
3186 * quotearg.c (N_STATIC_SLOTVECS): Define.
3187 (STATIC_BUF_SIZE): Define.
3188 (quotearg_n_options): Use only statically allocated storage when
3189 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
3190 than STATIC_BUF_SIZE.
3192 2000-07-29 Jim Meyering <meyering@lucent.com>
3194 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
3195 * dirname.c (dir_name): Likewise.
3197 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
3199 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
3200 (dir_name): Assert that there are no trailing slashes.
3202 2000-07-18 Bruno Haible <haible@clisp.cons.org>
3204 * mbswidth.h (mbswidth): Add a flags argument.
3205 (mbswidth): New declaration.
3206 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
3207 * mbswidth.c (mbswidth): Add a flags argument.
3208 (mbsnwidth): New function.
3210 2000-07-24 Jim Meyering <meyering@lucent.com>
3212 * mbswidth.c: Remove useless #else. From Bruno Haible.
3214 2000-07-23 Paul Eggert <eggert@twinsun.com>
3216 * mbswidth.c (_XOPEN_SOURCE):
3217 Don't define; this causes problems on Solaris 7.
3218 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
3220 2000-07-23 Paul Eggert <eggert@twinsun.com>
3223 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
3224 so that mbstate_t is always defined.
3226 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
3227 be 1 in at least one GCC installation, and this configuration
3228 error is likely to be common. Ignoring MB_LEN_MAX hurts
3229 performance on hosts that have mbrtowc but have only unibyte
3230 locales, but I assume these hosts are rare.
3232 2000-07-23 Paul Eggert <eggert@twinsun.com>
3234 * quotearg.c: Streamline by invoking multibyte code only if needed.
3235 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
3236 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
3237 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
3238 invoke multibyte primitives.
3240 2000-07-23 Jim Meyering <meyering@lucent.com>
3242 * basename.c (base_name): Add an assertion.
3244 2000-07-15 Bruno Haible <clisp.cons.org>
3246 * quotearg.c: When the system forces us to redefine mbstate_t,
3247 shadow its mbsinit function.
3249 2000-07-16 Bruno Haible <haible@clisp.cons.org>
3251 * mbswidth.h: New file.
3252 * mbswidth.c: New file.
3253 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
3254 (noinst_HEADERS): Add mbswidth.h.
3256 2000-07-17 Bruno Haible <haible@clisp.cons.org>
3258 * config.charset: Add support for FreeBSD. Improve support for HP-UX
3261 2000-07-15 Jim Meyering <meyering@lucent.com>
3263 * makepath.c: Include quote.h.
3264 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
3265 corresponding argument in a `quote (...)' call.
3266 Give better diagnostics.
3268 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
3269 (noinst_HEADERS): Add quote.h.
3271 * quote.c (quote, quote_n): New file. Two functions taken verbatim
3272 from tar's src/misc.c.
3273 * quote.h: New file. Prototypes for same.
3275 2000-07-10 Paul Eggert <eggert@twinsun.com>
3277 From a suggestion by Bruno Haible.
3278 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
3279 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
3280 to decide whether to define the BeOS workaround macro;
3281 this adjusts to the change to AC_MBSTATE_T.
3283 2000-07-13 Paul Eggert <eggert@twinsun.com>
3285 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
3287 * quotearg.c (quoting_style_args, quoting_style_vals,
3288 quotearg_buffer_restyled): Add support for
3289 clocale_quoting_style. Undo previous change to
3290 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
3291 and "{RIGHT QUOTATION MARK}" msgids.
3293 2000-07-05 Paul Eggert <eggert@twinsun.com>
3295 The old behavior of quoting `like this' doesn't look good with
3296 newer, ISO-style fonts. See:
3297 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
3299 Instead, quote "like this" by default. Let the translator
3300 tailor the locale-specific quoting behavior by providing
3301 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
3303 * quotearg.c (N_): New macro.
3304 (gettext_default): New function.
3305 (quotearg_buffer_restyled): Use
3306 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
3307 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
3309 2000-07-09 Jim Meyering <meyering@lucent.com>
3311 * Most files: Update copyright dates to include 2000.
3313 2000-07-08 Jim Meyering <meyering@lucent.com>
3315 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
3317 (xgethostname): Remove now-unnecessary #ifdef.
3318 Move declaration of `err' into loop where it's used.
3320 2000-07-05 Bruno Haible <haible@clisp.cons.org>
3322 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
3323 by allocating a larger buffer. Test the gethostname return value for
3324 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
3325 returns an error and ENAMETOOLONG isn't defined.
3327 2000-07-05 Paul Eggert <eggert@twinsun.com>
3328 and Bruno Haible <haible@clisp.cons.org>
3330 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
3332 2000-07-05 Bruno Haible <haible@clisp.cons.org>
3334 * quotearg.c (struct quoting_options): Simplify quote_these_too
3337 2000-07-03 Jim Meyering <meyering@lucent.com>
3339 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
3340 Reported by Bruno Haible.
3342 2000-07-04 Jim Meyering <meyering@lucent.com>
3344 * quotearg.c: Make inclusion of <wchar.h> independent of whether
3345 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
3348 2000-07-03 Paul Eggert <eggert@twinsun.com>
3349 and Bruno Haible <haible@clisp.cons.org>
3351 * quotearg.c (mbrtowc):
3352 Assign to *pwc, and return 1 only if result is nonzero.
3353 (iswprint): Use ISPRINT when substituting our own mbrtowc.
3355 2000-07-03 Jim Meyering <meyering@lucent.com>
3357 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
3358 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
3361 2000-07-02 Jim Meyering <meyering@lucent.com>
3363 * quotearg.c (mbstate_t): Don't define here.
3365 2000-07-02 Jim Meyering <meyering@lucent.com>
3367 * nanosleep.c (SIGCONT): Define if not already defined.
3369 2000-06-17 Bruno Haible <haible@clisp.cons.org>
3371 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
3372 per change in ../m4/ls-mntd-fs.m4.
3373 (read_filesystem_list): Ignore symbolic links.
3375 2000-06-29 Jim Meyering <meyering@lucent.com>
3377 * same.c: Include <string.h> or <strings.h>, as appropriate,
3378 for declaration of strcmp.
3380 * long-options.c: Include <stdlib.h>, for declaration of exit.
3382 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
3383 Avoid warning by casting result to `char *' to remove `const'.
3385 2000-06-17 Bruno Haible <haible@clisp.cons.org>
3387 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
3389 2000-06-26 Paul Eggert <eggert@twinsun.com>
3391 savedir now sets errno on failure and invokes xmalloc to get memory.
3392 Fix a couple of other minor bugs while we're at it.
3394 * savedir.c (<unistd.h>): Do not include; there's no need.
3395 (NAMLEN): Remove macro.
3396 (malloc, realloc): Remove decls.
3398 ("xalloc.h"): Include.
3399 (NAME_SIZE_DEFAULT): New macro.
3400 (savedir): Use xmalloc / xrealloc to allocate memory.
3401 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
3402 Skip "" directory entries.
3403 Use strlen to calculate directory entry length, since the old method
3404 is rarely used these days and isn't worth supporting.
3405 Don't use a pointer after freeing it.
3406 Check for integer overflow when calculating allocation size.
3407 Use memcpy to copy entries, instead of stpcpy.
3408 Set errno properly when returning NULL.
3409 Check for readdir error.
3411 2000-06-26 Jim Meyering <meyering@lucent.com>
3413 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
3415 2000-06-17 Bruno Haible <haible@clisp.cons.org>
3417 * getusershell.c (xmalloc, xrealloc): Remove functions.
3419 Don't include <stdlib.h>. Don't declare malloc, realloc.
3421 2000-06-23 Bruno Haible <haible@clisp.cons.org>
3423 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
3425 2000-06-24 Jim Meyering <meyering@lucent.com>
3427 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
3429 2000-06-21 Jim Meyering <meyering@lucent.com>
3431 * getpass.c: New file, from Bruno Haible. Required for BeOS.
3433 2000-06-19 Paul Eggert <eggert@twinsun.com>
3435 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
3436 (mbrtowc, mbstate_t): Define substitutes if
3437 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
3438 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
3439 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
3441 2000-06-17 Bruno Haible <haible@clisp.cons.org>
3443 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
3444 than 1024, return a memory chunk of least possible size, instead
3445 of size PATH_MAX + 2. In the loop, increment the size proportionally.
3446 Use free/xmalloc instead of xrealloc to avoid copying for very long
3449 2000-06-17 Bruno Haible <haible@clisp.cons.org>
3451 * canon-host.c (canon_host): Use malloc and memcpy to copy an
3452 address, not strdup. Include <stdlib.h> and don't declare free().
3454 2000-06-17 Bruno Haible <haible@clisp.cons.org>
3456 * path-concat.c (path_concat): Don't access dir[-1] if dir is
3459 2000-06-21 Jim Meyering <meyering@lucent.com>
3461 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
3462 (noinst_HEADERS): Add getstr.h.
3464 * getline.c (getstr): Move into a separate file.
3465 * getstr.c (getstr): New file, extracted from getline.c, with
3466 the following changes: new parameter, delim2; both delim[12]
3467 parameters have type `int', not `char'. The latter would lose
3468 with 8-bit delimiters.
3469 * getstr.h: New file.
3471 2000-06-19 Jim Meyering <meyering@lucent.com>
3473 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
3475 2000-06-18 Jim Meyering <meyering@lucent.com>
3477 * mkdir.c: Remove file, due mainly to copyright incompatibility.
3478 Besides, these days every porting target provides a mkdir function.
3480 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
3481 (this snippet comes from src/system.h).
3483 2000-06-15 Paul Eggert <eggert@twinsun.com>
3485 * human.c (adjust_value): New function.
3486 (human_readable_inexact): Apply rounding style even when
3487 printing approximate values.
3489 2000-06-14 Paul Eggert <eggert@twinsun.com>
3491 * human.c (human_readable_inexact): Allow an input block
3492 size that is not a multiple of the output block size, and vice versa.
3493 Reported by Piergiorgio Sartor.
3495 2000-06-14 Paul Eggert <eggert@twinsun.com>
3497 * getdate.y (get_date): Apply relative times after time
3498 zone indicator, not before. Reported by Todd A. Jacobs.
3500 2000-06-13 Jim Meyering <meyering@lucent.com>
3502 * Makefile.am (all-local): Depend on lstat.c and stat.c.
3504 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
3506 2000-06-12 Paul Eggert <eggert@twinsun.com>
3508 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
3510 2000-06-04 Paul Eggert <eggert@twinsun.com>
3512 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
3514 2000-06-04 Jim Meyering <meyering@lucent.com>
3516 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
3517 SunOS 4.1.4 for which gid_t is an unsigned type.
3519 2000-06-03 Jim Meyering <meyering@lucent.com>
3521 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
3523 2000-05-26 Bruno Haible <haible@clisp.cons.org>
3525 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
3526 newer, don't install charset.alias.
3527 * config.charset: Change the Linux/glibc rules so they become empty
3528 on glibc-2.1 or newer.
3530 2000-06-02 Jim Meyering <meyering@lucent.com>
3532 * mountlist.c: Back out last change. Instead, do this...
3533 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
3534 member using the same `ignore'-testing code.
3535 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
3539 2000-05-29 Jim Meyering <meyering@lucent.com>
3541 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
3542 with the `ignore' attribute. Based on a patch from Mark D. Roth.
3544 2000-05-22 Jim Meyering <meyering@lucent.com>
3546 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
3548 2000-05-18 Jim Meyering <meyering@lucent.com>
3550 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
3551 back, too, since it may have been modified by allocate_entry.
3552 (hash_delete): Rewrite to use neither the assignment operator
3553 nor the comma operator in an if-expression.
3555 2000-05-15 Paul Eggert <eggert@twinsun.com>
3558 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
3559 Remove; no longer needed.
3560 "quotearg.h": Add include.
3561 (file_name): Do not bother to explicitly initialize to NULL; it's less
3562 efficient on some hosts.
3563 (close_stdout_status): Remove test as to whether stdout was already
3564 closed; it breaks for the case "echo x | sort >&-".
3565 Quote file name colons.
3566 Do not assume that _("write error") lacks format strings.
3568 2000-05-15 Jim Meyering <meyering@lucent.com>
3570 * version-etc.c (version_etc_copyright): Update the copyright string
3571 used in all --version output.
3573 2000-05-14 Jim Meyering <meyering@lucent.com>
3575 * closeout.c (close_stdout_set_file_name): New function.
3576 (close_stdout_status): Use new file-scoped global.
3577 Return right away if fstat says the stdout file descriptor is invalid.
3578 * closeout.h (close_stdout_set_file_name): Declare.
3580 2000-05-10 Jim Meyering <meyering@lucent.com>
3582 * closeout.c [default_exit_status]: New file-scoped variable.
3583 (close_stdout_set_status): New function.
3584 * closeout.h (close_stdout_set_status): Declare.
3586 2000-05-08 Jim Meyering <meyering@lucent.com>
3588 * long-options.c: Don't include closeout.h.
3589 (parse_long_options): Don't call close_stdout for --version.
3591 2000-05-06 Jim Meyering <meyering@lucent.com>
3593 * strnlen.c: Undefine __strnlen and strnlen.
3594 [!weak_alias]: Define __strnlen to strnlen.
3596 * atexit.c: New file, from libiberty.
3598 2000-05-06 Jim Meyering <meyering@lucent.com>
3600 * closeout.c (close_stdout_status): Also check for errors on the
3603 2000-05-05 Bruno Haible <haible@clisp.cons.org>
3605 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
3606 instead of xmalloc, xrealloc, path_concat.
3607 (locale_charset): Treat empty environment variables as absent.
3608 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
3610 2000-05-04 Jim Meyering <meyering@lucent.com>
3612 * getopt.c: Update from glibc.
3613 * obstack.c: Likewise.
3614 * obstack.h: Likewise.
3615 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
3617 * regex.h: Likewise.
3618 * strndup.c: Likewise.
3619 * strnlen.c: New file, from glibc.
3621 2000-05-01 Jim Meyering <meyering@lucent.com>
3623 * full-write.c (full_write): Remove `FIXME' part of comment.
3625 2000-04-29 Jim Meyering <meyering@lucent.com>
3627 * path-concat.c: Declare strdup only if it's not defined.
3628 * canon-host.c: Likewise.
3630 2000-04-28 Jim Meyering <meyering@lucent.com>
3632 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
3633 redefinition warning on some systems (HPUX). Otherwise, regex.h is
3634 included first, then limits.h is included by locale.h by libintl.h.
3635 From John David Anglin.
3637 2000-04-25 Jim Meyering <meyering@lucent.com>
3639 * makepath.c (S_IRWXUGO): Define.
3640 (make_path): Always perform explicit chmod if MODE specifies any
3641 of the `special' permission bits. Prompted by a bug report against
3642 install from Mate Wierdl and Joost van Baal.
3644 2000-04-18 Jim Meyering <meyering@lucent.com>
3648 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
3649 getpagesize. For BeOS. Based on a patch from Bruno Haible.
3651 2000-04-17 Jim Meyering <meyering@lucent.com>
3653 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
3654 the definition of it to rpl_strftime also defined-away the system's
3657 2000-04-15 Jim Meyering <meyering@lucent.com>
3659 Use `C' to denote so-called `contiguous' files, the same way
3661 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
3662 (ftypelet): Use S_ISCTG.
3663 From Michael Deutschmann.
3665 2000-04-14 Jim Meyering <meyering@lucent.com>
3667 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
3669 2000-04-08 Jim Meyering <meyering@lucent.com>
3671 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
3672 names don't conflict. Reported by Eli Zaretskii.
3674 2000-03-28 Bruno Haible <haible@clisp.cons.org>
3676 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
3677 bug. Deal with the different error behavior of Irix iconv.
3679 2000-04-07 Jim Meyering <meyering@lucent.com>
3681 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
3682 to work around system header problems on AIX 3.2.5. From Bruno Haible.
3684 2000-04-05 Jim Meyering <meyering@lucent.com>
3686 Portability tweaks required for ultrix4.3.
3687 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
3688 * readutmp.c: Include sys/types.h before sys/stat.h.
3689 * canon-host.c: Declare strdup.
3690 * path-concat.c: Likewise.
3691 From John David Anglin.
3693 2000-04-04 Jim Meyering <meyering@lucent.com>
3695 Be more DOS 8.3-friendly.
3696 * ref-add.sin: Renamed from ref-add.sed.in.
3697 * ref-del.sin: Renamed from ref-del.sed.in.
3698 * Makefile.am: Reflect renaming.
3699 Reported by Eli Zaretskii.
3701 Use a temporary file name that won't clash with `charset.alias'
3702 in the DOS 8.3 name space.
3703 * Makefile.am (charset_tmp): Define.
3704 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
3705 (uninstall-local): Likewise.
3706 Reported by Eli Zaretskii.
3708 2000-03-29 Paul Eggert <eggert@twinsun.com>
3710 * time/strftime.c (my_strftime): Make sure we call the system
3711 strftime, not ourselves, when invoking the underlying strftime.
3713 2000-03-24 Jim Meyering <meyering@lucent.com>
3715 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
3716 (charset_alias): Define.
3717 (install-exec-local): Factor out common code.
3718 (uninstall-local): Split lines longer than 80.
3719 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
3721 (.sed.in.sed): New rule. Don't redirect directly to $@.
3722 (CLEANFILES): Add ref-add.sed and ref-del.sed.
3724 2000-03-19 Bruno Haible <haible@clisp.cons.org>
3726 * config.charset: Output a line containing "Packages using this file".
3727 * ref-add.sed.in, ref-del.sed.in: New files.
3728 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
3729 ref-del.sed): New rules.
3731 2000-03-17 Jim Meyering <meyering@lucent.com>
3733 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
3734 Otherwise, include <strings.h>
3736 2000-03-17 Bruno Haible <haible@clisp.cons.org>
3738 * unicodeio.c (utf8_wctomb): New function.
3739 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
3740 format instead of in UCS-4 with platform dependent endianness.
3742 2000-03-07 Paul Eggert <eggert@twinsun.com>
3744 * savedir.c (savedir): Work even if directory size is
3745 negative; this can happen with some screwy NFS configurations.
3747 2000-03-06 Jim Meyering <meyering@lucent.com>
3749 * localcharset.c (get_charset_aliases): Don't try to free file_name
3750 if it's NULL (because we ran out of memory). From Bruno Haible.
3752 2000-03-05 Jim Meyering <meyering@lucent.com>
3754 * localcharset.c ("path-concat.h"): Include.
3755 (get_charset_aliases): Use path_concat instead of ANSI string
3758 * unicodeio.h (PARAMS): Define.
3759 Use it to guard prototype.
3761 2000-03-04 Jim Meyering <meyering@lucent.com>
3763 * Makefile.am (install-exec-local): Create $(libdir) before installing
3765 (uninstall-local): Uncomment this rule so `make distcheck' works
3768 * unicodeio.c (<errno.h>): Include it.
3769 (errno): Declare if not defined.
3771 * localcharset.c: Add Bruno's comment justifying use of volatile.
3773 * config.charset: New version, incorporating remarks from a linux
3774 i18n mailing list. From Bruno Haible.
3776 2000-03-02 Jim Meyering <meyering@lucent.com>
3778 * Makefile.am (EXTRA_DIST): Add config.charset.
3780 2000-03-01 Jim Meyering <meyering@lucent.com>
3782 * localcharset.c: Guard some #includes with `#if HAVE_...'.
3783 * unicodeio.c: Likewise.
3785 2000-02-02 Bruno Haible <haible@clisp.cons.org>
3787 * config.charset: New file.
3788 * localcharset.c: New file.
3789 * unicodeio.h, unicodeio.c: New files.
3790 * Makefile.am (DEFS): Add -DLIBDIR=...
3791 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
3792 (noinst_HEADERS): Add unicodeio.h.
3793 (all-local, install-exec-local, charset.alias): New targets.
3795 2000-02-28 Paul Eggert <eggert@twinsun.com>
3797 * quotearg.c (ALERT_CHAR): New macro.
3798 (quotearg_buffer_restyled): Use it.
3800 2000-02-27 Jim Meyering <meyering@lucent.com>
3802 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
3803 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
3805 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
3806 not `#if STDC_HEADERS'.
3807 Declare malloc if needed.
3809 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
3810 now that autoconf always defines the HAVE_DECL_ symbols.
3811 * human.c: Likewise.
3813 * strtoumax.c: Likewise.
3815 * backupfile.c: Arrange for cpp to fail if the configure-time
3816 declaration check was not run.
3818 * human.c: Likewise.
3820 * strtoumax.c: Likewise.
3822 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
3823 then first look up the entire `.'-containing string as a login name.
3825 2000-02-18 Paul Eggert <eggert@twinsun.com>
3827 * getdate.y: Handle two-digit years with leading zeros correctly.
3828 (textint): New typedef.
3829 (parser_control): Member year changed from int to textint.
3831 (YYSTYPE): Removed; replaced by %union with int and textint members.
3832 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
3833 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
3834 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
3835 (tSNUMBER, tUNUMBER): Now of type <textintval>.
3836 (date, number, to_year): Use width of number in digits, not its value,
3837 to determine whether it's a 2-digit year, or a 2-digit time.
3838 (yylex): Store number of digits of numeric tokens.
3839 Reported by John Kendall.
3841 (parser_control): Changed from struct parser_control to typedef (for
3842 consistency). All uses changed.
3844 (tID): Removed; not used.
3845 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
3847 2000-02-14 Paul Eggert <eggert@twinsun.com>
3849 * getpagesize.h (getpagesize): Port to VMS for Alpha;
3850 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
3852 2000-02-12 Jim Meyering <meyering@lucent.com>
3854 * userspec.c (ISDIGIT): Define it.
3855 (isdigit): Remove definition.
3856 (is_number): Use ISDIGIT, not isdigit.
3857 <libintl.h>: Include.
3859 (parse_user_spec): Mark translatable strings.
3861 2000-02-10 Jim Meyering <meyering@lucent.com>
3863 With these changes, nanosleep.[ch] are finally enough like the other
3864 lib/* replacement files to compile on a few more losing systems.
3866 * nanosleep.h: Don't include config.h.
3867 Remove prototype from declaration of nanosleep.
3868 (PARAMS): Remove now-unneeded definition.
3869 * nanosleep.c: #undef nanosleep.
3870 (rpl_nanosleep): Rename from nanosleep.
3872 2000-02-03 Jim Meyering <meyering@lucent.com>
3874 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
3875 rather than with `#if HAVE_UTMPNAME'.
3877 2000-02-01 Jim Meyering <meyering@lucent.com>
3879 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
3881 2000-01-31 Jim Meyering <meyering@lucent.com>
3883 * nanosleep.h (nanosleep): Guard declaration with
3884 `#if ! HAVE_DECL_NANOSLEEP'.
3885 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
3886 the declaration in that vendor's sys/timers.h.
3887 Reported by Christian Krackowizer.
3889 * quotearg.c (ISASCII): Add #undef and move definition to follow
3890 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
3891 (ISPRINT): Likewise.
3892 Reported by Tom Tromey.
3894 2000-01-30 Jim Meyering <meyering@lucent.com>
3896 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
3897 uses of ->ut_name. The latter doesn't work with new Linux header files
3898 where only utmpx.ut_user is declared.
3900 * readutmp.h (UT_USER): Define.
3902 2000-01-23 Jim Meyering <meyering@lucent.com>
3904 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
3907 2000-01-22 Jim Meyering <meyering@lucent.com>
3909 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
3910 [! HAVE_DECL_STRTOULL]: Declare strtoull.
3911 Required for some AIX systems. Reported by Christian Krackowizer.
3912 [TESTING] (main): New function.
3914 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
3915 * dirname.c (dir_name): Support for DOS-style file names with drive
3918 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
3920 * strverscmp.c (ISDIGIT): Define.
3921 (strverscmp): Use ISDIGIT, not isdigit.
3923 2000-01-17 Paul Eggert <eggert@twinsun.com>
3925 * nanosleep.c (nanosleep):
3926 Don't use SA_INTERRUPT to decide whether to call sigaction, as
3927 POSIX.1 doesn't require SA_INTERRUPT and some systems
3928 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
3929 it's been part of POSIX.1 since day 1 (in 1988).
3931 2000-01-17 Jim Meyering <meyering@lucent.com>
3933 * interlock: Remove unused file. Reported by François Pinard.
3935 2000-01-16 Paul Eggert <eggert@twinsun.com>
3937 * quotearg.c (quotearg_buffer_restyled): Do not quote
3938 alert, backslash, formfeed, and vertical tab unnecessarily in
3939 shell quoting style.
3942 version-control: never