1 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
3 * lib/getpass.c (fflush_unlocked, flockfile, funlockfile)
4 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
7 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
9 * getdate.y: Add support for TZ="foo" within a date string.
10 Fix some bugs near time_t boundaries. Reject dates with
11 out-of-range components, e.g., "Sept 31".
12 Include <stdlib.h>, "setenv.h", "xalloc.h".
13 (ISDIGIT_LOCALE): Remove; unused.
14 Note that the TZ and time functions used here are not reentrant.
15 (mktime_ok, get_tz): New functions.
16 (TZBUFSIZE): New constant.
17 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
18 This requires that we sometimes generate our own TZ="XXX..." setting.
20 2004-10-27 Derek R. Price <derek@ximbiot.com>
22 * mktime.c (not_equal_tm): Remove redundant check.
24 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
26 * getdate.y: Use Bison 1.875 features, and some minor
27 code cleanups. This change does not affect semantics.
28 Don't include <stdlib.h>; no longer needed.
29 Don't include unlocked-io.h; only the "#if TEST" code uses
30 stdio, and performance isn't crucial there.
31 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
32 Bison 1.875 features as described below.
33 All uses of "PC." replaced by "pc->".
34 (YYSTYPE): Add a forward declaration.
35 (yylex, yyerror): Use full prototypes in forward decls.
36 Use "%pure-parser" rather than obsolescent "%pure_parser".
37 Use %parse-param and %lex-param instead of obsolescent
38 YYPARSE_PARAM and YYLEX_PARAM.
39 (meridian_table, month_and_day_table, time_units_table,
40 relative_time_table, time_zone_table, military_table,
41 lookup_zone, lookup_word, get_date):
42 Use NULL instead of 0 where appropriate.
43 (to_hour): Avoid abort (), to avoid a dependency on
45 (yyerror, yylex): Now accepts parser_control * arg.
46 (main) [TEST]: Use '\0' rather than 0 for char.
48 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
50 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
51 It's now the caller's responsibility to handle the case where
52 !HAVE_GETPAGESIZE && !defined getpagesize.
54 * mktime.c (leapyear): Arg is long int, not int.
56 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
58 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
60 2004-10-12 Simon Josefsson <jas@extundo.com>
62 * getpass.c (fflush_unlocked, flockfile, funlockfile)
63 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
66 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
68 * vsnprintf.h: New file.
69 * vsnprintf.c: New file.
71 2004-10-07 Bruno Haible <bruno@clisp.org>
73 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
74 into the provided buffer.
76 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
78 * diacrit.c, diacrit.h: Add GPL notice.
80 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
81 * atanl.c (atanl): Keep the code as similar to glibc as possible.
82 * logl.c (logl): Keep the code as similar to glibc as possible.
83 This avoids a potential constant-folding bug.
85 2004-10-05 Bruno Haible <bruno@clisp.org>
87 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
89 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
91 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
92 * xmalloc.c (xmemdup): Likewise.
93 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
94 XFREE): Remove these long-obsolescent macros.
95 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
98 * regex.c (re_comp): Cast gettext return value to char *,
99 Problem reported by Martin Neitzel via Mark D. Baushke.
101 2004-10-04 Simon Josefsson <jas@extundo.com>
103 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
104 '#ifdef USE_UNLOCKED_IO'.
106 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
108 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
109 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
110 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
111 regex.c, sha1.c, version-etc.c, yesno.c:
112 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
113 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
114 the includer's responsibility.
118 * modechange.c (mode_compile): Don't decrement a pointer that
119 points to the start of a string, as the C Standard says the
120 resulting behavior is undefined.
122 * backupfile.h (enum backuptype): Rename none -> no_backups,
123 simple -> simple_backups, numbered_existing ->
124 numbered_existing_backups, numbered -> numbered_backups
125 to avoid shadowing problems. All uses changed.
126 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
127 * backupfile.c (check_extension, numbered_backup):
128 Rename locals to avoid shadowing 'basename'.
129 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
132 * .cppi-disable: Add getopt_.h, getopt_int.h.
133 * .cvsignore: Add getopt.h.
135 2004-10-04 Simon Josefsson <jas@extundo.com>
137 * memmem.h: New file.
138 * memmem.c: New file, taken from glibc.
140 2004-10-02 Jim Meyering <jim@meyering.net>
142 * dirfd.h, getpagesize.h: Add copyright notice.
144 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
146 * snprintf.c: Remove comments as to why each header is needed.
148 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
150 * strsep.h: New file.
151 * strsep.c: New file.
153 2004-10-01 Simon Josefsson <jas@extundo.com>
155 * snprintf.c (snprintf): Handle size==0.
157 2004-10-01 Simon Josefsson <jas@extundo.com>
158 Bruno Haible <bruno@clisp.org>
160 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
161 (snprintf): Declare 'args'.
163 2004-09-30 Simon Josefsson <jas@extundo.com>
165 * snprintf.h, snprintf.c: New files.
167 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
169 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
170 (hol_entry_help): Never translate an empty string.
171 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
172 * argp.h (OPTION_NO_TRANS): New option.
174 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
176 * xvasprintf.c: Include xalloc.h.
177 (xvasprintf): Use xalloc_die, not xmalloc_die.
179 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
181 * dummy.c: Change copyright notice to FSF, and license to GPL.
183 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
185 * argp-pvh.c (argp_program_version_hook): Provide initial value.
186 Problem reported by Bruno Haible in:
187 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
189 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
191 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
192 in case some system header has #define'd it. Problem reported by
194 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
196 2004-09-08 Bruno Haible <bruno@clisp.org>
198 * stdint_.h.in: New file, taken from GNU clisp.
200 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
202 * xvasprintf.h: New file.
203 * xvasprintf.c: New file.
204 * xasprintf.c: New file.
206 2004-09-08 Bruno Haible <bruno@clisp.org>
208 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
210 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
212 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
214 Import from coreutils.
215 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
216 strings on unbounded length. alloca's performance benefits aren't
219 (parse_with_separator): New function, with most of the internals
220 of the old parse_user_spec. Allow user to omit both user and group,
221 for compatibility with FreeBSD.
222 Clone only the user name, not the entire spec.
223 Do not set *uid, *gid unless entirely successful.
224 Avoid memory leak in some failing cases.
225 Fix regression for USER.GROUP reported by Dmitry V. Levin in
226 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
227 (parse_user_spec): Rewrite to use parse_with_separator.
229 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
231 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
232 its complicated substitute.
233 * argp-help.c: Include <errno.h>, for program_invocation_short_name
234 and program_invocation_name.
235 (__argp_basename) [!_LIBC]: Remove; the only use was
236 replaced by its body.
237 (__argp_short_program_name): Change condition from
238 !defined __argp_short_program_name to
239 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
240 to match argp-namefrob.h.
241 (__argp_failure): Don't assume strerror_r returns char *.
242 * argp-parse.c (N_): Define unconditionally.
243 (argp_default_options): Fill out initializers with 0 to avoid
246 2004-08-12 Simon Josefsson <jas@extundo.com>
248 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
249 * getopt_.h: Renamed from getopt.h.
251 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
253 Merge from coreutils.
255 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
256 wmemchr or wmemcpy. Problem reported by Robert Dahlem
257 for Reliant Unix 5.43.
259 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
260 (union fooround): Use uintmax_t, not long int.
261 The rest is a merge from libc:
262 [defined _LIBC]: Include <shlib-compat.h>.
263 (_obstack) [defined _LIBC]: Remove after 2.3.4.
265 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
267 * strverscmp.c: Convert to UTF-8.
269 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
271 * obstack.h (obstack_empty_p):
272 Don't assume that chunk->contents is suitably aligned.
273 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
274 Likewise. Problem reported by Benno in
275 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
277 * chown.c (rpl_chown): Work even if the file is writeable but not
278 readable. This could be improved further but it'd take some work.
280 2004-08-08 Simon Josefsson <jas@extundo.com>
282 * xgethostname.c: Don't include error.h (not used).
285 * getpass.c: Include getpass.h first.
287 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
289 * xalloc-die.c: New files.
290 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
292 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
293 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
294 (_, N_, xalloc_die): Move to xalloc-die.c.
295 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
296 so that we needn't mess with xalloc_msg_memory_exhausted.
298 * sha1.h: Renamed from sha.h.
299 (SHA1_H): Renamed from _SHA_H.
300 (sha1_ctx): Renamed from sha_ctx.
301 (sha1_init_ctx): Renamed from sha_init_ctx.
302 (sha1_process_block): Renamed from sha_process_block.
303 (sha1_process_bytes): Renamed from sha_process_bytes.
304 (sha1_finish_ctx): Renamed from sha_finish_ctx.
305 (sha1_read_ctx): Renamed from sha_read_ctx.
306 (sha1_stream): Renamed from sha_stream.
307 (sha1_buffer): Renamed from sha_buffer.
308 * sha1.c: Likewise; renamed from sha.c.
309 Do not include <sys/types.h>.
310 Include <stddef.h> rather than <stdlib.h>.
312 2004-08-08 Bruno Haible <bruno@clisp.org>
314 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
315 FILESYSTEM_PREFIX_LEN.
316 * progreloc.c: Likewise.
317 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
319 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
322 * argp-help.c (make_hol, hol_append): Don't assume that
323 SIZE_MAX is a valid preprocessor constant.
324 (__argp_basename): Change from "#ifndef _LIBC"
325 to "#ifndef __argp_short_program_name", so that
326 we don't compile these functions for tar.
328 More merges from coreutils.
329 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
330 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
332 * addext.c: Remove; no longer needed.
333 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
334 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
335 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
336 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
337 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
338 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
339 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
340 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
341 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
342 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
343 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
344 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
345 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
346 Import changes from coreutils.
348 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
350 Merge from coreutils.
352 * .gdb-history: Remove; this doesn't belong here.
354 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
355 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
356 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
358 * dirname.h: Include <stdbool.h>.
359 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
360 for consistency with POSIX terminology. All uses changed.
361 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
362 (strip_trailing_slashes): Use bool for booleans.
363 * stripslash.c (strip_trailing_slashes): Likewise.
365 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
366 sometimes returns a positive errno value even when it succeeds.
367 (print_errno_message) [!LIBC]: Fall back on strerror if
370 * path-concat.c (mempcpy): Don't define if a system header defines it.
371 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
372 (longest_relative_suffix): New function.
373 (path_concat): Use it. Assume first argument is not NULL.
374 Port to DOS. Omit redundant separators.
375 Report an error instead of returning NULL.
376 Use mempcpy instead of memcpy.
377 (xpath_concat): Remove: not declared or used.
379 * same.h: Include <stdbool.h>
380 (same_name): Return bool, not int.
381 * same.c (same_name): Likewise.
382 (errno): Don't declare; we assume C89 or better now.
384 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
385 if not already defined.
387 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
388 * dup-safer.c (errno): Likewise.
390 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
392 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
395 2004-08-03 Simon Josefsson <jas@extundo.com>
397 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
398 * progname.h: Don't include stdbool.h.
400 2004-08-02 Simon Josefsson <jas@extundo.com>
402 * getsubopt.h: New file, with comments from Bruno Haible.
403 * getsubopt.c: New file, from glibc, but slightly modified based on
404 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
406 2004-08-01 Simon Josefsson <jas@extundo.com>
408 * xgetdomainname.c: Include stdlib.h, for free().
410 2004-07-16 Simon Josefsson <jas@extundo.com>
414 2004-07-16 Bruno Haible <bruno@clisp.org>
416 * backupfile.h: Add extern "C" for C++.
417 * closeout.h: Likewise.
418 * copy-file.h: Likewise.
419 * findprog.h: Likewise.
420 * full-write.h: Likewise.
421 * pathname.h: Likewise.
422 * progname.h: Likewise.
423 * stpcpy.h: Likewise.
424 * stpncpy.h: Likewise.
425 * strcase.h: Likewise.
426 * strstr.h: Likewise.
427 * xalloc.h: Likewise.
429 * mbswidth.h: Add extern "C" for C++.
430 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
432 2004-07-09 Simon Josefsson <jas@extundo.com>
434 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
435 failed without this.)
437 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
439 * fchown-stub.c: New file.
441 2004-06-24 Jim Meyering <jim@meyering.net>
443 * obstack.h (obstack_base): Cast to (void *), per documentation.
445 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
447 * argz.c, argz_.h: New files, which are autoupdated from libtool.
449 2004-06-01 Jim Meyering <jim@meyering.net>
451 * calloc.c: New file.
453 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
455 * getdate.y (yylex): Allow space between sign and number.
456 Problem reported by Dan Jacobson.
458 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
459 and Jim Meyering <jim@meyering.net>
461 Merge from coreutils CVS.
463 * stat-macros.h: New file, with contents from file-type.h
464 and coreutils' system.h.
465 * file-type.c: Include "stat-macros.h".
466 * file-type.h (file_type): Move all macro definitions to new file,
469 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
470 Wrap old code with this conditional.
471 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
472 function that does not dereference symlinks.
473 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
475 * xreadlink.c: Include xreadlink.h first, to catch .h file
477 (xreadlink): Accept new arg SIZE, for efficiency.
478 All decls and uses changed.
479 * xreadlink.h: Include <stddef.h>, for size_t.
481 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
482 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
484 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
486 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
488 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
489 macros to be defined.
490 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
491 the allocator returns NULL because the requested size is zero.
493 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
495 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
496 var. Add comment explaining why libc still defines it. This
497 merges the following patch from glibc:
498 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
500 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
502 * obstack.c (_obstack): Remove unused variable. It hasn't been
503 present in glibc since revision 1.1 of this file.
504 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
505 obstack_alignment_mask, obstack_alloc, obstack_base,
506 obstack_blank, obstack_blank_fast, obstack_chunk_size,
507 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
508 obstack_grow0, obstack_init, obstack_int_grow,
509 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
510 obstack_next_free, obstack_object_size, obstack_ptr_grow,
511 obstack_ptr_grow_fast, obstack_room): Remove declarations of
512 nonexistent functions.
514 2004-05-17 Derek R. Price <derek@ximbiot.com>
515 Paul Eggert <eggert@cs.ucla.edu>
517 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
519 2004-05-14 Bruno Haible <bruno@clisp.org>
521 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
522 that consists of a '.' followed by an empty digit string.
523 Patch by Tor Lillqvist <tml@iki.fi>.
525 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
527 Port obstack to the AS/400, where pointers are 16 bytes wide and
528 you cannot cast an integer to a valid pointer. This patch is
529 currently waiting to be integrated into glibc; see
530 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
532 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
533 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
534 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
535 (struct obstack): temp member is now a union of a pointer and
536 an integer, instead of an integer. All integer uses changed.
537 This does not affect the physical layout of struct obstack,
538 except on hosts (like the AS/400) where the size or alignment of
539 void * is greater than that of ptrdiff_t.
540 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
541 __STDC__)]: Store temporary in pointer member of union, not
543 * obstack.c: Include <stddef.h>, for offsetof.
544 (struct fooalign): Remove; it doesn't need a name.
545 (union fooround): Change double to long double, and add void *.
546 (DEFAULT_ALIGNMENT): Use offsetof to compute.
547 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
548 not a macro. Hence the values are always int; so remove all
549 casts-to-int in uses.
551 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
552 Derek Price <derek@ximbiot.com>
554 * alloca.c: Include <alloca.h>, to get our interface.
555 * alloca_.h: Use __alloca on AIX, so that we don't have to
556 include <alloca.h> first. Use C89 prototype for alloca; this
557 requires including <stddef.h> for size_t. Use extern "C" if C++.
558 Use #elif for simplicity, since we can assume C89 now.
559 Don't try to source the system alloca.h since it will not be found
560 and to prevent recursively including its replacement.
561 * fnmatch.c: Include <alloca.h> instead of opencoding.
562 * lib/regex.c: Likewise.
564 2004-05-16 Derek Price <derek@ximbiot.com>
565 Paul Eggert <eggert@cs.ucla.edu>
567 getline cleanup. This changes the getndelim2 API: both order of
568 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
571 * getline.c: Don't include stddef.h or stdio.h, since our
573 (getline): Always use getdelim, so that we don't have two
575 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
577 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
578 (GETNDELIM2_MAXIMUM): New macro.
579 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
580 instead of the old practice of delim2==0. All callers changed.
581 Return -1 on overflow, instead of returning junk.
582 Do not set *linesize unless allocation succeeds.
583 * getndelim2.h: Do not include stddef.h; no longer needed, now
584 that we include sys/types.h.
585 * getnline.h: Likewise.
586 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
587 (getndelim2): Reorder arguments.
588 * getnline.c (getnline, getndelim):
589 Don't discard the NMAX argument.
590 (getnline): Invoke getndelim, to avoid code duplication.
591 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
592 of (size_t) -1 by callers of the getnline family.
594 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
596 * nanosleep.c (suspended): Change its type from int to
597 sig_atomic_t volatile.
598 (first_call): Make it private to rpl_nanosleep, and have it
599 be zero initially as that's a bit faster.
600 (my_usleep): Round up fractional times instead of truncating them,
601 as this is the usual meaning for 'sleep'.
603 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
605 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
606 (ENOSYS): Define if not defined.
607 (settime): Fall back on stime if it exists and settimeofday fails.
608 But don't bother with fallbacks if a method fails with errno == EPERM.
610 2004-05-11 Jim Meyering <jim@meyering.net>
612 Prior to this change, the save_cwd caller required read access to the
613 current directory on most systems (ones with the fchdir function).
615 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
616 fails, try write-only, and finally, resort to using xgetcwd.
618 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
620 * obstack.c, obstack.h: Import changes from libc.
622 2004-04-28 Bruno Haible <bruno@clisp.org>
624 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
625 implicitly appends .exe to executables.
626 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
627 accepts Windows pathnames.
628 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
629 Cygwin like Windows, since it now accepts Windows pathnames.
630 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
631 Cygwin like Windows, since it now accepts Windows pathnames.
632 Reported by Derek Robert Price <derek@ximbiot.com>.
634 2004-04-20 Jim Meyering <jim@meyering.net>
636 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
638 2004-04-20 Jim Meyering <jim@meyering.net>
639 Bruno Haible <bruno@clisp.org>
641 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
642 memory when realloc fails.
644 2004-04-18 Jim Meyering <jim@meyering.net>
646 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
647 don't leak memory and do call END_UTMP_ENT.
649 2004-04-11 Paul Eggert <eggert@twinsun.com>
651 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
652 (CHAR_BIT): Remove, since we assume C89.
653 Include <stdint.h> if available, as per current Autoconf CVS advice.
655 2004-03-30 Paul Eggert <eggert@twinsun.com>
657 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
658 not bool, to be more consistent with Unix conventions.
659 Suggested by Bruno Haible.
661 Merge from coreutils.
663 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
666 * getdate.h: Include stdbool.h, and timespec.h instead of
667 the usual <time.h> dance.
668 (get_date): Change signature to support fractional time stamps.
670 * getdate.y: Include "getdate.h" first, as we can now
671 assume C89 and don't need to worry about 'const'.
672 Similarly, include "unlocked-io.h" near start, not in middle.
674 (textint.value): Use long int rather than int.
675 (textint.digits): Use size_t rather than int.
676 (BILLION, LOG10_BILLION): New constants.
677 (parser_control): New member rel_ns. Members day_ordinal,
678 time_zone, month, day, hour, minutes, rel_year, rel_month,
679 rel_day, rel_hour, rel_minutes, rel_seconds
680 are now long int, not int. Member seconds is now struct timespec,
681 not int. New member timespec_seen. Members dates_seen, days_seen,
682 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
684 (%union.intval): Now long int, not int.
686 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
687 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
688 (spec): Now is a timespec or an item list.
689 (timespec, items): New nonterminals.
690 (time, rel, relunit, number, get_date):
691 Add support for fractional seconds.
692 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
693 (gmtime, localtime, mktime): Remove decls; not needed with C89.
694 (to_hour): First arg is now long int, not int.
695 (to_year): Returns long int, not int.
696 Don't treat year -70 like 70.
697 (tm_diff): Returns long int, not int.
698 (lookup_word): Use bool instead of int when appropriate.
699 (yylex): Use size_t for count, not int.
700 Detect overflow when parsing large integer constants.
701 Add support for fractions.
702 (get_date): Make pointers 'const' if possible.
703 Use more-portable code to detect integer overflow.
704 (main) [TEST]: Adjust to above changes. Test for localtime failure.
705 Don't use ctime; it's not reliable if the year has >4 digits.
707 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
708 This is for compatibility with BSD.
710 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
711 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
712 From coreutils' system.h.
714 * userspec.c: Don't include "posixver.h".
715 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
716 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
717 compatible extension. Simplify code by removing a boolean int
718 that was always nonzero if a string was nonnull.
720 2004-03-30 Jim Meyering <jim@meyering.net>
722 Merge from coreutils.
724 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
726 * readtokens.c (readtoken): Don't leak 64 bytes when reading
727 an empty input stream.
729 * readtokens.c: Include <stdbool.h>.
730 (readtoken): Use `size_t' rather than int/long.
731 All callers adjusted.
732 Use `bool' rather than `int' where appropriate.
733 Use memset rather than an explicit loop.
734 Use x2nrealloc rather than xrealloc.
735 Allow the use of `\0' as a delimiter.
736 (readtokens): Likewise.
737 * readtokens.h (readtoken, readtokens): Update prototypes.
739 2004-03-30 Bruno Haible <bruno@clisp.org>
741 * getloadavg.c (getloadavg): Don't assume setlocale returns
744 2004-03-29 Paul Eggert <eggert@twinsun.com>
746 Merge changes to getloadavg.c from coreutils and Emacs.
748 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
749 Define to an expression, not to the empty string.
750 Include cloexec.h and xalloc.h.
751 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
752 Use set_cloexec_flag rather than rolling our own.
753 * cloexec.c, cloexec.h: New files.
755 2004-03-18 Paul Eggert <eggert@twinsun.com>
757 * getopt.h: Sync with libc CVS.
759 2004-03-18 Paul Eggert <eggert@twinsun.com>
760 Bruno Haible <bruno@clisp.org>
762 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
763 not on all platforms that have <wchar.h>.
764 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
766 2004-03-09 Paul Eggert <eggert@twinsun.com>
768 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
770 * getopt_int.h: New file, also synced from libc.
772 2004-03-07 Paul Eggert <eggert@twinsun.com>
774 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
775 '#if' expressions. Unlike the code it replaces, it does not
776 depend on (defined _SC_PAGESIZE). However, it does depend on
777 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
778 first reported by Jason Andrade in
779 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
781 2004-01-18 Simon Josefsson <jas@extundo.com>
783 * strdup.h: New file.
784 * strdup.c: Include it.
785 * path-concat.c: Include strdup.h. Drop strdup declaration.
786 * userspec.c: Include strdup.h. Drop strdup declaration.
788 2004-02-06 Karl Berry <karl@gnu.org>
790 * config.charset: update from gettext 0.14.1.
792 2004-02-05 Paul Eggert <eggert@twinsun.com>
794 Add comments and code, prompted by suggestions from Bruno Haible
796 * quotearg.h (quotearg_alloc): New decl. Improve the comments
797 describing the enum quoting_style values.
798 * quotearg.c (quotearg_alloc): New function.
799 (quotearg_buffer_restyled): Treat lone { and } as special.
800 Treat = as special. Work around bug with older shells
801 that "see" a '\' that is really the 2nd byte of a multibyte char.
802 Quote empty string with shell_quoting_style.
804 2004-02-03 Bruno Haible <bruno@clisp.org>
806 * pipe.h: New file, from GNU gettext.
807 * pipe.c: New file, from GNU gettext.
809 2004-01-27 Bruno Haible <bruno@clisp.org>
811 * execute.h: New file, from GNU gettext.
812 * execute.c: New file, from GNU gettext.
813 * w32spawn.h: New file, from GNU gettext.
815 2004-01-23 Paul Eggert <eggert@twinsun.com>
817 Exit-status fix from coreutils.
819 Use exit_failure consistently in place of EXIT_FAILURE,
820 so that program exit statuses are consistent on failure.
822 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
823 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
824 * argmatch.h: Comment fix to match the above.
825 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
826 Now a macro referring to exit_failure, instead of a separate
827 variable. Include "exitfail.h" to get it.
828 * xstrtol.h: Include "exitfail.h".
829 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
831 * long-options.c (parse_long_options): Use prototype
832 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
835 2004-01-21 Jim Meyering <jim@meyering.net>
837 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
838 so as not to conflict with a different-sized __mktime_internal
839 function in GNU libc.
840 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
841 Problem building statically-linked `ls' reported by Michael Brunnbauer.
843 2004-01-18 Paul Eggert <eggert@twinsun.com>
845 Merge from diffutils.
847 * file-type.c (file_type): Add typed memory objects.
848 * file-type.h (S_TYPEISTMO): New macro.
850 * c-stack.h (c_stack_action): Remove argv argument.
851 * c-stack.c (c_stack_action): Likewise. All uses changed.
852 (die): Don't calculate message unless segv_action returns.
853 (get_stack_location, min_address_from_argv, max_address_from_argv,
854 volatile stack_base, volatile_stack_size): Remove.
855 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
856 that every segmentation violation is a stack overflow. (Ouch!)
857 See Debian bug 136249 (still outstanding) for more info about why
858 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
860 2003-11-30 Bruno Haible <bruno@clisp.org>
862 Safer stack allocation.
863 * setenv.c: Include allocsa.h.
864 (alloca): Remove fallback definition.
865 (freea): Remove macro.
866 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
869 2003-10-17 Bruno Haible <bruno@clisp.org>
871 * binary-io.h: Avoid warnings on Cygwin.
873 2003-12-28 Bruno Haible <bruno@clisp.org>
875 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
876 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
878 2003-11-28 Bruno Haible <bruno@clisp.org>
880 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
882 2003-11-27 Bruno Haible <bruno@clisp.org>
884 * wait-process.c: On Windows, include windows.h. Needed on mingw.
886 2003-11-17 Bruno Haible <bruno@clisp.org>
888 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
890 2003-11-24 Bruno Haible <bruno@clisp.org>
892 * xallocsa.h: New file, from GNU gettext.
893 * xallocsa.c: New file, from GNU gettext.
895 2003-11-24 Bruno Haible <bruno@clisp.org>
897 * allocsa.h: New file, from GNU gettext.
898 * allocsa.c: New file, from GNU gettext.
900 2003-11-24 Bruno Haible <bruno@clisp.org>
902 * eealloc.h: New file.
904 2004-01-15 Jim Meyering <jim@meyering.net>
906 Merge from coreutils.
908 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
909 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
910 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
912 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
913 optional configure-time default.
915 * version-etc.c (version_etc_copyright): Update copyright date.
917 * xreadlink.c (xreadlink): Correct outdated comment.
919 2004-01-15 Paul Eggert <eggert@twinsun.com>
921 Merge from coreutils.
923 * posixver.c: Include posixver.h.
925 * same.c: Include <stdbool.h>, <limits.h>.
926 (_POSIX_NAME_MAX): Define if not defined.
928 (same_name): If file names are silently truncated, report
929 that the file names are the same if they are the same after
930 the silent truncation.
932 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
934 * xstrtod.c (xstrtod): Likewise. All callers changed to
935 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
938 2004-01-14 Paul Eggert <eggert@twinsun.com>
940 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
941 with like-named macro in fnmatch.c.
942 (EXT): Use an internal constant instead.
944 Merge fnmatch patches from glibc.
945 * fnmatch.c (mbsinit): Remove define.
946 Add libc_hidden_ver (__fnmatch, fnmatch).
947 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
948 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
950 2003-12-14 Karl Berry <karl@gnu.org>
952 * config.charset: update from gettext-runtime.
954 2003-12-03 Paul Eggert <eggert@twinsun.com>
956 * getgroups.c (getgroups): xmalloc takes one argument, not two.
957 Bug reported by Alfred M. Szmidt.
959 2003-11-29 Karl Berry <karl@gnu.org>
961 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
963 2003-11-23 Paul Eggert <eggert@twinsun.com>
964 Bruno Haible <bruno@clisp.org>
966 * printf-parse.h: Don't include sys/types.h.
967 (ARG_NONE): New macro.
968 (char_directive): Change type of *arg_index fields to size_t.
969 * printf-parse.c: Don't include sys/types.h.
970 (SSIZE_MAX): Remove macro.
971 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
972 Remove unnecessary overflow check.
973 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
976 2003-11-24 Paul Eggert <eggert@twinsun.com>
978 * alloca.c: Remove dependency on xalloc module.
979 (xalloc_die): Remove.
980 (memory_full) [!defined emacs]: New macro.
981 [!defined emacs]: Don't include xalloc.h.
982 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
983 address arithmetic overflows. Change datatypes a bit to avoid
986 2003-11-22 Jim Meyering <jim@meyering.net>
988 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
990 2003-11-17 Bruno Haible <bruno@clisp.org>
992 * vasnprintf.c (alloca): Remove fallback definition.
993 (freea): Remove definition.
994 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
995 Reported by Paul Eggert.
997 2003-11-17 Jim Meyering <jim@meyering.net>
999 On systems without utime and without a utimes function capable of
1000 dealing with a NULL struct utimbuf* argument, this utime replacement
1001 could -- in unusual circumstances -- leak a file descriptor.
1002 * utime.c: Include <unistd.h> and <errno.h>.
1003 (utime_null): Be sure to close `fd' and to preserve errno.
1004 Reported by Geoff Collyer via Arnold Robbins.
1006 2003-11-16 Paul Eggert <eggert@twinsun.com>
1007 Bruno Haible <bruno@clisp.org>
1009 Protect against address arithmetic overflow.
1010 * printf-args.h: Include stddef.h.
1011 (arguments): Change type of field 'count' to size_t.
1012 * printf-args.c (printf_fetchargs): Use size_t instead of
1013 'unsigned int' where appropriate.
1014 * printf-parse.h: Include sys/types.h.
1015 (char_directive): Change type of *arg_index fields to ssize_t.
1016 (char_directives): Change type of fields 'count', max_*_length to
1018 * printf-parse.c: Include sys/types.h and xsize.h.
1019 (SSIZE_MAX): Define fallback value.
1020 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
1021 instead of 'int' where appropriate. Check a_allocated, d_allocated
1022 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
1023 * vasnprintf.c: Include xsize.h.
1024 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
1025 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
1026 overflow. Avoid wraparound when converting a width or precision from
1029 2003-11-16 Bruno Haible <bruno@clisp.org>
1031 Update from GNU gettext.
1032 * printf-parse.c: Generalize to it can be compiled for wide strings.
1033 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
1034 * vasnprintf.c: Generalize to it can be compiled for wide strings.
1035 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
1036 SNPRINTF): New macros.
1037 Don't include <alloca.h> if the file is used inside libintl.
1038 (local_wcslen): New function, for Solaris 2.5.1.
1039 (VASNPRINTF): Use it instead of wcslen.
1041 2003-11-16 Bruno Haible <bruno@clisp.org>
1043 * xsize.h (xmax): New function.
1044 (xsum, xsum3, xsum4): Declare as "pure" functions.
1046 2003-11-12 Paul Eggert <eggert@twinsun.com>
1048 * xalloc.h: Do not include <limits.h> or <stdint.h>.
1049 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
1050 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
1051 heuristic is just as accurate as far as we know, and it removes a
1052 dependency on size_max.m4 and ptrdiff_max.m4.
1054 2003-11-12 Paul Eggert <eggert@twinsun.com>
1056 * xstrtol.c (__xstrtol): Remove "break" immediately after
1057 "return", to pacify some unknown compiler. Problem reported
1060 2003-11-11 Bruno Haible <bruno@clisp.org>
1062 * xsize.h (SIZE_MAX): Remove fallback definition.
1063 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
1066 2003-11-10 Paul Eggert <eggert@twinsun.com>
1068 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
1069 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
1070 rejected some allocations of exactly SIZE_MAX - 2 bytes.
1072 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
1073 not (size_t) -1, since it's defined here.
1075 2003-11-06 Paul Eggert <eggert@twinsun.com>
1077 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
1078 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
1079 Reject sizes of exactly SIZE_MAX bytes.
1080 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
1081 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
1083 2003-11-05 Bruno Haible <bruno@clisp.org>
1085 * xsize.h: Include limits.h, to avoid a possible collision with
1086 SIZE_MAX defined in <limits.h> on Solaris.
1088 2003-11-04 Bruno Haible <bruno@clisp.org>
1090 * xsize.h: New file.
1091 * linebreak.c: Include xsize.h.
1092 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
1093 argument for overflow.
1094 Suggested by Paul Eggert.
1096 2003-10-31 Bruno Haible <bruno@clisp.org>
1098 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
1099 to avoid (extremely rare) race condition.
1100 Suggested by Paul Eggert.
1102 2003-11-03 Jim Meyering <jim@meyering.net>
1104 * userspec.c: Include "userspec.h".
1105 * userspec.h: New file.
1107 2003-10-31 Paul Eggert <eggert@twinsun.com>
1109 * mountlist.h (struct mount_entry.me_type_malloced): New member.
1110 * mountlist.c (SIZE_MAX): Define if not defined already.
1111 (read_filesystem_list): Set and use me_type_malloced.
1112 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
1113 whatever the type happens to be), for brevity and consistency.
1114 Check for size calculation overflow on Alphas running OSF/1.
1116 2003-10-31 Jim Meyering <jim@meyering.net>
1118 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
1120 * linebuffer.c: Include <string.h> for declaration of memset.
1122 2003-10-30 Paul Eggert <eggert@twinsun.com>
1123 Bruno Haible <bruno@clisp.org>
1125 * vasprintf.c: Include <limits.h>, <stdlib.h>.
1126 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
1128 2003-10-29 Paul Eggert <eggert@twinsun.com>
1130 * xalloc.h (xalloc_oversized): Now a macro, not a function,
1131 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
1133 * quotearg.c (quotearg_n_options): Use it.
1134 * group-member.c: Include <stdbool.h>.
1135 (free_group_info): Arg is now const *; don't free arg.
1136 (get_group_info): Now returns bool and accepts struct group_info *,
1137 rather than returning a malloc'ed struct group_info *.
1138 All uses changed. Check for overflow in internal size calculation.
1140 * getusershell.c (readname): Simplify the code by using x2nrealloc
1141 rather than xmalloc/xrealloc.
1142 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
1143 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
1144 conformance bug: the old code used a pointer after freeing the
1145 storage that it addressed.
1146 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
1147 rather than doing it by hand.
1148 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
1149 the buffer preserved. Use free and xmalloc instead.
1150 * quotearg.c (quotearg_n_options): Likewise.
1151 Use a simpler test for size overflow. Don't use xalloc_oversized
1152 because unsigned int might be wider than size_t (!); this suggests
1153 that we should switch from unsigned int to size_t for slot numbers.
1155 2003-10-27 Bruno Haible <bruno@clisp.org>
1157 * stdbool_.h: Better support for BeOS.
1159 2003-10-27 Paul Eggert <eggert@twinsun.com>
1161 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
1162 to allocate the returned structure. Do not allocate a subarray,
1163 as x2nrealloc will do that.
1164 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
1165 instead of xnrealloc.
1166 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
1168 2003-10-26 Paul Eggert <eggert@twinsun.com>
1170 * xalloc.h (xalloc_oversized): New static inline function, for
1171 callers that want to do their own size-overflow checking. Include
1172 <stdbool.h>, since xalloc_oversized returns bool.
1173 * xalloc.c (array_size_overflow): Remove. All callers changed
1174 to use xalloc_oversized.
1176 Add two functions x2realloc, x2nrealloc, for programs that grow
1177 arrays dynamically by doubling their sizes.
1178 * xalloc.h (x2realloc, x2nrealloc): New decls.
1179 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
1182 Port to C99 semantics for 'inline' of external functions.
1183 Bug reported by Bruno Haible.
1184 * xmalloc.c (xnmalloc_inline): New static inline function,
1185 with the old contents of xnmalloc.
1186 (xnmalloc, xmalloc): Use it.
1187 (xnrealloc_inline): New static inline function,
1188 with the old contents of xnrealloc.
1189 (xnrealloc, xrealloc): Use it.
1191 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
1193 2003-10-25 Paul Eggert <eggert@twinsun.com>
1195 Fix several address-calculation bugs in the hash modules,
1196 plus some minor code cleanup.
1198 * hash.h: Include <stdbool.h>, for bool.
1199 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
1200 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
1201 hash_get_n_entries, hash_get_max_bucket_length,
1202 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
1203 hash_rehash): Use size_t rather than unsigned.
1204 * hash.c (struct hash_table, hash_get_n_buckets,
1205 hash_get_n_buckets_used, hash_get_n_entries,
1206 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
1207 hash_get_entries, hash_do_for_each, hash_string, is_prime,
1208 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
1210 (SIZE_MAX): Define if not defined.
1211 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
1212 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
1214 Use const * when possible.
1215 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
1216 (check_tuning): Fix bug: if tuning parameters were very close to
1217 0 or 1, rounding errors could have caused subscript violations.
1218 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
1219 (hash_initialize): Add 'fail:' label
1220 to free table and return NULL, and use it to simplify code.
1221 Use calloc rather than clearing the storage ourself.
1222 (hash_initialize, hash_rehash): Check for arithmetic overflow in
1223 buffer size calculations.
1224 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
1225 Include <stddef.h>, for size_t.
1226 * hash-pjw.c (hash_pjw): Likewise.
1227 Switch to method described by Bruno Haible.
1228 Include <limits.h>, for CHAR_BIT.
1229 (SIZE_BITS): New macro.
1231 2003-10-21 Paul Eggert <eggert@twinsun.com>
1233 * getndelim2.c (getndelim2): When size calculation overflows,
1234 ceiling the allocation at NMAX bytes rather than silently
1235 discarding input bytes before NMAX is reached. This makes
1236 a difference only if NMAX exceeds SIZE_MAX / 2.
1238 * obstack.c: Merge from glibc.
1239 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
1240 Add libc_hidden_def (_obstack_newchunk).
1241 (_obstack_free) [! defined _LIBC]: Remove.
1242 [defined _LIBC]: Make a strong alias from obstack_free, rather than
1243 a clone of the function body.
1244 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
1245 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
1247 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
1248 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
1251 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
1252 (obstack_ptr_grow_fast, obstack_int_grow_fast):
1253 Don't use lvalue casts, as GCC plans to remove support for them
1254 in GCC 3.5. Reported by Joseph S. Myers. This bug
1255 was also present in the non-GCC version, indicating that this
1256 code had always been buggy and had never been widely used.
1257 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
1258 Use the fast variant of each macro, rather than copying the
1259 definiens of the fast variant; that way, we'll be more likely to
1260 catch future bugs in the fast variants.
1262 2003-10-20 Bruno Haible <bruno@clisp.org>
1264 * wait-process.h: New file, from GNU gettext.
1265 * wait-process.c: New file, from GNU gettext.
1267 2003-10-19 Jim Meyering <jim@meyering.net>
1269 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
1271 2003-10-16 Paul Eggert <eggert@twinsun.com>
1273 * getgroups.c: Include <errno.h>, <stdlib.h>.
1274 (getgroups): First arg is int, not size_t.
1275 Don't let 'free' mangle errno.
1277 2003-10-16 Jim Meyering <jim@meyering.net>
1279 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
1281 2003-10-15 Paul Eggert <eggert@twinsun.com>
1283 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
1285 (new_exclude, add_exclude_file): Initial size no longer needs to
1287 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
1288 our own address arithmetic overflow checking.
1290 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
1291 (fnmatch): Do not alloca more than 2000 wide characters;
1292 instead, use malloc for large buffers.
1293 Check for address arithmetic overflow, and return -1
1294 with errno set to ENOMEM in that case.
1295 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
1296 (NEW_PATTERN): Do not alloca more than 8000 bytes;
1297 instead, return -1. Check for address arithmetic overflow.
1299 2003-10-14 Paul Eggert <eggert@twinsun.com>
1301 Handle invalid suffixes and overflow independently, so that
1302 callers can treat them independently as needed. Fix some bugs in
1303 suffix handling, e.g., "100k@" was not diagnosed as an invalid
1304 suffix for a human-readable blocksize. The major caller-visible
1305 change is the addition of a new
1306 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
1307 that both overflow and suffix chars were found.
1309 * human.c (humblock): Don't check separately for invalid suffix
1310 char; that is xstrtoumax's job (now that its bug is fixed).
1311 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
1312 INTMAX_MAX]: New macros.
1313 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
1314 TYPE_MAXIMUM): New macros.
1315 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
1316 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
1317 if overflow occurs, as it's what __strtol does and it's more useful
1319 (__xstrtol): If __strtol reports some error other than ERANGE,
1320 reflect it to the caller as LONGINT_INVALID. If it reports
1321 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
1322 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
1323 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
1325 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
1326 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
1327 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
1328 [defined UINTMAX_MAX]: New macros.
1330 2003-10-14 Bruno Haible <bruno@clisp.org>
1332 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
1333 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
1334 Also use volatile where needed.
1336 2003-10-12 Paul Eggert <eggert@twinsun.com>
1338 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
1339 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
1340 and define in terms of the other primitives.
1341 * xmalloc.c: Include stdbool.h; do not include exit.h.
1342 (SIZE_MAX): Define if not already defined.
1343 (array_size_overflow): New function.
1344 (xalloc_die): Abort instead of exiting if 'error' returns.
1345 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
1346 (xmalloc, xrealloc): Use them.
1347 (xcalloc): Check for address arithmetic overflow.
1348 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
1349 a bit faster than strcpy.
1351 2003-10-08 Paul Eggert <eggert@twinsun.com>
1353 Merge getpass from libc, plus a few fixes.
1355 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
1356 Include <stdbool.h>.
1357 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
1358 __fsetlocking to empty.
1359 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
1360 do include <bits/libc-lock.h>.
1361 Do not include <fcntl.h>; not needed.
1362 [_LIBC]: Include <wchar.h>.
1363 (NOTCANCEL_MODE): New macro.
1364 (flockfile, funlockfile) [_LIBC]: New macros.
1365 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
1366 [!_LIBC]: New macros.
1367 (call_fclose): New function.
1368 (getpass): Use it. Save tty stream separately; this simplifies the
1369 code and makes it more reliable if stdin happens to equal stdout.
1370 Invoke __fsetlocking on tty.
1371 Handle thread cancellation if needed.
1372 Namespace cleanup (use __tcgetattr, __getline).
1373 Use bool for Booleans.
1374 [USE_IN_LIBIO]: Handle wide streams.
1375 [!_LIBC]: Unconditionally do the fseek, since we don't know what
1376 stream might go where.
1378 * unlocked-io.h: Include <stdio.h>, so that the caller
1379 doesn't have to include <stdio.h> before us.
1380 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
1381 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
1382 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
1383 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
1384 if not declared, so that we can use getpass.c code from libc without
1386 (flockfile, ftrylockfile, funlockfile): New macros.
1388 2003-10-06 Bruno Haible <bruno@clisp.org>
1390 * version-etc-2.h: Remove file.
1391 * version-etc-2.c: Remove file.
1393 2003-09-25 Jim Meyering <jim@meyering.net>
1394 Bruno Haible <bruno@clisp.org>
1396 This lets translators provide better translations for the
1397 "Written by ..." part of --version output.
1398 * version-etc.h: Include stdarg.h.
1399 (version_etc_copyright): Declare as readonly.
1400 (version_etc): Make this function variadic with a NULL-terminated list
1401 of author name strings.
1402 (version_etc_va): New declaration.
1403 * version-etc.c: Include stdarg.h, stdlib.h.
1404 (version_etc_copyright): Declare as readonly.
1405 (version_etc_va): New function. Provide a different translatable string
1406 for each possible number of authors < 10. Abbreviate when there are 10
1408 (version_etc): Make this function variadic. Call version_etc_va.
1409 Suggestion from Gary V. Vaughan.
1411 * long-options.h (parse_long_options): Change prototype: the authors
1412 string is moved to the end and becomes variadic.
1413 * long-options.c: Include stdarg.h.
1414 (parse_long_options): Make this function variadic, too.
1415 Call version_etc_va, not version_etc.
1417 2003-10-06 Bruno Haible <bruno@clisp.org>
1419 * fatal-signal.h: New file, from GNU gettext.
1420 * fatal-signal.c: New file, from GNU gettext.
1422 2003-10-04 Karl Berry <karl@gnu.org>
1424 * argp*: update from libc.
1426 2003-10-01 Larry Jones <lawrence.jones@eds.com>
1428 * getpass.c (getpass): Use a no-op fseek when switching from input to
1429 output mode on the same stream.
1431 2003-09-29 Paul Eggert <eggert@twinsun.com>
1433 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
1434 Fix arg typo in previous patch.
1436 2003-09-28 Jim Meyering <jim@meyering.net>
1438 * error.c: Correct cpp indentation.
1440 2003-09-27 Paul Eggert <eggert@twinsun.com>
1442 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
1443 Omit the special code that used __typeof__, since we worry that
1444 it could be more trouble than it's worth. See:
1445 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
1446 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
1450 2003-09-26 Jim Meyering <jim@meyering.net>
1452 * error.c (error_tail): Move some declarations
1453 into inner scope where the local variables are used.
1455 2003-09-26 Bruno Haible <bruno@clisp.org>
1457 * stpncpy.h (gnu_stpncpy): New declaration.
1458 (stpncpy): Define as alias for gnu_stpncpy.
1459 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
1461 2003-09-26 Paul Eggert <eggert@twinsun.com>
1463 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
1464 (error_tail): Do not loop, reallocating temporary buffer, since
1465 the output cannot contain more wide characters than the input
1466 contains bytes, the size must be big enough already. This avoids
1467 one potential size overflow calculation. Check for size overflow
1468 when calculating temporary buffer size. Free temporary buffer
1469 when done, if it was allocated with malloc; this plugs a memory
1470 leak. Remove casts from void * to pointers, that are no longer
1471 needed now that we're assuming C89 or better.
1473 Merge error changes from glibc.
1475 * error.c, error.h: Update copyright notice header to match glibc.
1476 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
1477 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
1478 Disable cancellation while printing error.
1479 * error.h: Prepend __ to parameter names.
1481 2003-09-25 Karl Berry <karl@gnu.org>
1483 * argp-fmtstream.c, argp-help.c: update from libc.
1485 2003-09-25 Bruno Haible <bruno@clisp.org>
1487 * version-etc-2.h: New file, from version-etc.h with modifications.
1488 * version-etc-2.c: New file, from version-etc.c with modifications.
1490 2003-09-25 Simon Josefsson <jas@extundo.com>
1492 * xgetdomainname.h: New file.
1493 * xgetdomainname.c: New file.
1495 2003-09-25 Simon Josefsson <jas@extundo.com>
1496 Bruno Haible <bruno@clisp.org>
1498 * getdomainname.h: New file.
1499 * getdomainname.c: New file.
1501 2003-09-24 Paul Eggert <eggert@twinsun.com>
1503 * linebuffer.c (freebuffer): Don't free the argument, just
1504 the buffer associated with the argument. Bug reported by
1507 2003-09-19 Karl Berry <karl@gnu.org>
1509 * argp.h: update from libc.
1511 2003-09-16 Paul Eggert <eggert@twinsun.com>
1513 * linebuffer.c (readlinebuffer): Return NULL immediately upon
1514 input error, instead of returning NULL the next time we are called
1515 (and therefore losing track of errno).
1517 2003-09-15 Paul Eggert <eggert@twinsun.com>
1519 * getndelim2.c (getndelim2): Don't trash errno when a read
1520 fails, so that the caller gets the proper errno.
1522 * readutmp.c (read_utmp): Likewise.
1523 Check for fstat error. Close stream and free storage
1526 2003-09-14 Bruno Haible <bruno@clisp.org>
1528 * fwriteerror.h: New file.
1529 * fwriteerror.c: New file.
1531 2003-09-14 Jim Meyering <jim@meyering.net>
1533 * getloadavg.c: Correct cpp indentation.
1534 * strdup.c: Likewise.
1535 * vasnprintf.c: Likewise.
1537 2003-09-12 Paul Eggert <eggert@twinsun.com>
1539 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
1540 * obstack.c [!defined _LIBC]: Likewise.
1541 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
1542 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
1543 * exitfail.c: Don't include stdlib.h; no longer needed.
1545 More changes to assume C89 or better.
1547 * error.c (error_tail): Assume vprintf.
1549 * argmatch.c (getenv): Remove decl.
1550 * progreloc.c (get_full_program_name): Define via prototype.
1551 * setenv.c (clearenv): Likewise.
1552 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
1554 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
1555 (malloc, memcpy): Remove decls.
1556 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
1557 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
1558 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
1559 (memcpy): Remove macro.
1560 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
1561 (__P): Remove. All uses removed.
1562 (PTR): Remove. All uses changed to void *.
1563 (CHAR_BIT, NULL): Remove.
1564 (spaces, zeros, memset_space, memset_zero)
1565 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
1567 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
1568 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
1569 Define with prototype.
1570 Remove now-unnecessary prototype decl.
1571 (extra_args_spec): Assume ANSI C. All uses changed.
1572 (extra_args_spec_iso): Remove.
1573 (my_strftime, emacs_strftimeu): Define via prototype.
1574 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
1576 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
1577 * strtoimax.c: Include <stdlib.h> unconditionally.
1578 (strtoul, strtol): Remove decls.
1579 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
1581 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
1582 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
1583 (LOCALE_PARAM_PROTO): New macro.
1584 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
1585 (INTERNAL (strtol), strtol): Define with a prototype.
1586 (PARAMS): Remove. All uses removed.
1587 * tempname.c: Include <string.h> unconditionally.
1588 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
1589 * xgethostname.c (main): Define with a prototype.
1590 * xmalloc.c: Include "xalloc.h" first, to check interface.
1591 Include <stdlib.h> unconditionally.
1592 (calloc, malloc, realloc, free): Remove decls.
1593 * xstrtod.c: Include "xstrtod.h" first, to check interface.
1594 Include <stdlib.h> unconditionally. Sort include file names.
1596 (xstrtod): Define with a prototype.
1597 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
1598 (strtol, strtoul): Remove decls.
1600 2003-09-11 Paul Eggert <eggert@twinsun.com>
1602 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
1603 Include <stdlib.h>, <string.h> unconditionally.
1604 Remove now-unnecessary cast to char *.
1605 * strnlen.c: Include <string.h> unconditionally.
1606 * yesno.c (yesno): Define with a prototype.
1608 2003-09-10 Bruno Haible <bruno@clisp.org>
1610 * strcspn.c: Include <string.h> unconditionally.
1611 * strpbrk.c: Include <string.h> unconditionally.
1612 * strstr.c: Include <string.h> unconditionally.
1613 * unicodeio.c: Include <string.h> unconditionally.
1614 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
1615 * unsetenv.c: Likewise.
1616 * xreadlink.c: Include <stdlib.h> unconditionally.
1617 * yesno.c: Include <stdlib.h> unconditionally.
1618 (rpmatch): Add prototype.
1620 2003-09-10 Jim Meyering <jim@meyering.net>
1622 * error.c: Correct indentation of cpp directives.
1624 2003-09-09 Paul Eggert <eggert@twinsun.com>
1628 * acosl.c (main): Use a prototype.
1629 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
1632 * getloadavg.c (getloadavg, main): Define via prototypes.
1634 * getopt.h (struct option.name): Assume C89, and use 'const'.
1635 (getopt, etopt_long, getopt_long_only, _getopt_internal)
1636 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
1638 * getopt.c (const): Remove macro.
1639 Include <string.h> unconditionally.
1640 (my_index): Remove; all uses changed to strchr.
1641 (strlen): Remove decl.
1642 (exchange): Remove forward decl; no longer needed.
1643 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
1644 Define with prototype.
1645 * getopt1.c (const): Remove macro.
1646 (getopt_long, getopt_long_only, main): Define with prototype.
1648 * getugroups.c: Include <string.h> unconditionally.
1650 * getusershell.c: Include <stdlib.h> unconditionally.
1651 (getusershell, setusershell, endusershell, readname, main):
1652 Define with prototypes.
1654 * group-member.c: Include group-member.h first.
1655 Include <stdlib.h> unconditionally.
1657 * hard-locale.c: Include hard-locale.h first.
1658 Include <stdlib.h>, <string.h> unconditionally.
1660 * hash.c (free, malloc): Remove decls.
1661 Include <stdlib.h> unconditionally.
1663 * human.c: Include <stdlib.h>, <string.h> unconditionally.
1664 (getenv): Do not declare.
1666 * idcache.c: Include <string.h> unconditionally.
1668 * long-options.c: Include long-options.h first, to test interface.
1669 Include <stdlib.h> unconditionally.
1671 * makepath.c: Include makepath.h first, to test interface.
1672 Include <stdlib.h> and <string.h> unconditionally.
1674 * linebuffer.c: Include <stdlib.h>.
1675 (free): Remove decl.
1677 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
1678 rpl_malloc returns void *, not char *.
1679 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
1681 * md5.h: Include <limits.h> unconditionally.
1682 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
1683 (__P): Remove; all uses removed.
1684 * md5.c: Include "md5.h" first.
1685 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
1686 md5_buffer, md5_process_bytes, md5_process_block):
1687 Define with prototypes.
1688 * sha.h (__P): Remove all uses. (It wasn't defined??)
1689 * sha.c: Include "sha.h" first.
1690 Include <stdlib.h>, <string.h> unconditionally.
1692 * memchr.c (__ptr_t): Remove; all uses changed to void *.
1693 * memcmp.c (__ptr_t): Likewise.
1694 * memrchr.c (__ptr_t): Likewise.
1695 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
1696 Include <string.h> unconditionally.
1697 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
1698 * memchr.c: Include <stdlib.h> unconditionally.
1699 * memchr.c (LONG_MAX): Remove.
1700 * memrchr.c (LONG_MAX): Likewise.
1701 * memchr.c (__memchr): Define via a prototype.
1702 * memrchr.c (__memrchr): Likewise.
1703 * memcmp.c (__P): Remove, and remove all uses.
1704 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
1705 Remove forward decls; no longer needed.
1706 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
1707 Use types required by C89 in prototype.
1709 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
1710 * savedir.c: Likewise.
1711 * mkdir.c (free): Remove decl.
1712 * rmdir.c (rmdir): Define with a prototype.
1713 * savedir.c: Include savedir.h first, to test interface.
1715 * mktime.c (STDC_HEADERS): Remove.
1716 Include <stdlib.h>, <string.h> unconditionally.
1718 * modechange.c: Include <stdlib.h> unconditionally.
1719 (malloc): Remove decl.
1721 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
1722 (free): Remove decl.
1724 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
1725 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
1726 (This type really should be intptr_t, but that's a C99ism.)
1727 (_obstack_memcpy): Remove: all uses changed to memcpy.
1728 Include <string.h> unconditionally.
1729 (struct obstack): Assume __STDC__ for types of members
1730 chunkfun, freefun, extra_arg.
1731 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
1732 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
1733 obstack_begin, obstack_specify_allocation,
1734 obstack_specify_allocation_with_arg, obstack_chunkfun,
1735 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
1736 Remove unprototyped decls and the macros that use them.
1737 * obstack.c (POINTER): Remove. All uses changed to void *.
1738 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
1739 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
1740 (defined __STDC__ && __STDC__)]:
1741 Remove nonprototyped code.
1742 Include <stdlib.h> unconditionally.
1743 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
1744 _obstack_allocated_p, _obstack_free, obstack_free,
1745 _obstack_memory_used, print_and_abort):
1746 Define using prototypes.
1747 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
1748 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
1749 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
1750 obstack_next_free, obstack_object_size, obstack_room) [0]:
1751 Remove unused, unprototyped code.
1753 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
1755 * physmem.c (physmem_total, physmem_available, main): Define
1758 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
1759 (main): Define with a prototype.
1761 * posixver.c (getenv): Remove decl.
1763 * putenv.c (malloc): Returns void *, not char *.
1764 Include <string.h> unconditionally.
1765 (strchr, memcpy, NULL): Do not define.
1767 * readtokens.c: Include readtokens.h first, to test interface.
1768 Include <stdlib.h>, <string.h> unconditionally.
1769 (init_tokenbuffer): Define with a prototype.
1771 * regex.c (PARAMS): Remove. All uses removed.
1772 All uses of _RE_ARGS removed, too.
1773 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1775 (bzero): Assume memset exists.
1776 (memcmp, memcpy, NULL): Remove.
1777 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
1778 char, or assignments to local vars of type signed char.
1779 (init_syntax_once, PREFIX(extract_number_and_incr),
1780 PREFIX(print_partial_compiled_pattern),
1781 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
1782 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
1783 PREFIX(regex_grow_registers), PREFIX(regex_compile),
1784 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
1785 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
1786 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
1787 wcs_compile_range, byte_compile_range, truncate_wchar,
1788 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
1789 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
1790 count_mbs_length, wcs_re_match_2_internal,
1791 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
1792 PREFIX(alt_match_null_string_p),
1793 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
1794 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
1795 regfree, PREFIX(extract_number)): Define with prototype. Remove
1796 now-unnecessary declaration, if any.
1797 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
1799 Remove now-unnecessary casts among pointer types.
1800 * regex.h (_RE_ARGS): Remove. All uses removed.
1802 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
1803 (free): Remove decl.
1805 * rpmatch.c: Include <stdlib.h> unconditionally.
1807 * same.c: Include <stdlib.h>, <string.h> unconditionally.
1808 (free): Remove decl.
1810 * save-cwd.c: Include <stdlib.h> unconditionally.
1811 * xgetcwd.c: Likewise.
1813 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
1814 (free): Remove decl.
1816 * strchrnul.c (strchrnul): Define with a prototype.
1817 Fix bug: c_in was not converted to char before searching.
1819 The following changes are not K&R related:
1821 * group-member.h: Include <sys/types.h>, so that this file is
1823 * makepath.h: Likewise.
1825 * getusershell.c (readname, default_index, line_size, readname):
1826 Use size_t, not int, for sizes.
1827 (readname): If the size overflows, report an error instead of
1830 2003-09-09 Derek Robert Price <derek@ximbiot.com>
1832 * getndelim2.c: Assume stdlib.h per the C89 spec.
1834 2003-09-08 Paul Eggert <eggert@twinsun.com>
1836 Assume C89 or better; remove K&R cruft.
1837 A few of these changes were first proposed by Derek Robert Price
1838 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
1840 * addext.c: Include <string.h> unconditionally.
1841 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
1842 Don't declare getenv or malloc.
1844 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
1845 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
1847 (find_stack_direction, alloca): Use prototypes.
1849 * atexit.c (atexit): Define using a prototype.
1851 * basename.c, dirname.c, stripslash.c:
1852 Include <string.h> unconditionally.
1854 * bcopy.c: Include <stddef.h>.
1855 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
1857 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
1859 * error.h (error, error_at_line, error_print_progname)
1860 [! (defined (__STDC__) && __STDC__)]: Remove decls.
1861 * error.c: Include error.h first, to check interface.
1862 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1863 (VA_START): Remove; all uses changeed to va_start.
1864 (exit, strerror): Remove decls.
1865 (error_print_progname): Prototype uncondionally.
1866 Don't include <errno.h>; no longer needed.
1867 (private_strerror): Remove.
1868 (error_tail): Always define.
1869 (error, error_at_line): Assume C89 or better; always use prototypes.
1870 * fatal.c: Include "fatal.h" first, to test interface.
1871 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1872 (VA_START): Remove; all uses changed to va_start.
1873 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
1875 (exit): Remove decl.
1876 (fatal): Prototype unconditionally. Assume va_start works.
1877 Abort at end, to pacify gcc.
1879 * euidaccess.c (main): Define with a prototype.
1881 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
1883 * exitfail.c: Include <stdlib.h> unconditionally.
1885 * fnmatch_.h (__P): Remove. All uses changed to assume
1887 * fnmatch.c: Include fnmatch.h first, to test interface.
1888 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
1889 (getenv): Remove decl.
1890 (fnmatch): Define using a prototype.
1891 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
1892 (FCT): Define using a prototype.
1894 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
1896 * gethostname.c: Include <stddef.h>.
1897 (gethostname): Define with prototype. Length is size_t, not int.
1899 2003-09-08 Paul Eggert <eggert@twinsun.com>
1901 * getversion.c: Remove; was migrated to backupfile.c in 1997.
1902 getversion.c should have been removed then, but was accidentally
1905 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
1906 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
1908 2003-09-07 Paul Eggert <eggert@twinsun.com>
1910 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
1911 copy_tm_result. Bug reported by Simon Josefsson in
1912 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
1914 2003-09-06 Paul Eggert <eggert@twinsun.com>
1916 * time_r.c, time_r.h: New files.
1918 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
1920 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
1921 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
1923 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
1925 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
1926 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
1929 * timegm.c: Switch to glibc implementation, with the following changes:
1930 [defined HAVE_CONFIG_H]: Include <config.h>.
1931 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
1932 (__mktime_internal) [!defined _LIBC]: New decl.
1933 (__gmtime_r) [!defined _LIBC]: New macro and function.
1934 (timegm): Use a prototype, since gnulib assumes C89.
1935 Do not bother declaring tmp to be const, as it's not really usefu.
1936 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
1937 (timegm): Declare only if HAVE_DECL_TIMEGM.
1939 2003-09-03 Paul Eggert <eggert@twinsun.com>
1941 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
1942 Bug reported by Lute Kamstra in
1943 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
1945 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
1946 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
1947 course with correspondingly smaller numbers for tomorrow and
1948 yesterday. From Tadayoshi Funaba. Originally installed into
1949 sh-utils on 1999-08-07, but the patch got lost (I guess during the
1952 2003-08-31 Simon Josefsson <jas@extundo.com>
1954 * timegm.h: New file.
1955 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
1957 2003-08-31 Karl Berry <karl@gnu.org>
1959 * argp.h: update from libc.
1961 2003-08-28 Bruno Haible <bruno@clisp.org>
1963 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
1964 warning on QNX, which defines O_BINARY to 000000.
1966 2003-08-24 Bruno Haible <bruno@clisp.org>
1968 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
1969 MSVC7 <stdio.h> is included later.
1971 2003-08-20 Bruno Haible <bruno@clisp.org>
1973 * progname.h: New file, from GNU gettext.
1974 * progname.c: New file, from GNU gettext.
1975 * progreloc.c: New file, from GNU gettext.
1977 2003-08-19 Bruno Haible <bruno@clisp.org>
1979 * xstrdup.c: Assume <string.h> exists.
1981 2003-08-18 Jim Meyering <jim@meyering.net>
1983 * setenv.h: Indent nested cpp directive.
1984 * vasnprintf.c: Remove trailing blanks.
1986 2003-08-17 Simon Josefsson <jas@extundo.com>
1987 Bruno Haible <bruno@clisp.org>
1989 * xstrndup.h: New file.
1990 * xstrndup.c: New file.
1992 2003-08-17 Bruno Haible <bruno@clisp.org>
1994 * strndup.h: New file.
1996 2003-08-16 Paul Eggert <eggert@twinsun.com>
1998 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
1999 space, undoing this 2003-08-12 change:
2000 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
2002 2003-08-16 Jim Meyering <jim@meyering.net>
2004 Merge from coreutils.
2005 * xstrtoimax.c: #else #if -> #elif.
2006 * xstrtoumax.c: Likewise.
2008 2003-08-15 Paul Eggert <eggert@twinsun.com>
2010 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
2011 rather than tab, after '#' in shell-script copyright notices.
2012 Suggested by Bruno Haible.
2014 2003-08-15 Jim Meyering <jim@meyering.net>
2015 and Paul Eggert <eggert@twinsun.com>
2017 Merge from coreutils.
2018 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
2019 member but strut utmpx does not. Needed for AIX 4.3.3.
2020 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
2022 2003-08-15 Jim Meyering <jim@meyering.net>
2024 Merge from coreutils.
2025 * xgethostname.c: Include <stdlib.h>.
2026 (xghostname): Don't exit for anything other than memory-related
2027 failure; just return NULL.
2028 * userspec.c: Include "posixver.h".
2029 (parse_user_spec): Accept `.' as a separator only
2030 in pre-POSIX-200112 mode.
2031 * strtoimax.c: Use #elif rather than #else #if.
2032 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
2033 Remove function, now that we can rely on a working tzset function.
2034 [!_LIBC]: Ensure that the required autoconf test has been run.
2035 [!defined _NL_CURRENT && HAVE_STRFTIME]:
2036 Use underlying_strftime for %r.
2037 * sha.c: Merge in some clean-up and optimization changes from glibc.
2038 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
2039 Ensure that it is a multiple of 64.
2040 Rearrange loop exit tests so as to avoid performing an
2041 additional fread after encountering an error or EOF.
2042 * realloc.c: Update copyright date.
2044 2003-08-14 Jim Meyering <jim@meyering.net>
2046 Merge from coreutils.
2047 * obstack.h: Whitespace changes.
2048 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
2049 and xcalloc return values.
2050 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
2051 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
2052 hang on OSF/1 5.1 for DIR on both local and remote file systems.
2053 Reported by (and fix confirmed by) Nelson H. F. Beebe.
2054 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2056 Use mntctl's return value to drive the entry-processing loop, since
2057 we can't rely on the value of the vmt_length member in the last
2058 entry. On some systems doing so could result in exhausting
2059 virtual memory. Based in part on a patch from Mike Jetzer.
2061 2003-08-14 Jim Meyering <jim@meyering.net>
2062 and Paul Eggert <eggert@twinsun.com>
2064 Merges from coreutils, plus other fixes.
2065 * physmem.c: Merge in portability changes from gcc/libiberty
2066 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
2067 for credits and details. Thanks to Kaveh Ghazi for helping
2068 to keep these files in sync.
2069 (ARRAY_SIZE): Define it.
2070 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
2071 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
2072 (memcasecmp): Don't assume size_t fits in unsigned int.
2073 Remove casts and duplicate code.
2074 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
2075 (memcpy): Remove definition.
2076 Merge in some clean-up and optimization changes from glibc.
2077 [BLOCKSIZE]: Move definition to top of file.
2078 Ensure that it is a multiple of 64.
2079 Rearrange loop exit tests so as to avoid performing an
2080 additional fread after encountering an error or EOF.
2081 * md5.h (md5_uintptr): Define.
2082 * makepath.c (CLEANUP_CWD): Report an error if we failed to
2083 return to the initial working directory. Preserve errno
2085 * idcache.c: Include "xalloc.h".
2086 (xmalloc, xrealloc): Remove decls.
2087 (getuser): Remove casts no longer required in C89.
2088 * human.c: Include stdio.h, for sprintf.
2089 * group-member.c: Include "xalloc.h".
2090 (xmalloc, xrealloc): Remove decls.
2091 (get_group_info): Remove casts no longer required in C89.
2092 * getusershell.c (readname): Remove casts no longer required in C89.
2093 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
2094 * getline.c: Whitespace fix, from coreutils.
2096 2003-08-13 Paul Eggert <eggert@twinsun.com>
2098 * exclude.c: Include <ctype.h>
2099 (IN_CTYPE_DOMAIN): New macro.
2101 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
2104 * argp-help.c, argp-parse.c, config.charset, getopt.h:
2105 Undo previous (whitespace-only) change.
2107 2003-08-12 Paul Eggert <eggert@twinsun.com>
2109 * argp-help.c, argp-parse.c, config.charset, getopt.h:
2110 Normalize leading white space and remove trailing white space.
2111 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
2112 notice, as per ../config/srclist-update.
2114 Merge from coreutils.
2115 * euidaccess.h: New file.
2116 * euidaccess.c: Include it.
2117 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
2118 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
2119 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
2121 2003-08-11 Bruno Haible <bruno@clisp.org>
2123 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
2124 (vasnprintf): Use it instead of wcslen.
2126 2003-08-11 Bruno Haible <bruno@clisp.org>
2128 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
2129 value to ensure that _Bool promotes to int. Use #define for _Bool when
2130 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
2132 2003-08-10 Karl Berry <karl@gnu.org>
2134 * regex.h: update from libc (whitespace fix).
2136 2003-08-09 Paul Eggert <eggert@twinsun.com>
2138 Merge some files from coreutils. These changes were
2139 originally made by Jim Meyering.
2140 * acl.c: Include <sys/types.h> before <sys/stat.h>;
2141 many older Unixes require this.
2142 * alloca.c (alloca): Remove cast to argument of free;
2143 no longer needed in C89.
2144 * alloca_.h, regex.h: Fix white space to match
2145 what GNU indent does.
2147 2003-08-05 Paul Eggert <eggert@twinsun.com>
2149 * bumpalloc.h: Remove.
2151 2003-08-04 Paul Eggert <eggert@twinsun.com>
2153 * getloadavg.c: Change copyright notice and spacing to conform to
2156 Merge from coreutils.
2157 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
2159 * getdate.y (date): Also accept dates like May-23-2003; suggestion
2160 from Karl Berry, implemented by Jim Meyering.
2161 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
2162 from Dmitry V. Levin.
2163 Remove anachronistic cast of xrealloc.
2164 * fnmatch_.h (__const): Remove. Use 'const'.
2165 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
2166 type. Otherwise, it wouldn't compile with at least /bin/cc on
2167 ymp-cray-unicos9.0.2.X.
2168 Combine two mostly-identical uses of alloca into one.
2169 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
2171 2003-08-04 Dave Love <d.love@dl.ac.uk>
2175 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
2176 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
2177 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
2178 obsolete NLIST_NAME_UNION.
2179 [__GNU__]: Undef BSD and FSCALE.
2180 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
2182 2003-08-03 Paul Eggert <eggert@twinsun.com>
2184 * stdbool_.h (_Bool): Make it signed char, instead of
2185 an enum type, so that it's guaranteed to promote to int. See:
2186 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
2188 2003-07-31 Paul Eggert <eggert@twinsun.com>
2190 * strerror.c: Include config.h, limits.h. Declare sprintf.
2191 (strerror): Don't assume that a printable int fits in 14 bytes.
2193 2003-07-24 Derek Robert Price <derek@ximbiot.com>
2194 Bruno Haible <bruno@clisp.org>
2196 * getline.h (getline, getdelim): Change return type to ssize_t.
2197 * getline.c (getline, getdelim): Likewise.
2198 Remove _GNU_SOURCE define; now it's defined in config.h through
2201 2003-07-22 Paul Eggert <eggert@twinsun.com>
2203 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
2204 over-parenthesization in macros.
2206 Sync with coreutils.
2208 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
2211 Use `exit_failure' for xalloc and xmemcoll instead of their own
2212 private exit-failure variables.
2213 * xalloc.h (xalloc_exit_failure): Remove.
2214 * xmalloc.c: Likewise. Include exitfail.h.
2215 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
2216 * xmemcoll.h (xmemcoll_exit_failure): Remove.
2217 * xmemcoll.c: Likewise. Include exitfail.h.
2218 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
2220 2003-07-18 Paul Eggert <eggert@twinsun.com>
2222 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
2223 * closeout.c: Likewise. Include "closeout.h" right after config.h,
2224 to test that it can stand by itself. Include "exitfail.h".
2225 Clients should set exit_failure instead.
2226 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
2228 2003-07-18 Andreas Schwab <schwab@suse.de>
2230 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
2232 2003-07-18 Bruno Haible <bruno@clisp.org>
2234 * getndelim2.h: New file.
2235 * getndelim2.c: Make into a module of its own. Include config.h,
2237 (getndelim2): Make non-static. Change return type to ssize_t.
2238 * getline.h: Change argument names.
2239 * getline.c: Include getndelim2.h instead of getndelim2.c.
2240 * getnline.c: Include getndelim2.h.
2242 2003-07-17 Bruno Haible <bruno@clisp.org>
2244 * Makefile.am: Remove file.
2245 * Makefile.in: Remove file.
2247 2003-07-17 Bruno Haible <bruno@clisp.org>
2249 * getnline.h: New file.
2250 * getnline.c: New file.
2251 * getndelim2.c: New file, extracted from getline.c.
2252 (getndelim2): Renamed from getdelim2, with added nmax argument.
2253 * getline.c: Include getndelim2.c.
2254 (getdelim2): Moved out to getndelim2.c.
2255 (getline, getdelim): Update.
2257 2003-07-15 <karl@gnu.org>
2259 * vasnprintf.c: update from gettext.
2261 2003-07-15 Jim Meyering <jim@meyering.net>
2263 * makepath.c (make_path): Enclose diagnostic in _(...).
2265 2003-07-14 Paul Eggert <eggert@twinsun.com>
2267 * asnprintf.c, asprintf.c, config.charset, gettext.h,
2268 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
2269 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
2270 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
2271 vasprintf.c, vasprintf.h: Regenerate. These files are now being
2272 updated automatically by ../config/srclist-update. This changes
2273 their license from LPGL to GPL.
2275 2003-07-14 Jim Meyering <jim@meyering.net>
2277 Don't emit diagnostics. Let callers do that.
2278 * save-cwd.c: Don't include "error.h".
2279 (save_cwd): Don't call error. Ensure that errno is valid
2280 when returning nonzero.
2282 * save-cwd.h (restore_cwd): Update prototype.
2283 * save-cwd.c (restore_cwd): Remove two parameters.
2284 Simplify. Don't call error upon failure. Let callers do that.
2285 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
2286 when auditing is enabled. But don't bother updating the #if.
2288 2003-07-14 Simon Josefsson <jas@extundo.com>
2290 * mempcpy.h: New file.
2291 * mempcpy.c: New file.
2293 2003-07-14 Paul Eggert <eggert@twinsun.com>
2295 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
2296 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
2297 unicodeio.c, unicodeio.h, unlocked-io.h:
2298 Switch from LGPL to GPL.
2300 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
2302 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
2303 it breaks C++ compilation.
2304 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
2306 2003-07-10 Jim Meyering <jim@meyering.net>
2308 * vasnprintf.c: Remove trailing blanks.
2309 Make cpp indentation consistent.
2311 2003-07-09 Paul Eggert <eggert@twinsun.com>
2313 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
2314 posixver.c, strftime.c, strnlen.c, strverscmp.c:
2315 Switch from LGPL to GPL.
2317 2003-07-07 Paul Eggert <eggert@twinsun.com>
2319 * mktime.c: Fix some boundary cases and remove need for floating point.
2321 Issue a compile-time diagnostic if time_t is floating point, or if
2322 two's complement arithmetic is not in effect, or if arithmetic
2323 right shift does not propagate the sign. These assumptions were
2324 all in the original code but they weren't checked.
2326 (TIME_T_MIDPOINT, verify): New macros.
2327 (__isleap): Remove; it has integer overflow problems.
2328 (leapyear): New function, without those problems.
2329 (ydhms_tm_diff): Remove; splitting into two parts.
2330 (ydhms_diff): New function, containing the arithmetic part of
2331 the old ydhms_tm_diff function. Issue a compile-time
2332 diagnostic if we are not using C99 integer division.
2333 Avoid casts when possible.
2334 (guess_time_tm): New function, containing the checking part of
2335 the old ydhms_tm_diff function. Return the new value, rather than
2336 the difference between it and the old. Accept a new argument T
2337 so that *T specifies the old value. Check for overflow in the result.
2339 (__mktime_internal): Use a time_t offset, not a long int offset.
2340 This undoes the 2003-06-04 change, which is no longer needed now
2341 that we have better overflow checking.
2342 (localtime_offset): Likewise.
2344 (__mktime_internal): Avoid harmful overflow on hosts where time_t
2345 and long are 64-bit but int is only 32-bit.
2346 (ydhms_diff): Use long int to store year1 and yday1.
2347 Issue a compile-time diagnostic if long int is not wide enough.
2349 (__mktime_internal): Use long int to store adjusted year and yday.
2350 Use plain C rather than preprocessor commands, if that doesn't
2352 Check for overflow (and try to repair) after each probe
2353 rather than checking only at the very end. This avoids some bugs
2354 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
2355 does not equal GMT offset at maximum time).
2356 Use integer to check for overflow rather than floating point; this
2357 is more portable to non-IEEE hosts, and is a tad faster.
2358 When we detect that we are oscillating between two values,
2359 don't check whether tm_isdst has the requested value, since
2360 we already know the answer. When tm_isdst has the wrong value,
2361 use a different heuristic to find the right one, based on the
2362 extreme values actually observed in practice in tz2003a,
2363 rather than the (overly optimistic) "previous 3 calendar quarters".
2365 (not_equal_tm, print_tm, check_result): Use "const T" rather than
2366 "T const" to accommodate glibc style.
2367 (check_result): Use less-confusing report format. "long" -> "long int.
2369 Don't loop if the iteration overflows time_t.
2370 Allow a negative step in the iteration.
2372 2003-07-01 Paul Eggert <eggert@twinsun.com>
2374 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
2375 having it depend on HAVE_SYS_TYPES_H.
2377 2003-06-25 Bruno Haible <bruno@clisp.org>
2379 * readlink.c: New file.
2381 2003-06-20 Bruno Haible <bruno@clisp.org>
2383 Assume C89, so PARAMS isn't needed.
2384 * unicodeio.h (PARAMS): Remove.
2385 * unicodeio.c: Don't use PARAMS.
2387 2003-06-18 Jim Meyering <jim@meyering.net>
2389 Merge changes from coreutils.
2390 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
2391 Remove explicit declarations of xmalloc and realloc.
2393 (read_utmp): Remove anachronistic cast of xmalloc.
2395 2003-06-17 Paul Eggert <eggert@twinsun.com>
2397 Assume C89, so PARAMS isn't needed.
2398 * backupfile.h (PARAMS): Remove. All uses removed.
2399 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
2400 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
2401 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
2402 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
2403 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
2404 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
2405 xstrtol.h: Likewise.
2406 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
2407 same.h, strverscmp.h: Do not include config.h; no longer needed.
2408 Anyway, config.h should always be included before any other file.
2410 2003-06-11 Simon Josefsson <jas@extundo.com>
2412 * sysexit_.h: New file.
2414 2003-05-20 Derek Price <derek@ximbiot.com>
2416 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
2418 2003-06-10 Simon Josefsson <jas@extundo.com>
2420 * strchrnul.h: New file.
2421 * strchrnul.c: New file.
2423 2003-06-10 Simon Josefsson <jas@extundo.com>
2425 * argp.h: New file, from glibc.
2426 * argp-ba.c: New file, from glibc.
2427 * argp-eexst.c: New file, from glibc.
2428 * argp-fmtstream.c: New file, from glibc.
2429 * argp-fmtstream.h: New file, from glibc.
2430 * argp-fs-xinl.c: New file, from glibc.
2431 * argp-help.c: New file, from glibc.
2432 * argp-namefrob.h: New file, from glibc.
2433 * argp-parse.c: New file, from glibc.
2434 * argp-pv.c: New file, from glibc.
2435 * argp-pvh.c: New file, from glibc.
2436 * argp-xinl.c: New file, from glibc.
2438 2003-06-07 Jim Meyering <jim@meyering.net>
2440 * readtokens.h: Put `Free Software Foundation, Inc.'
2441 in place of my name in the copyright comment.
2442 Remove definition and uses of __P.
2445 * stat.c: Don't declare xmalloc explicitly.
2446 Instead, include "xalloc.h".
2447 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
2448 xrealloc, and xcalloc return values.
2449 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
2451 * xgetcwd.h: Remove definition/uses of PARAMS.
2453 2003-06-06 Jim Meyering <jim@meyering.net>
2455 * stdbool_.h: Renamed from stdbool.h.in.
2457 2003-06-06 Jim Meyering <jim@meyering.net>
2459 Merge from coreutils.
2460 * same.c: (same_name): Declare *_basename locals to be `const'.
2461 Consolidate declarations and initializations of *_base* locals.
2463 Merge from coreutils.
2464 This avoids a core dump on systems without GNU putenv,
2465 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
2466 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
2467 (unsetenv): New static function, from GNU libc.
2468 (rpl_putenv): Use it.
2470 * modechange.c: Remove trailing blanks.
2472 Merge from coreutils.
2473 * fsusage.c: Remove declaration of statfs.
2474 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
2476 * posixtm.c: Include <stdbool.h> unconditionally.
2478 2003-06-05 Paul Eggert <eggert@twinsun.com>
2480 * mktime.c (__mktime_internal): When resolving a tm_isdst
2481 mismatch, look in future quarters as well as past. This fixes a
2482 bug when processing fall-backwards gaps immediately after a long
2483 period of daylight-saving time.
2485 * mktime.c: Assume freestanding C89 or better.
2486 (HAVE_LIMITS_H): Remove. Assume it's 1.
2487 (__P): Remove; not used.
2488 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
2489 (mktime, not_equal_tm, print_tm, check_result,
2490 main): Use prototypes. Use const * where appropriate.
2491 (main): Fix typo in testing code that uncovered by above changes.
2492 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
2494 2003-06-04 Paul Eggert <eggert@twinsun.com>
2496 * mktime.c: Fix Debian bug 177940
2497 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
2498 (localtime_offset): Now long int, not time_t, because we want it
2499 to be guaranteed to be signed. All uses changed.
2500 (__mktime_internal): If overflow would occur when adding offset,
2503 Merge 'human' changes from coreutils. Rewrite to support
2504 locale-specific notations like thousands separators.
2505 * human.c: Simplify authorship notice.
2506 Include human.h immediately after config.h.
2507 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
2508 <limits.h>: Do not include, since human.h does.
2509 (SIZE_MAX, UINTMAX_MAX): New macros.
2510 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
2511 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
2512 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
2513 (power_letter): Renamed from suffixes.
2514 (generate_suffix_backwards): Remove.
2515 (adjust_value): Now takes int style (because of human.h changes)
2516 and long double value (for greater precision on some platforms).
2517 (group_number): New function.
2518 (human_readable): Use it. Use integer options, not enum.
2519 Put the options before the sizes in the arg list.
2520 Support all the new options.
2521 The old human_readable function has been removed;
2522 use inttostr.h instead.
2523 (human_readable, default_block_size, humblock):
2524 Use uintmax_t, not int, for block sizes.
2525 (human_readable_inexact, block_size_types): Remove.
2526 (block_size_opts): New constant.
2527 (human_options): Renamed from human_block_size, with new signature
2528 that allows block sizes up to UINTMAX_MAX. All callers changed.
2529 * human.h: Add copyright and authorship notice.
2530 Include <limits.h> and <stdbool.h> unconditionally.
2531 (PARAMS): Remove. All uses removed.
2532 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
2533 (enum human_inexact_style): Remove tag; now a nameless enum.
2534 (human_floor, human_ceiling, human_round_to_even): Now have
2535 values 2, 0, 1 rather than -1, 1, 0.
2536 (human_group_digits, human_suppress_point_zero, human_autoscale,
2537 human_base_1024, human_SI, human_B): New constants.
2538 (human_readable_inexact, human_block_size): Remove.
2539 (human_readable): Size args are now uintmax_t, not int.
2540 (human_options): New decl.
2542 * exclude.c: (new_exclude, add_exclude): Remove casts that are
2543 unnecessary now that we assume C89 or better. This change
2544 imported from coreutils.
2546 * mktime.c (__mktime_internal): Do not reject negative timestamps
2547 arbitrarily. This is the same patch as 2003-05-28, but it got lost
2548 in the 2003-05-30 sync from glibc.
2550 .h files should stand alone, but we shouldn't include <sys/types.h>
2551 if we can get away with just <stddef.h>.
2553 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
2554 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
2555 rather than <sys/types.h>, as we merely need size_t.
2556 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
2558 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
2559 Include <stdio.h>, to get FILE.
2560 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
2561 memcasecmp.h has included <stddef.h> and all we need is size_t.
2562 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
2563 our interface, instead of including <sys/types.h>
2565 2003-06-02 Paul Eggert <eggert@twinsun.com>
2568 Fix some minor time-related bugs with POSIX time arguments.
2569 Some valid time stamps were being rejected (notably -1, and
2570 time stamps before 1900 on 64-bit hosts). And some invalid
2571 time stamps were being accepted, e.g. September 31.
2573 * posixtm.h (posixtime): Return bool instead of time_t, so
2574 that we can return (time_t) -1 successfully.
2575 * posixtm.c: Likewise.
2576 [HAVE_STDBOOL_H]: Include <stdbool.h>.
2577 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
2578 (t): Remove static var.
2579 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
2580 of static var. All uses changed.
2581 (year): Do not reject years before 1900; they can occur with
2583 (posix_time_parse): Do not check for out-of-range components;
2584 that is now the caller's responsibility, since our checks were
2585 only approximations.
2586 (posixtime): Use mktime to check for out-of-range components,
2587 since it knows them exactly.
2588 If mktime returns (time_t) -1, check whether an error actually occurred
2589 by invoking localtime on -1.
2590 (main) [TEST_POSIXTIME]: Check for input data errors, and report
2591 posixtime failures better.
2592 Improve the test data (in comments only).
2594 2003-05-30 <karl@gnu.org>
2596 * mktime.c: update from libc.
2598 2003-05-30 Bruno Haible <bruno@clisp.org>
2600 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
2601 * localcharset.h: Likewise.
2602 * localcharset.c: Likewise.
2604 2003-05-28 Paul Eggert <eggert@twinsun.com>
2606 Assume the headers required for C89 freestanding compilers.
2607 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
2608 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
2609 without checking for HAVE_LIMITS_H.
2610 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
2611 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
2613 * fatal.c: Include <stdarg.h> without checking for __STDC__.
2614 * exclude.c: Include <stdbool.h> unconditionally.
2615 * tempname.c: Include <stddef.h> unconditionally.
2616 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
2617 * modechange.c, rpmatch.c (NULL): Don't define, since
2618 <stddef.h> does that.
2619 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
2620 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
2621 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
2622 * xstrtol.c: Likewise.
2623 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
2624 * savedir.c: Include <stddef.h> instead of defining NULL.
2626 * addext.c (addext): Use assignment rather than cast, to avoid
2627 warnings on some platforms.
2629 * mktime.c (__mktime_internal): Do not reject negative timestamps
2632 2003-05-10 Bruno Haible <bruno@clisp.org>
2634 * linebreak.c (iconv_string_length): Don't return -1 just because the
2635 string is longer than 4 KB.
2637 2003-05-12 Jim Meyering <jim@meyering.net>
2639 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
2640 the space-padded-by-default conversion specifiers, %e, %k, %l.
2642 2003-05-03 Bruno Haible <bruno@clisp.org>
2644 Upgrade to Unicode-4.0.
2645 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
2646 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
2647 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
2648 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
2649 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
2650 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
2651 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
2652 Change width of U+E0100..U+E01EF from 1 to 0.
2654 2003-04-25 Bruno Haible <bruno@clisp.org>
2656 * copy-file.c: Include <stddef.h>, for size_t.
2658 2003-04-25 Jim Meyering <jim@meyering.net>
2660 * copy-file.c (copy_file_preserving): Declare buf_size to be
2661 of type size_t, not int.
2663 2003-04-11 Jim Meyering <jim@meyering.net>
2665 Merge changes from Coreutils.
2667 2003-03-22 Jim Meyering <jim@meyering.net>
2669 * strftime.c (widen): Cast alloca return value to proper type.
2671 2003-01-19 Ulrich Drepper <drepper@redhat.com>
2674 * strftime.c (my_strftime): Handle very large width
2675 specifications for numeric values correctly. Improve checks for
2678 2003-01-19 Jim Meyering <jim@meyering.net>
2680 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
2681 (nl_get_alt_digit) [! defined my_strftime]: Define.
2682 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
2683 _nl_get_alt_digit and _nl_get_walt_digit.
2685 * strftime.c (my_strftime): Merge in locale-related changes from libc.
2686 These changes have no effect outside of _LIBC.
2688 2003-04-10 Bruno Haible <bruno@clisp.org>
2690 * findprog.h: New file, from GNU gettext.
2691 * findprog.c: New file, from GNU gettext.
2693 2003-04-05 Jim Meyering <jim@meyering.net>
2695 Merge changes from Coreutils.
2697 * exclude.h (PARAMS): Remove definition and uses.
2698 * exclude.c: Remove uses of `PARAMS'.
2700 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
2701 Add test-cases for DOS filenames. Declare program_name.
2702 (main): Set up program_name. Patch by Rich Dawe.
2704 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2706 Use mntctl's return value to drive the entry-processing loop, since
2707 we can't rely on the value of the vmt_length member in the last
2708 entry. On some systems doing so could result in exhausting
2709 virtual memory. Based in part on a patch from Mike Jetzer.
2711 2003-04-04 Bruno Haible <bruno@clisp.org>
2713 * linebreak.h: New file, from GNU gettext.
2714 * linebreak.c: New file, from GNU gettext with slight modifications.
2715 * lbrkprop.h: New file, from GNU gettext.
2717 2003-04-03 Bruno Haible <bruno@clisp.org>
2719 * utf8-ucs4.h: New file, from GNU gettext.
2720 * utf16-ucs4.h: New file, from GNU gettext.
2721 * ucs4-utf8.h: New file, from GNU gettext.
2722 * ucs4-utf16.h: New file, from GNU gettext.
2724 2003-04-02 Bruno Haible <bruno@clisp.org>
2726 * binary-io.h: New file, from GNU gettext.
2728 2003-04-01 Bruno Haible <bruno@clisp.org>
2730 * pathname.h: New file, from GNU gettext.
2731 * concatpath.c: New file, from GNU gettext.
2733 2003-03-30 Bruno Haible <bruno@clisp.org>
2735 * copy-file.c (copy_file_preserving): Don't set owner if the function
2736 chown() doesn't exist.
2738 2003-03-28 Bruno Haible <bruno@clisp.org>
2740 * copy-file.h: New file, from GNU gettext.
2741 * copy-file.c: New file, from GNU gettext.
2743 2003-03-18 Jim Meyering <jim@meyering.net>
2745 * quote.c (quote_n): Fix typo in comment.
2747 2003-03-14 Jim Meyering <jim@meyering.net>
2749 Merge changes from Coreutils.
2750 * obstack.h (obstack_object_size): Declare temporary, __o,
2751 to be const, in order to avoid warnings.
2752 (obstack_room): Likewise.
2753 (obstack_empty_p): Likewise.
2755 2003-03-13 Paul Eggert <eggert@twinsun.com>
2757 Merge changes from Bison.
2758 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
2759 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
2760 when compiling Bison 1.875's `bitset bset = obstack_alloc
2761 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
2762 * hash.c: Include <stdbool.h> unconditionally.
2764 2003-03-09 Paul Eggert <eggert@twinsun.com>
2766 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
2767 Reported by Bruce Becker; see:
2768 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
2770 2003-03-03 Paul Eggert <eggert@twinsun.com>
2771 Bruno Haible <bruno@clisp.org>
2773 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
2774 Reported by John Hughes, see
2775 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
2777 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
2779 * poll_.h: New file.
2782 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
2784 * mathl.h: New file.
2785 * acosl.c: New file.
2786 * asinl.c: New file.
2787 * atanl.c: New file.
2788 * ceill.c: New file.
2791 * floorl.c: New file.
2792 * frexpl.c: New file.
2793 * ldexpl.c: New file.
2795 * sincosl.c: New file.
2797 * sqrtl.c: New file.
2799 * trigl.c: New file.
2800 * trigl.h: New file.
2802 2003-02-17 Bruno Haible <bruno@clisp.org>
2804 * mkdtemp.h: New file, from GNU gettext.
2805 * mkdtemp.c: New file, from GNU gettext.
2807 2003-01-31 Bruno Haible <bruno@clisp.org>
2809 * rename.c: #undef rename before defining rpl_rename.
2810 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
2812 2003-01-30 Bruno Haible <bruno@clisp.org>
2814 * printf-args.h: New file, from GNU gettext.
2815 * printf-args.c: New file, from GNU gettext.
2816 * printf-parse.h: New file, from GNU gettext.
2817 * printf-parse.c: New file, from GNU gettext.
2818 * vasnprintf.h: New file, from GNU gettext.
2819 * vasnprintf.c: New file, from GNU gettext.
2820 * asnprintf.c: New file, from GNU gettext.
2821 * vasprintf.h: New file, from GNU gettext with modifications.
2822 * vasprintf.c: New file, from GNU gettext.
2823 * asprintf.c: New file, from GNU gettext.
2825 2003-01-29 Bruno Haible <bruno@clisp.org>
2827 * stpncpy.h: New file, from GNU gettext with modifications.
2828 * stpncpy.c: New file, from GNU gettext with modifications.
2830 2003-01-28 Bruno Haible <bruno@clisp.org>
2832 * c-ctype.h: New file, from GNU gettext, with changes suggested by
2834 * c-ctype.c: New file, from GNU gettext, with changes suggested by
2837 2003-01-27 Bruno Haible <bruno@clisp.org>
2839 * xsetenv.h: New file, from GNU gettext.
2840 * xsetenv.c: New file, from GNU gettext.
2842 2003-01-23 Bruno Haible <bruno@clisp.org>
2844 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
2846 2003-01-22 Bruno Haible <bruno@clisp.org>
2848 * exit.h: New file, from GNU gettext.
2850 2003-01-11 Bruno Haible <bruno@clisp.org>
2852 * stpcpy.h (stpcpy): Use ANSI C function declarations.
2853 * strcase.h (strcasecmp, strncasecmp): Likewise.
2855 2003-01-14 Jim Meyering <jim@meyering.net>
2857 * same.c (same_name): Tweak a comment.
2859 2003-01-11 Bruno Haible <bruno@clisp.org>
2861 * same.c (same_name): Reorder tests so as to avoid calling stat()
2862 when a string comparison is sufficient.
2864 2003-01-11 Bruno Haible <bruno@clisp.org>
2866 * readtokens.c (readtoken): Cast character to 'unsigned char', not
2869 2003-01-11 Bruno Haible <bruno@clisp.org>
2871 * hash-pjw.c: Add comment about low quality of this function.
2873 2003-01-12 Paul Eggert <eggert@twinsun.com>
2875 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
2876 to avoid collisions with libcurses and libreadline.
2878 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
2879 * getstr.h, getstr.c: Remove.
2880 * getline.c: Include "getline.h", to check interface.
2881 Move body of old getstr.c here: this defines MIN_CHUNK and
2882 declares getdelim2, which is renamed from getstr.
2883 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
2885 * linebuffer.c (readlinebuffer): Renamed from readline.
2887 * linebuffer.h: Likewise.
2888 (readline): Remove backward-compatibility macro.
2890 2003-01-12 Jim Meyering <jim@meyering.net>
2892 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
2894 2003-01-10 Bruno Haible <bruno@clisp.org>
2896 * alloca_.h: New file.
2897 * getdate.y: Unconditionally include alloca.h.
2898 * makepath.c: Likewise.
2899 * setenv.c: Likewise.
2900 * userspec.c: Likewise.
2902 2003-01-09 Bruno Haible <bruno@clisp.org>
2904 * stdbool.h.in: New file.
2906 2003-01-08 Bruno Haible <bruno@clisp.org>
2908 * safe-read.c: Include specification header first, to ensure its
2910 * full-write.c: Likewise.
2912 2003-01-08 Jim Meyering <jim@meyering.net>
2914 * full-write.c: Undefine and define-away `const' after inclusion
2915 of errno.h, not before. Suggestion from Bruno Haible.
2917 2003-01-07 Jim Meyering <jim@meyering.net>
2919 * full-write.c: Rework so that it may serve to define full_read, too.
2920 * full-read.c: Simply #define FULL_READ and include full-write.c.
2922 2003-01-06 Jim Meyering <jim@meyering.net>
2924 * version-etc.c: Update year in translatable copyright string.
2926 2002-12-25 Bruno Haible <bruno@clisp.org>
2928 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
2929 * xstrtol.h: Likewise.
2930 * xstrtoimax.c: Likewise.
2931 * xstrtoumax.c: Likewise.
2932 * human.h: Likewise.
2934 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
2935 on systems that have <inttypes.h> but not <stdint.h>.
2937 2002-12-31 Paul Eggert <eggert@twinsun.com>
2939 * memcoll.c (memcoll): Fall back on a simple algorithm using
2940 memcmp if strcoll doesn't work.
2942 2002-12-23 Bruno Haible <bruno@clisp.org>
2944 * localcharset.h: New file.
2945 * localcharset.c: Include it.
2946 * unicodeio.c: Likewise.
2948 2002-12-22 Bruno Haible <bruno@clisp.org>
2950 * utime.c (utime_null): No need to call ftruncate if the file was
2953 2002-12-23 Bruno Haible <bruno@clisp.org>
2955 * memcoll.c (STRCOLL): New macro.
2958 2002-12-22 Bruno Haible <bruno@clisp.org>
2960 * getstr.h (getstr): Define, to avoid clash with libcurses.
2961 * linebuffer.h (readline): Define, to avoid clash with libreadline.
2963 2002-12-22 Bruno Haible <bruno@clisp.org>
2965 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
2967 2002-12-23 Bruno Haible <bruno@clisp.org>
2969 * getline.h: Include <stddef.h>, for size_t.
2971 * unicodeio.h: Include <stddef.h>, for size_t.
2972 * unicodeio.c: Don't include <stddef.h>.
2974 2002-12-17 Bruno Haible <bruno@clisp.org>
2976 * canon-host.c (strdup): Remove unused declaration.
2978 * fsusage.c: Include full_read.h.
2979 (get_fs_usage): Use full_read instead of safe_read.
2981 * utime.c (utime_null): Use SAFE_READ_ERROR.
2983 2002-12-11 Bruno Haible <bruno@clisp.org>
2985 * setenv.h: Rewritten to cope with systems that have setenv() but not
2987 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
2990 2002-12-11 Bruno Haible <bruno@clisp.org>
2992 * setenv.c (alloca): Fall back to malloc.
2994 (setenv): Use freea() to free memory allocated with alloca().
2996 2002-11-13 Bruno Haible <bruno@clisp.org>
2998 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
2999 function declarations.
3000 * unsetenv.c (unsetenv): Likewise.
3002 2002-03-04 Bruno Haible <bruno@clisp.org>
3004 Portability to AIX 4.3.3.
3005 * unsetenv.c: New file, extracted from setenv.c.
3006 * setenv.c: Move the unsetenv() function to unsetenv.c.
3008 2001-12-20 Bruno Haible <bruno@clisp.org>
3010 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
3011 use malloc instead. For SunOS 4.
3013 2001-12-11 Bruno Haible <bruno@clisp.org>
3015 * setenv.c: Declare alloca.
3016 (compar_fn_t): New typedef.
3017 (KNOWN_VALUE, STORE_VALUE): Use it.
3019 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
3022 2002-12-10 Paul Eggert <eggert@twinsun.com>
3024 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
3025 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
3026 Choose values that are less likely to collide with system fnmatch
3028 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
3029 defined (e.g., a pure POSIX system).
3030 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
3031 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
3033 2002-12-06 Jim Meyering <jim@meyering.net>
3035 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
3037 Merge in changes from libc's misc/error.c, in preparation
3038 for the merge of gnulib's changes back into libc.
3040 * error.c (_): Define only if not already defined.
3041 Move definition to follow all #include directives.
3042 Include unlocked-io.h only if !_LIBC.
3043 [_LIBC]: Include <libio/libioP.h>.
3044 [USE_IN_LIBIO]: Include <libio/iolibio.h>
3045 (fflush): Tweak definition to use INTUSE.
3048 2002-12-05 Paul Eggert <eggert@twinsun.com>
3050 * alloca.c [defined emacs]: Include "lisp.h".
3051 (xalloc_die) [defined emacs]: New macro.
3052 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
3053 [! defined emacs]: Include <xalloc.h>.
3054 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
3055 (pointer): Typedef to POINTER_TYPE *.
3056 (malloc): Remove decl; we now always use xmalloc.
3057 (alloca): Use old-style definition, since Emacs needs this.
3058 Check for arithmetic overflow when computing combined size.
3060 2002-12-04 Paul Eggert <eggert@twinsun.com>
3062 Do not generate unlocked-io.h automatically, since it's easier to
3063 maintain it by hand.
3065 * unlocked-io.h: New file, from GNU diffutils,
3066 but with proper copyright notice and attribution.
3068 * Makefile.am: Add copyright notice.
3069 (libfetish_a_SOURCES): Add unlocked-io.h.
3070 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
3071 (DISTCLEANFILES, io_functions): Remove macros.
3072 (EXTRA_DIST): Remove gen_uio.
3073 (unlocked-io.h): Remove rule.
3075 2002-12-04 Jim Meyering <jim@meyering.net>
3077 Reflect the fact that stat.c and lstat.c are no longer generated.
3078 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
3079 (DISTCLEANFILES): Likewise.
3080 (EXTRA_DIST): Likewise.
3081 (all_local): Don't depend on stat.c or lstat.c.
3082 (stat.c, lstat.c): Remove rules.
3083 (EXTRA_DIST): Remove xstat.in.
3085 * xstat.in: Remove file. Contents moved into stat.c.
3086 * stat.c: New file. Contents mostly from xstat.in.
3087 * stat.c: Rework so that it may serve to define rpl_lstat, too.
3088 * lstat.c: New file. Simply #define LSTAT and include stat.c.
3090 * safe-read.c: Rework so that it may serve to define safe_write, too.
3091 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
3093 2002-12-03 Jim Meyering <jim@meyering.net>
3095 * safe-read.c, safe-write.c: Change variable names and comments, but
3096 not semantics, to minimize the differences between these two files.
3097 (safe_read): Change comment to mention SAFE_READ_ERROR.
3099 * safe-read.c (IS_EINTR): Define.
3100 (safe_read): Use IS_EINTR in place of in-function cpp directives.
3102 2002-12-02 Bruno Haible <bruno@clisp.org>
3104 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
3105 Define, taken from safe-read.c.
3106 (INT_MAX): Provide fallback.
3107 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
3108 * safe-write.h (SAFE_WRITE_ERROR): Define.
3110 * safe-read.c (EINTR): Remove definition.
3111 (safe_read): Don't use EINTR if it is absent.
3113 2002-12-02 Jim Meyering <jim@meyering.net>
3115 * safe-read.c (EINTR): Define.
3116 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
3117 (INT_MAX): Provide fallback.
3118 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
3120 * safe-read.h (SAFE_READ_ERROR): Define.
3122 2002-12-01 Jim Meyering <jim@meyering.net>
3124 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
3125 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
3127 2002-11-27 Paul Eggert <eggert@twinsun.com>
3129 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
3130 hash_rehash): Replace `if (limit <= value) abort ();' with
3131 `if (! (value < limit)) abort ();', for readability.
3133 2002-11-26 <karl@gnu.org>
3135 * strdup.c: copy from libc again, with jim's ok.
3136 * .cppi-disable: re-add strdup.c
3138 2002-11-25 <karl@gnu.org>
3140 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
3141 instead of "strtol.c".
3143 2002-11-25 Jim Meyering <jim@meyering.net>
3145 * mktime.c: Sync from libc, now that it has the latest fix.
3147 2002-11-24 <karl@gnu.org>
3149 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
3150 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
3152 2002-11-24 Jim Meyering <jim@meyering.net>
3154 Update from coreutils:
3156 * mktime.c: Merge in changes from libc.
3158 Avoid a link-time failure on some Linux systems.
3159 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
3160 (__mon_yday): Declare with the STATIC attribute.
3161 (__mktime_internal): Likewise.
3162 Based on a report from Greg Schafer.
3164 2002-11-23 Jim Meyering <jim@meyering.net>
3166 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
3167 Use `unsigned', not `int', as type of index.
3169 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
3171 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
3173 2002-11-22 Paul Eggert <eggert@twinsun.com>
3175 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
3176 hint that one should use `if (! x) abort ();' rather than `assert
3177 (x);', and anyway it's one less thing to worry about configuring.
3178 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
3179 hash_rehash, hash_insert): Use abort rather than assert.
3181 2002-11-22 Paul Eggert <eggert@twinsun.com>
3183 * quotearg.h: Allow multiple inclusion by surrounding with
3184 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
3185 so that we can be included first.
3186 (PARAMS): Remove; we now assume C89 or later. All uses removed.
3187 * quotearg.c: Include quotearg.h immediately after config.h.
3188 No need to include stddef.h or sys/types.h any more.
3189 Surround local include files with "", not "<>".
3190 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
3191 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
3192 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
3193 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
3194 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
3195 (ISPRINT): Remove; no longer needed now that we assume C89.
3197 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
3200 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
3201 quotearg_char): Use SIZE_MAX rather than
3202 (size_t) -1 when we are talking about "infinity".
3204 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
3206 2002-11-22 Bruno Haible <bruno@clisp.org>
3208 * safe-read.h: Assume C89. Add comments.
3209 (safe_read): Change return type to size_t.
3210 * safe-read.c (safe_read): Change return type to size_t. Handle byte
3211 counts > SSIZE_MAX correctly.
3212 * safe-write.h: New file.
3213 * safe-write.c: New file.
3214 * full-read.h: New file.
3215 * full-read.c: New file.
3216 * full-write.h: Assume C89. Add comments.
3217 * full-write.c: Include safe-write.h.
3218 (full_write): Rewritten to use safe_write.
3219 Suggested by Jim Meyering and Paul Eggert.
3221 2002-11-21 Bruno Haible <bruno@clisp.org>
3223 Remove case insensitive option matching.
3224 * argmatch.h (argcasematch): Remove declaration.
3225 (ARGCASEMATCH): Remove macro.
3226 (__xargmatch_internal): Remove case_sensitive argument.
3227 (XARGMATCH): Update.
3228 (XARGCASEMATCH): Remove macro.
3229 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
3230 case_sensitive argument.
3231 (argcasematch): Remove function.
3232 (__xargmatch_internal): Remove case_sensitive argument.
3233 (main): Use XARGMATCH instead of XARGCASEMATCH.
3235 * xmalloc.c: Change compile-time error message. Add comment about
3236 required autoconf version.
3238 2002-11-21 Jim Meyering <jim@meyering.net>
3240 * strdup.c (strdup): Tweak comment and initial #if/#include.
3242 Merge in changes from the coreutils.
3244 2002-09-25 Paul Eggert <eggert@twinsun.com>
3245 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
3246 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
3247 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
3248 int. Work more efficiently if X is the same width as uintmax_t.
3249 Do not compare X to -1, to avoid bogus compiler warning.
3250 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
3251 Don't assume that f_frsize and f_bsize are the same type.
3253 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
3256 * makepath.c (make_path): Restore umask *before* creating the final
3258 (make_path): Minor reformatting.
3260 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
3261 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
3263 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
3264 ones. At least on GNU/Linux systems, `auto' means something else.
3267 2002-11-20 Paul Eggert <eggert@twinsun.com>
3269 Merge argmatch cleanups from Bison. Assume C89.
3271 * argmatch.c: Include config.h here, not in argmatch.h.
3272 Include stdlib.h, for EXIT_FAILURE.
3273 Always include <string.h>, since we assume C89.
3274 (EXIT_FAILURE): Remove pre-C89 bug workaround.
3275 * argmatch.h: Do not include <config.h> or <sys/types.h>.
3276 Include <stddef.h> instead, since it's all we need for size_t.
3277 (PARAMS): Remove. All uses removed.
3278 (ARRAY_CARDINALITY): Do not bother to #undef.
3279 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
3280 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3281 Remove unnecessary parentheses.
3282 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3283 Insert necessary parentheses.
3284 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
3285 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
3287 2002-11-19 Bruno Haible <bruno@clisp.org>
3289 * mbswidth.c: Include mbswidth.h right at the beginning.
3290 * mbswidth.h: Include <stddef.h>, for size_t.
3292 * mbswidth.h (PARAMS): Remove macro.
3293 (mbswidth, mbsnwidth): Use ANSI C function declarations.
3294 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
3296 * gcd.h (PARAMS): Remove macro.
3297 (gcd): Use ANSI C function declarations.
3298 * gcd.c (gcd): Likewise.
3300 2002-11-15 Bruno Haible <bruno@clisp.org>
3302 * strcspn.c: Include <stddef.h>.
3303 (strcspn): Use ANSI C function declaration. Change return type to
3305 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
3306 (strpbrk): Use NULL.
3307 * strpbrk.h (PARAMS): Remove macro.
3308 (strpbrk): Use ANSI C function declaration.
3309 * strstr.c: Don't include <sys/types.h>.
3310 * strstr.h (PARAMS): Remove macro.
3311 (strstr): Use ANSI C function declarations.
3313 2002-11-06 Bruno Haible <bruno@clisp.org>
3315 * gcd.h (gcd): Change argument type to 'unsigned long'.
3316 * gcd.c (gcd): Likewise.
3318 2002-11-05 Bruno Haible <bruno@clisp.org>
3320 * gcd.h: New file, from gettext-0.11.5.
3321 * gcd.c: New file, from gettext-0.11.5.
3323 2002-11-05 Bruno Haible <bruno@clisp.org>
3325 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3326 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3327 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3328 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3330 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3331 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3333 * closeout.c: Include gettext.h instead of <libintl.h>.
3334 * human.c: Include gettext.h instead of <libintl.h>.
3335 * quotearg.c: Include gettext.h instead of <libintl.h>.
3336 * rpmatch.c: Include gettext.h instead of <libintl.h>.
3337 * unicodeio.c: Include gettext.h instead of <libintl.h>.
3338 * userspec.c: Include gettext.h instead of <libintl.h>.
3339 * version-etc.c: Include gettext.h instead of <libintl.h>.
3340 * xmalloc.c: Include gettext.h instead of <libintl.h>.
3341 (textdomain): Remove definition.
3342 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
3344 * long-options.c: Remove include of <libintl.h> and definition of _.
3345 * same.c: Remove include of <libintl.h> and definition of _.
3347 2002-11-04 Bruno Haible <bruno@clisp.org>
3349 * stpcpy.h: New file, from GNU gettext-0.11.5.
3350 * strcase.h: New file, from GNU gettext-0.11.5.
3351 * strpbrk.h: New file, from GNU gettext-0.11.5.
3352 * strstr.h: New file, from GNU gettext-0.11.5.
3353 * xgetcwd.h: New file, from GNU gettext-0.11.5.
3355 2002-05-09 Bruno Haible <bruno@clisp.org>
3357 * config.charset: Update for newest glibc. Add canonical names
3358 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
3360 2002-05-09 Bruno Haible <bruno@clisp.org>
3362 * localcharset.c (get_charset_aliases): Add more Windows specific
3365 2002-05-08 Owen Taylor <otaylor@redhat.com>
3367 * config.charset: A few additions for Solaris.
3369 2001-12-05 Bruno Haible <bruno@clisp.org>
3371 * localcharset.c (locale_charset): Don't return an empty string.
3373 2001-10-23 Bruno Haible <haible@clisp.cons.org>
3375 * config.charset: msdos in uk_UA uses CP1125.
3377 2001-08-05 Bruno Haible <haible@clisp.cons.org>
3379 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
3380 * localcharset.c (locale_charset): Declare as extern "C".
3382 2002-02-15 Bruno Haible <bruno@clisp.org>
3384 * config.charset [msdosdjgpp]: For Russian, use CP866.
3386 2002-02-11 Bruno Haible <bruno@clisp.org>
3388 * config.charset: Add support for NetBSD.
3390 2002-09-25 <karl@gnu.org>
3392 * strdup.c: copy from libc/string (via ../config/srclist*).
3393 * getopt*: copy from libc/posix.
3394 * gettext.h: copy from gettext.
3395 * .cppi-disable: add strdup.c, gettext.h.
3397 2002-07-01 Jim Meyering <meyering@lucent.com>
3399 * c-stack.c: Include sys/time.h.
3400 From Volker Borchert.
3402 2002-06-11 Paul Eggert <eggert@twinsun.com>
3404 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
3405 New macro. Use it uniformly instead of
3406 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
3407 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
3408 reported by Vin Shelton.
3410 2002-06-22 Jim Meyering <meyering@lucent.com>
3412 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
3413 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
3415 2002-06-22 Paul Eggert <eggert@twinsun.com>
3417 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
3418 Do not assume SA_SIGINFO behavior.
3419 Bug reported by Jim Meyering on NetBSD 1.5.2.
3421 2002-06-22 Jim Meyering <meyering@lucent.com>
3423 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
3425 * exitfail.c, exitfail.h: Likewise.
3426 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
3428 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
3430 (EXTRA_DIST): Add fnmatch_loop.c.
3431 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
3433 * fnmatch_loop.c: New file, from diffutils-2.8.2.
3434 * fnmatch.c: Update from diffutils-2.8.2.
3435 * fnmatch_.h: New file. From diffutils-2.8.2.
3436 * fnmatch.h: Remove file.
3438 2002-06-18 Paul Eggert <eggert@twinsun.com>
3440 * file-type.h: Report an error if neither S_ISREG nor
3441 S_IFREG is defined, instead of using a test specific to glibc
3442 2.2. This should be safe, since POSIX requires S_ISREG and
3443 Unix Version 7 had S_IFREG. We don't need to check for
3444 <sys/types.h> since we don't use any symbols that it defines.
3446 2002-06-15 Jim Meyering <meyering@lucent.com>
3448 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
3449 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
3450 have been included before this file.
3452 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
3454 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
3455 so that each temporary file name is unique and valid in the first
3456 8 characters, for operation under DOS.
3458 2002-06-15 Jim Meyering <meyering@lucent.com>
3460 Work even with DJGPP 2.03, which lacks support for symlinks.
3462 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
3464 * lchown.c (S_ISLNK): Likewise.
3466 2002-06-14 Jim Meyering <meyering@lucent.com>
3468 * file-type.h: Use the version from diffutils-2.8.2.
3469 * file-type.c: Likewise.
3471 2002-05-27 Jim Meyering <meyering@lucent.com>
3473 Fix a problem seen only on nonconforming systems whereby ls.c's
3474 use of localtime, and then of gettimeofday would cause trouble:
3475 the localtime call used to initialize rpl_gettimeofday's save
3476 mechanism would clobber ls's current local time information so
3477 that in any long listing the first file would always be listed
3478 with date 1970-01-01. Analysis by Volker Borchert.
3480 * gettimeofday.c (localtime): Undefine.
3481 (rpl_localtime): New function.
3483 2002-05-22 Jim Meyering <meyering@lucent.com>
3485 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
3486 * file-type.h: New file.
3487 * file-type.c (file_type): New file/function. Extracted from diffutils.
3489 2002-04-29 Paul Eggert <eggert@twinsun.com>
3491 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
3493 2002-04-28 Paul Eggert <eggert@twinsun.com>
3495 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
3496 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
3497 of 127, since 64 is the largest conceivable number for ancient
3499 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
3501 2002-04-28 Jim Meyering <meyering@lucent.com>
3503 * sig2str.c (WTERMSIG): Remove definition (unused).
3505 2002-04-28 Paul Eggert <eggert@twinsun.com>
3507 * sig2str.h, sig2str.c: New files.
3508 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
3510 2002-04-24 Jim Meyering <meyering@lucent.com>
3512 * gettext.h: New file, from Gettext.
3513 * Makefile.am (INCLUDES): Remove -I../intl.
3514 (libfetish_a_SOURCES): Add gettext.h.
3516 2002-04-16 Jim Meyering <meyering@lucent.com>
3518 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
3519 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
3520 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
3522 2002-04-12 Jim Meyering <meyering@lucent.com>
3524 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
3526 2002-03-10 Jim Meyering <meyering@lucent.com>
3528 * makepath.c (make_path): Remove a comma from a diagnostic.
3529 Suggestion from Santiago Vila.
3531 2002-03-08 Jim Meyering <meyering@lucent.com>
3533 * rename.c: Mention that this wrapper is needed also on
3534 mips-dec-ultrix4.4 systems.
3536 2002-03-02 Jim Meyering <meyering@lucent.com>
3538 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
3539 not HAVE_CLOCK_SETTIME.
3541 2002-02-27 Paul Eggert <eggert@twinsun.com>
3543 * nanosleep.h: Rename to....
3544 * timespec.h: New name for nanosleep.h. All uses changed.
3546 * gettime.c: New file.
3547 * settime.c: New file.
3550 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
3551 timespec.h. Remove nanosleep.h.
3553 2002-02-25 Paul Eggert <eggert@twinsun.com>
3555 * acl.c, acl.h: New files.
3556 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
3558 2002-02-24 Jim Meyering <meyering@lucent.com>
3560 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
3561 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
3562 cause trouble. Reported by Nelson Beebe.
3564 2002-02-23 Paul Eggert <eggert@twinsun.com>
3566 * path-concat.c (xpath_concat): Reorder code to pacify
3567 compilers that don't know that xalloc_die never returns.
3569 2002-02-20 Jim Meyering <meyering@lucent.com>
3571 * getdate.c: Regenerate using bison-1.33.
3573 2002-02-15 Paul Eggert <eggert@twinsun.com>
3575 * posixver.c, posixver.h: New files.
3576 * Makefile.am (libfetish_a_SOURCES): Add them.
3578 2002-02-02 Paul Eggert <eggert@twinsun.com>
3579 Bruno Haible <bruno@clisp.org>
3581 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
3582 (fwrite_success_callback): New declaration.
3583 * unicodeio.c (unicode_to_mb): New function, extracted from
3584 print_unicode_char. Call failure callback instead of error.
3585 (fwrite_success_callback): New function.
3586 (exit_failure_callback): New function.
3587 (fallback_failure_callback): New function.
3588 (print_unicode_char): Call unicode_to_mb.
3590 2002-01-26 Jim Meyering <meyering@lucent.com>
3592 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
3594 2002-01-22 Jim Meyering <meyering@lucent.com>
3596 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
3597 Otherwise, some versions of automake would omit the rule that makes
3598 Makefile from Makefile.in.
3600 2001-01-21 Paul Eggert <eggert@twinsun.com>
3602 * xmemcoll.h, xmemcoll.c: New files.
3603 * Makefile.am (libfetish_a_SOURCES): Add them.
3604 * memcoll.c: Include errno.h, and declare errno if not defined.
3605 (memcoll): Set errno to zero if there is no error.
3607 * quotearg.c (quotearg_buffer_restyled):
3608 Fix bug with quoting buffers containing NUL when backslashing escapes.
3609 This bug was exposed by the other changes in this patch.
3610 (quotearg_n_options): New arg ARGSIZE.
3611 All callers changed.
3612 (quoting_options_from_style): New function.
3613 (quotearg_n_style): Use it.
3614 (quotearg_n_style_mem): New function.
3616 * quotearg.h (quotearg_n_style_mem): New function.
3618 2002-01-16 Jim Meyering <meyering@lucent.com>
3620 * getdate.y: Add three semicolons, each just before a closing brace.
3621 Bison (as of version 1.31) no longer papers over that mistake.
3623 2002-02-14 Paul Eggert <eggert@twinsun.com>
3625 * backupfile.c (ISDIGIT): Comment fix.
3626 * getdate.y (ISDIGIT): Likewise.
3627 * posixtm.c (ISDIGIT, year): Likewise.
3628 * strverscmp.c (ISDIGIT): Likewise.
3629 * userspec.c (ISDIGIT): Likewise.
3631 2002-01-05 Jim Meyering <meyering@lucent.com>
3633 * version-etc.c (version_etc_copyright): Update copyright year.
3635 2001-01-19 Paul Eggert <eggert@twinsun.com>
3637 * closeout.c (close_stdout_status): If ferror (stdout), do
3638 not silently exit merely because the output buffer happens to
3639 have nothing pending.
3641 2001-12-18 Paul Eggert <eggert@twinsun.com>
3643 See the big note in ../ChangeLog.
3644 * human.c (suffixes): Prefer K to k for 1024.
3645 (generate_suffix_backwards): New function.
3646 (human_readable_inexact): Use it.
3647 * xstrtol.c (__xstrtol): If there is no number but there
3648 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
3649 Accept 'K' as well as 'k'.
3651 2001-12-15 Jim Meyering <meyering@lucent.com>
3653 * regex.h (__restrict_arr): Update from libc.
3655 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
3656 as `remote' if the name starts with `//'. Suggested by Michael Stone.
3659 2001-12-10 Jim Meyering <meyering@lucent.com>
3661 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
3662 Instead, include "xalloc.h".
3663 (initbuffer): Don't cast xmalloc return value to char*.
3664 (readline): Reword comment.
3665 Don't cast xrealloc return value to char*
3668 2001-12-09 Jim Meyering <meyering@lucent.com>
3670 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
3671 `signed and unsigned type in conditional expression'.
3672 * posixtm.c (posix_time_parse): Likewise.
3674 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
3676 * readtokens.c (readtoken): Declare an index to be of type unsigned
3677 to avoid a pedantic warning.
3679 * getstr.c: Don't include assert.h.
3680 (getstr): Remove warning-evoking assertions.
3681 Return -1 if offset parameter is out of bounds.
3682 Change the type of a local from int to size_t.
3684 * strftime.c (my_strftime_localtime_r): Include this function
3685 definition in the `#if ! HAVE_TM_GMTOFF' block.
3687 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
3688 Include xalloc.h instead.
3690 2001-12-02 Jim Meyering <meyering@lucent.com>
3692 * tempname.c: Don't declare getenv, thus reverting the change of
3693 2001-11-18. It's no longer necessary, now that stdlib.h is always
3696 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
3697 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
3699 2001-11-30 Akim Demaille <akim@epita.fr>
3701 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
3702 before being defined.
3704 2001-11-27 Paul Eggert <eggert@twinsun.com>
3706 * quotearg.h (quotearg_n, quotearg_n_style):
3707 First arg is int, not unsigned.
3708 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
3709 (SIZE_MAX, UINT_MAX): New macros.
3710 (quotearg_n_options): Abort if N is negative.
3711 Avoid overflow check on hosts where size_t is 64 bits and int
3712 is 32 bits, as overflow is impossible there.
3713 Fix off-by-one typo that caused unnecessary reallocation.
3715 2001-11-27 Jim Meyering <meyering@lucent.com>
3717 * tempname.c: Merge with version from libc.
3718 * regex.c: Likewise.
3720 * tempname.c: Include stdlib.h unconditionally. On some old systems
3721 for which STDC_HEADERS is 0, it was not included, resulting in a
3722 warning about an integer-to-pointer conversion problem with getenv.
3723 Reported by Volker Borchert.
3725 2001-11-26 Jim Meyering <meyering@lucent.com>
3727 * gtod.h: Remove file.
3728 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
3729 * gettimeofday.c: Don't include gtod.h.
3730 (GTOD_init): Remove function.
3731 (rpl_gettimeofday): Do its job here instead, rather than aborting.
3732 Suggestion from Volker Borchert.
3734 2001-11-23 Jim Meyering <meyering@lucent.com>
3736 * hash.h (struct hash_table): Don't define here. Merely declare it.
3737 * hash.c (struct hash_table): Define it here instead.
3739 2001-11-22 Jim Meyering <meyering@lucent.com>
3741 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
3743 2001-11-18 Paul Eggert <eggert@twinsun.com>
3745 * tempname.c (TMP_MAX): Remove; no longer needed.
3746 (TEMPORARIES): New macro.
3747 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
3748 removes an artificial limitation (e.g. HP-UX 10.20, where
3751 2001-11-18 Jim Meyering <meyering@lucent.com>
3753 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
3756 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
3757 files will be created before anything else.
3759 2001-11-17 Jim Meyering <meyering@lucent.com>
3761 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
3762 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
3763 rather than group writable. Patch by Juan F. Codagnone.
3765 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
3766 Instead, include "xalloc.h".
3768 * mountlist.c: Include unlocked-io.h after all system headers.
3769 Remove explicit declarations of xmalloc, xrealloc,
3770 and xstrdup. Instead, include "xalloc.h".
3772 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
3773 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
3774 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
3776 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
3777 Reported by Padraig Brady.
3779 * mkstemp.c: #undef mkstemp.
3781 (rpl_mkstemp): Rename from mkstemp.
3784 2001-11-16 Jim Meyering <meyering@lucent.com>
3786 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
3787 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
3788 determine the amount of total physical memory, use pstat_getstatic.
3789 HPUX-11 doesn't define _SC_PHYS_PAGES.
3790 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
3791 If sysconf couldn't be used to determine the amount of available
3792 physical memory, use both pstat_getstatic and pstat_getdynamic.
3793 Based on a patch from Bob Proulx.
3795 2001-11-05 Jim Meyering <meyering@lucent.com>
3797 * xstat.in (slash_aware_lstat): Correct a misleading comment.
3799 2001-11-03 Jim Meyering <meyering@lucent.com>
3801 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
3802 in argmatch_to_argument call.
3804 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
3807 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
3808 e.g., a fault due to an attempt to free a NULL pointer.
3810 2001-11-01 Jim Meyering <meyering@lucent.com>
3812 * dirfd.c, dirfd.h: New files.
3813 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
3815 * hash.c (hash_print) [TESTING]: Clean up.
3817 2001-10-22 Paul Eggert <eggert@twinsun.com>
3819 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
3820 to avoid a warning if -Wall.
3822 2001-10-21 Paul Eggert <eggert@twinsun.com>
3824 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
3826 2001-10-21 Jim Meyering <meyering@lucent.com>
3828 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
3829 this code would end up calling gettext even in packages built
3831 * getopt.c (_): Likewise.
3832 * regex.c (_): Likewise.
3834 2001-10-20 Paul Eggert <eggert@twinsun.com>
3836 * error.c (strerror_r): Do not declare unless !_LIBC.
3837 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
3838 Use strerror_r that is only a macro, even if it is not a function.
3839 (strerror): Check for HAVE_DECL_STRERROR before declaring.
3840 (private_strerror): Use prototypes, not old-style function definition.
3841 (print_errno_message): New function.
3842 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
3844 (error_tail, error, error_at_line): Use it.
3846 2001-10-11 Jim Meyering <meyering@lucent.com>
3848 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
3849 and quote_n (1, ... to avoid clobbering a buffer.
3851 2001-10-05 Jim Meyering <meyering@lucent.com>
3853 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
3854 * hash-pjw.c: New file (factored out of fileutils' remove.c).
3855 * hash-pjw.h: New file.
3857 2001-09-30 Jim Meyering <meyering@lucent.com>
3859 * mountlist.c [MOUNTED_GETFSSTAT]:
3860 Include <sys/ucred.h>, for Apple Darwin.
3861 Include sys/mount.h and sys/fs_types.h only if available.
3863 (read_filesystem_list): Use FS_TYPE.
3865 2001-09-29 Paul Eggert <eggert@twinsun.com>
3867 * exclude.c (excluded_filename): 0 -> false, since it's
3870 2001-09-28 Paul Eggert <eggert@twinsun.com>
3872 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
3873 #defines strtoimax. Also treat the other strto* functions
3876 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
3877 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
3878 (strtoimax, strtoumax): Do not declare if already defined as a macro.
3880 2001-09-26 Jim Meyering <meyering@lucent.com>
3882 Most macros in unlocked-io.h had the wrong number of arguments.
3883 * gen-uio: New script.
3884 (USE_UNLOCKED_IO): Define to 1 if not already defined.
3885 * unlocked-io.hin: Remove file.
3886 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
3887 rather than trying to embed it here.
3888 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
3889 Reported by Padraig Brady.
3891 2001-09-25 Volker Borchert <bt@teknon.de>
3893 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
3895 2001-09-23 Jim Meyering <meyering@lucent.com>
3897 * mountlist.c: Remove useless parentheses in #if directives.
3898 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
3899 the deprecated MOUNTED symbol is no longer defined in mntent.h.
3901 2001-09-22 Jim Meyering <meyering@lucent.com>
3903 * localcharset.c: Update from latest gettext.
3904 * config.charset: Likewise.
3906 2001-09-20 Jim Meyering <meyering@lucent.com>
3908 * xstrtol.c (strtoimax): Guard declaration with
3909 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
3910 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
3911 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
3912 (strtoumax): Likewise, for completeness (it wasn't necessary).
3914 2001-09-06 Paul Eggert <eggert@twinsun.com>
3916 * strtoimax.c (HAVE_LONG_LONG):
3917 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
3918 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
3919 to work around bug in IBM C compiler.
3921 2001-09-16 Jim Meyering <meyering@lucent.com>
3923 * mkdir.c: New file.
3925 2001-09-04 Paul Eggert <eggert@twinsun.com>
3927 * xgetcwd.c: Revert some of the previous change; intead,
3928 fix the HAVE_GETCWD_NULL code to behave more like the
3929 !HAVE_GETCWD_NULL code used to.
3932 (xgetcwd): Do not return NULL when memory is exhausted; instead,
3935 2001-09-04 Paul Eggert <eggert@twinsun.com>
3937 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
3938 Use ssize_t, not int, to store result of readlink.
3939 Check for ssize_t overflow as well as size_t overflow,
3940 as POSIX says the result of readlink is implementation-defined
3941 when ssize_t overflows.
3942 Remove unnecessary cast to char*.
3943 Use free+malloc instead of realloc, as the storage doesn't need
3944 to be preserved and it's clearer and can be more efficient that way.
3945 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
3946 * xreadlink.h (xreadlink): Update prototype.
3948 2001-09-03 Paul Eggert <eggert@twinsun.com>
3950 * exclude.c (fnmatch_no_wildcards): Fix confusion between
3951 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
3952 spotted by Jim Meyering.
3954 2001-09-03 Jim Meyering <meyering@lucent.com>
3956 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
3958 2001-09-03 Paul Eggert <eggert@twinsun.com>
3960 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
3961 like the HAVE_GETCWD_NULL code.
3962 Include pathmax.h if not HAVE_GETCWD.
3963 Do not include xalloc.h.
3964 (INITIAL_BUFFER_SIZE): New symbol.
3965 Do not use xmalloc / xrealloc, since the caller is responsible for
3966 handling errors. Preserve errno around `free' during failure.
3967 Do not overrun buffer when using getwd.
3969 2001-09-03 Paul Eggert <eggert@twinsun.com>
3971 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
3972 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
3974 2001-09-02 Jim Meyering <meyering@lucent.com>
3976 * error.c: Update from GNU libc.
3978 2001-09-01 Jim Meyering <meyering@lucent.com>
3980 * xreadlink.c: New file.
3981 * xreadlink.h: New file.
3982 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
3984 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
3985 doesn't conflict with sparc Solaris 7's definition in
3986 /usr/include/sys/int_types.h.
3988 * exclude.c: Use `""', not `<>' to #include non-system header files.
3989 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
3990 and strncasecmp as r-values. Unixware didn't have declarations.
3992 2001-08-31 Jim Meyering <meyering@lucent.com>
3994 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
3995 Use an initial, malloc'd, buffer of length 128 rather than
3996 a statically allocated one of length 1024.
3998 2001-08-30 Paul Eggert <eggert@twinsun.com>
4000 * xgetcwd.c: Don't include pathmax.h.
4001 Include stdlib.h and unistd.h if available.
4003 (xmalloc, xstrdup, free): Remove decls.
4004 (xgetcwd): Don't assume sizes fit in unsigned.
4005 Check for overflow when computing sizes.
4006 Simplify reallocation code.
4008 2001-08-28 Paul Eggert <eggert@twinsun.com>
4010 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
4012 * strtoimax.c: Renamed from strtoxmax.c, removing the
4015 Also, make the following further changes to make this file's
4016 configuration more similar to that of strtol.c:
4017 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
4018 (strtoumax, uintmax_t, strtoull, strtol): Remove.
4019 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
4020 (strtoimax): Renamed from strtoumax. All uses of unsigned values
4021 changed to signed values.
4023 And make the following changes as well:
4024 Fix copyright notice, as 1999 was missing.
4025 (verify): New macro.
4026 (strtoimax): Check sizes at compile-time, not run-time.
4027 Prefer strtol to strtoll if both work.
4028 (main): Remove; it was not that useful and was a pain to maintain.
4030 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
4032 2001-08-30 Paul Eggert <eggert@twinsun.com>
4034 * savedir.c (savedir): Remove size parameter, as POSIX says that
4035 a directory's st_size can have an arbitrary value, so the old
4036 usage could waste an arbitrary amount of memory. All uses
4038 * savedir.h: Update prototype.
4040 2001-08-30 Paul Eggert <eggert@twinsun.com>
4042 * xstrtol.c (strtoimax): New decl.
4044 2001-08-28 Paul Eggert <eggert@twinsun.com>
4046 * xstrtol.h: Add copyright notice.
4047 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
4048 LONGINT_INVALID_SUFFIX_CHAR.
4050 2001-08-30 Paul Eggert <eggert@twinsun.com>
4052 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
4055 2001-08-30 Paul Eggert <eggert@twinsun.com>
4057 * hash.c: Remove '2001' from copyright notice.
4059 2001-08-30 Paul Eggert <eggert@twinsun.com>
4061 * full-write.h: New file.
4062 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
4063 * full-write.c: Correct credits, as cccp.c no longer
4064 exists and anyway it was so heavily changed from the old cccp
4065 code as to be unrecognizable. Include full-write.h.
4066 (full_write) Return size_t, with short writes meaning failure.
4067 All callers changed. This fixes a bug with large buffers
4069 * utime.c: Include full-write.h.
4071 2001-08-30 Paul Eggert <eggert@twinsun.com>
4073 Merge 'exclude' changes from tar 1.13.22.
4074 This fixes one or two unlikely storage allocation overflow bugs,
4075 but doesn't change user-visible behavior otherwise.
4077 2001-08-30 Paul Eggert <eggert@twinsun.com>
4079 * exclude.c (bool): Declare, perhaps by including stdbool.h.
4080 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
4081 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
4082 Include if available.
4083 (<xalloc.h>): Include
4084 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
4085 (verify): New macro. Use it to verify that EXCLUDE macros do not
4086 collide with FNM macros.
4087 (struct patopts): New struct.
4088 (struct exclude): Use it, as exclude patterns now come with options.
4089 (new_exclude): Support above changes.
4090 (new_exclude, add_exclude_file):
4091 Initial size must now be a power of two to simplify overflow checking.
4092 (free_exclude, fnmatch_no_wildcards): New function.
4093 (excluded_filename): No longer requires options arg, as the options
4094 are determined by add_exclude. Now returns bool, not int.
4095 (excluded_filename, add_exclude):
4096 Add support for the fancy new exclusion options.
4097 (add_exclude, add_exclude_file): Now takes int options arg.
4098 Check for arithmetic overflow when computing sizes.
4099 (add_exclude_file): xrealloc might modify errno, so don't
4100 realloc until after errno might be used.
4102 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
4104 (free_exclude): New decl.
4105 (add_exclude, add_exclude_file): Now takes int options arg.
4106 (excluded_filename): No longer requires options arg, as the options
4107 are determined by add_exclude. Now returns bool, not int.
4109 2001-08-30 Paul Eggert <eggert@twinsun.com>
4111 * alloca.c (alloca): Arg is of type size_t, not unsigned.
4113 2001-08-27 Jim Meyering <meyering@lucent.com>
4115 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
4117 * version-etc.c (N_): Remove definition.
4118 Revert most of last change.
4119 Instead, simply don't mark the `Copyright...' string for translation.
4120 Based on advice from Paul Eggert.
4122 * strtoxmax.c: Tweak comment.
4124 2001-08-26 Jim Meyering <meyering@lucent.com>
4126 * version-etc.c (version_etc_copyright_fmt): Replace literal year
4127 of copyright with `%s' so translators don't get an untranslated
4129 (COPYRIGHT_YEAR): Define.
4130 (version_etc): Use fprintf rather than fputs.
4131 Suggestion from Ulrich Drepper.
4133 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
4135 * strtoll.c: New file, from GNU libc.
4136 * xstrtoimax.c: New file.
4138 * xstrtol.h: Add xstrtoimax.
4139 * strtoumax.c: New file. Simply include "strtoumax.c".
4140 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
4142 * strtoumax.c: Factor to work both for unsigned and signed types, ...
4143 * strtoxmax.c: ... then renamed to this.
4145 2001-08-13 Paul Eggert <eggert@twinsun.com>
4147 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
4148 Port to Solaris 8, where 'sed' requires a space after the 'r'
4149 command, and where sh dislikes "$/". Clean up the spacing a bit.
4150 Redirect output to $tmp just once.
4152 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
4154 * addext.c (<errno.h>): Include.
4155 (errno): Declare if not defined.
4156 (addext): Work correctly when pathconf returns -1 and leaves
4157 errno alone because there is no limit. Also, work even if
4158 pathconf returns a value greater than SIZE_MAX.
4160 2001-08-12 Jim Meyering <meyering@lucent.com>
4162 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
4163 Simply `return getcwd (NULL, 0);'.
4164 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
4165 Use 1300 as initial value for length, not PATH_MAX.
4167 * pathmax.h: Clean up cpp syntax.
4169 2001-08-12 Jim Meyering <meyering@lucent.com>
4171 * gettimeofday.c: New file.
4173 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
4175 2001-08-04 Jim Meyering <meyering@lucent.com>
4177 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
4178 to get in sync with glibc.
4180 2001-08-03 Paul Eggert <eggert@twinsun.com>
4182 The following changes are from gettext 0.10.39 as maintained by
4185 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
4186 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
4187 with inverted sense. All uses changed.
4189 * mbswidth.c: Don't include <limits.h>.
4190 Include <stdlib.h> and <string.h> unconditionally.
4191 (iswcntrl, mbsinit, ISCNTRL): New macros.
4192 (mbsnwidth): Use K&R style function declarations.
4193 Don't bother checking for MB_LEN_MAX == 1, since the compiler
4194 can optimize it when MB_CUR_MAX == 1.
4195 The width of control characters is zero, not 1.
4197 2001-07-15 Jim Meyering <meyering@lucent.com>
4199 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
4200 (BUILT_SOURCES): Add unlocked-io.h.
4201 (io_functions): Define.
4202 (unlocked-io.h): New rule.
4203 (DISTCLEANFILES): Add unlocked-io.h.
4204 (all-local): Depend on unlocked-io.h, to ensure it is created.
4206 * unlocked-io.hin: New file
4208 * regex.c: Update from glibc.
4210 2001-07-05 Jim Meyering <meyering@lucent.com>
4212 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
4214 (libfetish_a_SOURCES): Put all .h files here instead.
4215 Remove a thus-exposed (better checks in automake) duplicate and
4216 two unnecessary .h files.
4218 2001-06-11 Jim Meyering <meyering@lucent.com>
4220 * regex.c: Update from GNU libc.
4222 2001-05-27 Jim Meyering <meyering@lucent.com>
4224 * readutmp.h (UT_TYPE): Define.
4226 2001-05-24 Jim Meyering <meyering@lucent.com>
4228 * argmatch.c: Include "quote.h".
4229 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
4230 quote function. Reported by Göran Uddeborg.
4232 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
4234 * dirname.c (dir_name): Compute append_dot using path, not newpath
4235 which is not yet declared.
4237 2001-05-11 Paul Eggert <eggert@twinsun.com>
4239 * Makefile.am (libfetish_a_SOURCES):
4240 Add strftime.c, since we now compile it on all hosts.
4242 * strftime.c (my_strftime):
4243 Define to nstrftime if emacs, but only if my_strftime is not defined.
4244 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
4245 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
4246 Add one more extra argument: a nanoseconds value.
4249 (my_strftime function): Add %N format.
4250 (emacs_strftimeu): Renamed from emacs_strftime,
4251 with extra ut argument.
4253 2001-05-11 Paul Eggert <eggert@twinsun.com>
4255 dirname code cleanup. base_name now behaves more compatibly
4256 with POSIX basename when given file names that have trailing
4257 slashes, and similarly for dir_name. Add new primitives
4258 base_len and dir_len. Put the directory-name-related decls
4261 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
4262 * backupfile.c (base_name): Likewise.
4263 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
4264 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
4265 * makepath.c (strip_trailing_slashes): Likewise.
4266 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
4268 * rename.c (strip_trailing_slashes): Likewise.
4269 * same.c (base_name): Likewise.
4270 * stripslash.c (ISSLASH): Likewise.
4272 * addext.c: Include <dirname.h> after size_t is defined.
4273 * backupfile.c: Likewise.
4275 * addext.c (addext): Use base_len to trim redundant
4276 trailing slashes instead of doing it ourselves.
4277 But do not trim the last slash if it is not redundant.
4279 * backupfile.c (find_backup_file_name,
4280 max_backup_version): Use base_len instead of rolling it ourselves.
4281 Handle the case of "" and (on DOS) "C:" correctly.
4283 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
4284 Include <string.h>, <dirname.h>.
4285 (base_name): Allow file names ending in slashes, other than names
4286 that are all slashes. In this case, return the basename followed
4287 by the slashes. This is more general, and can be used in places
4288 where the original base_name purposely had an assertion failure.
4289 (base_len): New function.
4291 * dirname.c: Include <string.h> instead of <stdlib.h>.
4292 Do not include <assert.h>; no longer needed.
4294 (memrchr): Remove decl.
4295 (dir_name_r): Remove.
4296 (dir_len): Renamed from dirlen. All callers changed.
4297 Rewrite in terms of base_name, for simplicity and consistency.
4298 (dir_name): Never return NULL. All callers changed.
4299 Do not include <stdlib.h> in test program; no longer needed.
4300 return 0; is fine for test program.
4302 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
4304 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
4306 * path-concat.c (path_concat): Use base_len to compute
4307 base length, not strlen; this means we cannot rely on memcpy
4310 * same.c (STREQ): Remove.
4311 (same_name): Handle the case where the basename ends in trailing '/'.
4313 * stripslash.c (strip_trailing_slashes): Return nonzero if
4314 a slash was stripped. Do not strip the last slash after a
4317 2001-04-08 Jim Meyering <meyering@lucent.com>
4319 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
4320 recomputed; that's necessary when the offset spans a DST transition.
4321 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
4323 2001-04-02 Jim Meyering <meyering@lucent.com>
4325 * regex.h, regex.c: Update from GNU libc.
4327 2001-03-19 Paul Eggert <eggert@twinsun.com>
4329 * version-etc.c (version_etc_copyright): Update to 2001.
4331 2001-03-16 Paul Eggert <eggert@twinsun.com>
4333 * tempname.c (uint64_t): Define to uintmax_t if
4334 not defined, and if UINT64_MAX is not defined.
4335 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
4336 Reported by John David Anglin.
4338 2001-03-10 Bruno Haible <haible@clisp.cons.org>
4340 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
4341 alias if codeset is empty.
4342 * config.charset (BeOS): Use wildcard syntax.
4344 2001-03-13 Jim Meyering <meyering@lucent.com>
4346 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
4347 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
4350 2001-03-06 Bruno Haible <haible@clisp.cons.org>
4352 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
4354 * unicodeio.c (print_unicode_char): Simplify accordingly.
4356 2001-03-06 Bruno Haible <haible@clisp.cons.org>
4358 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
4359 support for DOS/DJGPP.
4361 2001-02-28 Paul Eggert <eggert@twinsun.com>
4363 * Makefile.am (libfetish_a_SOURCES):
4364 Add dup-safer.c, fopen-safer.c.
4365 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
4367 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
4369 2001-02-25 Paul Eggert <eggert@twinsun.com>
4371 The mkstemp replacement is taken from glibc 2.2.2, with some
4372 portability fixes for use outside glibc, as follows:
4374 * tempname.c (struct_stat64): New macro.
4375 (direxists, __gen_tempname): Use it.
4376 This avoids a portability problem with Solaris 8.
4378 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
4379 (<stddef.h>, <stdint.h>, <string.h>):
4380 Include only if STDC_HEADERS || _LIBC.
4381 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
4382 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
4383 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
4384 (__set_errno): Define this macro if <errno.h> doesn't.
4385 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
4386 Define these macros if <stdio.h> doesn't.
4387 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
4388 Define these macros if <sys/stat.h>
4389 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
4390 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
4391 __xstat64): Define if not _LIBC.
4392 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
4393 (__gen_tempname): Invoke gettimeofday only if
4394 HAVE_GETTIMEOFDAY || _LIBC;
4395 otherwise, fall back on plain "time".
4396 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
4398 * mkstemp.c (__GT_FILE): Define to zero if not defined.
4400 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
4402 2001-02-17 Jim Meyering <meyering@lucent.com>
4404 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
4405 around included file name.
4407 * strnlen.c (__strnlen): Merge in a change from GNU libc.
4409 * strftime.c: Update from GNU libc (the only changes were to comments).
4411 2001-02-13 Bruno Haible <haible@clisp.cons.org>
4413 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
4415 2001-02-17 Paul Eggert <eggert@twinsun.com>
4417 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
4418 Remove workaround macros for hosts that have mbrtowc but not
4419 mbstate_t, as we now insist on proper declarations for both
4420 before using mbrtowc.
4422 2001-02-17 Jim Meyering <meyering@lucent.com>
4424 * regex.c: Update from libc.
4426 2001-02-16 Paul Eggert <eggert@twinsun.com>
4428 * alloca.c (malloc): Undef before defining, since stdlib.h
4429 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
4430 Reported by Mark Hounschell via Paul Eggert.
4432 2001-01-30 Bruno Haible <haible@clisp.cons.org>
4434 * config.charset: Update for FreeBSD 4.2.
4436 2001-01-26 Jim Meyering <meyering@lucent.com>
4438 * quotearg.c: Include stddef.h.
4439 * quote.c: Include stddef.h.
4440 Reported by Axel Kittenberger.
4442 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
4443 line in double quotes so that it evokes a better diagnostic.
4444 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
4445 Reported by Axel Kittenberger.
4447 2001-01-15 Bruno Haible <haible@clisp.cons.org>
4449 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
4450 to avoid a warning. Add back 'const' to inptr.
4452 2001-01-16 Jim Meyering <meyering@lucent.com>
4454 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
4457 2001-01-14 Jim Meyering <meyering@lucent.com>
4459 * rename.c: New file. From Volker Borchert.
4460 Include stdlib.h, string.h or strings.h, and xalloc.h.
4461 Use strip_trailing_slashes rather than open-coding it.
4463 2001-01-03 Paul Eggert <eggert@twinsun.com>
4465 * strftime.c: Sync with glibc time/strftime.c 1.81.
4467 2001-01-03 Jim Meyering <meyering@lucent.com>
4469 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
4470 local `inptr' to avoid warning with some system declarations of iconv.
4472 2000-12-29 Paul Eggert <eggert@twinsun.com>
4474 * modechange.c: Do not assume that mode_t uses the
4475 traditional octal encoding. E.g. "chmod 1 FOO" should set
4476 the other-execute bit of FOO even if S_IXOTH != 1.
4478 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
4479 WOTH, XOTH, ALLM): New macros.
4480 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
4481 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
4483 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
4484 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
4486 No need to use uintmax_t; unsigned long is long enough.
4487 Don't bother to get suffix since we don't use it.
4489 2000-12-24 Jim Meyering <meyering@lucent.com>
4491 * hash.c (is_prime): Return explicit boolean values.
4492 (hash_get_first): Return NULL to appease Irix5.6's 89.
4493 Reported by Nelson Beebe.
4495 2000-10-31 Bruno Haible <haible@clisp.cons.org>
4497 * localcharset.c (locale_charset): Add support for Win32.
4499 2000-12-18 Paul Eggert <eggert@twinsun.com>
4501 * physmem.h, physmem.c: New files.
4503 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
4504 (noinst_HEADERS): Add physmem.h.
4506 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
4507 't' for compatibility with Solaris 8 sort.
4509 2000-12-18 Bruno Haible <haible@clisp.cons.org>
4511 * config.charset: Add support for BeOS.
4513 2000-12-16 Jim Meyering <meyering@lucent.com>
4515 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
4516 SHELLS_FILE to a file name that's useful on djgpp systems.
4518 (ADDITIONAL_DEFAULT_SHELLS): Define.
4519 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
4520 Based mostly on a patch from Prashant TR.
4522 2000-12-16 Jim Meyering <meyering@lucent.com>
4524 This bug had a serious impact on chown: `chown N:M FILE' (for integer
4525 N and M) would have treated it like `chown N:N FILE'.
4527 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
4529 2000-10-31 Bruno Haible <haible@clisp.cons.org>
4531 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
4532 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
4533 to the list of canonical encodings. Rename EUC-CN to GB2312.
4535 2000-12-08 Andreas Schwab <schwab@suse.de>
4537 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
4538 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
4540 2000-12-07 Jim Meyering <meyering@lucent.com>
4542 * stripslash.c (ISSLASH): Define.
4543 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
4546 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
4547 (dir_name_r): Declare this function as static.
4548 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
4549 manifest itself on a name containing a mix of slashes and
4551 Make this function work with names starting with a DOS-style
4552 drive letter and colon prefix.
4553 (dir_name): Append `.' if necessary.
4554 Based mostly on patches from Prashant TR and Eli Zaretskii.
4556 * dirname.h (dir_name_r): Remove prototype.
4558 2000-12-05 Jim Meyering <meyering@lucent.com>
4560 * dirname.c (dir_name_r): Add `const' in a few local declarations.
4562 2000-12-04 Jim Meyering <meyering@lucent.com>
4564 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
4565 Also include memory.h, stdlib.h, unistd.h if appropriate.
4566 Reported by Andreas Jaeger (conflicting declaration of malloc).
4568 2000-12-02 Jim Meyering <meyering@lucent.com>
4570 * closeout.h: Make idempotent, to avoid some obscure warnings.
4572 2000-12-01 Paul Eggert <eggert@twinsun.com>
4574 * memrchr.c: Include <config.h> before any system include file.
4576 2000-11-29 Paul Eggert <eggert@twinsun.com>
4578 * dirname.c (dir_name_r): Fix typo: int -> size_t.
4580 2000-11-26 Jim Meyering <meyering@lucent.com>
4582 * memcoll.c: Include sys/types.h. From Werner Almesberger.
4584 2000-11-22 Paul Eggert <eggert@twinsun.com>
4586 * strftime.c (my_strftime): Do not invoke mbrlen with a
4587 size of (size_t) -1; it's not portable.
4589 2000-11-17 Akim Demaille <akim@epita.fr>
4591 * obstack.h: Formatting changes.
4592 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
4593 prevent type checking.
4594 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
4595 cast the value to (void *): assigning a `foo *' to a `void *'
4597 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
4599 2000-11-17 Jim Meyering <meyering@lucent.com>
4601 * strstr.c: Update from GNU libc.
4603 2000-11-16 Jim Meyering <meyering@lucent.com>
4605 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
4607 2000-11-11 Jim Meyering <meyering@lucent.com>
4609 * error.c: Add a couple #includes, merging from GNU libc version.
4611 2000-11-10 Jim Meyering <meyering@lucent.com>
4613 * obstack.h: Update from GNU libc.
4614 * obstack.c: Likewise.
4616 2000-11-06 Paul Eggert <eggert@twinsun.com>
4618 * getusershell.c (setusershell): Use rewind rather than
4619 fseek/fseeko, to avoid configuration hassles with fseeko.
4620 Don't bother opening SHELLS_FILE if shellstream is NULL;
4623 2000-11-05 Jim Meyering <meyering@lucent.com>
4625 * makepath.h (make_dir): Declare.
4626 * makepath.c (make_dir): Remove `static' attribute.
4629 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
4631 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
4632 last one in a bucket, advance to the next bucket.
4634 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
4636 * fnmatch.c: Do not comment out all the code if we are using
4637 the GNU C library, because in some cases we are replacing buggy
4638 code in the GNU C library itself.
4640 2000-10-30 Paul Eggert <eggert@twinsun.com>
4642 * error.h, getline.h, modechange.h:
4643 Remove "2000" from Copyright line, as the file hasn't been
4644 changed this year other than in the copyright notice.
4646 * xalloc.h: Add "2000" to Copyright line, as this file
4647 was changed this year.
4649 2000-10-30 Paul Eggert <eggert@twinsun.com>
4651 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
4652 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
4653 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
4655 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
4657 * regex.h (__restrict_arr): Move definition out of #ifndef block.
4658 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
4659 doesn't define __restrict_arr.
4661 2000-10-29 Jim Meyering <meyering@lucent.com>
4663 * xstat.in: Fix grammar in comment.
4665 2000-10-28 Jim Meyering <meyering@lucent.com>
4667 * memchr.c: Update from libc.
4668 Adjust for portability:
4669 [HAVE_STDLIB_H]: Include stdlib.h.
4670 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
4671 Undef __memchr, too.
4672 [!weak_alias]: Define __memchr to memchr.
4674 * regex.c: Update from libc.
4675 * regex.h: Likewise.
4676 * getopt1.c: Likewise.
4677 * memcmp.c: Likewise.
4679 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
4680 Avoid using fseek, when possible -- it's broken by design.
4681 Patch by Ulrich Drepper.
4683 2000-10-26 Jim Meyering <meyering@lucent.com>
4685 * strftime.c: Update from libc.
4687 2000-10-25 Jim Meyering <meyering@lucent.com>
4689 * obstack.c: Update from libc.
4691 2000-10-23 Jim Meyering <meyering@lucent.com>
4693 * hard-locale.c (hard_locale): Revert last change -- it was simply
4694 wrong. That set_locale call must not have any side effects.
4697 2000-10-22 Jim Meyering <meyering@lucent.com>
4699 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
4700 [CYCLIC]: Remove now-unused definition.
4702 * save-cwd.c (O_DIRECTORY): Define, if needed.
4703 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
4704 Suggestion from Ulrich Drepper.
4706 2000-10-21 Jim Meyering <meyering@lucent.com>
4708 * dirname.c (dir_name_r): New function, factored out of dir_name.
4709 (dir_name): Use dir_name_r.
4710 * dirname.h (dir_name_r): Declare it.
4712 2000-10-21 Jim Meyering <meyering@lucent.com>
4714 * dirname.c (memrchr): Declare if necessary.
4715 (dir_name): Remove the restriction that there be no
4716 trailing slashes. Now, this code skips past them, effectively
4718 [TEST_DIRNAME] (main): New unit tests.
4720 * memrchr.c: New file from GNU libc.
4721 Undef __memrchr, too.
4722 [!weak_alias]: Define __memrchr to memrchr.
4723 Guard weak_alias use with `#ifdef weak_alias'.
4725 2000-10-17 Jim Meyering <meyering@lucent.com>
4727 * quote.h (PARAMS): Define and use.
4728 Reported by Akim Demaille.
4730 * getopt.c: Update from libc.
4732 2000-10-16 Jim Meyering <meyering@lucent.com>
4734 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
4737 2000-09-25 Jim Meyering <meyering@lucent.com>
4739 * md5.h (rol): Define (from GnuPG).
4741 * sha.c: Give credit (GnuPG) where due.
4742 (M): Use rol rather than open-coding it.
4743 Add a FIXME comment.
4745 2000-09-21 Jim Meyering <meyering@lucent.com>
4747 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
4748 Reported by Michael Stone.
4750 2000-09-20 Jim Meyering <meyering@lucent.com>
4752 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
4753 (noinst_HEADERS): Add sha.h.
4754 Based on code from Scott G. Miller and from GnuPG.
4756 2000-09-15 Jim Meyering <meyering@lucent.com>
4758 * regex.c: Update from libc.
4760 2000-09-10 Jim Meyering <meyering@lucent.com>
4762 * getopt.c (_getopt_internal): Update from glibc.
4764 2000-09-09 Jim Meyering <meyering@lucent.com>
4766 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
4767 think it should be used as a general replacement for isascii.
4768 * fnmatch.c: Likewise.
4769 * mbswidth.c: Likewise
4770 * regex.c: Likewise.
4773 * userspec.c: Include sys/param.h and limits.h.
4775 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4776 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
4777 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
4778 UID, GID. Check range.
4780 2000-09-06 Jim Meyering <meyering@lucent.com>
4782 * getopt.c (_getopt_internal): Update from glibc.
4784 2000-08-30 Jim Meyering <meyering@lucent.com>
4786 * strftime.c: Merge in changes from GNU libc.
4788 2000-08-26 Jim Meyering <meyering@lucent.com>
4790 * closeout.c: Include "__fpending.h".
4791 (close_stdout_status): Return right away if there's nothing to flush.
4793 * Makefile.am (noinst_HEADERS): Add __fpending.h.
4794 * __fpending.c: New file.
4795 * __fpending.h: New file.
4797 2000-08-07 Paul Eggert <eggert@twinsun.com>
4799 Standardize on "memory exhausted" instead of "Memory exhausted"
4800 or "virtual memory exhausted".
4801 * obstack.c (print_and_abort): Use "memory exhausted", not
4802 "virtual memory exhausted".
4803 * same.c (same_name): Invoke xalloc_die instead of printing
4805 * userspec.c (parse_user_spec): Likewise.
4806 * bumpalloc.h: comment fix
4807 * same.c, userspec.c: Include xalloc.h.
4809 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
4810 not char *const and pointing to a constant array.
4811 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
4812 (xrealloc): Comment fix.
4814 * userspec.c (parse_user_spec):
4815 Don't translate a message until just before returning,
4816 to avoid unnecessary translation.
4818 2000-08-07 Jim Meyering <meyering@lucent.com>
4820 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
4821 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
4822 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
4823 getgroups.c, gethostname.c, getopt.h, group-member.c,
4824 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
4825 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
4826 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
4827 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
4828 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
4829 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
4830 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
4831 yesno.c: Back out Copyright date changes for each file with no change
4832 this year. This eases coordination with other programs using the same
4833 source code modules. From Paul Eggert.
4835 2000-08-03 Greg McGary <greg@mcgary.org>
4837 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
4838 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
4839 (EXTEND_BUFFER): Use them.
4841 2000-08-01 Jim Meyering <meyering@lucent.com>
4843 * dirname.c (ISSLASH): Define.
4844 (BACKSLASH_IS_PATH_SEPARATOR): Define.
4845 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
4846 both `\' and `/' may be use as path separators.
4847 Based on a patch from Prashant TR.
4849 2000-07-31 Paul Eggert <eggert@twinsun.com>
4851 * quotearg.c (quotearg_n_options): Don't make the initial
4852 slot vector a constant, since it might get modified.
4854 2000-07-31 Jim Meyering <meyering@lucent.com>
4856 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
4857 * obstack.c (print_and_abort): Likewise.
4859 2000-07-30 Paul Eggert <eggert@twinsun.com>
4861 * quotearg.c (quotearg_n_options): Preallocate a slot 0
4862 buffer, so that the caller can always quote one small
4863 component of a "memory exhausted" message in slot 0.
4864 From a suggestion by Jim Meyering.
4866 2000-07-30 Jim Meyering <meyering@lucent.com>
4868 * makepath.c (make_path): Quote the other instance, too.
4870 * quotearg.c (N_STATIC_SLOTVECS): Define.
4871 (STATIC_BUF_SIZE): Define.
4872 (quotearg_n_options): Use only statically allocated storage when
4873 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
4874 than STATIC_BUF_SIZE.
4876 2000-07-29 Jim Meyering <meyering@lucent.com>
4878 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
4879 * dirname.c (dir_name): Likewise.
4881 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
4883 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
4884 (dir_name): Assert that there are no trailing slashes.
4886 2000-07-18 Bruno Haible <haible@clisp.cons.org>
4888 * mbswidth.h (mbswidth): Add a flags argument.
4889 (mbswidth): New declaration.
4890 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
4891 * mbswidth.c (mbswidth): Add a flags argument.
4892 (mbsnwidth): New function.
4894 2000-07-24 Jim Meyering <meyering@lucent.com>
4896 * mbswidth.c: Remove useless #else. From Bruno Haible.
4898 2000-07-23 Paul Eggert <eggert@twinsun.com>
4900 * mbswidth.c (_XOPEN_SOURCE):
4901 Don't define; this causes problems on Solaris 7.
4902 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
4904 2000-07-23 Paul Eggert <eggert@twinsun.com>
4907 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
4908 so that mbstate_t is always defined.
4910 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
4911 be 1 in at least one GCC installation, and this configuration
4912 error is likely to be common. Ignoring MB_LEN_MAX hurts
4913 performance on hosts that have mbrtowc but have only unibyte
4914 locales, but I assume these hosts are rare.
4916 2000-07-23 Paul Eggert <eggert@twinsun.com>
4918 * quotearg.c: Streamline by invoking multibyte code only if needed.
4919 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
4920 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
4921 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
4922 invoke multibyte primitives.
4924 2000-07-23 Jim Meyering <meyering@lucent.com>
4926 * basename.c (base_name): Add an assertion.
4928 2000-07-15 Bruno Haible <clisp.cons.org>
4930 * quotearg.c: When the system forces us to redefine mbstate_t,
4931 shadow its mbsinit function.
4933 2000-07-16 Bruno Haible <haible@clisp.cons.org>
4935 * mbswidth.h: New file.
4936 * mbswidth.c: New file.
4937 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
4938 (noinst_HEADERS): Add mbswidth.h.
4940 2000-07-17 Bruno Haible <haible@clisp.cons.org>
4942 * config.charset: Add support for FreeBSD. Improve support for HP-UX
4945 2000-07-15 Jim Meyering <meyering@lucent.com>
4947 * makepath.c: Include quote.h.
4948 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
4949 corresponding argument in a `quote (...)' call.
4950 Give better diagnostics.
4952 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
4953 (noinst_HEADERS): Add quote.h.
4955 * quote.c (quote, quote_n): New file. Two functions taken verbatim
4956 from tar's src/misc.c.
4957 * quote.h: New file. Prototypes for same.
4959 2000-07-10 Paul Eggert <eggert@twinsun.com>
4961 From a suggestion by Bruno Haible.
4962 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
4963 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
4964 to decide whether to define the BeOS workaround macro;
4965 this adjusts to the change to AC_MBSTATE_T.
4967 2000-07-13 Paul Eggert <eggert@twinsun.com>
4969 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
4971 * quotearg.c (quoting_style_args, quoting_style_vals,
4972 quotearg_buffer_restyled): Add support for
4973 clocale_quoting_style. Undo previous change to
4974 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
4975 and "{RIGHT QUOTATION MARK}" msgids.
4977 2000-07-05 Paul Eggert <eggert@twinsun.com>
4979 The old behavior of quoting `like this' doesn't look good with
4980 newer, ISO-style fonts. See:
4981 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
4983 Instead, quote "like this" by default. Let the translator
4984 tailor the locale-specific quoting behavior by providing
4985 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
4987 * quotearg.c (N_): New macro.
4988 (gettext_default): New function.
4989 (quotearg_buffer_restyled): Use
4990 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
4991 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
4993 2000-07-09 Jim Meyering <meyering@lucent.com>
4995 * Most files: Update copyright dates to include 2000.
4997 2000-07-08 Jim Meyering <meyering@lucent.com>
4999 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
5001 (xgethostname): Remove now-unnecessary #ifdef.
5002 Move declaration of `err' into loop where it's used.
5004 2000-07-05 Bruno Haible <haible@clisp.cons.org>
5006 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
5007 by allocating a larger buffer. Test the gethostname return value for
5008 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
5009 returns an error and ENAMETOOLONG isn't defined.
5011 2000-07-05 Paul Eggert <eggert@twinsun.com>
5012 and Bruno Haible <haible@clisp.cons.org>
5014 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
5016 2000-07-05 Bruno Haible <haible@clisp.cons.org>
5018 * quotearg.c (struct quoting_options): Simplify quote_these_too
5021 2000-07-03 Jim Meyering <meyering@lucent.com>
5023 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
5024 Reported by Bruno Haible.
5026 2000-07-04 Jim Meyering <meyering@lucent.com>
5028 * quotearg.c: Make inclusion of <wchar.h> independent of whether
5029 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
5032 2000-07-03 Paul Eggert <eggert@twinsun.com>
5033 and Bruno Haible <haible@clisp.cons.org>
5035 * quotearg.c (mbrtowc):
5036 Assign to *pwc, and return 1 only if result is nonzero.
5037 (iswprint): Use ISPRINT when substituting our own mbrtowc.
5039 2000-07-03 Jim Meyering <meyering@lucent.com>
5041 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
5042 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
5045 2000-07-02 Jim Meyering <meyering@lucent.com>
5047 * quotearg.c (mbstate_t): Don't define here.
5049 2000-07-02 Jim Meyering <meyering@lucent.com>
5051 * nanosleep.c (SIGCONT): Define if not already defined.
5053 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5055 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
5056 per change in ../m4/ls-mntd-fs.m4.
5057 (read_filesystem_list): Ignore symbolic links.
5059 2000-06-29 Jim Meyering <meyering@lucent.com>
5061 * same.c: Include <string.h> or <strings.h>, as appropriate,
5062 for declaration of strcmp.
5064 * long-options.c: Include <stdlib.h>, for declaration of exit.
5066 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
5067 Avoid warning by casting result to `char *' to remove `const'.
5069 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5071 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
5073 2000-06-26 Paul Eggert <eggert@twinsun.com>
5075 savedir now sets errno on failure and invokes xmalloc to get memory.
5076 Fix a couple of other minor bugs while we're at it.
5078 * savedir.c (<unistd.h>): Do not include; there's no need.
5079 (NAMLEN): Remove macro.
5080 (malloc, realloc): Remove decls.
5082 ("xalloc.h"): Include.
5083 (NAME_SIZE_DEFAULT): New macro.
5084 (savedir): Use xmalloc / xrealloc to allocate memory.
5085 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
5086 Skip "" directory entries.
5087 Use strlen to calculate directory entry length, since the old method
5088 is rarely used these days and isn't worth supporting.
5089 Don't use a pointer after freeing it.
5090 Check for integer overflow when calculating allocation size.
5091 Use memcpy to copy entries, instead of stpcpy.
5092 Set errno properly when returning NULL.
5093 Check for readdir error.
5095 2000-06-26 Jim Meyering <meyering@lucent.com>
5097 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
5099 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5101 * getusershell.c (xmalloc, xrealloc): Remove functions.
5103 Don't include <stdlib.h>. Don't declare malloc, realloc.
5105 2000-06-23 Bruno Haible <haible@clisp.cons.org>
5107 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
5109 2000-06-24 Jim Meyering <meyering@lucent.com>
5111 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
5113 2000-06-21 Jim Meyering <meyering@lucent.com>
5115 * getpass.c: New file, from Bruno Haible. Required for BeOS.
5117 2000-06-19 Paul Eggert <eggert@twinsun.com>
5119 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
5120 (mbrtowc, mbstate_t): Define substitutes if
5121 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
5122 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
5123 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
5125 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5127 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
5128 than 1024, return a memory chunk of least possible size, instead
5129 of size PATH_MAX + 2. In the loop, increment the size proportionally.
5130 Use free/xmalloc instead of xrealloc to avoid copying for very long
5133 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5135 * canon-host.c (canon_host): Use malloc and memcpy to copy an
5136 address, not strdup. Include <stdlib.h> and don't declare free().
5138 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5140 * path-concat.c (path_concat): Don't access dir[-1] if dir is
5143 2000-06-21 Jim Meyering <meyering@lucent.com>
5145 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
5146 (noinst_HEADERS): Add getstr.h.
5148 * getline.c (getstr): Move into a separate file.
5149 * getstr.c (getstr): New file, extracted from getline.c, with
5150 the following changes: new parameter, delim2; both delim[12]
5151 parameters have type `int', not `char'. The latter would lose
5152 with 8-bit delimiters.
5153 * getstr.h: New file.
5155 2000-06-19 Jim Meyering <meyering@lucent.com>
5157 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
5159 2000-06-18 Jim Meyering <meyering@lucent.com>
5161 * mkdir.c: Remove file, due mainly to copyright incompatibility.
5162 Besides, these days every porting target provides a mkdir function.
5164 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
5165 (this snippet comes from src/system.h).
5167 2000-06-15 Paul Eggert <eggert@twinsun.com>
5169 * human.c (adjust_value): New function.
5170 (human_readable_inexact): Apply rounding style even when
5171 printing approximate values.
5173 2000-06-14 Paul Eggert <eggert@twinsun.com>
5175 * human.c (human_readable_inexact): Allow an input block
5176 size that is not a multiple of the output block size, and vice versa.
5177 Reported by Piergiorgio Sartor.
5179 2000-06-14 Paul Eggert <eggert@twinsun.com>
5181 * getdate.y (get_date): Apply relative times after time
5182 zone indicator, not before. Reported by Todd A. Jacobs.
5184 2000-06-13 Jim Meyering <meyering@lucent.com>
5186 * Makefile.am (all-local): Depend on lstat.c and stat.c.
5188 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
5190 2000-06-12 Paul Eggert <eggert@twinsun.com>
5192 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
5194 2000-06-04 Paul Eggert <eggert@twinsun.com>
5196 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
5198 2000-06-04 Jim Meyering <meyering@lucent.com>
5200 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
5201 SunOS 4.1.4 for which gid_t is an unsigned type.
5203 2000-06-03 Jim Meyering <meyering@lucent.com>
5205 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
5207 2000-05-26 Bruno Haible <haible@clisp.cons.org>
5209 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
5210 newer, don't install charset.alias.
5211 * config.charset: Change the Linux/glibc rules so they become empty
5212 on glibc-2.1 or newer.
5214 2000-06-02 Jim Meyering <meyering@lucent.com>
5216 * mountlist.c: Back out last change. Instead, do this...
5217 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
5218 member using the same `ignore'-testing code.
5219 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
5223 2000-05-29 Jim Meyering <meyering@lucent.com>
5225 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
5226 with the `ignore' attribute. Based on a patch from Mark D. Roth.
5228 2000-05-22 Jim Meyering <meyering@lucent.com>
5230 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
5232 2000-05-18 Jim Meyering <meyering@lucent.com>
5234 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
5235 back, too, since it may have been modified by allocate_entry.
5236 (hash_delete): Rewrite to use neither the assignment operator
5237 nor the comma operator in an if-expression.
5239 2000-05-15 Paul Eggert <eggert@twinsun.com>
5242 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
5243 Remove; no longer needed.
5244 "quotearg.h": Add include.
5245 (file_name): Do not bother to explicitly initialize to NULL; it's less
5246 efficient on some hosts.
5247 (close_stdout_status): Remove test as to whether stdout was already
5248 closed; it breaks for the case "echo x | sort >&-".
5249 Quote file name colons.
5250 Do not assume that _("write error") lacks format strings.
5252 2000-05-15 Jim Meyering <meyering@lucent.com>
5254 * version-etc.c (version_etc_copyright): Update the copyright string
5255 used in all --version output.
5257 2000-05-14 Jim Meyering <meyering@lucent.com>
5259 * closeout.c (close_stdout_set_file_name): New function.
5260 (close_stdout_status): Use new file-scoped global.
5261 Return right away if fstat says the stdout file descriptor is invalid.
5262 * closeout.h (close_stdout_set_file_name): Declare.
5264 2000-05-10 Jim Meyering <meyering@lucent.com>
5266 * closeout.c [default_exit_status]: New file-scoped variable.
5267 (close_stdout_set_status): New function.
5268 * closeout.h (close_stdout_set_status): Declare.
5270 2000-05-08 Jim Meyering <meyering@lucent.com>
5272 * long-options.c: Don't include closeout.h.
5273 (parse_long_options): Don't call close_stdout for --version.
5275 2000-05-06 Jim Meyering <meyering@lucent.com>
5277 * strnlen.c: Undefine __strnlen and strnlen.
5278 [!weak_alias]: Define __strnlen to strnlen.
5280 * atexit.c: New file, from libiberty.
5282 2000-05-06 Jim Meyering <meyering@lucent.com>
5284 * closeout.c (close_stdout_status): Also check for errors on the
5287 2000-05-05 Bruno Haible <haible@clisp.cons.org>
5289 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
5290 instead of xmalloc, xrealloc, path_concat.
5291 (locale_charset): Treat empty environment variables as absent.
5292 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
5294 2000-05-04 Jim Meyering <meyering@lucent.com>
5296 * getopt.c: Update from glibc.
5297 * obstack.c: Likewise.
5298 * obstack.h: Likewise.
5299 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
5301 * regex.h: Likewise.
5302 * strndup.c: Likewise.
5303 * strnlen.c: New file, from glibc.
5305 2000-05-01 Jim Meyering <meyering@lucent.com>
5307 * full-write.c (full_write): Remove `FIXME' part of comment.
5309 2000-04-29 Jim Meyering <meyering@lucent.com>
5311 * path-concat.c: Declare strdup only if it's not defined.
5312 * canon-host.c: Likewise.
5314 2000-04-28 Jim Meyering <meyering@lucent.com>
5316 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
5317 redefinition warning on some systems (HPUX). Otherwise, regex.h is
5318 included first, then limits.h is included by locale.h by libintl.h.
5319 From John David Anglin.
5321 2000-04-25 Jim Meyering <meyering@lucent.com>
5323 * makepath.c (S_IRWXUGO): Define.
5324 (make_path): Always perform explicit chmod if MODE specifies any
5325 of the `special' permission bits. Prompted by a bug report against
5326 install from Mate Wierdl and Joost van Baal.
5328 2000-04-18 Jim Meyering <meyering@lucent.com>
5332 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
5333 getpagesize. For BeOS. Based on a patch from Bruno Haible.
5335 2000-04-17 Jim Meyering <meyering@lucent.com>
5337 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
5338 the definition of it to rpl_strftime also defined-away the system's
5341 2000-04-15 Jim Meyering <meyering@lucent.com>
5343 Use `C' to denote so-called `contiguous' files, the same way
5345 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
5346 (ftypelet): Use S_ISCTG.
5347 From Michael Deutschmann.
5349 2000-04-14 Jim Meyering <meyering@lucent.com>
5351 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
5353 2000-04-08 Jim Meyering <meyering@lucent.com>
5355 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
5356 names don't conflict. Reported by Eli Zaretskii.
5358 2000-03-28 Bruno Haible <haible@clisp.cons.org>
5360 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
5361 bug. Deal with the different error behavior of Irix iconv.
5363 2000-04-07 Jim Meyering <meyering@lucent.com>
5365 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
5366 to work around system header problems on AIX 3.2.5. From Bruno Haible.
5368 2000-04-05 Jim Meyering <meyering@lucent.com>
5370 Portability tweaks required for ultrix4.3.
5371 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
5372 * readutmp.c: Include sys/types.h before sys/stat.h.
5373 * canon-host.c: Declare strdup.
5374 * path-concat.c: Likewise.
5375 From John David Anglin.
5377 2000-04-04 Jim Meyering <meyering@lucent.com>
5379 Be more DOS 8.3-friendly.
5380 * ref-add.sin: Renamed from ref-add.sed.in.
5381 * ref-del.sin: Renamed from ref-del.sed.in.
5382 * Makefile.am: Reflect renaming.
5383 Reported by Eli Zaretskii.
5385 Use a temporary file name that won't clash with `charset.alias'
5386 in the DOS 8.3 name space.
5387 * Makefile.am (charset_tmp): Define.
5388 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
5389 (uninstall-local): Likewise.
5390 Reported by Eli Zaretskii.
5392 2000-03-29 Paul Eggert <eggert@twinsun.com>
5394 * time/strftime.c (my_strftime): Make sure we call the system
5395 strftime, not ourselves, when invoking the underlying strftime.
5397 2000-03-24 Jim Meyering <meyering@lucent.com>
5399 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
5400 (charset_alias): Define.
5401 (install-exec-local): Factor out common code.
5402 (uninstall-local): Split lines longer than 80.
5403 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
5405 (.sed.in.sed): New rule. Don't redirect directly to $@.
5406 (CLEANFILES): Add ref-add.sed and ref-del.sed.
5408 2000-03-19 Bruno Haible <haible@clisp.cons.org>
5410 * config.charset: Output a line containing "Packages using this file".
5411 * ref-add.sed.in, ref-del.sed.in: New files.
5412 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
5413 ref-del.sed): New rules.
5415 2000-03-17 Jim Meyering <meyering@lucent.com>
5417 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
5418 Otherwise, include <strings.h>
5420 2000-03-17 Bruno Haible <haible@clisp.cons.org>
5422 * unicodeio.c (utf8_wctomb): New function.
5423 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
5424 format instead of in UCS-4 with platform dependent endianness.
5426 2000-03-07 Paul Eggert <eggert@twinsun.com>
5428 * savedir.c (savedir): Work even if directory size is
5429 negative; this can happen with some screwy NFS configurations.
5431 2000-03-06 Jim Meyering <meyering@lucent.com>
5433 * localcharset.c (get_charset_aliases): Don't try to free file_name
5434 if it's NULL (because we ran out of memory). From Bruno Haible.
5436 2000-03-05 Jim Meyering <meyering@lucent.com>
5438 * localcharset.c ("path-concat.h"): Include.
5439 (get_charset_aliases): Use path_concat instead of ANSI string
5442 * unicodeio.h (PARAMS): Define.
5443 Use it to guard prototype.
5445 2000-03-04 Jim Meyering <meyering@lucent.com>
5447 * Makefile.am (install-exec-local): Create $(libdir) before installing
5449 (uninstall-local): Uncomment this rule so `make distcheck' works
5452 * unicodeio.c (<errno.h>): Include it.
5453 (errno): Declare if not defined.
5455 * localcharset.c: Add Bruno's comment justifying use of volatile.
5457 * config.charset: New version, incorporating remarks from a linux
5458 i18n mailing list. From Bruno Haible.
5460 2000-03-02 Jim Meyering <meyering@lucent.com>
5462 * Makefile.am (EXTRA_DIST): Add config.charset.
5464 2000-03-01 Jim Meyering <meyering@lucent.com>
5466 * localcharset.c: Guard some #includes with `#if HAVE_...'.
5467 * unicodeio.c: Likewise.
5469 2000-02-02 Bruno Haible <haible@clisp.cons.org>
5471 * config.charset: New file.
5472 * localcharset.c: New file.
5473 * unicodeio.h, unicodeio.c: New files.
5474 * Makefile.am (DEFS): Add -DLIBDIR=...
5475 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
5476 (noinst_HEADERS): Add unicodeio.h.
5477 (all-local, install-exec-local, charset.alias): New targets.
5479 2000-02-28 Paul Eggert <eggert@twinsun.com>
5481 * quotearg.c (ALERT_CHAR): New macro.
5482 (quotearg_buffer_restyled): Use it.
5484 2000-02-27 Jim Meyering <meyering@lucent.com>
5486 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
5487 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
5489 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
5490 not `#if STDC_HEADERS'.
5491 Declare malloc if needed.
5493 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
5494 now that autoconf always defines the HAVE_DECL_ symbols.
5495 * human.c: Likewise.
5497 * strtoumax.c: Likewise.
5499 * backupfile.c: Arrange for cpp to fail if the configure-time
5500 declaration check was not run.
5502 * human.c: Likewise.
5504 * strtoumax.c: Likewise.
5506 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
5507 then first look up the entire `.'-containing string as a login name.
5509 2000-02-18 Paul Eggert <eggert@twinsun.com>
5511 * getdate.y: Handle two-digit years with leading zeros correctly.
5512 (textint): New typedef.
5513 (parser_control): Member year changed from int to textint.
5515 (YYSTYPE): Removed; replaced by %union with int and textint members.
5516 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
5517 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
5518 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
5519 (tSNUMBER, tUNUMBER): Now of type <textintval>.
5520 (date, number, to_year): Use width of number in digits, not its value,
5521 to determine whether it's a 2-digit year, or a 2-digit time.
5522 (yylex): Store number of digits of numeric tokens.
5523 Reported by John Kendall.
5525 (parser_control): Changed from struct parser_control to typedef (for
5526 consistency). All uses changed.
5528 (tID): Removed; not used.
5529 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
5531 2000-02-14 Paul Eggert <eggert@twinsun.com>
5533 * getpagesize.h (getpagesize): Port to VMS for Alpha;
5534 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
5536 2000-02-12 Jim Meyering <meyering@lucent.com>
5538 * userspec.c (ISDIGIT): Define it.
5539 (isdigit): Remove definition.
5540 (is_number): Use ISDIGIT, not isdigit.
5541 <libintl.h>: Include.
5543 (parse_user_spec): Mark translatable strings.
5545 2000-02-10 Jim Meyering <meyering@lucent.com>
5547 With these changes, nanosleep.[ch] are finally enough like the other
5548 lib/* replacement files to compile on a few more losing systems.
5550 * nanosleep.h: Don't include config.h.
5551 Remove prototype from declaration of nanosleep.
5552 (PARAMS): Remove now-unneeded definition.
5553 * nanosleep.c: #undef nanosleep.
5554 (rpl_nanosleep): Rename from nanosleep.
5556 2000-02-03 Jim Meyering <meyering@lucent.com>
5558 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
5559 rather than with `#if HAVE_UTMPNAME'.
5561 2000-02-01 Jim Meyering <meyering@lucent.com>
5563 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
5565 2000-01-31 Jim Meyering <meyering@lucent.com>
5567 * nanosleep.h (nanosleep): Guard declaration with
5568 `#if ! HAVE_DECL_NANOSLEEP'.
5569 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
5570 the declaration in that vendor's sys/timers.h.
5571 Reported by Christian Krackowizer.
5573 * quotearg.c (ISASCII): Add #undef and move definition to follow
5574 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
5575 (ISPRINT): Likewise.
5576 Reported by Tom Tromey.
5578 2000-01-30 Jim Meyering <meyering@lucent.com>
5580 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
5581 uses of ->ut_name. The latter doesn't work with new Linux header files
5582 where only utmpx.ut_user is declared.
5584 * readutmp.h (UT_USER): Define.
5586 2000-01-23 Jim Meyering <meyering@lucent.com>
5588 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
5591 2000-01-22 Jim Meyering <meyering@lucent.com>
5593 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
5594 [! HAVE_DECL_STRTOULL]: Declare strtoull.
5595 Required for some AIX systems. Reported by Christian Krackowizer.
5596 [TESTING] (main): New function.
5598 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
5599 * dirname.c (dir_name): Support for DOS-style file names with drive
5602 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
5604 * strverscmp.c (ISDIGIT): Define.
5605 (strverscmp): Use ISDIGIT, not isdigit.
5607 2000-01-17 Paul Eggert <eggert@twinsun.com>
5609 * nanosleep.c (nanosleep):
5610 Don't use SA_INTERRUPT to decide whether to call sigaction, as
5611 POSIX.1 doesn't require SA_INTERRUPT and some systems
5612 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
5613 it's been part of POSIX.1 since day 1 (in 1988).
5615 2000-01-17 Jim Meyering <meyering@lucent.com>
5617 * interlock: Remove unused file. Reported by François Pinard.
5619 2000-01-16 Paul Eggert <eggert@twinsun.com>
5621 * quotearg.c (quotearg_buffer_restyled): Do not quote
5622 alert, backslash, formfeed, and vertical tab unnecessarily in
5623 shell quoting style.
5626 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
5627 Free Software Foundation, Inc.
5628 Copying and distribution of this file, with or without modification,
5629 are permitted provided the copyright notice and this notice are preserved.